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 AoSoAneeds adeep_copyfunction 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 AoSoAneeds an implementation of theHostMirrorconcept. This concept creates an 'AoSoA' container on the host that mirros anotherAoSoAthat is in a potentially different memory space and allows for more straightforward syncing between them for MPI-based communications. Creating aHostMirrormay mean of shallow copy if the memory spaces of are compatible or a deep copy if they are not. For example,CudaUVMSpaceis compatible with host space and will therefore not require a deep copy whileCudaSpacerequires a deep copy because it is not accessible from the host.
Edited by Slattery, Stuart