Skip to content

Comments

Implement GPU-aware IO#277

Draft
ia267 wants to merge 19 commits intoxcompact3d:mainfrom
ia267:176_cuda_aware_adios2
Draft

Implement GPU-aware IO#277
ia267 wants to merge 19 commits intoxcompact3d:mainfrom
ia267:176_cuda_aware_adios2

Conversation

@ia267
Copy link
Collaborator

@ia267 ia267 commented Feb 17, 2026

This PR implements GPU aware IO (closes #176) where data is written directly from device memory to ADIOS2 without host staging.

Process:

  • After defining the variable, tell ADIOS2 the buffer lives on GPU
  • Pass the device pointer via C wrapper (the Fortran API call adios2_put does not accept CUDA device array. Therefore a C wrapper adios2_put_gpu is created to receive the device pointer and calls the C adios2_put. Without the C wrapper it triggers a device-to-copy which defeats the purpose)
  • At runtime, write-field subroutines detects the cuda backend and uses the GPU path to write. Non-cuda paths uses the default host path

In order to use GPU-aware IO we have to use the compiler flag: -DWITH_ADIOS2_GPU_AWARE=ON

As part of this PR I have also implemented single-precision writing from GPU, as well as reading mixed-precision (closes #276) and as well fixed a bug in checkpoints, where it was using the host pointer (%data) see 20d98bf.

@ia267 ia267 added this to the Enhancing IO functionality milestone Feb 17, 2026
@ia267 ia267 self-assigned this Feb 17, 2026
@ia267 ia267 added cuda Related to CUDA backend infrastructure Software infrastructure labels Feb 17, 2026
@ia267 ia267 marked this pull request as draft February 17, 2026 15:45
@ia267 ia267 force-pushed the 176_cuda_aware_adios2 branch from b80c3e8 to f5f3027 Compare February 17, 2026 16:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

cuda Related to CUDA backend infrastructure Software infrastructure

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Allow to mixed-precision input reading Implement CUDA-aware IO in ADIOS2

1 participant