Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use The_Comms_Arena in particle communication. #4175

Merged
merged 4 commits into from
Oct 23, 2024

Conversation

atmyers
Copy link
Member

@atmyers atmyers commented Sep 30, 2024

The proposed changes:

  • fix a bug or incorrect behavior in AMReX
  • add new capabilities to AMReX
  • changes answers in the test suite to more than roundoff level
  • are likely to significantly affect the results of downstream AMReX users
  • include documentation in the code and/or rst files, if appropriate

@WeiqunZhang
Copy link
Member

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());
    }

@atmyers
Copy link
Member Author

atmyers commented Oct 1, 2024

Maybe we can use The_Comms_Arena() with gpu-aware MPI, and The_Arena() without it.

@ax3l ax3l self-requested a review October 1, 2024 22:04
@WeiqunZhang
Copy link
Member

Maybe we can use The_Comms_Arena() with gpu-aware MPI, and The_Arena() without it.

Yes, that would require the least amount of changes.

@atmyers atmyers merged commit dc745bb into AMReX-Codes:development Oct 23, 2024
59 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants