Classes | Public Types | Public Member Functions | Static Public Member Functions | Static Public Attributes | List of all members
UPstream Class Reference

Inter-processor communications stream. More...

Inheritance diagram for UPstream:
Inheritance graph
[legend]
Collaboration diagram for UPstream:
Collaboration graph
[legend]

Classes

class  commsStruct
 Structure for communicating between processors. More...
 
class  communicator
 Wrapper class for allocating/freeing communicators. More...
 
struct  listEq
 combineReduce operator for lists. Used for counting. More...
 

Public Types

enum  commsTypes : char { blocking, scheduled, nonBlocking }
 Types of communications. More...
 
typedef IntRange< int > rangeType
 Int ranges are used for MPI ranks (processes) More...
 

Public Member Functions

 ClassName ("UPstream")
 Declare name of the class and its debug switch. More...
 
 UPstream (const commsTypes commsType)
 Construct for given communication type. More...
 
commsTypes commsType () const noexcept
 Get the communications type of the stream. More...
 
commsTypes commsType (const commsTypes ct) noexcept
 Set the communications type of the stream. More...
 
template<class T >
Foam::List< TlistGatherValues (const T &localValue, const label comm)
 

Static Public Member Functions

static label nComms () noexcept
 Number of currently defined communicators. More...
 
static bool isUserComm (label communicator) noexcept
 True if communicator appears to be user-allocated. More...
 
static label allocateCommunicator (const label parent, const labelUList &subRanks, const bool doPstream=true)
 Allocate a new communicator with subRanks of parent communicator. More...
 
static void freeCommunicator (const label communicator, const bool doPstream=true)
 Free a previously allocated communicator. More...
 
static void freeCommunicators (const bool doPstream)
 Free all communicators. More...
 
static int baseProcNo (label comm, int procID)
 Return physical processor number (i.e. processor number in worldComm) given communicator and processor. More...
 
static label procNo (const label comm, const int baseProcID)
 Return processor number in communicator (given physical processor number) (= reverse of baseProcNo) More...
 
static label procNo (const label comm, const label currentComm, const int currentProcID)
 Return processor number in communicator (given processor number and communicator) More...
 
static void addValidParOptions (HashTable< string > &validParOptions)
 Add the valid option this type of communications library adds/requires on the command line. More...
 
static bool init (int &argc, char **&argv, const bool needsThread)
 Initialisation function called from main. More...
 
static bool initNull ()
 Special purpose initialisation function. More...
 
static label nRequests () noexcept
 Number of outstanding requests. More...
 
static void resetRequests (const label n)
 Truncate outstanding requests to given length. More...
 
static void waitRequests (const label start=0)
 Wait until all requests (from start onwards) have finished. More...
 
static void waitRequest (const label i)
 Wait until request i has finished. More...
 
static bool finishedRequest (const label i)
 Non-blocking comms: has request i finished? More...
 
static int allocateTag (const char *const msg=nullptr)
 
static void freeTag (const int tag, const char *const msg=nullptr)
 
static bool parRun (const bool on) noexcept
 Set as parallel run on/off. More...
 
static bool & parRun () noexcept
 Test if this a parallel run. More...
 
static bool haveThreads () noexcept
 Have support for threads. More...
 
static label nProcs (const label communicator=worldComm)
 Number of ranks in parallel run (for given communicator) is 1 for serial run. More...
 
static constexpr int masterNo () noexcept
 Process index of the master (always 0) More...
 
static bool master (const label communicator=worldComm)
 Am I the master rank. More...
 
static bool is_subrank (const label communicator=worldComm)
 Is this process a sub-rank on the communicator. More...
 
static int myProcNo (const label communicator=worldComm)
 Number of this process (starting from masterNo() = 0) More...
 
static label parent (const label communicator)
 The parent communicator. More...
 
static List< int > & procID (const label communicator)
 Process IDs within a given communicator. More...
 
static const wordListallWorlds () noexcept
 All worlds. More...
 
static const labelListworldIDs () noexcept
 The indices into allWorlds for all processes. More...
 
static label myWorldID ()
 My worldID. More...
 
static const wordmyWorld ()
 My world. More...
 
static rangeType allProcs (const label communicator=worldComm)
 Range of process indices for all processes. More...
 
static rangeType subProcs (const label communicator=worldComm)
 Range of process indices for sub-processes. More...
 
static const List< commsStruct > & linearCommunication (const label communicator=worldComm)
 Communication schedule for linear all-to-master (proc 0) More...
 
static const List< commsStruct > & treeCommunication (const label communicator=worldComm)
 Communication schedule for tree all-to-master (proc 0) More...
 
static const List< commsStruct > & whichCommunication (const label communicator=worldComm)
 Communication schedule for linear/tree all-to-master (proc 0). Chooses based on the value of UPstream::nProcsSimpleSum. More...
 
static int & msgType () noexcept
 Message tag of standard messages. More...
 
static void shutdown (int errNo=0)
 Shutdown (finalize) MPI as required. More...
 
static void abort ()
 Call MPI_Abort with no other checks or cleanup. More...
 
static void exit (int errNo=1)
 Shutdown (finalize) MPI as required and exit program with errNo. More...
 
static void allToAll (const UList< int32_t > &sendData, UList< int32_t > &recvData, const label communicator=worldComm)
 Exchange integer data with all processors (in the communicator). More...
 
static void allToAll (const UList< int64_t > &sendData, UList< int64_t > &recvData, const label communicator=worldComm)
 Exchange integer data with all processors (in the communicator). More...
 
static void mpiGather (const char *sendData, int sendCount, char *recvData, int recvCount, const label communicator=worldComm)
 Receive identically-sized char data from all ranks. More...
 
static void mpiScatter (const char *sendData, int sendCount, char *recvData, int recvCount, const label communicator=worldComm)
 Send identically-sized char data to all ranks. More...
 
static void gather (const char *sendData, int sendCount, char *recvData, const UList< int > &recvCounts, const UList< int > &recvOffsets, const label communicator=worldComm)
 Receive variable length char data from all ranks. More...
 
static void scatter (const char *sendData, const UList< int > &sendCounts, const UList< int > &sendOffsets, char *recvData, int recvCount, const label communicator=worldComm)
 Send variable length char data to all ranks. More...
 
static void gather (const int32_t *sendData, int sendCount, int32_t *recvData, const UList< int > &recvCounts, const UList< int > &recvOffsets, const label communicator=worldComm)
 Receive variable length int32_t data from all ranks. More...
 
static void scatter (const int32_t *sendData, const UList< int > &sendCounts, const UList< int > &sendOffsets, int32_t *recvData, int recvCount, const label communicator=worldComm)
 Send variable length int32_t data to all ranks. More...
 
static void gather (const int64_t *sendData, int sendCount, int64_t *recvData, const UList< int > &recvCounts, const UList< int > &recvOffsets, const label communicator=worldComm)
 Receive variable length int64_t data from all ranks. More...
 
static void scatter (const int64_t *sendData, const UList< int > &sendCounts, const UList< int > &sendOffsets, int64_t *recvData, int recvCount, const label communicator=worldComm)
 Send variable length int64_t data to all ranks. More...
 
static void gather (const uint32_t *sendData, int sendCount, uint32_t *recvData, const UList< int > &recvCounts, const UList< int > &recvOffsets, const label communicator=worldComm)
 Receive variable length uint32_t data from all ranks. More...
 
static void scatter (const uint32_t *sendData, const UList< int > &sendCounts, const UList< int > &sendOffsets, uint32_t *recvData, int recvCount, const label communicator=worldComm)
 Send variable length uint32_t data to all ranks. More...
 
static void gather (const uint64_t *sendData, int sendCount, uint64_t *recvData, const UList< int > &recvCounts, const UList< int > &recvOffsets, const label communicator=worldComm)
 Receive variable length uint64_t data from all ranks. More...
 
static void scatter (const uint64_t *sendData, const UList< int > &sendCounts, const UList< int > &sendOffsets, uint64_t *recvData, int recvCount, const label communicator=worldComm)
 Send variable length uint64_t data to all ranks. More...
 
static void gather (const float *sendData, int sendCount, float *recvData, const UList< int > &recvCounts, const UList< int > &recvOffsets, const label communicator=worldComm)
 Receive variable length float data from all ranks. More...
 
static void scatter (const float *sendData, const UList< int > &sendCounts, const UList< int > &sendOffsets, float *recvData, int recvCount, const label communicator=worldComm)
 Send variable length float data to all ranks. More...
 
static void gather (const double *sendData, int sendCount, double *recvData, const UList< int > &recvCounts, const UList< int > &recvOffsets, const label communicator=worldComm)
 Receive variable length double data from all ranks. More...
 
static void scatter (const double *sendData, const UList< int > &sendCounts, const UList< int > &sendOffsets, double *recvData, int recvCount, const label communicator=worldComm)
 Send variable length double data to all ranks. More...
 
template<class T >
static List< TlistGatherValues (const T &localValue, const label communicator=worldComm)
 Gather individual values into list locations. More...
 
template<class T >
static T listScatterValues (const UList< T > &allValues, const label communicator=worldComm)
 Scatter individual values from list locations. More...
 
static bool broadcast (char *buf, const std::streamsize bufSize, const label communicator=worldComm, const int rootProcNo=masterNo())
 Broadcast buffer contents to all processes in communicator. The sizes must match on all processes. More...
 
static void reduceAnd (bool &value, const label communicator=worldComm)
 Logical (and) reduction (cf. MPI AllReduce) More...
 
static void reduceOr (bool &value, const label communicator=worldComm)
 Logical (or) reduction (cf. MPI AllReduce) More...
 
static constexpr int firstSlave () noexcept
 Process index of first sub-process. More...
 
static int lastSlave (const label communicator=worldComm)
 Process index of last sub-process. More...
 

Static Public Attributes

static const Enum< commsTypescommsTypeNames
 Enumerated names for the communication types. More...
 
static bool floatTransfer
 Should compact transfer be used in which floats replace doubles reducing the bandwidth requirement at the expense of some loss in accuracy. More...
 
static int nProcsSimpleSum
 Number of processors to change from linear to tree communication. More...
 
static commsTypes defaultCommsType
 Default commsType. More...
 
static int nPollProcInterfaces
 Number of polling cycles in processor updates. More...
 
static int maxCommsSize
 Optional maximum message size (bytes) More...
 
static const int mpiBufferSize
 MPI buffer-size (bytes) More...
 
static label worldComm
 Default world communicator (all processors). May differ from globalComm if local worlds are in use. More...
 
static label warnComm
 Debugging: warn for use of any communicator differing from warnComm. More...
 
static constexpr label globalComm = 0
 Communicator for all processors, irrespective of any local worlds. More...
 
static constexpr label selfComm = 1
 A communicator within the current rank only. More...
 

Detailed Description

Inter-processor communications stream.

Source files

Definition at line 54 of file UPstream.H.

Member Typedef Documentation

◆ rangeType

typedef IntRange<int> rangeType

Int ranges are used for MPI ranks (processes)

Definition at line 61 of file UPstream.H.

Member Enumeration Documentation

◆ commsTypes

enum commsTypes : char
strong

Types of communications.

Enumerator
blocking 

"blocking" : (MPI_Bsend, MPI_Recv)

scheduled 

"scheduled" : (MPI_Send, MPI_Recv)

nonBlocking 

"nonBlocking" : (MPI_Isend, MPI_Irecv)

Definition at line 66 of file UPstream.H.

Constructor & Destructor Documentation

◆ UPstream()

UPstream ( const commsTypes  commsType)
inlineexplicit

Construct for given communication type.

Definition at line 397 of file UPstream.H.

Member Function Documentation

◆ ClassName()

ClassName ( "UPstream"  )

Declare name of the class and its debug switch.

◆ nComms()

static label nComms ( )
inlinestaticnoexcept

Number of currently defined communicators.

Definition at line 381 of file UPstream.H.

References UList< T >::size().

Here is the call graph for this function:

◆ isUserComm()

static bool isUserComm ( label  communicator)
inlinestaticnoexcept

◆ allocateCommunicator()

Foam::label allocateCommunicator ( const label  parent,
const labelUList subRanks,
const bool  doPstream = true 
)
static

Allocate a new communicator with subRanks of parent communicator.

