Inter-processor communications stream. More...
Public Member Functions | |
ClassName ("Pstream") | |
Pstream (const commsTypes commsType, const label bufSize=0) | |
![]() | |
ClassName ("UPstream") | |
UPstream (const commsTypes commsType) | |
commsTypes | commsType () const noexcept |
commsTypes | commsType (const commsTypes ct) noexcept |
template<class T > | |
Foam::List< T > | listGatherValues (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 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 bool & | parRun () 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 wordList & | allWorlds () noexcept |
static const labelList & | worldIDs () noexcept |
static label | myWorldID () |
static const word & | myWorld () |
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< T > | listGatherValues (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_ |
![]() | |
commsTypes | commsType_ |
Additional Inherited Members | |
![]() | |
enum | commsTypes : char { blocking, scheduled, nonBlocking } |
typedef IntRange< int > | rangeType |
![]() | |
static const Enum< commsTypes > | commsTypeNames |
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 |
Inter-processor communications stream.
|
inlineexplicit |
Definition at line 106 of file Pstream.H.
References DynamicList::setCapacity(), and Pstream::transferBuf_.
ClassName | ( | "Pstream" | ) |
|
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().
|
static |
Definition at line 124 of file gatherScatter.C.
References UPstream::linearCommunication(), UPstream::nProcs(), UPstream::nProcsSimpleSum, and UPstream::treeCommunication().
|
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().
|
static |
Definition at line 220 of file gatherScatter.C.
References UPstream::linearCommunication(), UPstream::nProcs(), UPstream::nProcsSimpleSum, Pstream::scatter(), and UPstream::treeCommunication().
|
static |
Definition at line 42 of file combineGatherScatter.C.
References UPstream::commsStruct::above(), UPstream::commsStruct::below(), Foam::expressions::patchExpr::debug, Foam::endl(), forAll, Foam::Pout, Foam::blockMeshTools::read(), T, and Foam::vtk::write().
Referenced by Foam::combineReduce(), multiWorldConnections::createComms(), and parProfiling::report().
|
static |
Definition at line 143 of file combineGatherScatter.C.
|
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().
|
static |
Definition at line 265 of file combineGatherScatter.C.
|
static |
Definition at line 284 of file combineGatherScatter.C.
References UPstream::commsStruct::above(), UPstream::commsStruct::below(), Foam::expressions::patchExpr::debug, Foam::endl(), forAll, Foam::Pout, Foam::blockMeshTools::read(), and Foam::vtk::write().
Referenced by lumpedPointMovement::areas(), meshRefinement::balance(), forces::calcForcesMoment(), viewFactor::calculate(), extractEulerianParticles::calculateAddressing(), NURBS3DVolume::computeControlPointSensitivities(), patchInjection::correct(), cellCellStencil::count(), meshRefinement::createZoneBaffles(), Curle::execute(), patchProbes::findElements(), mappedPatchBase::findSamples(), lumpedPointMovement::forcesAndMoments(), injectionModelList::info(), transferModelList::info(), propellerInfo::interpolate(), patchInjection::patchInjectedMassTotals(), meshRefinement::printMeshInfo(), probes::sample(), patchProbes::sample(), fvMeshSubset::setCellSubset(), cellVolumeWeight::update(), inverseDistance::update(), patchInjectionBase::updateMesh(), propellerInfo::updateSampleDiskCells(), fileMonitor::updateStates(), and histogram::write().
|
static |
Definition at line 392 of file combineGatherScatter.C.
|
static |
Definition at line 426 of file combineGatherScatter.C.
References UPstream::commsStruct::above(), UPstream::commsStruct::below(), Foam::expressions::patchExpr::debug, Foam::endl(), forAllReverse, Foam::Pout, Foam::blockMeshTools::read(), and Foam::vtk::write().
Referenced by lumpedPointMovement::areas(), meshRefinement::balance(), forces::calcForcesMoment(), viewFactor::calculate(), extractEulerianParticles::calculateAddressing(), NURBS3DVolume::computeControlPointSensitivities(), meshRefinement::createZoneBaffles(), Curle::execute(), patchProbes::findElements(), mappedPatchBase::findSamples(), lumpedPointMovement::forcesAndMoments(), propellerInfo::interpolate(), meshRefinement::printMeshInfo(), probes::sample(), patchProbes::sample(), fvMeshSubset::setCellSubset(), cellVolumeWeight::update(), inverseDistance::update(), patchInjectionBase::updateMesh(), propellerInfo::updateSampleDiskCells(), and fileMonitor::updateStates().
|
static |
Definition at line 514 of file combineGatherScatter.C.
|
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().
|
static |
Definition at line 626 of file combineGatherScatter.C.
|
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().
|
static |
Definition at line 718 of file combineGatherScatter.C.
|
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().
|
static |
Definition at line 194 of file gatherScatterList.C.
References Pstream::gatherList(), UPstream::linearCommunication(), UPstream::nProcs(), UPstream::nProcsSimpleSum, and UPstream::treeCommunication().
|
static |
Definition at line 209 of file gatherScatterList.C.
References Foam::abort(), UPstream::commsStruct::above(), UPstream::commsStruct::allNotBelow(), UPstream::commsStruct::below(), Foam::expressions::patchExpr::debug, Foam::endl(), Foam::FatalError, FatalErrorInFunction, forAll, forAllReverse, 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(), distributedTriSurfaceMesh::distribute(), distributedTriSurfaceMesh::distributedTriSurfaceMesh(), mappedPatchBase::findSamples(), InjectedParticleInjection< CloudType >::initialise(), InjectedParticleDistributionInjection< CloudType >::initialise(), distributedTriSurfaceMesh::localQueries(), pointHistory::pointHistory(), globalIndex::reset(), Pstream::scatterList(), fvMeshSubset::setCellSubset(), trackingInverseDistance::update(), and inverseDistance::update().
|
static |
Definition at line 336 of file gatherScatterList.C.
References UPstream::linearCommunication(), UPstream::nProcs(), UPstream::nProcsSimpleSum, Pstream::scatterList(), and UPstream::treeCommunication().
|
static |
Definition at line 181 of file exchange.C.
References Foam::abort(), Foam::FatalError, FatalErrorInFunction, forAll, Foam::max(), UPstream::maxCommsSize, Foam::min(), UPstream::myProcNo(), UPstream::nProcs(), UPstream::parRun(), Foam::reduce(), List::setSize(), UList::size(), Foam::T(), and Foam::Zero.
|
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().
|
static |
Definition at line 370 of file exchange.C.
|
protected |
Definition at line 93 of file Pstream.H.
Referenced by Pstream::Pstream().
Copyright © 2011-2018 OpenFOAM | OPENFOAM® is a registered trademark of OpenCFD Ltd.