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 async sends in particle communication #4257

Merged
merged 5 commits into from
Dec 10, 2024

Conversation

atmyers
Copy link
Member

@atmyers atmyers commented Dec 7, 2024

This changes a few instances of ParallelDescriptor::Send to ParallelDescriptor::Asend. This improves the overall runtime of the redistribute benchmark by a few percent for multi-node runs:

Gpus      Send        Asend
4	  4.125       4.123
8	  4.29 	      4.198
16	  4.472       4.297
32	  4.62 	      4.456

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

@atmyers atmyers requested a review from WeiqunZhang December 7, 2024 00:07
Src/Particle/AMReX_ParticleCommunication.H Outdated Show resolved Hide resolved
@@ -169,8 +170,9 @@ void ParticleCopyPlan::buildMPIStart (const ParticleBufferMap& map, Long psize)
AMREX_ASSERT(Who >= 0 && Who < NProcs);
AMREX_ASSERT(Cnt < std::numeric_limits<int>::max());

ParallelDescriptor::Send((char*) snd_data[i].data(), Cnt, Who, SeqNum,
ParallelContext::CommunicatorSub());
auto msg = ParallelDescriptor::Asend((char*) snd_data[i].data(), Cnt, Who, SeqNum,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We only need to save ParallelDescriptor::Asend(...).req(), and later we can call Waitall on the vector.

@atmyers atmyers merged commit 9643da4 into AMReX-Codes:development Dec 10, 2024
75 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants