Public Member Functions | Static Public Member Functions | Protected Attributes | List of all members
Pstream Class Reference

Inter-processor communications stream. More...

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

Public Member Functions

 ClassName ("Pstream")
 
 Pstream (const commsTypes commsType, const label bufSize=0)
 
- Public Member Functions inherited from UPstream
 ClassName ("UPstream")
 
 UPstream (const commsTypes commsType)
 
commsTypes commsType () const noexcept
 
commsTypes commsType (const commsTypes ct) noexcept
 
template<class T >
Foam::List< TlistGatherValues (const T &localValue, const label comm)
 

Static Public Member Functions

template<class T , class BinaryOp >
static void gather (const List< commsStruct > &comms, T &Value, const BinaryOp &bop, const int tag, const label comm)
 
template<class T , class BinaryOp >
static void gather (T &Value, const BinaryOp &bop, const int tag=Pstream::msgType(), const label comm=Pstream::worldComm)
 
template<class T >
static void scatter (const List< commsStruct > &comms, T &Value, const int tag, const label comm)
 
template<class T >
static void scatter (T &Value, const int tag=Pstream::msgType(), const label comm=Pstream::worldComm)
 
template<class T , class CombineOp >
static void combineGather (const List< commsStruct > &comms, T &Value, const CombineOp &cop, const int tag, const label comm)
 
template<class T , class CombineOp >
static void combineGather (T &Value, const CombineOp &cop, const int tag=Pstream::msgType(), const label comm=Pstream::worldComm)
 
template<class T >
static void combineScatter (const List< commsStruct > &comms, T &Value, const int tag, const label comm)
 
template<class T >
static void combineScatter (T &Value, const int tag=Pstream::msgType(), const label comm=Pstream::worldComm)
 
template<class T , class CombineOp >
static void listCombineGather (const List< commsStruct > &comms, List< T > &Value, const CombineOp &cop, const int tag, const label comm)
 
template<class T , class CombineOp >
static void listCombineGather (List< T > &Value, const CombineOp &cop, const int tag=Pstream::msgType(), const label comm=Pstream::worldComm)
 
template<class T >
static void listCombineScatter (const List< commsStruct > &comms, List< T > &Value, const int tag, const label comm)
 
template<class T >
static void listCombineScatter (List< T > &Value, const int tag=Pstream::msgType(), const label comm=Pstream::worldComm)
 
template<class Container , class CombineOp >
static void mapCombineGather (const List< commsStruct > &comms, Container &Values, const CombineOp &cop, const int tag, const label comm)
 
template<class Container , class CombineOp >
static void mapCombineGather (Container &Values, const CombineOp &cop, const int tag=Pstream::msgType(), const label comm=UPstream::worldComm)
 
template<class Container >
static void mapCombineScatter (const List< commsStruct > &comms, Container &Values, const int tag, const label comm)
 
template<class Container >
static void mapCombineScatter (Container &Values, const int tag=Pstream::msgType(), const label comm=UPstream::worldComm)
 
template<class T >
static void gatherList (const List< commsStruct > &comms, List< T > &Values, const int tag, const label comm)
 
template<class T >
static void gatherList (List< T > &Values, const int tag=Pstream::msgType(), const label comm=UPstream::worldComm)
 
template<class T >
static void scatterList (const List< commsStruct > &comms, List< T > &Values, const int tag, const label comm)
 
template<class T >
static void scatterList (List< T > &Values, const int tag=Pstream::msgType(), const label comm=UPstream::worldComm)
 
template<class Container , class T >
static void exchange (const UList< Container > &sendData, const labelUList &recvSizes, List< Container > &recvData, const int tag=UPstream::msgType(), const label comm=UPstream::worldComm, const bool block=true)
 
template<class Container >
static void exchangeSizes (const Container &sendData, labelList &sizes, const label comm=UPstream::worldComm)
 
template<class Container , class T >
static void exchange (const UList< Container > &sendData, List< Container > &recvData, const int tag=UPstream::msgType(), const label comm=UPstream::worldComm, const bool block=true)
 
- Static Public Member Functions inherited from UPstream
static label allocateCommunicator (const label parent, const labelList &subRanks, const bool doPstream=true)
 
static void freeCommunicator (const label communicator, const bool doPstream=true)
 
static void freeCommunicators (const bool doPstream)
 
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)
 
static bool initNull ()
 
static label nRequests ()
 
static void resetRequests (const label sz)
 
static void waitRequests (const label start=0)
 
static void waitRequest (const label i)
 
static bool finishedRequest (const label i)
 
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
 
static boolparRun () noexcept
 
static bool haveThreads () noexcept
 
static label nProcs (const label communicator=worldComm)
 
static constexpr int masterNo () noexcept
 
static bool master (const label communicator=worldComm)
 
static int myProcNo (const label communicator=worldComm)
 
static label parent (const label communicator)
 
static List< int > & procID (label communicator)
 
static const wordListallWorlds () noexcept
 
static const labelListworldIDs () noexcept
 
static label myWorldID ()
 
static const wordmyWorld ()
 
static rangeType allProcs (const label communicator=worldComm)
 
static rangeType subProcs (const label communicator=worldComm)
 
static const List< commsStruct > & linearCommunication (const label communicator=worldComm)
 
static const List< commsStruct > & treeCommunication (const label communicator=worldComm)
 
static int & msgType () noexcept
 
static void shutdown (int errNo=0)
 
static void abort ()
 
static void exit (int errNo=1)
 
static void allToAll (const labelUList &sendData, labelUList &recvData, const label communicator=worldComm)
 
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)
 
static void mpiGather (const char *sendData, int sendSize, char *recvData, int recvSize, const label communicator=worldComm)
 
static void mpiScatter (const char *sendData, int sendSize, char *recvData, int recvSize, const label communicator=worldComm)
 
static void gather (const char *sendData, int sendSize, char *recvData, const UList< int > &recvSizes, const UList< int > &recvOffsets, const label communicator=worldComm)
 
static void scatter (const char *sendData, const UList< int > &sendSizes, const UList< int > &sendOffsets, char *recvData, int recvSize, const label communicator=worldComm)
 
template<class T >
static List< TlistGatherValues (const T &localValue, const label communicator=worldComm)
 
template<class T >
static T listScatterValues (const UList< T > &allValues, const label communicator=worldComm)
 
static constexpr int firstSlave () noexcept
 
static int lastSlave (const label communicator=worldComm)
 

Protected Attributes

DynamicList< char > transferBuf_
 
- Protected Attributes inherited from UPstream
commsTypes commsType_
 

Additional Inherited Members

- Public Types inherited from UPstream
enum  commsTypes : char { blocking, scheduled, nonBlocking }
 
typedef IntRange< int > rangeType
 
- Static Public Attributes inherited from UPstream
static const Enum< commsTypescommsTypeNames
 
static bool floatTransfer
 
static int nProcsSimpleSum
 
static commsTypes defaultCommsType
 
static int nPollProcInterfaces
 
static int maxCommsSize
 
static const int mpiBufferSize
 
static label worldComm
 
static label warnComm
 

Detailed Description

Inter-processor communications stream.

Source files

Definition at line 52 of file Pstream.H.

Constructor & Destructor Documentation

◆ Pstream()

Pstream ( const commsTypes  commsType,
const label  bufSize = 0 
)
inlineexplicit

Definition at line 106 of file Pstream.H.

References DynamicList::setCapacity(), and Pstream::transferBuf_.

Here is the call graph for this function:

Member Function Documentation

◆ ClassName()

ClassName ( "Pstream"  )

◆ gather() [1/2]

void gather ( const List< commsStruct > &  comms,
T Value,
const BinaryOp &  bop,
const int  tag,
const label  comm 
)
static

Definition at line 44 of file gatherScatter.C.

References UPstream::commsStruct::above(), UPstream::commsStruct::below(), forAll, UPstream::myProcNo(), UPstream::nProcs(), UPstream::parRun(), UIPstream::read(), UPstream::scheduled, Foam::T(), and UOPstream::write().

Referenced by Foam::reduce().

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

◆ gather() [2/2]

void gather ( T Value,
const BinaryOp &  bop,
const int  tag = Pstream::msgType(),
const label  comm = Pstream::worldComm 
)
static

Definition at line 124 of file gatherScatter.C.

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

Here is the call graph for this function:

◆ scatter() [1/2]

void scatter ( const List< commsStruct > &  comms,
T Value,
const int  tag,
const label  comm 
)
static

Definition at line 144 of file gatherScatter.C.

References UPstream::commsStruct::above(), UPstream::commsStruct::below(), forAllReverse, UPstream::myProcNo(), UPstream::nProcs(), UPstream::parRun(), UIPstream::read(), UPstream::scheduled, Foam::T(), and UOPstream::write().

Referenced by unwatchedIOdictionary::addWatch(), regIOobject::addWatch(), masterUncollatedFileOperation::addWatch(), multiWorldConnections::createComms(), masterUncollatedFileOperation::dirPath(), systemCall::dispatch(), abort::execute(), masterUncollatedFileOperation::filePath(), masterUncollatedFileOperation::findInstance(), meshRefinement::findRegions(), masterUncollatedFileOperation::findTimes(), masterUncollatedFileOperation::findWatch(), masterUncollatedFileOperation::getFile(), masterUncollatedFileOperation::getState(), Random::globalGaussNormal(), Random::globalPosition(), Random::globalRandomise01(), Random::globalSample01(), surfaceNoise::initialise(), fileOperation::lookupAndCacheProcessorsPath(), fvMeshTools::newMesh(), fileOperation::nProcs(), InflationInjection< CloudType >::parcelsToInject(), masterUncollatedFileOperation::read(), lumpedPointState::readData(), masterUncollatedFileOperation::readHeader(), masterUncollatedFileOperation::readObjects(), masterUncollatedFileOperation::readStream(), Foam::reduce(), masterUncollatedFileOperation::removeWatch(), Pstream::scatter(), rigidBodyMotion::solve(), ParSortableList< Type >::sort(), surfaceNoise::surfaceAverage(), hexRef8Data::sync(), triSurfaceMesh::triSurfaceMesh(), sixDoFRigidBodyMotion::update(), turbulentDigitalFilterInletFvPatchVectorField::updateCoeffs(), fileMonitor::updateStates(), externalFileCoupler::waitForMaster(), externalFileCoupler::waitForSlave(), OFstreamCollator::write(), decomposedBlockData::writeData(), sampledSets::writeSampleFile(), surfaceNoise::writeSurfaceData(), and streamLineBase::writeToFile().

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

◆ scatter() [2/2]

void scatter ( T Value,
const int  tag = Pstream::msgType(),
const label  comm = Pstream::worldComm 
)
static

Definition at line 220 of file gatherScatter.C.

References UPstream::linearCommunication(), UPstream::nProcs(), UPstream::nProcsSimpleSum, Pstream::scatter(), and UPstream::treeCommunication().

Here is the call graph for this function:

◆ combineGather() [1/2]

void combineGather ( const List< commsStruct > &  comms,
T Value,
const CombineOp &  cop,
const int  tag,
const label  comm 
)
static

◆ combineGather() [2/2]

void combineGather ( T Value,
const CombineOp &  cop,
const int  tag = Pstream::msgType(),
const label  comm = Pstream::worldComm 
)
static

Definition at line 143 of file combineGatherScatter.C.

◆ combineScatter() [1/2]

void combineScatter ( const List< commsStruct > &  comms,
T Value,
const int  tag,
const label  comm 
)
static

Definition at line 177 of file combineGatherScatter.C.

References UPstream::commsStruct::above(), UPstream::commsStruct::below(), Foam::expressions::patchExpr::debug, Foam::endl(), forAllReverse, Foam::Pout, Foam::blockMeshTools::read(), T, and Foam::vtk::write().

Referenced by Foam::combineReduce().

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

◆ combineScatter() [2/2]

void combineScatter ( T Value,
const int  tag = Pstream::msgType(),
const label  comm = Pstream::worldComm 
)
static

Definition at line 265 of file combineGatherScatter.C.

◆ listCombineGather() [1/2]

void listCombineGather ( const List< commsStruct > &  comms,
List< T > &  Value,
const CombineOp &  cop,
const int  tag,
const label  comm 
)
static

◆ listCombineGather() [2/2]

void listCombineGather ( List< T > &  Value,
const CombineOp &  cop,
const int  tag = Pstream::msgType(),
const label  comm = Pstream::worldComm 
)
static

Definition at line 392 of file combineGatherScatter.C.

◆ listCombineScatter() [1/2]

void listCombineScatter ( const List< commsStruct > &  comms,
List< T > &  Value,
const int  tag,
const label  comm 
)
static

◆ listCombineScatter() [2/2]

void listCombineScatter ( List< T > &  Value,
const int  tag = Pstream::msgType(),
const label  comm = Pstream::worldComm 
)
static

Definition at line 514 of file combineGatherScatter.C.

◆ mapCombineGather() [1/2]

void mapCombineGather ( const List< commsStruct > &  comms,
Container &  Values,
const CombineOp &  cop,
const int  tag,
const label  comm 
)
static

Definition at line 545 of file combineGatherScatter.C.

References UPstream::commsStruct::above(), UPstream::commsStruct::below(), Foam::expressions::patchExpr::debug, Foam::endl(), forAll, and Foam::Pout.

Referenced by areaWrite::write(), and meshRefinement::zonify().

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

◆ mapCombineGather() [2/2]

void mapCombineGather ( Container &  Values,
const CombineOp &  cop,
const int  tag = Pstream::msgType(),
const label  comm = UPstream::worldComm 
)
static

Definition at line 626 of file combineGatherScatter.C.

◆ mapCombineScatter() [1/2]

void mapCombineScatter ( const List< commsStruct > &  comms,
Container &  Values,
const int  tag,
const label  comm 
)
static

Definition at line 660 of file combineGatherScatter.C.

References UPstream::commsStruct::above(), UPstream::commsStruct::below(), Foam::expressions::patchExpr::debug, Foam::endl(), forAllReverse, and Foam::Pout.

Referenced by areaWrite::write(), and meshRefinement::zonify().

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

◆ mapCombineScatter() [2/2]

void mapCombineScatter ( Container &  Values,
const int  tag = Pstream::msgType(),
const label  comm = UPstream::worldComm 
)
static

Definition at line 718 of file combineGatherScatter.C.

◆ gatherList() [1/2]

void gatherList ( const List< commsStruct > &  comms,
List< T > &  Values,
const int  tag,
const label  comm 
)
static

Definition at line 46 of file gatherScatterList.C.

References Foam::abort(), UPstream::commsStruct::above(), UPstream::commsStruct::allBelow(), UPstream::commsStruct::below(), Foam::expressions::patchExpr::debug, Foam::endl(), Foam::FatalError, FatalErrorInFunction, forAll, UPstream::myProcNo(), UPstream::nProcs(), UPstream::parRun(), Foam::Pout, UIPstream::read(), UPstream::scheduled, and UOPstream::write().

Referenced by surfaceZonesInfo::addCellZonesToMesh(), surfaceZonesInfo::addFaceZonesToMesh(), sensitivitySurfacePoints::assembleSensitivities(), meshRefinement::checkCoupledFaceZones(), polyBoundaryMesh::checkParallelSync(), mappedPatchBase::collectSamples(), fieldValue::combineFields(), sizeDistribution::combineFields(), distributedTriSurfaceMesh::distribute(), distributedTriSurfaceMesh::distributedTriSurfaceMesh(), meshRefinement::findRegions(), mappedPatchBase::findSamples(), externalCoupled::gatherAndCombine(), Pstream::gatherList(), InjectedParticleInjection< CloudType >::initialise(), viewFactor::initialise(), InjectedParticleDistributionInjection< CloudType >::initialise(), distributedTriSurfaceMesh::localQueries(), masterUncollatedFileOperation::NewIFstream(), InflationInjection< CloudType >::parcelsToInject(), pointHistory::pointHistory(), masterUncollatedFileOperation::readHeader(), masterUncollatedFileOperation::readStream(), globalIndex::reset(), fvMeshSubset::setCellSubset(), ParSortableList< Type >::sort(), trackingInverseDistance::update(), inverseDistance::update(), externalCoupled::writeGeometry(), and isoAdvection::writeIsoFaces().

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

◆ gatherList() [2/2]

void gatherList ( List< T > &  Values,
const int  tag = Pstream::msgType(),
const label  comm = UPstream::worldComm 
)
static

Definition at line 194 of file gatherScatterList.C.

References Pstream::gatherList(), UPstream::linearCommunication(), UPstream::nProcs(), UPstream::nProcsSimpleSum, and UPstream::treeCommunication().

Here is the call graph for this function:

◆ scatterList() [1/2]

void scatterList ( const List< commsStruct > &  comms,
List< T > &  Values,
const int  tag,
const label  comm 
)
static

◆ scatterList() [2/2]

void scatterList ( List< T > &  Values,
const int  tag = Pstream::msgType(),
const label  comm = UPstream::worldComm 
)
static

Definition at line 336 of file gatherScatterList.C.

References UPstream::linearCommunication(), UPstream::nProcs(), UPstream::nProcsSimpleSum, Pstream::scatterList(), and UPstream::treeCommunication().

Here is the call graph for this function:

◆ exchange() [1/2]

void exchange ( const UList< Container > &  sendData,
const labelUList recvSizes,
List< Container > &  recvData,
const int  tag = UPstream::msgType(),
const label  comm = UPstream::worldComm,
const bool  block = true 
)
static

◆ exchangeSizes()

void exchangeSizes ( const Container &  sendData,
labelList sizes,
const label  comm = UPstream::worldComm 
)
static

Definition at line 343 of file exchange.C.

References Foam::abort(), Foam::FatalError, FatalErrorInFunction, forAll, UPstream::nProcs(), and List::setSize().

Referenced by distributedTriSurfaceMesh::distribute(), PstreamBuffers::finishedSends(), and mapDistributeBase::mapDistributeBase().

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

◆ exchange() [2/2]

void exchange ( const UList< Container > &  sendData,
List< Container > &  recvData,
const int  tag = UPstream::msgType(),
const label  comm = UPstream::worldComm,
const bool  block = true 
)
static

Definition at line 370 of file exchange.C.

Member Data Documentation

◆ transferBuf_

DynamicList<char> transferBuf_
protected

Definition at line 93 of file Pstream.H.

Referenced by Pstream::Pstream().


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