Replies: 1 comment 1 reply
|
Hi @Simon067 , If you compile (py)AMReX with OpenMP support, then intrinsic functions called on the MultiFabs will make use of OpenMP threads. Examples: We have not yet exposed detailed OpenMP support on the #ifdef AMREX_USE_OMP
#pragma omp parallel if (amrex::Gpu::notInLaunchRegion())
#endif
for (MFIter mfi(divEfield, TilingIfNotGPU()); mfi.isValid(); ++mfi) {
Array4<Real> const& divE = divEfield.array(mfi); // global-indexed
Box const& tdive = mfi.tilebox(divEfield.ixType().toIntVect());
amrex::ParallelFor(tdive, [=] AMREX_GPU_DEVICE (int i, int j, int k) {
divE(i,j,k) = ... Ex(i-1,j,k) ...; // neighbor access
});
}
Note that tiling is only a technique to manufacture work units for a thread pool (e.g., using If we expose tiling by implementing proper An alternative you can explore in the meantime to manufacture more parallel work on CPUs: over-decompose the grid and use more MPI ranks. |
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
How can OpenMP be used to run parallel over parts of the grid? As far as I understand, when you make a view (like a not-copied numpy array) for data in the MultiFabs you no longer use OpenMP to parallelize actions over it? But can you even do calculations on the data without using views? I took HeatEquation.py as an example of how to do calculations on fields, but are there other ways (that are OpenMP parallelizable)?
edit: it appears my mistake it that it doesn't do any tiling within boxes when iterating in a typical
loop? do you need to globally turn on static tiling?
All reactions