Closed atmyers closed 1 month ago
Because The_Comms_Arena
is an alias to The_Pinned_Arena
when gpu aware mpi is not used, the code like below might be problematic.
// assuming ParallelDescriptor::UseGpuAwareMpi() is false
amrex::PODVector<char, PolymorphicArenaAllocator<char> > rcv_buffer;
rcv_buffer.setArena(The_Comms_Arena()); // pinned memory if not using gpu aware mpi
if (ParallelDescriptor::UseGpuAwareMpi())
{
// ...
}
else
{
...
// rcv_buffer is not device memory
Gpu::htod_memcpy_async(rcv_buffer.dataPtr(), pinned_rcv_buffer.dataPtr(), pinned_rcv_buffer.size());
}
Maybe we can use The_Comms_Arena()
with gpu-aware MPI, and The_Arena()
without it.
Maybe we can use
The_Comms_Arena()
with gpu-aware MPI, andThe_Arena()
without it.
Yes, that would require the least amount of changes.
The proposed changes: