-
- Downloads
ENH: additional MPI gather/scatter routines, globalIndex gather methods
- UPstream::mpiGather (MPI_Gather) - used by Pstream::listGatherValues - UPstream::mpiScatter (MPI_Scatter) - used by Pstream::listScatterValues These are much simpler forms for gather/scatter of fixed-sized contiguous types data types (eg, primitives, simple pairs etc). In the gather form, creates a list of gathered values on the master process. The subranks have a list size of zero. Similarly, scatter will distribute a list of values to single values on each process. Instead of labelList sendSizes(Pstream::nProcs()); sendSizes[Pstream::myProcNo()] = sendData.size(); Pstream::gatherList(sendSizes); Can write const labelList sendSizes ( UPstream::listGatherValues<label>(sendData.size()) ); // Less code, lower overhead and list can be const. For scattering an individual value only, instead of labelList someValues; if (Pstream::master()) someValues = ...; Pstream::gatherList(sendSizes); const label localValue ( someValues[Pstream::myProcNo()] ); Can write labelList someValues; if (Pstream::master()) someValues = ...; Pstream::gatherList(sendSizes); const label localValue ( UPstream::listScatterValues<label>(someValues) ); Can of course also mix listGatherValues to assemble a list on master and use Pstream::scatterList to distribute. ENH: adjusted globalIndex gather methods - added mpiGather() method [contiguous data only] using MPI_Gatherv - respect localSize if gathering master data to ensure that a request for 0 master elements is properly handled.
Showing
- applications/test/gatherValues1/Make/files 3 additions, 0 deletionsapplications/test/gatherValues1/Make/files
- applications/test/gatherValues1/Make/options 2 additions, 0 deletionsapplications/test/gatherValues1/Make/options
- applications/test/gatherValues1/Test-gatherValues1.C 189 additions, 0 deletionsapplications/test/gatherValues1/Test-gatherValues1.C
- src/OpenFOAM/db/IOstreams/Pstreams/UPstream.H 52 additions, 2 deletionssrc/OpenFOAM/db/IOstreams/Pstreams/UPstream.H
- src/OpenFOAM/db/IOstreams/Pstreams/UPstreamTemplates.C 132 additions, 0 deletionssrc/OpenFOAM/db/IOstreams/Pstreams/UPstreamTemplates.C
- src/OpenFOAM/meshes/polyMesh/globalMeshData/globalIndex.H 71 additions, 39 deletionssrc/OpenFOAM/meshes/polyMesh/globalMeshData/globalIndex.H
- src/OpenFOAM/meshes/polyMesh/globalMeshData/globalIndexTemplates.C 140 additions, 40 deletions...OAM/meshes/polyMesh/globalMeshData/globalIndexTemplates.C
- src/Pstream/dummy/UPstream.C 31 additions, 3 deletionssrc/Pstream/dummy/UPstream.C
- src/Pstream/mpi/UPstream.C 128 additions, 11 deletionssrc/Pstream/mpi/UPstream.C
Loading
Please register or sign in to comment