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

Improvements to maxParticleVelocity #5169

Merged
merged 8 commits into from
Sep 10, 2024

Conversation

archermarx
Copy link
Contributor

@archermarx archermarx commented Aug 26, 2024

This PR improves the functionality of WarpXParticleContainer::maxParticleVelocity in two ways.

  1. The function can now make use of the GPU for the reduction stage, just like meanParticleVelocity
  2. The function now actually returns velocities, wheras before it returned momenta.

This PR also adds a version to MultiParticleContainer, so the maximum velocity among all particle species can be obtained.

As far as I can tell, this function is not used anywhere at the moment. I am however working on another PR which will make use of it, so I thought i would go ahead and send this off for feedback now.

@archermarx
Copy link
Contributor Author

archermarx commented Aug 26, 2024

A question for those more experienced. Is the a reason we need to call OpenMP manually when we're not using GPU? My understanding is that AMReX should be able to use OpenMP just fine within the ParticleReduce function, but I'm basing a lot of this code on the getMeanParticleVelocity function above this, which adopts this strategy.

@archermarx
Copy link
Contributor Author

Not sure why CUDA is failing to compile. Can compile with NVCC on my machine without errors.

@archermarx archermarx added machine / system Machine or system-specific issue enhancement New feature or request component: electrostatic electrostatic solver component: diagnostics all types of outputs and removed machine / system Machine or system-specific issue component: electrostatic electrostatic solver labels Aug 26, 2024
@ax3l ax3l self-assigned this Aug 26, 2024
@ax3l ax3l self-requested a review August 26, 2024 23:14
@archermarx
Copy link
Contributor Author

Thanks for the refactor. It seems all tests are green. Anything else needed before merge? @RemiLehe @ax3l

@RemiLehe RemiLehe merged commit ab19438 into ECP-WarpX:development Sep 10, 2024
38 checks passed
@RemiLehe
Copy link
Member

Thanks for the PR @archermarx

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
component: diagnostics all types of outputs enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants