ENH: provide getter/setter interface to standard communicators
- similar to UPstream::parRun(), the setter returns the previous value. The accessors are prefixed with 'comm': Eg, commGlobal(), commWarn(), commWorld(), commSelf(). This distinguishes them from any existing variables (eg, worldComm) and arguably more similar to MPI_COMM_WORLD etc... If demand-driven communicators are added in the future, the function call syntax can help encapsulate that. Previously: const label oldWarnComm = UPstream::warnComm; const label oldWorldComm = UPstream::worldComm; UPstream::warnComm = myComm; UPstream::worldComm = myComm; ... UPstream::warnComm = oldWarnComm; UPstream::worldComm = oldWorldComm; Now: const label oldWarnComm = UPstream::commWarn(myComm); const label oldWorldComm = UPstream::commWorld(myComm); ... UPstream::commWarn(oldWarnComm); UPstream::commWorld(oldWorldComm); STYLE: check (warnComm >= 0) instead of (warnComm != -1)
Showing
- applications/test/parallel-comm0/Test-parallel-comm0.C 17 additions, 17 deletionsapplications/test/parallel-comm0/Test-parallel-comm0.C
- applications/test/parallel-comm1/Test-parallel-comm1.C 2 additions, 6 deletionsapplications/test/parallel-comm1/Test-parallel-comm1.C
- applications/test/parallel-comm2/Test-parallel-comm2.C 15 additions, 15 deletionsapplications/test/parallel-comm2/Test-parallel-comm2.C
- src/OpenFOAM/db/IOstreams/Pstreams/PstreamReduceOps.H 1 addition, 1 deletionsrc/OpenFOAM/db/IOstreams/Pstreams/PstreamReduceOps.H
- src/OpenFOAM/db/IOstreams/Pstreams/UPstream.H 31 additions, 3 deletionssrc/OpenFOAM/db/IOstreams/Pstreams/UPstream.H
- src/OpenFOAM/db/error/messageStream.C 1 addition, 1 deletionsrc/OpenFOAM/db/error/messageStream.C
- src/OpenFOAM/meshes/polyMesh/globalMeshData/globalMeshData.C 4 additions, 4 deletionssrc/OpenFOAM/meshes/polyMesh/globalMeshData/globalMeshData.C
- src/Pstream/mpi/UIPstreamRead.C 1 addition, 1 deletionsrc/Pstream/mpi/UIPstreamRead.C
- src/Pstream/mpi/UOPstreamWrite.C 1 addition, 1 deletionsrc/Pstream/mpi/UOPstreamWrite.C
- src/Pstream/mpi/UPstreamBroadcast.C 1 addition, 1 deletionsrc/Pstream/mpi/UPstreamBroadcast.C
- src/Pstream/mpi/UPstreamWrappingTemplates.C 10 additions, 10 deletionssrc/Pstream/mpi/UPstreamWrappingTemplates.C
- src/functionObjects/utilities/syncObjects/syncObjects.C 5 additions, 5 deletionssrc/functionObjects/utilities/syncObjects/syncObjects.C
- src/meshTools/mappedPatches/mappedPolyPatch/mappedPatchBase.C 18 additions, 19 deletions...meshTools/mappedPatches/mappedPolyPatch/mappedPatchBase.C
- src/meshTools/mappedPatches/mappedPolyPatch/mappedPatchBaseTemplates.C 37 additions, 34 deletions.../mappedPatches/mappedPolyPatch/mappedPatchBaseTemplates.C
- src/meshTools/multiWorld/multiWorldConnectionsObject.C 11 additions, 10 deletionssrc/meshTools/multiWorld/multiWorldConnectionsObject.C
Please register or sign in to comment