Singleton class of default values used throughout KvikIO.
More...
#include <defaults.hpp>
Singleton class of default values used throughout KvikIO.
Definition at line 88 of file defaults.hpp.
◆ bounce_buffer_size()
static std::size_t kvikio::defaults::bounce_buffer_size |
( |
| ) |
|
|
static |
Get the size of the bounce buffer used to stage data in host memory.
Set the value using kvikio::default::bounce_buffer_size_reset()
or by setting the KVIKIO_BOUNCE_BUFFER_SIZE
environment variable. If not set, the value is 16 MiB.
- Returns
- The bounce buffer size in bytes.
◆ bounce_buffer_size_reset()
static void kvikio::defaults::bounce_buffer_size_reset |
( |
std::size_t |
nbytes | ) |
|
|
static |
Reset the size of the bounce buffer used to stage data in host memory.
- Parameters
-
nbytes | The bounce buffer size in bytes. |
◆ compat_mode()
static CompatMode kvikio::defaults::compat_mode |
( |
| ) |
|
|
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:
- when
libcufile
cannot be found
- when running in Windows Subsystem for Linux (WSL)
- when
/run/udev
isn't readable, which typically happens when running inside a docker image not launched with --volume /run/udev:/run/udev:ro
- Returns
- Compatibility mode.
◆ compat_mode_reset()
static void kvikio::defaults::compat_mode_reset |
( |
CompatMode |
compat_mode | ) |
|
|
static |
Reset 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.
- Parameters
-
compat_mode | Compatibility mode. |
◆ gds_threshold()
static std::size_t kvikio::defaults::gds_threshold |
( |
| ) |
|
|
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::gds_threshold_reset()
or by setting the KVIKIO_GDS_THRESHOLD
environment variable. If not set, the default value is 1 MiB.
- Returns
- The default GDS threshold size in bytes.
◆ gds_threshold_reset()
static void kvikio::defaults::gds_threshold_reset |
( |
std::size_t |
nbytes | ) |
|
|
static |
Reset the default GDS threshold, which is the minimum size to use GDS (in bytes).
- Parameters
-
nbytes | The default GDS threshold size in bytes. |
◆ infer_compat_mode_if_auto()
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.
◆ is_compat_mode_preferred() [1/2]
static bool kvikio::defaults::is_compat_mode_preferred |
( |
| ) |
|
|
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:
- The compatibility mode is
ON
.
- It is
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:
- The compatibility mode is
OFF
.
- It is
AUTO
but inferred to be OFF
.
- Returns
- Boolean answer.
◆ is_compat_mode_preferred() [2/2]
static bool kvikio::defaults::is_compat_mode_preferred |
( |
CompatMode |
compat_mode | ) |
|
|
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:
- The compatibility mode is
ON
.
- It is
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:
- The compatibility mode is
OFF
.
- It is
AUTO
but inferred to be OFF
.
- Parameters
-
compat_mode | Compatibility mode. |
- Returns
- Boolean answer.
◆ task_size()
static std::size_t kvikio::defaults::task_size |
( |
| ) |
|
|
static |
Get the default task size used for parallel IO operations.
Set the default value using kvikio::default::task_size_reset()
or by setting the KVIKIO_TASK_SIZE
environment variable. If not set, the default value is 4 MiB.
- Returns
- The default task size in bytes.
◆ task_size_reset()
static void kvikio::defaults::task_size_reset |
( |
std::size_t |
nbytes | ) |
|
|
static |
Reset the default task size used for parallel IO operations.
- Parameters
-
nbytes | The default task size in bytes. |
◆ thread_pool()
static BS::thread_pool& kvikio::defaults::thread_pool |
( |
| ) |
|
|
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::thread_pool_nthreads_reset()
).
- Returns
- The the default thread pool instance.
◆ thread_pool_nthreads()
static unsigned int kvikio::defaults::thread_pool_nthreads |
( |
| ) |
|
|
static |
Get the number of threads in the default thread pool.
Set the default value using kvikio::default::thread_pool_nthreads_reset()
or by setting the KVIKIO_NTHREADS
environment variable. If not set, the default value is 1.
- Returns
- The number of threads.
◆ thread_pool_nthreads_reset()
static void kvikio::defaults::thread_pool_nthreads_reset |
( |
unsigned int |
nthreads | ) |
|
|
static |
Reset 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. If the pool was paused before resetting it, the new pool will be paused as well.
- Parameters
-
nthreads | The number of threads to use. |
The documentation for this class was generated from the following file: