Singleton class of default values used throughout KvikIO. More...
#include <defaults.hpp>
Static Public Member Functions | |
static CompatMode | compat_mode () |
Return whether the KvikIO library is running in compatibility mode or not. More... | |
static void | set_compat_mode (CompatMode compat_mode) |
Set the value of kvikio::defaults::compat_mode() . More... | |
static CompatMode | infer_compat_mode_if_auto (CompatMode compat_mode) noexcept |
Infer the AUTO compatibility mode from the system runtime. More... | |
static bool | is_compat_mode_preferred (CompatMode compat_mode) noexcept |
Given a requested compatibility mode, whether it is expected to reduce to ON . More... | |
static bool | is_compat_mode_preferred () |
Whether the global compatibility mode from class defaults is expected to be ON . More... | |
static BS_thread_pool & | thread_pool () |
Get the default thread pool. More... | |
static unsigned int | thread_pool_nthreads () |
Get the number of threads in the default thread pool. More... | |
static void | set_thread_pool_nthreads (unsigned int nthreads) |
Set the number of threads in the default thread pool. Waits for all currently running tasks to be completed, then destroys all threads in the pool and creates a new thread pool with the new number of threads. Any tasks that were waiting in the queue before the pool was reset will then be executed by the new threads. More... | |
static unsigned int | num_threads () |
Alias of thread_pool_nthreads More... | |
static void | set_num_threads (unsigned int nthreads) |
Alias of set_thread_pool_nthreads More... | |
static std::size_t | task_size () |
Get the default task size used for parallel IO operations. More... | |
static void | set_task_size (std::size_t nbytes) |
Set the default task size used for parallel IO operations. More... | |
static std::size_t | gds_threshold () |
Get the default GDS threshold, which is the minimum size to use GDS (in bytes). More... | |
static void | set_gds_threshold (std::size_t nbytes) |
Set the default GDS threshold, which is the minimum size to use GDS (in bytes). More... | |
static std::size_t | bounce_buffer_size () |
Get the size of the bounce buffer used to stage data in host memory. More... | |
static void | set_bounce_buffer_size (std::size_t nbytes) |
Set the size of the bounce buffer used to stage data in host memory. More... | |
static std::size_t | http_max_attempts () |
Get the maximum number of attempts per remote IO read. More... | |
static void | set_http_max_attempts (std::size_t attempts) |
Set the maximum number of attempts per remote IO read. More... | |
static long | http_timeout () |
The maximum time, in seconds, the transfer is allowed to complete. More... | |
static void | set_http_timeout (long timeout_seconds) |
Reset the http timeout. More... | |
static std::vector< int > const & | http_status_codes () |
The list of HTTP status codes to retry. More... | |
static void | set_http_status_codes (std::vector< int > status_codes) |
Set the list of HTTP status codes to retry. More... | |
Singleton class of default values used throughout KvikIO.
Definition at line 123 of file defaults.hpp.
|
static |
Get the size of the bounce buffer used to stage data in host memory.
Set the value using kvikio::default::set_bounce_buffer_size()
or by setting the KVIKIO_BOUNCE_BUFFER_SIZE
environment variable. If not set, the value is 16 MiB.
|
static |
Return whether the KvikIO library is running in compatibility mode or not.
Notice, this is not the same as the compatibility mode in cuFile. That is, cuFile can run in compatibility mode while KvikIO is not.
When KvikIO is running in compatibility mode, it doesn't load libcufile.so
. Instead, reads and writes are done using POSIX.
Set the environment variable KVIKIO_COMPAT_MODE
to enable/disable compatibility mode. By default, compatibility mode is enabled:
libcufile
cannot be found/run/udev
isn't readable, which typically happens when running inside a docker image not launched with --volume /run/udev:/run/udev:ro
|
static |
Get the default GDS threshold, which is the minimum size to use GDS (in bytes).
In order to improve performance of small IO, .pread()
and .pwrite()
implement a shortcut that circumvent the threadpool and use the POSIX backend directly.
Set the default value using kvikio::default::set_gds_threshold()
or by setting the KVIKIO_GDS_THRESHOLD
environment variable. If not set, the default value is 1 MiB.
|
static |
Get the maximum number of attempts per remote IO read.
Set the value using kvikio::default::set_http_max_attempts()
or by setting the KVIKIO_HTTP_MAX_ATTEMPTS
environment variable. If not set, the value is 3.
|
static |
The list of HTTP status codes to retry.
Set the value using kvikio::default::set_http_status_codes()
or by setting the KVIKIO_HTTP_STATUS_CODES
environment variable. If not set, the default value is
|
static |
The maximum time, in seconds, the transfer is allowed to complete.
Set the value using kvikio::default::set_http_timeout()
or by setting the KVIKIO_HTTP_TIMEOUT
environment variable. If not set, the value is 60.
|
staticnoexcept |
Infer the AUTO
compatibility mode from the system runtime.
If the requested compatibility mode is AUTO
, set the expected compatibility mode to ON
or OFF
by performing a system config check; otherwise, do nothing. Effectively, this function reduces the requested compatibility mode from three possible states (ON
/OFF
/AUTO
) to two (ON
/OFF
) so as to determine the actual I/O path. This function is lightweight as the inferred result is cached.
|
static |
Whether the global compatibility mode from class defaults is expected to be ON
.
This function returns true if any of the two condition is satisfied:
ON
.AUTO
but inferred to be ON
.Conceptually, the opposite of this function is whether the global compatibility mode is expected to be OFF
, which would occur if any of the two condition is satisfied:
OFF
.AUTO
but inferred to be OFF
.
|
staticnoexcept |
Given a requested compatibility mode, whether it is expected to reduce to ON
.
This function returns true if any of the two condition is satisfied:
ON
.AUTO
but inferred to be ON
.Conceptually, the opposite of this function is whether requested compatibility mode is expected to be OFF
, which would occur if any of the two condition is satisfied:
OFF
.AUTO
but inferred to be OFF
.compat_mode | Compatibility mode. |
|
static |
Alias of thread_pool_nthreads
|
static |
Set the size of the bounce buffer used to stage data in host memory.
nbytes | The bounce buffer size in bytes. |
|
static |
Set the value of kvikio::defaults::compat_mode()
.
Changing the compatibility mode affects all the new FileHandles whose compat_mode
argument is not explicitly set, but it never affects existing FileHandles.
compat_mode | Compatibility mode. |
|
static |
Set the default GDS threshold, which is the minimum size to use GDS (in bytes).
nbytes | The default GDS threshold size in bytes. |
|
static |
Set the maximum number of attempts per remote IO read.
attempts | The maximum number of attempts to try before raising an error. |
|
static |
Set the list of HTTP status codes to retry.
status_codes | The HTTP status codes to retry. |
|
static |
Reset the http timeout.
timeout_seconds | The maximum time the transfer is allowed to complete. |
|
static |
Alias of set_thread_pool_nthreads
nthreads | The number of threads to use |
|
static |
Set the default task size used for parallel IO operations.
nbytes | The default task size in bytes. |
|
static |
Set the number of threads in the default thread pool. Waits for all currently running tasks to be completed, then destroys all threads in the pool and creates a new thread pool with the new number of threads. Any tasks that were waiting in the queue before the pool was reset will then be executed by the new threads.
nthreads | The number of threads to use. |
|
static |
Get the default task size used for parallel IO operations.
Set the default value using kvikio::default::set_task_size()
or by setting the KVIKIO_TASK_SIZE
environment variable. If not set, the default value is 4 MiB.
|
static |
Get the default thread pool.
Notice, it is not possible to change the default thread pool. KvikIO will always use the same thread pool however it is possible to change number of threads in the pool (see kvikio::default::set_thread_pool_nthreads()
).
|
static |
Get the number of threads in the default thread pool.
Set the default value using kvikio::default::set_thread_pool_nthreads()
or by setting the KVIKIO_NTHREADS
environment variable. If not set, the default value is 1.