if (myProcNo_[index] < 0 && parentIndex >= 0) { // As global rank myProcNo_[index] = -(myProcNo_[worldComm]+1);

OR: // As parent rank number if (myProcNo_[parentIndex] >= 0) { myProcNo_[index] = -(myProcNo_[parentIndex]+1); } }

Parameters
parentThe parent communicator
subRanksThe sub-ranks of parent to use (ignore negative values)
doPstreamCall allocatePstreamCommunicator

Definition at line 139 of file UPstream.C.

References Foam::ensightOutput::debug, Foam::endl(), Foam::Pout, UList< T >::size(), and Foam::sort().

Referenced by eagerGAMGProcAgglomeration::agglomerate(), masterCoarsestGAMGProcAgglomeration::agglomerate(), manualGAMGProcAgglomeration::agglomerate(), procFacesGAMGProcAgglomeration::agglomerate(), UPstream::communicator::reset(), and globalMeshData::updateMesh().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ freeCommunicator()

void freeCommunicator ( const label  communicator,
const bool  doPstream = true 
)
static

◆ freeCommunicators()

void freeCommunicators ( const bool  doPstream)
static

Free all communicators.

Definition at line 274 of file UPstream.C.

References forAll.

◆ baseProcNo()

int baseProcNo ( label  comm,
int  procID 
)
static

Return physical processor number (i.e. processor number in worldComm) given communicator and processor.

Definition at line 286 of file UPstream.C.

References UPstream::procID().

Referenced by UPstream::procNo().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ procNo() [1/2]

Foam::label procNo ( const label  comm,
const int  baseProcID 
)
static

Return processor number in communicator (given physical processor number) (= reverse of baseProcNo)

Definition at line 299 of file UPstream.C.

◆ procNo() [2/2]

Foam::label procNo ( const label  comm,
const label  currentComm,
const int  currentProcID 
)
static

Return processor number in communicator (given processor number and communicator)

Definition at line 316 of file UPstream.C.

References UPstream::baseProcNo().

Here is the call graph for this function:

◆ addValidParOptions()

void addValidParOptions ( HashTable< string > &  validParOptions)
static

Add the valid option this type of communications library adds/requires on the command line.

Definition at line 26 of file UPstream.C.

◆ init()

bool init ( int &  argc,
char **&  argv,
const bool  needsThread 
)
static

Initialisation function called from main.

Spawns sub-processes and initialises inter-communication

Definition at line 40 of file UPstream.C.

References Foam::endl(), Foam::exit(), Foam::FatalError, and FatalErrorInFunction.

Referenced by ParRunControl::runPar().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ initNull()

bool initNull ( )
static

Special purpose initialisation function.

Performs a basic MPI_Init without any other setup. Only used for applications that need MPI communication when OpenFOAM is running in a non-parallel mode.

Note
Behaves as a no-op if MPI has already been initialized. Fatal if MPI has already been finalized.

Definition at line 30 of file UPstream.C.

References Foam::endl(), and WarningInFunction.

Here is the call graph for this function:

◆ nRequests()

Foam::label nRequests ( )
staticnoexcept

◆ resetRequests()

void resetRequests ( const label  n)
static

Truncate outstanding requests to given length.

Definition at line 89 of file UPstream.C.

◆ waitRequests()

void waitRequests ( const label  start = 0)
static

Wait until all requests (from start onwards) have finished.

A no-op if parRun() == false

Definition at line 93 of file UPstream.C.

Referenced by cellCellStencil::correctBoundaryConditions(), oversetFvMeshBase::correctCoupledBoundaryConditions(), Foam::evaluateConstraintTypes(), Pstream::exchangeSizes(), syncTools::syncBoundaryFaceList(), syncTools::syncFaceList(), and OFstreamCollator::write().

Here is the caller graph for this function:

◆ waitRequest()

void waitRequest ( const label  i)
static

Wait until request i has finished.

A no-op if parRun() == false or for placeholder (negative) request indices

Definition at line 97 of file UPstream.C.

Referenced by PPCG::scalarSolveCG().

Here is the caller graph for this function:

◆ finishedRequest()

bool finishedRequest ( const label  i)
static

Non-blocking comms: has request i finished?

A no-op and returns true if parRun() == false or for placeholder (negative) request indices

Definition at line 101 of file UPstream.C.

◆ allocateTag()

int allocateTag ( const char *const  msg = nullptr)
static

◆ freeTag()

void freeTag ( const int  tag,
const char *const  msg = nullptr 
)
static

Definition at line 841 of file UPstream.C.

References Foam::ensightOutput::debug, Foam::endl(), Foam::PstreamGlobals::freedTags_, Foam::Pout, and DynamicList< T, SizeMin >::push_back().

Here is the call graph for this function:

◆ parRun() [1/2]

static bool parRun ( const bool  on)
inlinestaticnoexcept

Set as parallel run on/off.

Returns
the previous value

Definition at line 627 of file UPstream.H.

◆ parRun() [2/2]

static bool& parRun ( )
inlinestaticnoexcept

Test if this a parallel run.

Modify access is deprecated

Definition at line 639 of file UPstream.H.

Referenced by snappyLayerDriver::addLayers(), unwatchedIOdictionary::addWatch(), regIOobject::addWatch(), meshRefinement::balance(), Pstream::broadcast(), Pstream::broadcasts(), addPatchCellLayer::calcExtrudeInfo(), processorCyclicPolyPatch::calcGeometry(), processorPolyPatch::calcGeometry(), processorFaPatch::calcGeometry(), surfaceNoise::calculate(), cyclicAMIPolyPatch::canResetAMI(), IOobjectList::checkNames(), faBoundaryMesh::checkParallelSync(), polyBoundaryMesh::checkParallelSync(), AMIInterpolation::checkSymmetricWeights(), fieldValue::combineFields(), cellCellStencil::correctBoundaryConditions(), meshRefinement::countEdgeFaces(), processorFvPatch::coupled(), cyclicAMIPointPatch::coupled(), processorPointPatchField< Type >::coupled(), processorCyclicPointPatchField< Type >::coupled(), processorFvsPatchField< Type >::coupled(), processorFaePatchField< Type >::coupled(), processorCyclicFvsPatchField< Type >::coupled(), processorFaPatchField< Type >::coupled(), processorFvPatchField< Type >::coupled(), cyclicACMIFvPatch::coupled(), cyclicAMIFvPatch::coupled(), processorFaPatch::coupled(), calculatedProcessorFvPatchField< Type >::coupled(), processorPolyPatch::coupled(), multiWorldConnections::createComms(), simpleGeomDecomp::decompose(), decompositionMethod::decompose(), conformalVoronoiMesh::decomposition(), processorFvPatch::delta(), processorFaPatch::delta(), masterUncollatedFileOperation::dirPath(), refinementHistory::distribute(), fvMeshDistribute::distribute(), distributedTriSurfaceMesh::distribute(), distributedTriSurfaceMesh::distributedTriSurfaceMesh(), snappyLayerDriver::doLayers(), snappyRefineDriver::doRefine(), ensightSurfaceReader::ensightSurfaceReader(), Pstream::exchange(), Foam::exitNow(), faMeshReconstructor::faMeshReconstructor(), masterUncollatedFileOperation::filePath(), polyMesh::findCell(), masterUncollatedFileOperation::findInstance(), distributedTriSurfaceMesh::findLine(), distributedTriSurfaceMesh::findLineAll(), distributedTriSurfaceMesh::findLineAny(), distributedTriSurfaceMesh::findNearest(), masterUncollatedFileOperation::findTimes(), ensightSurfaceReader::geometry(), zoneDistribute::getDatafromOtherProc(), distributedTriSurfaceMesh::getField(), distributedTriSurfaceMesh::getNormal(), distributedTriSurfaceMesh::getRegion(), distributedTriSurfaceMesh::getVolumeType(), faMeshBoundaryHalo::haloSize(), InflationInjection< CloudType >::InflationInjection(), faMesh::init(), processorPolyPatch::initGeometry(), processorFaPatch::initGeometry(), InjectedParticleInjection< CloudType >::initialise(), InjectedParticleDistributionInjection< CloudType >::initialise(), extractEulerianParticles::initialiseBins(), processorPolyPatch::initOrder(), processorPolyPatch::initUpdateMesh(), processorFaPatch::initUpdateMesh(), faMeshTools::loadOrCreateMesh(), fvMeshTools::loadOrCreateMesh(), fileOperation::lookupAndCacheProcessorsPath(), LUscalarMatrix::LUscalarMatrix(), processorFaPatch::makeDeltaCoeffs(), processorFaPatch::makeNonGlobalPatchPoints(), processorFvPatch::makeWeights(), processorFaPatch::makeWeights(), error::master(), mergedSurf::merge(), surfaceWriter::merge(), surfaceWriter::mergeFieldTemplate(), polyBoundaryMesh::neighbourEdges(), masterUncollatedFileOperation::NewIFstream(), faMeshTools::newMesh(), fvMeshTools::newMesh(), fileWriter::open(), processorPolyPatch::order(), InflationInjection< CloudType >::parcelsToInject(), argList::parse(), collatedFileOperation::processorsDir(), surfaceNoise::read(), uncollatedFileOperation::read(), masterUncollatedFileOperation::read(), lumpedPointState::readData(), Time::readModifiedObjects(), masterUncollatedFileOperation::readObjects(), masterUncollatedFileOperation::readStream(), surfaceNoise::readSurfaceData(), Foam::reduce(), AMIWeights::reportPatch(), faMeshBoundaryHalo::reset(), globalIndex::reset(), fvMeshSubset::reset(), mapDistributeBase::schedule(), Time::setControls(), surfaceWriter::setSurface(), zoneDistribute::setUpCommforZone(), globalMeshData::sharedPoints(), shortestPathSet::shortestPathSet(), error::simpleExit(), messageStream::stream(), Foam::sumReduce(), surfaceWriter::surface(), surfaceNoise::surfaceAverage(), syncObjects::sync(), syncTools::syncEdgeMap(), syncTools::syncPointMap(), triSurfaceMesh::triSurfaceMesh(), fileOperation::uniformFile(), turbulentDFSEMInletFvPatchVectorField::updateCoeffs(), processorPolyPatch::updateMesh(), processorFaPatch::updateMesh(), faMesh::updateMesh(), fileOperation::updateStates(), energySpectrum::write(), ensightCells::write(), vtkWrite::write(), meshToMeshMethod::writeConnectivity(), AMIWeights::writeFileHeader(), fieldMinMax::writeFileHeader(), isoAdvection::writeIsoFaces(), faMeshReconstructor::writeMesh(), patchMeshWriter::writeNeighIDs(), collatedFileOperation::writeObject(), fileWriter::writeProcIDs(), surfaceNoise::writeSurfaceData(), and streamLineBase::writeToFile().

◆ haveThreads()

static bool haveThreads ( )
inlinestaticnoexcept

Have support for threads.

Definition at line 647 of file UPstream.H.

Referenced by OFstreamCollator::write().

Here is the caller graph for this function:

◆ nProcs()

static label nProcs ( const label  communicator = worldComm)
inlinestatic

Number of ranks in parallel run (for given communicator) is 1 for serial run.

Definition at line 656 of file UPstream.H.

References UList< T >::size().

Referenced by surfaceZonesInfo::addCellZonesToMesh(), surfaceZonesInfo::addFaceZonesToMesh(), eagerGAMGProcAgglomeration::agglomerate(), masterCoarsestGAMGProcAgglomeration::agglomerate(), manualGAMGProcAgglomeration::agglomerate(), procFacesGAMGProcAgglomeration::agglomerate(), UPstream::allProcs(), sensitivitySurfacePoints::assembleSensitivities(), meshRefinement::balanceAndRefine(), faPatch::boundaryProcs(), faMesh::boundaryProcs(), faPatch::boundaryProcSizes(), faMesh::boundaryProcSizes(), Pstream::broadcast(), Pstream::broadcasts(), mapDistributeBase::calcCompactAddressing(), surfaceNoise::calculate(), meshRefinement::checkCoupledFaceZones(), mappedPatchBase::collectSamples(), fieldValue::combineFields(), sizeDistribution::combineFields(), UPstream::commsStruct::commsStruct(), GAMGAgglomeration::continueAgglomerating(), fvMeshDistribute::countCells(), Foam::createReconstructMap(), meshRefinement::directionalRefineCandidates(), fvMeshDistribute::distribute(), distributedTriSurfaceMesh::distribute(), Pstream::exchange(), mapDistributeBase::exchangeAddressing(), Pstream::exchangeSizes(), extendedUpwindCellToFaceStencil::extendedUpwindCellToFaceStencil(), distributedTriSurfaceMesh::findNearest(), mappedPatchBase::findSamples(), externalCoupled::gatherAndCombine(), distributedTriSurfaceMesh::getVolumeType(), processorPolyPatch::initGeometry(), processorFaPatch::initGeometry(), InjectedParticleInjection< CloudType >::initialise(), InjectedParticleDistributionInjection< CloudType >::initialise(), viewFactor::initialise(), processorPolyPatch::initUpdateMesh(), processorFaPatch::initUpdateMesh(), UPstream::lastSlave(), distributedTriSurfaceMesh::localQueries(), LUscalarMatrix::LUscalarMatrix(), mapDistributeBase::mapDistributeBase(), masterUncollatedFileOperation::NewIFstream(), InflationInjection< CloudType >::parcelsToInject(), argList::parse(), pointHistory::pointHistory(), mapDistributeBase::printLayout(), collatedFileOperation::processorsDir(), masterUncollatedFileOperation::readHeader(), masterUncollatedFileOperation::readStream(), meshRefinement::refineAndBalance(), meshRefinement::refineCandidates(), Foam::regionSum(), meshRefinement::removeGapCells(), parProfiling::report(), faMeshBoundaryHalo::reset(), globalIndex::reset(), fvMeshSubset::reset(), mapDistributeBase::schedule(), Time::setControls(), zoneDistribute::setUpCommforZone(), ParSortableList< Type >::sort(), UPstream::subProcs(), trackingInverseDistance::update(), inverseDistance::update(), oversetFvMeshBase::updateAddressing(), turbulentDFSEMInletFvPatchVectorField::updateCoeffs(), globalMeshData::updateMesh(), UPstream::whichCommunication(), externalCoupled::writeGeometry(), isoAdvection::writeIsoFaces(), and streamLineBase::writeToFile().

Here is the call graph for this function:

◆ masterNo()

static constexpr int masterNo ( )
inlinestaticnoexcept

◆ master()

static bool master ( const label  communicator = worldComm)
inlinestatic

Am I the master rank.

Definition at line 672 of file UPstream.H.

References UPstream::masterNo().

Referenced by regIOobject::addWatch(), masterUncollatedFileOperation::addWatch(), Pstream::broadcast(), Pstream::broadcasts(), mappedPatchBase::calcMapping(), pointNoise::calculate(), viewFactor::calculate(), surfaceNoise::calculate(), writeFile::canResetFile(), writeFile::canWriteHeader(), writeFile::canWriteToFile(), argList::check(), fileWriter::checkFormatterValidity(), argList::checkRootCase(), extractEulerianParticles::collectParticle(), sizeDistribution::combineFields(), logFiles::createFiles(), Foam::createReconstructMap(), simpleGeomDecomp::decompose(), masterUncollatedFileOperation::dirPath(), systemCall::dispatch(), distributedTriSurfaceMesh::distribute(), distributedTriSurfaceMesh::distributedTriSurfaceMesh(), snappyVoxelMeshDriver::doRefine(), abort::end(), ensightSurfaceReader::ensightSurfaceReader(), abort::execute(), wallHeatFlux::execute(), Curle::execute(), momentum::execute(), externalFileCoupler::externalFileCoupler(), masterUncollatedFileOperation::filePath(), logFiles::files(), probes::findElements(), masterUncollatedFileOperation::findInstance(), masterUncollatedFileOperation::findTimes(), masterUncollatedFileOperation::findWatch(), STDMD::fit(), externalCoupled::gatherAndCombine(), coordSet::gatherSort(), ensightSurfaceReader::geometry(), masterUncollatedFileOperation::getFile(), masterUncollatedFileOperation::getState(), Random::globalGaussNormal(), Random::globalPosition(), Random::globalRandomise01(), Random::globalSample01(), surfaceNoise::initialise(), viewFactor::initialise(), JobInfo::JobInfo(), faMeshTools::loadOrCreateMesh(), fvMeshTools::loadOrCreateMesh(), fileOperation::lookupAndCacheProcessorsPath(), LUscalarMatrix::LUscalarMatrix(), NURBS3DVolume::makeFolders(), error::master(), messageStream::masterStream(), surfaceWriter::mergeFieldTemplate(), ensightCase::newCloud(), writeFile::newFile(), writeFile::newFileAtTime(), ensightCase::newGeometry(), masterUncollatedFileOperation::NewIFstream(), faMeshTools::newMesh(), fvMeshTools::newMesh(), fileOperation::nProcs(), objectiveManager::objectiveManager(), fileWriter::open(), InflationInjection< CloudType >::parcelsToInject(), argList::parse(), pointHistory::pointHistory(), porosityModel::porosityModel(), probes::prepare(), meshRefinement::printMeshInfo(), pointNoise::processData(), timeActivatedFileUpdate::read(), decomposedBlockData::read(), writeFile::read(), uncollatedFileOperation::read(), sampledSets::read(), externalCoupled::read(), sampledSurfaces::read(), masterUncollatedFileOperation::read(), baseIOdictionary::readData(), lumpedPointState::readData(), masterUncollatedFileOperation::readHeader(), masterUncollatedFileOperation::readObjects(), masterUncollatedFileOperation::readStream(), surfaceNoise::readSurfaceData(), externalCoupled::removeDataMaster(), externalCoupled::removeDataSlave(), masterUncollatedFileOperation::removeWatch(), parProfiling::report(), globalIndex::reset(), logFiles::resetNames(), mapDistributeBase::schedule(), faMatrix< Type >::setReference(), ensightCase::setTime(), masterUncollatedFileOperation::setUnmodified(), globalMeshData::sharedPoints(), shortestPathSet::shortestPathSet(), externalFileCoupler::shutdown(), snappyVoxelMeshDriver::snappyVoxelMeshDriver(), rigidBodyMeshMotionSolver::solve(), rigidBodyMeshMotion::solve(), rigidBodyMotion::solve(), ParSortableList< Type >::sort(), SQP::SQP(), messageStream::stream(), surfaceNoise::surfaceAverage(), hexRef8Data::sync(), syncTools::syncEdgeMap(), syncTools::syncPointMap(), triSurfaceMesh::triSurfaceMesh(), sixDoFRigidBodyMotion::update(), lumpedPointDisplacementPointPatchVectorField::updateCoeffs(), activePressureForceBaffleVelocityFvPatchVectorField::updateCoeffs(), electrostaticDepositionFvPatchScalarField::updateCoeffs(), updateMethod::updateMethod(), fileMonitor::updateStates(), masterUncollatedFileOperation::updateStates(), solution::upgradeSolverDict(), externalFileCoupler::useMaster(), externalFileCoupler::useSlave(), OFstreamCollator::waitAll(), externalFileCoupler::waitForMaster(), externalFileCoupler::waitForSlave(), histogramModel::write(), sensitivityBezier::write(), sensitivityVolBSplines::write(), sensitivityVolBSplinesFI::write(), sensitivityBezierFI::write(), proxyWriter::write(), timeInfo::write(), debugWriter::write(), energySpectrum::write(), x3dWriter::write(), starcdWriter::write(), OFstreamCollator::write(), yPlus::write(), rawWriter::write(), foamWriter::write(), SQP::write(), wallShearStress::write(), referenceTemperature::write(), abaqusWriter::write(), vtkWriter::write(), boundaryDataWriter::write(), nastranWriter::write(), vtkCloud::write(), sizeDistribution::write(), NURBS3DCurve::write(), effectivenessTable::write(), objective::write(), volFieldValue::write(), vtkWrite::write(), regionSizeDistribution::write(), NURBS3DSurface::write(), surfaceFieldValue::write(), propellerInfo::writeAxialWake(), ensightWriter::writeCollated(), updateMethod::writeCorrection(), NURBS3DVolume::writeCps(), decomposedBlockData::writeData(), lumpedPointMovement::writeData(), lumpedPointMovement::writeForcesAndMomentsVTP(), externalCoupled::writeGeometry(), objective::writeInstantaneousSeparator(), objective::writeInstantaneousValue(), isoAdvection::writeIsoFaces(), objective::writeMeanValue(), faMeshReconstructor::writeMesh(), patchMeshWriter::writeNeighIDs(), collatedFileOperation::writeObject(), decomposedBlockData::writeObject(), patchMeshWriter::writePatchIDs(), patchMeshWriter::writePoints(), fileWriter::writeProcIDs(), surfaceNoise::writeSurfaceData(), foamWriter::writeTemplate(), starcdWriter::writeTemplate(), boundaryDataWriter::writeTemplate(), x3dWriter::writeTemplate(), vtkWriter::writeTemplate(), debugWriter::writeTemplate(), streamLineBase::writeToFile(), ensightWriter::writeUncollated(), NURBS3DSurface::writeVTK(), propellerInfo::writeWake(), AMIWeights::writeWeightField(), NURBS3DCurve::writeWParses(), and NURBS3DSurface::writeWParses().

Here is the call graph for this function:

◆ is_subrank()

static bool is_subrank ( const label  communicator = worldComm)
inlinestatic

Is this process a sub-rank on the communicator.

Definition at line 680 of file UPstream.H.

References UPstream::masterNo().

Here is the call graph for this function:

◆ myProcNo()

static int myProcNo ( const label  communicator = worldComm)
inlinestatic

Number of this process (starting from masterNo() = 0)

Definition at line 688 of file UPstream.H.

Referenced by surfaceZonesInfo::addCellZonesToMesh(), surfaceZonesInfo::addFaceZonesToMesh(), eagerGAMGProcAgglomeration::agglomerate(), masterCoarsestGAMGProcAgglomeration::agglomerate(), manualGAMGProcAgglomeration::agglomerate(), sensitivitySurfacePoints::assembleSensitivities(), faPatch::boundaryProcs(), faMesh::boundaryProcs(), faPatch::boundaryProcSizes(), faMesh::boundaryProcSizes(), mapDistributeBase::calcCompactAddressing(), viewFactor::calculate(), GAMGAgglomeration::calculateRegionMaster(), meshRefinement::checkCoupledFaceZones(), mappedPatchBase::collectSamples(), fieldValue::combineFields(), sizeDistribution::combineFields(), Foam::createReconstructMap(), noDecomp::decompose(), fvMeshDistribute::distribute(), distributedTriSurfaceMesh::distribute(), Pstream::exchange(), mapDistributeBase::exchangeAddressing(), processorField::execute(), InjectionModel< CloudType >::findCellAtPosition(), patchProbes::findElements(), probes::findElements(), mappedPatchBase::findLocalSamples(), distributedTriSurfaceMesh::findNearest(), mappedPatchBase::findSamples(), lduPrimitiveMesh::gather(), globalIndex::gather(), externalCoupled::gatherAndCombine(), zoneDistribute::getDatafromOtherProc(), InjectedParticleInjection< CloudType >::initialise(), InjectedParticleDistributionInjection< CloudType >::initialise(), viewFactor::initialise(), globalIndex::inplaceToGlobal(), globalIndex::isLocal(), lduPrimitiveMesh::lduPrimitiveMesh(), faMeshTools::loadOrCreateMesh(), fvMeshTools::loadOrCreateMesh(), distributedTriSurfaceMesh::localQueries(), globalIndex::localSize(), globalIndex::localStart(), mapDistribute::mapDistribute(), mapDistributeBase::mapDistributeBase(), globalIndex::maxNonLocalSize(), UPstream::myWorld(), UPstream::myWorldID(), masterUncollatedFileOperation::NewIFstream(), regionSplit::nLocalRegions(), InflationInjection< CloudType >::parcelsToInject(), argList::parse(), pointHistory::pointHistory(), mapDistributeBase::printLayout(), backgroundMeshDecomposition::procBounds(), globalIndex::range(), masterUncollatedFileOperation::readHeader(), masterUncollatedFileOperation::readStream(), indexedVertex< Gt, Vb >::referred(), parProfiling::report(), faMeshBoundaryHalo::reset(), globalIndex::reset(), fvMeshSubset::reset(), mapDistributeBase::schedule(), Time::setControls(), patchInjectionBase::setPositionAndCell(), zoneDistribute::setUpCommforZone(), ParSortableList< Type >::sort(), KinematicSurfaceFilm< CloudType >::splashInteraction(), globalIndex::toGlobal(), globalIndex::toLocal(), trackingInverseDistance::update(), inverseDistance::update(), oversetFvMeshBase::updateAddressing(), patchInjectionBase::updateMesh(), processorField::updateMesh(), propellerInfo::updateSampleDiskCells(), globalIndex::whichProcID(), meshToMeshMethod::writeConnectivity(), AMIInterpolation::writeFaceConnectivity(), externalCoupled::writeGeometry(), isoAdvection::writeIsoFaces(), and fileWriter::writeProcIDs().

◆ parent()

static label parent ( const label  communicator)
inlinestatic

The parent communicator.

Definition at line 696 of file UPstream.H.

Referenced by UPstream::communicator::reset().

Here is the caller graph for this function:

◆ procID()

static List<int>& procID ( const label  communicator)
inlinestatic

Process IDs within a given communicator.

Definition at line 704 of file UPstream.H.

Referenced by UPstream::baseProcNo(), and collatedFileOperation::processorsDir().

Here is the caller graph for this function:

◆ allWorlds()

static const wordList& allWorlds ( )
inlinestaticnoexcept

All worlds.

Definition at line 715 of file UPstream.H.

Referenced by mappedPatchBase::calcMapping(), mappedPatchBase::masterWorld(), argList::parse(), Foam::printDOT(), and mappedPatchBase::sameWorld().

Here is the caller graph for this function:

◆ worldIDs()

static const labelList& worldIDs ( )
inlinestaticnoexcept

The indices into allWorlds for all processes.

Definition at line 723 of file UPstream.H.

◆ myWorldID()

static label myWorldID ( )
inlinestatic

My worldID.

Definition at line 731 of file UPstream.H.

References UPstream::globalComm, and UPstream::myProcNo().

Referenced by mappedPatchBase::calcMapping(), multiWorldConnections::createComms(), and mappedPatchBase::masterWorld().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ myWorld()

static const word& myWorld ( )
inlinestatic

My world.

Definition at line 739 of file UPstream.H.

References UPstream::globalComm, and UPstream::myProcNo().

Referenced by multiWorldConnections::addConnectionById(), multiWorldConnections::addConnectionByName(), mappedPatchBase::calcMapping(), argList::parse(), mappedPatchBase::sameWorld(), and mappedPatchBase::sampleMesh().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ allProcs()

static rangeType allProcs ( const label  communicator = worldComm)
inlinestatic

Range of process indices for all processes.

Definition at line 748 of file UPstream.H.

References UPstream::nProcs().

Referenced by refinementHistory::distribute(), zoneDistribute::getDatafromOtherProc(), viewFactor::initialise(), mapDistributeBase::receive(), mapDistributeBase::send(), zoneDistribute::setUpCommforZone(), ParSortableList< Type >::sort(), energySpectrum::write(), and externalCoupled::writeGeometry().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ subProcs()

static rangeType subProcs ( const label  communicator = worldComm)
inlinestatic

◆ linearCommunication()

static const List<commsStruct>& linearCommunication ( const label  communicator = worldComm)
inlinestatic

Communication schedule for linear all-to-master (proc 0)

Definition at line 767 of file UPstream.H.

◆ treeCommunication()

static const List<commsStruct>& treeCommunication ( const label  communicator = worldComm)
inlinestatic

Communication schedule for tree all-to-master (proc 0)

Definition at line 778 of file UPstream.H.

◆ whichCommunication()

static const List<commsStruct>& whichCommunication ( const label  communicator = worldComm)
inlinestatic

Communication schedule for linear/tree all-to-master (proc 0). Chooses based on the value of UPstream::nProcsSimpleSum.

Definition at line 790 of file UPstream.H.

References UPstream::nProcs(), and UPstream::nProcsSimpleSum.

Referenced by Foam::reduce(), and Pstream::scatter().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ msgType()

static int& msgType ( )
inlinestaticnoexcept

Message tag of standard messages.

Definition at line 806 of file UPstream.H.

Referenced by solidAbsorption::a(), mappedPatchBase::calcMapping(), masterUncollatedFileOperation::chMod(), mappedPatchBase::collectSamples(), extendedCentredCellToFaceStencil::compact(), extendedCentredFaceToCellStencil::compact(), extendedCentredCellToCellStencil::compact(), masterUncollatedFileOperation::cp(), masterUncollatedFileOperation::dirPath(), mappedPatchBase::distribute(), solidAbsorption::e(), masterUncollatedFileOperation::exists(), masterUncollatedFileOperation::filePath(), masterUncollatedFileOperation::fileSize(), distributedTriSurfaceMesh::findNearest(), mappedPatchBase::findSamples(), lduPrimitiveMesh::gather(), Foam::gAverage(), distributedTriSurfaceMesh::getVolumeType(), Foam::gSumCmptProd(), Foam::gSumProd(), masterUncollatedFileOperation::highResLastModified(), viewFactor::initialise(), regionModel::interRegionAMI(), masterUncollatedFileOperation::isDir(), masterUncollatedFileOperation::isFile(), masterUncollatedFileOperation::lastModified(), lduPrimitiveMesh::lduPrimitiveMesh(), masterUncollatedFileOperation::ln(), LUscalarMatrix::LUscalarMatrix(), surfaceWriter::mergeFieldTemplate(), masterUncollatedFileOperation::mkDir(), masterUncollatedFileOperation::mode(), masterUncollatedFileOperation::mv(), masterUncollatedFileOperation::mvBak(), masterUncollatedFileOperation::NewIFstream(), masterUncollatedFileOperation::readDir(), masterUncollatedFileOperation::readHeader(), masterUncollatedFileOperation::readStream(), surfaceNoise::readSurfaceData(), fvMatrix< Type >::relax(), faMeshBoundaryHalo::reset(), mappedPatchBase::reverseDistribute(), masterUncollatedFileOperation::rm(), masterUncollatedFileOperation::rmDir(), mapDistributeBase::schedule(), surfaceNoise::surfaceAverage(), syncObjects::sync(), processorFvPatch::tag(), processorFaPatch::tag(), processorCyclicPolyPatch::tag(), processorPolyPatch::tag(), masterUncollatedFileOperation::type(), oversetFvMeshBase::updateAddressing(), wideBandDiffusiveRadiationMixedFvPatchScalarField::updateCoeffs(), mappedVelocityFluxFixedValueFvPatchField::updateCoeffs(), mappedFlowRateFvPatchVectorField::updateCoeffs(), MarshakRadiationFvPatchScalarField::updateCoeffs(), filmPyrolysisTemperatureCoupledFvPatchScalarField::updateCoeffs(), filmPyrolysisVelocityCoupledFvPatchVectorField::updateCoeffs(), MarshakRadiationFixedTemperatureFvPatchScalarField::updateCoeffs(), greyDiffusiveRadiationMixedFvPatchScalarField::updateCoeffs(), alphatFilmWallFunctionFvPatchScalarField::updateCoeffs(), thermalBaffle1DFvPatchScalarField< solidType >::updateCoeffs(), turbulentTemperatureCoupledBaffleMixedFvPatchScalarField::updateCoeffs(), turbulentTemperatureRadCoupledMixedFvPatchScalarField::updateCoeffs(), globalMeshData::updateMesh(), OFstreamCollator::write(), and surfaceNoise::writeSurfaceData().

◆ commsType() [1/2]

commsTypes commsType ( ) const
inlinenoexcept

Get the communications type of the stream.

Definition at line 814 of file UPstream.H.

Referenced by UIPstream::UIPstream().

Here is the caller graph for this function:

◆ commsType() [2/2]

commsTypes commsType ( const commsTypes  ct)
inlinenoexcept

Set the communications type of the stream.

Returns
the previous value

Definition at line 824 of file UPstream.H.

◆ shutdown()

void shutdown ( int  errNo = 0)
static

Shutdown (finalize) MPI as required.

Uses MPI_Abort instead of MPI_Finalize if errNo is non-zero

Definition at line 51 of file UPstream.C.

Referenced by ParRunControl::~ParRunControl().

Here is the caller graph for this function:

◆ abort()

void abort ( )
static

Call MPI_Abort with no other checks or cleanup.

Definition at line 62 of file UPstream.C.

References Foam::abort().

Referenced by error::simpleExit().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ exit()

void exit ( int  errNo = 1)
static

Shutdown (finalize) MPI as required and exit program with errNo.

Definition at line 55 of file UPstream.C.

References Foam::exit().

Referenced by argList::argList(), Foam::exitNow(), argList::parse(), ParRunControl::runPar(), and error::simpleExit().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ allToAll() [1/2]

void allToAll ( const UList< int32_t > &  sendData,
UList< int32_t > &  recvData,
const label  communicator = worldComm 
)
static

Exchange integer data with all processors (in the communicator).

sendData[proci] is the value to send to proci. After return recvData contains the data from the other processors.

Definition at line 41 of file UPstreamAllToAll.C.

Referenced by fvMeshDistribute::distribute(), and Pstream::exchangeSizes().

Here is the caller graph for this function:

◆ allToAll() [2/2]

void allToAll ( const UList< int64_t > &  sendData,
UList< int64_t > &  recvData,
const label  communicator = worldComm 
)
static

Exchange integer data with all processors (in the communicator).

sendData[proci] is the value to send to proci. After return recvData contains the data from the other processors.

Definition at line 42 of file UPstreamAllToAll.C.

◆ mpiGather()

void mpiGather ( const char *  sendData,
int  sendCount,
char *  recvData,
int  recvCount,
const label  communicator = worldComm 
)
static

Receive identically-sized char data from all ranks.

Definition at line 55 of file UPstreamGatherScatter.C.

◆ mpiScatter()

void mpiScatter ( const char *  sendData,
int  sendCount,
char *  recvData,
int  recvCount,
const label  communicator = worldComm 
)
static

Send identically-sized char data to all ranks.

Definition at line 55 of file UPstreamGatherScatter.C.

◆ gather() [1/7]

void gather ( const char *  sendData,
int  sendCount,
char *  recvData,
const UList< int > &  recvCounts,
const UList< int > &  recvOffsets,
const label  communicator = worldComm 
)
static

Receive variable length char data from all ranks.

Parameters
sendCountIgnored on master if recvCount[0] == 0
recvDataIgnored on non-root rank
recvCountsIgnored on non-root rank
recvOffsetsIgnored on non-root rank

Definition at line 95 of file UPstreamGatherScatter.C.

◆ scatter() [1/7]

void scatter ( const char *  sendData,
const UList< int > &  sendCounts,
const UList< int > &  sendOffsets,
char *  recvData,
int  recvCount,
const label  communicator = worldComm 
)
static

Send variable length char data to all ranks.

Parameters
sendDataIgnored on non-root rank
sendCountsIgnored on non-root rank
sendOffsetsIgnored on non-root rank

Definition at line 95 of file UPstreamGatherScatter.C.

◆ gather() [2/7]

void gather ( const int32_t *  sendData,
int  sendCount,
int32_t *  recvData,
const UList< int > &  recvCounts,
const UList< int > &  recvOffsets,
const label  communicator = worldComm 
)
static

Receive variable length int32_t data from all ranks.

Parameters
sendCountIgnored on master if recvCount[0] == 0
recvDataIgnored on non-root rank
recvCountsIgnored on non-root rank
recvOffsetsIgnored on non-root rank

Definition at line 96 of file UPstreamGatherScatter.C.

◆ scatter() [2/7]

void scatter ( const int32_t *  sendData,
const UList< int > &  sendCounts,
const UList< int > &  sendOffsets,
int32_t *  recvData,
int  recvCount,
const label  communicator = worldComm 
)
static

Send variable length int32_t data to all ranks.

Parameters
sendDataIgnored on non-root rank
sendCountsIgnored on non-root rank
sendOffsetsIgnored on non-root rank

Definition at line 96 of file UPstreamGatherScatter.C.

◆ gather() [3/7]

void gather ( const int64_t *  sendData,
int  sendCount,
int64_t *  recvData,
const UList< int > &  recvCounts,
const UList< int > &  recvOffsets,
const label  communicator = worldComm 
)
static

Receive variable length int64_t data from all ranks.

Parameters
sendCountIgnored on master if recvCount[0] == 0
recvDataIgnored on non-root rank
recvCountsIgnored on non-root rank
recvOffsetsIgnored on non-root rank

Definition at line 97 of file UPstreamGatherScatter.C.

◆ scatter() [3/7]

void scatter ( const int64_t *  sendData,
const UList< int > &  sendCounts,
const UList< int > &  sendOffsets,
int64_t *  recvData,
int  recvCount,
const label  communicator = worldComm 
)
static

Send variable length int64_t data to all ranks.

Parameters
sendDataIgnored on non-root rank
sendCountsIgnored on non-root rank
sendOffsetsIgnored on non-root rank

Definition at line 97 of file UPstreamGatherScatter.C.

◆ gather() [4/7]

void gather ( const uint32_t *  sendData,
int  sendCount,
uint32_t *  recvData,
const UList< int > &  recvCounts,
const UList< int > &  recvOffsets,
const label  communicator = worldComm 
)
static

Receive variable length uint32_t data from all ranks.

Parameters
sendCountIgnored on master if recvCount[0] == 0
recvDataIgnored on non-root rank
recvCountsIgnored on non-root rank
recvOffsetsIgnored on non-root rank

Definition at line 98 of file UPstreamGatherScatter.C.

◆ scatter() [4/7]

void scatter ( const uint32_t *  sendData,
const UList< int > &  sendCounts,
const UList< int > &  sendOffsets,
uint32_t *  recvData,
int  recvCount,
const label  communicator = worldComm 
)
static

Send variable length uint32_t data to all ranks.

Parameters
sendDataIgnored on non-root rank
sendCountsIgnored on non-root rank
sendOffsetsIgnored on non-root rank

Definition at line 98 of file UPstreamGatherScatter.C.

◆ gather() [5/7]

void gather ( const uint64_t *  sendData,
int  sendCount,
uint64_t *  recvData,
const UList< int > &  recvCounts,
const UList< int > &  recvOffsets,
const label  communicator = worldComm 
)
static

Receive variable length uint64_t data from all ranks.

Parameters
sendCountIgnored on master if recvCount[0] == 0
recvDataIgnored on non-root rank
recvCountsIgnored on non-root rank
recvOffsetsIgnored on non-root rank

Definition at line 99 of file UPstreamGatherScatter.C.

◆ scatter() [5/7]

void scatter ( const uint64_t *  sendData,
const UList< int > &  sendCounts,
const UList< int > &  sendOffsets,
uint64_t *  recvData,
int  recvCount,
const label  communicator = worldComm 
)
static

Send variable length uint64_t data to all ranks.

Parameters
sendDataIgnored on non-root rank
sendCountsIgnored on non-root rank
sendOffsetsIgnored on non-root rank

Definition at line 99 of file UPstreamGatherScatter.C.

◆ gather() [6/7]

void gather ( const float *  sendData,
int  sendCount,
float *  recvData,
const UList< int > &  recvCounts,
const UList< int > &  recvOffsets,
const label  communicator = worldComm 
)
static

Receive variable length float data from all ranks.

Parameters
sendCountIgnored on master if recvCount[0] == 0
recvDataIgnored on non-root rank
recvCountsIgnored on non-root rank
recvOffsetsIgnored on non-root rank

Definition at line 100 of file UPstreamGatherScatter.C.

◆ scatter() [6/7]

void scatter ( const float *  sendData,
const UList< int > &  sendCounts,
const UList< int > &  sendOffsets,
float *  recvData,
int  recvCount,
const label  communicator = worldComm 
)
static

Send variable length float data to all ranks.

Parameters
sendDataIgnored on non-root rank
sendCountsIgnored on non-root rank
sendOffsetsIgnored on non-root rank

Definition at line 100 of file UPstreamGatherScatter.C.

◆ gather() [7/7]

void gather ( const double *  sendData,
int  sendCount,
double *  recvData,
const UList< int > &  recvCounts,
const UList< int > &  recvOffsets,
const label  communicator = worldComm 
)
static

Receive variable length double data from all ranks.

Parameters
sendCountIgnored on master if recvCount[0] == 0
recvDataIgnored on non-root rank
recvCountsIgnored on non-root rank
recvOffsetsIgnored on non-root rank

Definition at line 101 of file UPstreamGatherScatter.C.

◆ scatter() [7/7]

void scatter ( const double *  sendData,
const UList< int > &  sendCounts,
const UList< int > &  sendOffsets,
double *  recvData,
int  recvCount,
const label  communicator = worldComm 
)
static

Send variable length double data to all ranks.

Parameters
sendDataIgnored on non-root rank
sendCountsIgnored on non-root rank
sendOffsetsIgnored on non-root rank

Definition at line 101 of file UPstreamGatherScatter.C.

◆ listGatherValues() [1/2]

static List<T> listGatherValues ( const T localValue,
const label  communicator = worldComm 
)
static

Gather individual values into list locations.

On master list length == nProcs, otherwise zero length. If called in non-parallel mode, the returned list length is 1 with localValue.

Referenced by globalIndex::reset().

Here is the caller graph for this function:

◆ listScatterValues()

T listScatterValues ( const UList< T > &  allValues,
const label  communicator = worldComm 
)
static

Scatter individual values from list locations.

On master input list length == nProcs, ignored on other procs. If called in non-parallel mode, returns the first list element (or zero).

Definition at line 71 of file UPstreamTemplates.C.

References Foam::abort(), UList< T >::cdata_bytes(), UList< T >::empty(), Foam::endl(), Foam::FatalError, FatalErrorInFunction, UList< T >::size(), T, and Foam::Zero.

Here is the call graph for this function:

◆ broadcast()

bool broadcast ( char *  buf,
const std::streamsize  bufSize,
const label  communicator = worldComm,
const int  rootProcNo = masterNo() 
)
static

Broadcast buffer contents to all processes in communicator. The sizes must match on all processes.

Returns
True on success

Definition at line 26 of file UPstreamBroadcast.C.

Referenced by Pstream::broadcast().

Here is the caller graph for this function:

◆ reduceAnd()

void reduceAnd ( bool &  value,
const label  communicator = worldComm 
)
static

Logical (and) reduction (cf. MPI AllReduce)

Definition at line 28 of file UPstreamReduce.C.

Referenced by faMeshReconstructor::faMeshReconstructor(), and Foam::returnReduceAnd().

Here is the caller graph for this function:

◆ reduceOr()

void reduceOr ( bool &  value,
const label  communicator = worldComm 
)
static

Logical (or) reduction (cf. MPI AllReduce)

Definition at line 31 of file UPstreamReduce.C.

Referenced by polyBoundaryMesh::checkDefinition(), snappyLayerDriver::doLayers(), PstreamBuffers::finishedSends(), masterUncollatedFileOperation::readStream(), and Foam::returnReduceOr().

Here is the caller graph for this function:

◆ firstSlave()

static constexpr int firstSlave ( )
inlinestaticnoexcept

Process index of first sub-process.

Deprecated:
(2020-09) use subProcs() method instead

Definition at line 1016 of file UPstream.H.

◆ lastSlave()

static int lastSlave ( const label  communicator = worldComm)
inlinestatic

Process index of last sub-process.

Deprecated:
(2020-09) use subProcs() method instead

Definition at line 1026 of file UPstream.H.

References UPstream::nProcs().

Here is the call graph for this function:

◆ listGatherValues() [2/2]

Foam::List<T> listGatherValues ( const T localValue,
const label  comm 
)

Definition at line 25 of file UPstreamTemplates.C.

References Foam::abort(), UList< T >::data_bytes(), Foam::endl(), Foam::FatalError, FatalErrorInFunction, List< T >::resize(), and T.

Here is the call graph for this function:

Member Data Documentation

◆ commsTypeNames

const Foam::Enum< Foam::UPstream::commsTypes > commsTypeNames
static

◆ floatTransfer

bool floatTransfer
static

Should compact transfer be used in which floats replace doubles reducing the bandwidth requirement at the expense of some loss in accuracy.

Definition at line 327 of file UPstream.H.

Referenced by argList::parse().

◆ nProcsSimpleSum

int nProcsSimpleSum
static

Number of processors to change from linear to tree communication.

Definition at line 332 of file UPstream.H.

Referenced by UList< Foam::vector >::operator[](), argList::parse(), and UPstream::whichCommunication().

◆ defaultCommsType

Foam::UPstream::commsTypes defaultCommsType
static

◆ nPollProcInterfaces

int nPollProcInterfaces
static

Number of polling cycles in processor updates.

Definition at line 342 of file UPstream.H.

Referenced by argList::parse().

◆ maxCommsSize

int maxCommsSize
static

Optional maximum message size (bytes)

Definition at line 347 of file UPstream.H.

Referenced by Pstream::exchange().

◆ mpiBufferSize

const int mpiBufferSize
static

MPI buffer-size (bytes)

Definition at line 352 of file UPstream.H.

Referenced by attachOurBuffers().

◆ worldComm

Foam::label worldComm
static

◆ warnComm

Foam::label warnComm
static

◆ globalComm

constexpr label globalComm = 0
static

Communicator for all processors, irrespective of any local worlds.

Definition at line 371 of file UPstream.H.

Referenced by multiWorldConnections::createComms(), UPstream::myWorld(), and UPstream::myWorldID().

◆ selfComm

constexpr label selfComm = 1
static

A communicator within the current rank only.

Definition at line 376 of file UPstream.H.

Referenced by UPstream::isUserComm().


The documentation for this class was generated from the following files: