How to get min/max particle positions across all levels with GPU parallelization? #4632
-
Hi all, I would like to compute the bounding box of all particles (minimum and maximum coordinates in each dimension) across all levels of my AMReX simulation. Currently, I have the following code:
This works fine on CPU (with OpenMP parallelization), but it is not GPU-friendly because of the explicit for-loops over particles. My question is: Thanks in advance! |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
You can use the ParticleReduce function. Here is a link to doxygen documentation (https://amrex-codes.github.io/amrex/doxygen/namespaceamrex.html#a3762aae68593d892d48ede3cb6e317a7). The example code there is not formatted correctly for doxygen. We need to fix it. For now you might want to look at comments in the source code. amrex/Src/Particle/AMReX_ParticleReduce.H Line 1207 in 5d1b6c2 Note that you still need to do MPI reduction yourself. (See the documentation for detail.) |
Beta Was this translation helpful? Give feedback.
You can use the ParticleReduce function.
Here is a link to doxygen documentation (https://amrex-codes.github.io/amrex/doxygen/namespaceamrex.html#a3762aae68593d892d48ede3cb6e317a7). The example code there is not formatted correctly for doxygen. We need to fix it. For now you might want to look at comments in the source code.
amrex/Src/Particle/AMReX_ParticleReduce.H
Line 1207 in 5d1b6c2
Note that you still need to do MPI reduction yourself. (See the documentation for detail.)