gpu_io_staging_bytes Function

public pure function gpu_io_staging_bytes(local_dims, checkpoint_cfg, device_write) result(bytes)

Device memory the GPU-aware ADIOS2 write path (src/io/adios2/io.f90, write_device_field_adios2) holds on top of the solver's own peak: a single reused staging buffer (file_handle%device_staging), sized to one unpadded LOCAL field in whichever precision that write uses. The buffer is grown, never shrunk (see write_device_field_adios2), so its steady-state size is the LARGEST single write it is asked to hold: the build precision whenever a checkpoint is enabled (always native, and always at least as large as a single-precision snapshot), otherwise whatever precision the snapshot uses.

Zero when the device path cannot be taken: device_write false (build without X3D2_ADIOS2_CUDA, or X3D2_ADIOS2_GPU_WRITE_MODE= host), or neither a unit-stride snapshot nor a checkpoint is enabled (striding falls back to the host path in snapshot_manager.f90; checkpoints never stride).

The DIR_X->DIR_C reorder borrows a block from the allocator free list and is not counted here (measurements 2026-09-15 showed exactly one field of growth).

Arguments

Type IntentOptional Attributes Name
integer, intent(in) :: local_dims(3)
type(checkpoint_config_t), intent(in) :: checkpoint_cfg
logical, intent(in) :: device_write

Return Value integer(kind=i8)


Calls

proc~~gpu_io_staging_bytes~~CallsGraph proc~gpu_io_staging_bytes m_memory_estimate::gpu_io_staging_bytes proc~gpu_io_staging_parts m_memory_estimate::gpu_io_staging_parts proc~gpu_io_staging_bytes->proc~gpu_io_staging_parts

Called by

proc~~gpu_io_staging_bytes~~CalledByGraph proc~gpu_io_staging_bytes m_memory_estimate::gpu_io_staging_bytes proc~estimate_for_num_gpus m_memcheck_estimate::estimate_for_num_gpus proc~estimate_for_num_gpus->proc~gpu_io_staging_bytes proc~report m_memcheck_report::report proc~report->proc~gpu_io_staging_bytes proc~report->proc~estimate_for_num_gpus proc~print_requested_line m_memcheck_report::print_requested_line proc~report->proc~print_requested_line proc~print_requested_line->proc~estimate_for_num_gpus proc~run_build_mode m_memcheck_build::run_build_mode proc~run_build_mode->proc~estimate_for_num_gpus program~x3d2_memcheck x3d2_memcheck program~x3d2_memcheck->proc~report program~x3d2_memcheck->proc~run_build_mode