Suggestions for efficient scheme for elementwise reduction across ranks on MultiFab
s?
#4473
-
Hi all I'm asking for suggestions on how to implement a particular operation. I appreciate any and all help :) I have e.g. 8 I'd like the master rank to have a From what I can see, If this is the best approach, then that's fine, but I am wondering if anyone has any suggestions for other ideas? Any feedback is appreciated! :) |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
Do these MultiFabs have the same BoxArray? How many boxes do they have? Do they have ghost cells? If so, are the number of ghost cells the same? I suppose the BoxArrays are the same and the number of ghost cells are the same too, otherwise it probably does not make sense. If that is the case and there are not that many boxes, you can do
If you have lots of boxes, you can allocate a single chunk of memory for a MultiFab. For example,
Here we assume that GPU aware MPI is used. If not, you will have to memcpy data from multifab to pinned memory first, before you can MPI Reduce. However, the question is why you need to do this in the first place. |
Beta Was this translation helpful? Give feedback.
Do these MultiFabs have the same BoxArray? How many boxes do they have? Do they have ghost cells? If so, are the number of ghost cells the same? I suppose the BoxArrays are the same and the number of ghost cells are the same too, otherwise it probably does not make sense. If that is the case and there are not that many boxes, you can do
If you have lots of boxes, you can allocate a single chunk of memory for a MultiFab. For example,
MultiFab mf(ba,dm,ncomp,nghost,MFInfo{}.SetAllocSingleChunk(true)
. Then you can do