(ADaptive Input Output System v2) library. It acts as a translation layer converting generic I/O calls from the session interface into specific calls to the ADIOS2 API.
The adios2_reader_t and adios2_writer_t types defined here extend the
abstract base types from m_io_base and implement required procedures
This backend leverages several key features of the underlying ADIOS2 library - engine abstraction - the same API can be used for different transport methods (e.g. BP4, BP5, HDF5) - Asynchronous I/O - by default ADIOS2 uses a deferred transport mode which can improve performance by overlapping computation and I/O - MPI integration - it is designed for large-scale parallel I/O and integrates with MPI, though serial operation is also supported
GPU-aware writes (built with WITH_ADIOS2_GPU_AWARE, which defines
X3D2_ADIOS2_CUDA) hand device memory straight to ADIOS2:
- the solver backend packs each field into a contiguous, unpadded device
buffer (base_backend_t%export_field_to_device), so this module needs
no knowledge of the backend's field layout or allocator types
- one staging buffer belongs to the open file and is reused across
fields and steps, so no device memory is allocated per write
- puts are synchronous: ADIOS2 2.12's BP5 engine copies GPU buffers
during Put whatever mode is requested, so the buffer is free again as
soon as the put returns
Runtime options, read from the environment when the first writer starts:
- X3D2_ADIOS2_GPU_WRITE_MODE=auto|gpu|host (default auto): host forces
the device-to-host staged path even when GPU-aware writes are available
- X3D2_ADIOS2_IO_BENCH=0|1 (default 0): time Put and EndStep per step and
print a summary when the file closes, excluding the first
bench_warmup_steps steps
Note
This is an internal backend module and should never be used directly.
All user interaction must go through m_io_session.
| Type | Visibility | Attributes | Name | Initial | |||
|---|---|---|---|---|---|---|---|
| integer, | public, | parameter | :: | IO_BACKEND_DUMMY | = | 0 | |
| integer, | public, | parameter | :: | IO_BACKEND_ADIOS2 | = | 1 | |
| integer, | public, | parameter | :: | gpu_write_mode_force_host | = | 2 | |
| character(len=4), | public, | parameter | :: | gpu_write_mode_names(0:2) | = | ["auto", "gpu ", "host"] |
Names of the gpu_write_mode_* values, indexed by value |
Map the text of X3D2_ADIOS2_GPU_WRITE_MODE to a gpu_write_mode_* value. Case is ignored, an unknown or empty text gives auto.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| character(len=*), | intent(in) | :: | raw |
The gpu_write_mode_* value of the environment variable X3D2_ADIOS2_GPU_WRITE_MODE. An unset or empty variable gives auto.
Count the leading steps of a file whose scalar variable_name is no
greater than limit. Returns 0 if the variable is not in the file.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| character(len=*), | intent(in) | :: | filename | |||
| character(len=*), | intent(in) | :: | variable_name | |||
| real(kind=dp), | intent(in) | :: | limit | |||
| integer, | intent(in) | :: | comm |
Read a string attribute of a file. Returns an empty string if the attribute is not in the file.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| character(len=*), | intent(in) | :: | filename | |||
| character(len=*), | intent(in) | :: | attribute_name | |||
| integer, | intent(in) | :: | comm |
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(io_reader_t), | intent(out), | allocatable | :: | reader |
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(io_writer_t), | intent(out), | allocatable | :: | writer |