Skip to content
Snippets Groups Projects
Commit 64ea3e3b authored by Martin Bauer's avatar Martin Bauer
Browse files

AllGather support for fields

parent 9095d9ef
No related merge requests found
...@@ -40,7 +40,8 @@ namespace field { ...@@ -40,7 +40,8 @@ namespace field {
* \param blocks the block storage where the field is stored * \param blocks the block storage where the field is stored
* \param fieldID the block data id of the field * \param fieldID the block data id of the field
* \param boundingBox cell bounding box in global coordinates of the interval which is gathered * \param boundingBox cell bounding box in global coordinates of the interval which is gathered
* \param targetRank rank of the process where field is gathered * \param targetRank rank of the process where field is gathered, if negative rank is passed, field is gathered
* on all processes
* \param comm MPI communicator * \param comm MPI communicator
* *
* \tparam Field_T the type of field which is stored in the given fieldID * \tparam Field_T the type of field which is stored in the given fieldID
...@@ -88,7 +89,10 @@ namespace field { ...@@ -88,7 +89,10 @@ namespace field {
// -- Gather message sizes -- // -- Gather message sizes --
mpi::RecvBuffer recvBuffer; mpi::RecvBuffer recvBuffer;
mpi::gathervBuffer( sendBuffer, recvBuffer, targetRank, comm ); if ( targetRank >= 0 )
mpi::gathervBuffer( sendBuffer, recvBuffer, targetRank, comm );
else
mpi::allGathervBuffer( sendBuffer, recvBuffer, comm );
// -- Unpacking -- // -- Unpacking --
if ( recvBuffer.size() > 0 ) if ( recvBuffer.size() > 0 )
...@@ -105,7 +109,6 @@ namespace field { ...@@ -105,7 +109,6 @@ namespace field {
recvBuffer >> it.getF(f); recvBuffer >> it.getF(f);
} }
} }
} }
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment