Need deep copy and host mirror for AoSoA
Two final memory utilities are needed before MPI-based data structures may be implemented with AoSoA
for distributed parallel operations.
-
The AoSoA
needs adeep_copy
function for copying data between containers in with potentially different inner array sizes and memory spaces. This action will always copy the data from one container to the other. -
The AoSoA
needs an implementation of theHostMirror
concept. This concept creates an 'AoSoA' container on the host that mirros anotherAoSoA
that is in a potentially different memory space and allows for more straightforward syncing between them for MPI-based communications. Creating aHostMirror
may mean of shallow copy if the memory spaces of are compatible or a deep copy if they are not. For example,CudaUVMSpace
is compatible with host space and will therefore not require a deep copy whileCudaSpace
requires a deep copy because it is not accessible from the host.
Edited by Slattery, Stuart