UPstream Class Reference

Inter-processor communications stream. More...

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

Classes

class  commsStruct
 Structure for communicating between processors. More...
 
class  communicator
 Helper 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")
 
 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 allocateCommunicator (const label parent, const labelList &subRanks, const bool doPstream=true)
 Allocate a new 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 (const label myComm, const int procID)
 
static label procNo (const label comm, const int baseProcID)
 
static label procNo (const label myComm, const label currentComm, const int currentProcID)
 
static void addValidParOptions (HashTable< string > &validParOptions)
 
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 ()
 Get number of outstanding requests. More...
 
static void resetRequests (const label sz)
 Truncate number of outstanding requests. 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 *)
 
static int allocateTag (const word &)
 
static void freeTag (const char *, const int tag)
 
static void freeTag (const word &, const int tag)
 
static bool parRun (const bool on) noexcept
 Set as parallel run on/off. More...
 
static boolparRun () 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 processes in parallel run, and 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 process. More...
 
static int myProcNo (const label communicator=worldComm)
 Number of this process (starting from masterNo() = 0) More...
 
static label parent (const label communicator)
 
static List< int > & procID (label communicator)
 Process ID of given process index. More...
 
static const wordListallWorlds () noexcept
 All worlds. More...
 
static const labelListworldIDs () noexcept
 worldID (index in allWorlds) of 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 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 labelUList &sendData, labelUList &recvData, const label communicator=worldComm)
 Exchange label with all processors (in the communicator). More...
 
static void allToAll (const char *sendData, const UList< int > &sendSizes, const UList< int > &sendOffsets, char *recvData, const UList< int > &recvSizes, const UList< int > &recvOffsets, const label communicator=worldComm)
 Exchange data with all processors (in the communicator) More...
 
static void mpiGather (const char *sendData, int sendSize, char *recvData, int recvSize, const label communicator=worldComm)
 Receive data from all processors on the master (low-level) More...
 
static void mpiScatter (const char *sendData, int sendSize, char *recvData, int recvSize, const label communicator=worldComm)
 Send data to all processors from master (low-level) More...
 
static void gather (const char *sendData, int sendSize, char *recvData, const UList< int > &recvSizes, const UList< int > &recvOffsets, const label communicator=worldComm)
 Receive data from all processors on the master. More...
 
static void scatter (const char *sendData, const UList< int > &sendSizes, const UList< int > &sendOffsets, char *recvData, int recvSize, const label communicator=worldComm)
 Send data to all processors from the root of the communicator. More...
 
template<class T >
static List< TlistGatherValues (const T &localValue, const label communicator=worldComm)
 Individual values into list locations. More...
 
template<class T >
static T listScatterValues (const UList< T > &allValues, const label communicator=worldComm)
 Individual values into list locations. 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
 Names of the communication types. More...
 
static bool floatTransfer
 
static int nProcsSimpleSum
 
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 communicator (all processors) More...
 
static label warnComm
 Debugging: warn for use of any communicator differing from warnComm. More...
 

Protected Attributes

commsTypes commsType_
 Communications type of this stream. More...
 

Detailed Description

Inter-processor communications stream.

Source files

Definition at line 61 of file UPstream.H.

Member Typedef Documentation

◆ rangeType

typedef IntRange<int> rangeType

Int ranges are used for MPI ranks (processes)

Definition at line 66 of file UPstream.H.

Member Enumeration Documentation

◆ commsTypes

enum commsTypes : char
strong

Types of communications.

Enumerator
blocking 
scheduled 
nonBlocking 

Definition at line 69 of file UPstream.H.

Constructor & Destructor Documentation

◆ UPstream()

UPstream ( const commsTypes  commsType)
inlineexplicit

Construct for given communication type.

Definition at line 302 of file UPstream.H.

Member Function Documentation

◆ ClassName()

ClassName ( "UPstream"  )

◆ allocateCommunicator()

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

Allocate a new communicator.

Definition at line 108 of file UPstream.C.

References Foam::abort(), Foam::expressions::patchExpr::debug, Foam::endl(), Foam::FatalError, FatalErrorInFunction, forAll, and Foam::Pout.

Referenced by masterCoarsestGAMGProcAgglomeration::agglomerate(), eagerGAMGProcAgglomeration::agglomerate(), procFacesGAMGProcAgglomeration::agglomerate(), manualGAMGProcAgglomeration::agglomerate(), 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

Free a previously allocated communicator.

Definition at line 174 of file UPstream.C.

References Foam::expressions::patchExpr::debug, Foam::endl(), and Foam::Pout.

Referenced by globalMeshData::updateMesh(), collatedFileOperation::~collatedFileOperation(), UPstream::communicator::~communicator(), eagerGAMGProcAgglomeration::~eagerGAMGProcAgglomeration(), hostCollatedFileOperation::~hostCollatedFileOperation(), manualGAMGProcAgglomeration::~manualGAMGProcAgglomeration(), masterCoarsestGAMGProcAgglomeration::~masterCoarsestGAMGProcAgglomeration(), masterUncollatedFileOperation::~masterUncollatedFileOperation(), OFstreamCollator::~OFstreamCollator(), and procFacesGAMGProcAgglomeration::~procFacesGAMGProcAgglomeration().

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

◆ freeCommunicators()

void freeCommunicators ( const bool  doPstream)
static

Free all communicators.

Definition at line 201 of file UPstream.C.

References forAll.

◆ baseProcNo()

int baseProcNo ( const label  myComm,
const int  procID 
)
static

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

Definition at line 213 of file UPstream.C.

References UPstream::parent(), and 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 229 of file UPstream.C.

◆ procNo() [2/2]

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

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

Definition at line 247 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 34 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 48 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 38 of file UPstream.C.

References Foam::endl(), and WarningInFunction.

Here is the call graph for this function:

◆ nRequests()

Foam::label nRequests ( )
static

Get number of outstanding requests.

Definition at line 252 of file UPstream.C.

Referenced by mapDistributeBase::compact(), dynamicOversetFvMesh::correctBoundaryConditions(), dynamicOversetFvMesh::correctCoupledBoundaryConditions(), GeometricField< Type, PatchField, GeoMesh >::Boundary::evaluate(), Foam::evaluateConstraintTypes(), syncTools::syncBoundaryFaceList(), syncTools::syncFaceList(), and OFstreamCollator::write().

Here is the caller graph for this function:

◆ resetRequests()

void resetRequests ( const label  sz)
static

Truncate number of outstanding requests.

Definition at line 258 of file UPstream.C.

◆ waitRequests()

void waitRequests ( const label  start = 0)
static

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

Definition at line 262 of file UPstream.C.

Referenced by mapDistributeBase::compact(), dynamicOversetFvMesh::correctBoundaryConditions(), dynamicOversetFvMesh::correctCoupledBoundaryConditions(), GeometricField< Type, PatchField, GeoMesh >::Boundary::evaluate(), Foam::evaluateConstraintTypes(), 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.

Definition at line 266 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?

Definition at line 270 of file UPstream.C.

References NotImplemented.

◆ allocateTag() [1/2]

int allocateTag ( const char *  s)
static

Definition at line 1426 of file UPstream.C.

References Foam::expressions::patchExpr::debug, Foam::endl(), Foam::PstreamGlobals::freedTags_, Foam::PstreamGlobals::nTags_, Foam::Pout, DynamicList< T, SizeMin >::remove(), and s.

Here is the call graph for this function:

◆ allocateTag() [2/2]

int allocateTag ( const word s)
static

Definition at line 1455 of file UPstream.C.

References Foam::expressions::patchExpr::debug, Foam::endl(), Foam::PstreamGlobals::freedTags_, Foam::PstreamGlobals::nTags_, Foam::Pout, DynamicList< T, SizeMin >::remove(), and s.

Here is the call graph for this function:

◆ freeTag() [1/2]

void freeTag ( const char *  s,
const int  tag 
)
static

Definition at line 1484 of file UPstream.C.

References DynamicList< T, SizeMin >::append(), Foam::expressions::patchExpr::debug, Foam::endl(), Foam::PstreamGlobals::freedTags_, Foam::Pout, and s.

Here is the call graph for this function:

◆ freeTag() [2/2]

void freeTag ( const word s,
const int  tag 
)
static

Definition at line 1500 of file UPstream.C.

References DynamicList< T, SizeMin >::append(), Foam::expressions::patchExpr::debug, Foam::endl(), Foam::PstreamGlobals::freedTags_, Foam::Pout, and s.

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 424 of file UPstream.H.

◆ parRun() [2/2]

static bool& parRun ( )
inlinestaticnoexcept

Test if this a parallel run.

Modify access is deprecated

Definition at line 433 of file UPstream.H.

Referenced by snappyLayerDriver::addLayers(), unwatchedIOdictionary::addWatch(), regIOobject::addWatch(), UPstream::allToAll(), meshRefinement::balance(), addPatchCellLayer::calcExtrudeInfo(), processorCyclicPolyPatch::calcGeometry(), processorFaPatch::calcGeometry(), processorPolyPatch::calcGeometry(), surfaceNoise::calculate(), cyclicAMIPolyPatch::canResetAMI(), IOobjectList::checkNames(), polyBoundaryMesh::checkParallelSync(), AMIInterpolation::checkSymmetricWeights(), fieldValue::combineFields(), mapDistributeBase::compact(), dynamicOversetFvMesh::correctBoundaryConditions(), dynamicOversetFvMesh::correctCoupledBoundaryConditions(), processorFvPatch::coupled(), cyclicAMIPointPatch::coupled(), processorPointPatchField< Type >::coupled(), processorCyclicPointPatchField< Type >::coupled(), processorFvsPatchField< Type >::coupled(), processorCyclicFvsPatchField< Type >::coupled(), processorFaePatchField< Type >::coupled(), processorFaPatchField< Type >::coupled(), processorFvPatchField< Type >::coupled(), cyclicACMIFvPatch::coupled(), processorFaPatch::coupled(), cyclicAMIFvPatch::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(), GeometricField< Type, PatchField, GeoMesh >::Boundary::evaluate(), Foam::evaluateConstraintTypes(), Pstream::exchange(), Foam::exitNow(), faMesh::faMesh(), faMeshReconstructor::faMeshReconstructor(), masterUncollatedFileOperation::filePath(), polyMesh::findCell(), masterUncollatedFileOperation::findInstance(), distributedTriSurfaceMesh::findLine(), distributedTriSurfaceMesh::findLineAll(), distributedTriSurfaceMesh::findLineAny(), distributedTriSurfaceMesh::findNearest(), masterUncollatedFileOperation::findTimes(), Pstream::gather(), Pstream::gatherList(), zoneDistribute::getDatafromOtherProc(), distributedTriSurfaceMesh::getField(), distributedTriSurfaceMesh::getNormal(), distributedTriSurfaceMesh::getRegion(), distributedTriSurfaceMesh::getVolumeType(), faMeshBoundaryHalo::haloSize(), InflationInjection< CloudType >::InflationInjection(), processorFaPatch::initGeometry(), processorPolyPatch::initGeometry(), InjectedParticleInjection< CloudType >::initialise(), InjectedParticleDistributionInjection< CloudType >::initialise(), extractEulerianParticles::initialiseBins(), processorPolyPatch::initOrder(), processorFaPatch::initUpdateMesh(), processorPolyPatch::initUpdateMesh(), fileOperation::lookupAndCacheProcessorsPath(), LUscalarMatrix::LUscalarMatrix(), processorFaPatch::makeDeltaCoeffs(), processorFaPatch::makeNonGlobalPatchPoints(), processorFvPatch::makeWeights(), processorFaPatch::makeWeights(), error::master(), surfaceWriter::merge(), surfaceWriter::mergeFieldTemplate(), polyBoundaryMesh::neighbourEdges(), masterUncollatedFileOperation::NewIFstream(), fvMeshTools::newMesh(), fileWriter::open(), processorPolyPatch::order(), InflationInjection< CloudType >::parcelsToInject(), argList::parse(), pointHistory::pointHistory(), collatedFileOperation::processorsDir(), masterUncollatedFileOperation::read(), lumpedPointState::readData(), Time::readModifiedObjects(), masterUncollatedFileOperation::readObjects(), masterUncollatedFileOperation::readStream(), surfaceNoise::readSurfaceData(), AMIWeights::reportPatch(), faMeshBoundaryHalo::reset(), PPCG::scalarSolveCG(), Pstream::scatter(), Pstream::scatterList(), fvMeshSubset::setCellSubset(), Time::setControls(), surfaceWriter::setSurface(), zoneDistribute::setUpCommforZone(), shortestPathSet::shortestPathSet(), error::simpleExit(), messageStream::stream(), surfaceWriter::surface(), surfaceNoise::surfaceAverage(), syncObjects::sync(), syncTools::syncEdgeMap(), syncTools::syncPointMap(), triSurfaceMesh::triSurfaceMesh(), turbulentDFSEMInletFvPatchVectorField::updateCoeffs(), processorFaPatch::updateMesh(), processorPolyPatch::updateMesh(), faMesh::updateMesh(), fileOperation::updateStates(), mergedSurf::use(), energySpectrum::write(), ensightCells::write(), areaWrite::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 439 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 processes in parallel run, and 1 for serial run.

Definition at line 445 of file UPstream.H.

Referenced by surfaceZonesInfo::addCellZonesToMesh(), surfaceZonesInfo::addFaceZonesToMesh(), masterCoarsestGAMGProcAgglomeration::agglomerate(), eagerGAMGProcAgglomeration::agglomerate(), procFacesGAMGProcAgglomeration::agglomerate(), manualGAMGProcAgglomeration::agglomerate(), UPstream::allProcs(), sensitivitySurfacePoints::assembleSensitivities(), meshRefinement::balanceAndRefine(), faPatch::boundaryProcs(), faMesh::boundaryProcs(), faPatch::boundaryProcSizes(), faMesh::boundaryProcSizes(), mapDistributeBase::calcCompactAddressing(), surfaceNoise::calculate(), meshRefinement::checkCoupledFaceZones(), polyBoundaryMesh::checkParallelSync(), mappedPatchBase::collectSamples(), fieldValue::combineFields(), sizeDistribution::combineFields(), Foam::combineReduce(), UPstream::commsStruct::commsStruct(), mapDistributeBase::compact(), GAMGAgglomeration::continueAgglomerating(), fvMeshDistribute::countCells(), meshRefinement::directionalRefineCandidates(), fvMeshDistribute::distribute(), distributedTriSurfaceMesh::distribute(), distributedTriSurfaceMesh::distributedTriSurfaceMesh(), Pstream::exchange(), mapDistributeBase::exchangeAddressing(), Pstream::exchangeSizes(), extendedUpwindCellToFaceStencil::extendedUpwindCellToFaceStencil(), distributedTriSurfaceMesh::findNearest(), meshRefinement::findRegions(), mappedPatchBase::findSamples(), Pstream::gather(), externalCoupled::gatherAndCombine(), Pstream::gatherList(), zoneDistribute::getDatafromOtherProc(), distributedTriSurfaceMesh::getVolumeType(), processorPolyPatch::initGeometry(), InjectedParticleInjection< CloudType >::initialise(), viewFactor::initialise(), InjectedParticleDistributionInjection< CloudType >::initialise(), processorPolyPatch::initUpdateMesh(), distributedTriSurfaceMesh::localQueries(), LUscalarMatrix::LUscalarMatrix(), mapDistributeBase::mapDistributeBase(), masterUncollatedFileOperation::NewIFstream(), InflationInjection< CloudType >::parcelsToInject(), argList::parse(), pointHistory::pointHistory(), mapDistributeBase::printLayout(), collatedFileOperation::processorsDir(), masterUncollatedFileOperation::read(), lumpedPointState::readData(), masterUncollatedFileOperation::readHeader(), masterUncollatedFileOperation::readStream(), Foam::reduce(), meshRefinement::refineAndBalance(), meshRefinement::refineCandidates(), meshRefinement::removeGapCells(), parProfiling::report(), faMeshBoundaryHalo::reset(), globalIndex::reset(), Foam::returnReduce(), Pstream::scatter(), Pstream::scatterList(), fvMeshSubset::setCellSubset(), Time::setControls(), zoneDistribute::setUpCommforZone(), ParSortableList< Type >::sort(), UPstream::subProcs(), syncObjects::sync(), trackingInverseDistance::update(), inverseDistance::update(), dynamicOversetFvMesh::updateAddressing(), turbulentDFSEMInletFvPatchVectorField::updateCoeffs(), globalMeshData::updateMesh(), externalCoupled::writeGeometry(), isoAdvection::writeIsoFaces(), and streamLineBase::writeToFile().

◆ masterNo()

static constexpr int masterNo ( )
inlinestaticconstexprnoexcept

Process index of the master (always 0)

Definition at line 451 of file UPstream.H.

Referenced by simpleGeomDecomp::decompose(), LUscalarMatrix::LUscalarMatrix(), UPstream::master(), masterUncollatedFileOperation::NewIFstream(), fvMeshTools::newMesh(), argList::parse(), globalMeshData::sharedPoints(), syncTools::syncEdgeMap(), syncTools::syncPointMap(), patchMeshWriter::writeNeighIDs(), patchMeshWriter::writePatchIDs(), and patchMeshWriter::writePoints().

Here is the caller graph for this function:

◆ master()

static bool master ( const label  communicator = worldComm)
inlinestatic

Am I the master process.

Definition at line 457 of file UPstream.H.

References UPstream::masterNo().

Referenced by regIOobject::addWatch(), masterUncollatedFileOperation::addWatch(), mappedPatchBase::calcMapping(), pointNoise::calculate(), viewFactor::calculate(), surfaceNoise::calculate(), argList::check(), fileWriter::checkFormatterValidity(), polyBoundaryMesh::checkParallelSync(), argList::checkRootCase(), extractEulerianParticles::collectParticle(), sizeDistribution::combineFields(), commSchedule::commSchedule(), writeFile::createFile(), logFiles::createFiles(), simpleGeomDecomp::decompose(), masterUncollatedFileOperation::dirPath(), systemCall::dispatch(), snappyVoxelMeshDriver::doRefine(), abort::end(), abort::execute(), wallHeatFlux::execute(), Curle::execute(), momentum::execute(), forces::execute(), externalFileCoupler::externalFileCoupler(), masterUncollatedFileOperation::filePath(), logFiles::files(), probes::findElements(), masterUncollatedFileOperation::findInstance(), meshRefinement::findRegions(), masterUncollatedFileOperation::findTimes(), masterUncollatedFileOperation::findWatch(), STDMD::fit(), sampledSet::gather(), externalCoupled::gatherAndCombine(), masterUncollatedFileOperation::getFile(), masterUncollatedFileOperation::getState(), Random::globalGaussNormal(), Random::globalPosition(), Random::globalRandomise01(), Random::globalSample01(), viewFactor::initialise(), surfaceNoise::initialise(), JobInfo::JobInfo(), fileOperation::lookupAndCacheProcessorsPath(), LUscalarMatrix::LUscalarMatrix(), NURBS3DVolume::makeFolders(), error::master(), messageStream::masterStream(), surfaceWriter::mergeFieldTemplate(), ensightCase::newCloud(), ensightCase::newGeometry(), masterUncollatedFileOperation::NewIFstream(), fvMeshTools::newMesh(), fileOperation::nProcs(), objectiveManager::objectiveManager(), fileWriter::open(), InflationInjection< CloudType >::parcelsToInject(), argList::parse(), pointHistory::pointHistory(), porosityModel::porosityModel(), probes::prepare(), decomposedBlockData::read(), writeFile::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(), logFiles::resetNames(), 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(), turbulentDigitalFilterInletFvPatchVectorField::updateCoeffs(), updateMethod::updateMethod(), fileMonitor::updateStates(), masterUncollatedFileOperation::updateStates(), solution::upgradeSolverDict(), externalFileCoupler::useMaster(), externalFileCoupler::useSlave(), OFstreamCollator::waitAll(), externalFileCoupler::waitForMaster(), externalFileCoupler::waitForSlave(), sensitivityBezier::write(), sensitivityVolBSplines::write(), sensitivityVolBSplinesFI::write(), proxyWriter::write(), sensitivityBezierFI::write(), timeInfo::write(), x3dWriter::write(), SQP::write(), energySpectrum::write(), starcdWriter::write(), foamWriter::write(), OFstreamCollator::write(), rawWriter::write(), yPlus::write(), vtkWriter::write(), wallShearStress::write(), abaqusWriter::write(), boundaryDataWriter::write(), histogram::write(), sampledSets::write(), nastranWriter::write(), sizeDistribution::write(), vtkCloud::write(), NURBS3DCurve::write(), vtkWrite::write(), volFieldValue::write(), regionSizeDistribution::write(), NURBS3DSurface::write(), turbulentDigitalFilterInletFvPatchVectorField::write(), surfaceFieldValue::write(), propellerInfo::writeAxialWake(), ensightWriter::writeCollated(), updateMethod::writeCorrection(), NURBS3DVolume::writeCps(), decomposedBlockData::writeData(), lumpedPointMovement::writeData(), lumpedPointMovement::writeForcesAndMomentsVTP(), externalCoupled::writeGeometry(), isoAdvection::writeIsoFaces(), faMeshReconstructor::writeMesh(), patchMeshWriter::writeNeighIDs(), collatedFileOperation::writeObject(), decomposedBlockData::writeObject(), patchMeshWriter::writePatchIDs(), patchMeshWriter::writePoints(), fileWriter::writeProcIDs(), sampledSets::writeSampleFile(), surfaceNoise::writeSurfaceData(), foamWriter::writeTemplate(), starcdWriter::writeTemplate(), boundaryDataWriter::writeTemplate(), x3dWriter::writeTemplate(), vtkWriter::writeTemplate(), streamLineBase::writeToFile(), ensightWriter::writeUncollated(), NURBS3DSurface::writeVTK(), propellerInfo::writeWake(), AMIWeights::writeWeightField(), NURBS3DCurve::writeWParses(), and NURBS3DSurface::writeWParses().

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 463 of file UPstream.H.

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

◆ parent()

static label parent ( const label  communicator)
inlinestatic

Definition at line 468 of file UPstream.H.

Referenced by UPstream::baseProcNo().

Here is the caller graph for this function:

◆ procID()

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

Process ID of given process index.

Definition at line 474 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 483 of file UPstream.H.

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

Here is the caller graph for this function:

◆ worldIDs()

static const labelList& worldIDs ( )
inlinestaticnoexcept

worldID (index in allWorlds) of all processes

Definition at line 489 of file UPstream.H.

◆ myWorldID()

static label myWorldID ( )
inlinestatic

My worldID.

Definition at line 495 of file UPstream.H.

References UPstream::myProcNo().

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

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 501 of file UPstream.H.

References UPstream::allWorlds(), and UPstream::myWorldID().

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 508 of file UPstream.H.

References UPstream::nProcs().

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

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

Range of process indices for sub-processes.

Definition at line 515 of file UPstream.H.

References UPstream::nProcs().

Referenced by polyBoundaryMesh::checkParallelSync(), simpleGeomDecomp::decompose(), LUscalarMatrix::LUscalarMatrix(), masterUncollatedFileOperation::NewIFstream(), fvMeshTools::newMesh(), argList::parse(), globalMeshData::sharedPoints(), surfaceNoise::surfaceAverage(), syncTools::syncEdgeMap(), syncTools::syncPointMap(), patchMeshWriter::writeNeighIDs(), patchMeshWriter::writePatchIDs(), patchMeshWriter::writePoints(), and surfaceNoise::writeSurfaceData().

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

◆ linearCommunication()

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

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

Definition at line 523 of file UPstream.H.

Referenced by Foam::combineReduce(), Pstream::gather(), Pstream::gatherList(), masterUncollatedFileOperation::read(), lumpedPointState::readData(), Foam::reduce(), Foam::returnReduce(), Pstream::scatter(), and Pstream::scatterList().

Here is the caller graph for this function:

◆ treeCommunication()

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

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

Definition at line 532 of file UPstream.H.

Referenced by Foam::combineReduce(), Pstream::gather(), Pstream::gatherList(), masterUncollatedFileOperation::read(), lumpedPointState::readData(), Foam::reduce(), Foam::returnReduce(), Pstream::scatter(), and Pstream::scatterList().

Here is the caller graph for this function:

◆ msgType()

static int& msgType ( )
inlinestaticnoexcept

Message tag of standard messages.

Definition at line 540 of file UPstream.H.

Referenced by solidAbsorption::a(), decompositionMethod::calcCellCells(), mappedPatchBase::calcMapping(), masterUncollatedFileOperation::chMod(), mappedPatchBase::collectSamples(), extendedCentredFaceToCellStencil::compact(), extendedCentredCellToFaceStencil::compact(), extendedCentredCellToCellStencil::compact(), masterUncollatedFileOperation::cp(), masterUncollatedFileOperation::dirPath(), mappedPatchBase::distribute(), solidAbsorption::e(), masterUncollatedFileOperation::exists(), masterUncollatedFileOperation::filePath(), masterUncollatedFileOperation::fileSize(), masterUncollatedFileOperation::findInstance(), distributedTriSurfaceMesh::findNearest(), mappedPatchBase::findSamples(), lduPrimitiveMesh::gather(), Foam::gAverage(), distributedTriSurfaceMesh::getVolumeType(), Foam::gSumCmptProd(), Foam::gSumProd(), masterUncollatedFileOperation::highResLastModified(), dynamicOversetFvMesh::interpolate(), regionModel::interRegionAMI(), masterUncollatedFileOperation::isDir(), masterUncollatedFileOperation::isFile(), masterUncollatedFileOperation::lastModified(), lduPrimitiveMesh::lduPrimitiveMesh(), masterUncollatedFileOperation::ln(), fileOperation::lookupAndCacheProcessorsPath(), LUscalarMatrix::LUscalarMatrix(), masterUncollatedFileOperation::mkDir(), masterUncollatedFileOperation::mode(), masterUncollatedFileOperation::mv(), masterUncollatedFileOperation::mvBak(), masterUncollatedFileOperation::NewIFstream(), fileOperation::nProcs(), masterUncollatedFileOperation::read(), lumpedPointState::readData(), masterUncollatedFileOperation::readDir(), masterUncollatedFileOperation::readHeader(), masterUncollatedFileOperation::readStream(), fvMatrix< Type >::relax(), faMeshBoundaryHalo::reset(), globalIndex::reset(), mappedPatchBase::reverseDistribute(), masterUncollatedFileOperation::rm(), masterUncollatedFileOperation::rmDir(), mapDistributeBase::schedule(), syncObjects::sync(), processorFvPatch::tag(), processorFaPatch::tag(), processorCyclicPolyPatch::tag(), processorPolyPatch::tag(), masterUncollatedFileOperation::type(), dynamicOversetFvMesh::updateAddressing(), wideBandDiffusiveRadiationMixedFvPatchScalarField::updateCoeffs(), mappedVelocityFluxFixedValueFvPatchField::updateCoeffs(), filmPyrolysisTemperatureCoupledFvPatchScalarField::updateCoeffs(), filmPyrolysisVelocityCoupledFvPatchVectorField::updateCoeffs(), greyDiffusiveRadiationMixedFvPatchScalarField::updateCoeffs(), mappedFlowRateFvPatchVectorField::updateCoeffs(), MarshakRadiationFvPatchScalarField::updateCoeffs(), MarshakRadiationFixedTemperatureFvPatchScalarField::updateCoeffs(), alphatFilmWallFunctionFvPatchScalarField::updateCoeffs(), thermalBaffle1DFvPatchScalarField< solidType >::updateCoeffs(), turbulentTemperatureCoupledBaffleMixedFvPatchScalarField::updateCoeffs(), turbulentTemperatureRadCoupledMixedFvPatchScalarField::updateCoeffs(), globalMeshData::updateMesh(), OFstreamCollator::write(), and decomposedBlockData::writeData().

◆ commsType() [1/2]

commsTypes commsType ( ) const
inlinenoexcept

Get the communications type of the stream.

Definition at line 547 of file UPstream.H.

References UPstream::commsType_.

◆ commsType() [2/2]

commsTypes commsType ( const commsTypes  ct)
inlinenoexcept

Set the communications type of the stream.

Definition at line 553 of file UPstream.H.

References UPstream::commsType_.

◆ 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 59 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 70 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 63 of file UPstream.C.

References Foam::exit().

Referenced by snappyLayerDriver::addLayers(), 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 labelUList sendData,
labelUList recvData,
const label  communicator = worldComm 
)
static

Exchange label with all processors (in the communicator).

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

Definition at line 172 of file UPstream.C.

References UList< T >::deepCopy().

Referenced by fvMeshDistribute::distribute().

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

◆ allToAll() [2/2]

void allToAll ( const char *  sendData,
const UList< int > &  sendSizes,
const UList< int > &  sendOffsets,
char *  recvData,
const UList< int > &  recvSizes,
const UList< int > &  recvOffsets,
const label  communicator = worldComm 
)
static

Exchange data with all processors (in the communicator)

sendSizes, sendOffsets give (per processor) the slice of sendData to send, similarly recvSizes, recvOffsets give the slice of recvData to receive

Definition at line 800 of file UPstream.C.

References Foam::abort(), profilingPstream::addAllToAllTime(), profilingPstream::beginTiming(), UList< T >::cdata(), Foam::endl(), Foam::FatalError, FatalErrorInFunction, Foam::PstreamGlobals::MPICommunicators_, UPstream::parRun(), Foam::Pout, error::printStack(), UList< T >::size(), and UPstream::warnComm.

Here is the call graph for this function:

◆ mpiGather()

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

Receive data from all processors on the master (low-level)

Definition at line 183 of file UPstream.C.

◆ mpiScatter()

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

Send data to all processors from master (low-level)

Definition at line 197 of file UPstream.C.

◆ gather()

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

Receive data from all processors on the master.

Definition at line 211 of file UPstream.C.

◆ scatter()

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

Send data to all processors from the root of the communicator.

Definition at line 226 of file UPstream.C.

◆ listGatherValues() [1/2]

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

Individual values into list locations.

On master list length == nProcs, otherwise zero length

◆ listScatterValues()

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

Individual values into list locations.

On master list length == nProcs, otherwise zero length

Definition at line 78 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:

◆ firstSlave()

static constexpr int firstSlave ( )
inlinestaticconstexprnoexcept

Process index of first sub-process.

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

Definition at line 670 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 677 of file UPstream.H.

◆ listGatherValues() [2/2]

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

Definition at line 32 of file UPstreamTemplates.C.

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

Here is the call graph for this function:

Member Data Documentation

◆ commsTypeNames

◆ commsType_

commsTypes commsType_
protected

Communications type of this stream.

Definition at line 260 of file UPstream.H.

Referenced by UPstream::commsType().

◆ 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 274 of file UPstream.H.

Referenced by argList::parse().

◆ nProcsSimpleSum

◆ defaultCommsType

◆ nPollProcInterfaces

int nPollProcInterfaces
static

Number of polling cycles in processor updates.

Definition at line 284 of file UPstream.H.

Referenced by argList::parse().

◆ maxCommsSize

int maxCommsSize
static

Optional maximum message size (bytes)

Definition at line 287 of file UPstream.H.

Referenced by Pstream::exchange().

◆ mpiBufferSize

const int mpiBufferSize
static

MPI buffer-size (bytes)

Definition at line 290 of file UPstream.H.

Referenced by attachOurBuffers().

◆ worldComm

◆ warnComm


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