Are there prospects for allowing a different memory layout in the data storage? #2472
-
Based on a long time optimizing our existing code, we know it performs fastest when the memory is laid out as We have bolted on AMReX to handle AMR operations and communication and retained our existing data structures so our core code doesn't change and we can keep all of our existing validated capabilities with and without AMReX. However, because the AMReX memory order is If AMReX had the ability to put the components first or last in the layout, then it would eliminate virtually all the overhead of bolting on AMReX -- we could provide pointers to existing arrays instead of allocating duplicate arrays, and then we wouldn't need to do any copying back and forth either. I don't know what the possibility of adding that option would be, however. I would bet it's quite an undertaking and makes the AMR-specific tasks more expensive since they tend to operate on one variable over multiple cells at a time. But based on my profiling studies of the current approach in our code, very little time is spent in the AMR math parts and almost the entire cost of bolting on AMReX is spent on copying between the arrays. Is there any prospect of allowing either ordering? It's okay if the answer is no or if nobody other than me would be interested in it, but I would like to throw it out there that it would certainly improve our performance if it could be done. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
We have limited support for the |
Beta Was this translation helpful? Give feedback.
We have limited support for the
(nvar, icells, jcells, kcells)
support. ForMultiFab
, it's always(icells, jcells, kcells, nvars)
. However, ifnvar
is a fixed size known at compile time, we do haveFabArray<BaseFab<GpuArray<Real,nvar>>>
. Note thatMultiFab
is derived fromFabArray
.