Class containing processor-to-processor mapping information. More...
#include <OpenFOAM/mapDistribute.H>
Class containing processor-to-processor mapping information.
We store mapping from the bits-to-send to the complete starting list (subXXXMap) and from the received bits to their location in the new list (constructXXXMap).
Note: Schedule is a list of processor pairs (one send, one receive. One of them will be myself) which forms a scheduled (i.e. non-buffered) exchange. See distribute on how to use it. Note2: number of items send on one processor have to equal the number of items received on the other processor.
Definition at line 66 of file mapDistribute.H.
Public Member Functions | |
mapDistribute (const label constructSize, const labelListList &subMap, const labelListList &constructMap) | |
Construct from components. | |
mapDistribute (const label constructSize, labelListList &subMap, labelListList &constructMap, const bool reUse) | |
(optionally destructively) construct from components | |
mapDistribute (const labelList &sendProcs, const labelList &recvProcs) | |
Construct from reverse addressing: per data item the send. | |
mapDistribute (const mapDistribute &) | |
Construct copy. | |
label | constructSize () const |
Constructed data size. | |
label & | constructSize () |
Constructed data size. | |
const labelListList & | subMap () const |
From subsetted data back to original data. | |
labelListList & | subMap () |
From subsetted data back to original data. | |
const labelListList & | constructMap () const |
From subsetted data to new reconstructed data. | |
labelListList & | constructMap () |
From subsetted data to new reconstructed data. | |
const List< labelPair > & | schedule () const |
Return a schedule. Demand driven. See above. | |
void | compact (const boolList &elemIsUsed) |
Compact maps. Gets per field a bool whether it is used (locally) | |
template<class T > | |
void | distribute (List< T > &fld) const |
Distribute data using default commsType. | |
void | updateMesh (const mapPolyMesh &) |
Correct for topo change. | |
void | operator= (const mapDistribute &) |
Static Public Member Functions | |
static List< labelPair > | schedule (const labelListList &subMap, const labelListList &constructMap) |
Calculate a schedule. See above. | |
template<class T > | |
static void | distribute (const Pstream::commsTypes commsType, const List< labelPair > &schedule, const label constructSize, const labelListList &subMap, const labelListList &constructMap, List< T > &) |
Distribute data. Note:schedule only used for Pstream::scheduled. | |
template<class T , class CombineOp > | |
static void | distribute (const Pstream::commsTypes commsType, const List< labelPair > &schedule, const label constructSize, const labelListList &subMap, const labelListList &constructMap, List< T > &, const CombineOp &cop, const T &nullValue) |
Distribute data. If multiple processors writing to same. |
mapDistribute | ( | const label | constructSize, |
const labelListList & | subMap, | ||
const labelListList & | constructMap | ||
) |
Construct from components.
Definition at line 172 of file mapDistribute.C.
mapDistribute | ( | const label | constructSize, |
labelListList & | subMap, | ||
labelListList & | constructMap, | ||
const bool | reUse | ||
) |
(optionally destructively) construct from components
Definition at line 187 of file mapDistribute.C.
mapDistribute | ( | const labelList & | sendProcs, |
const labelList & | recvProcs | ||
) |
Construct from reverse addressing: per data item the send.
processor and the receive processor. All processors get same data.
Definition at line 202 of file mapDistribute.C.
References Foam::abort(), Foam::FatalError, FatalErrorIn, forAll, Pstream::myProcNo(), Pstream::nProcs(), List< T >::setSize(), and List< T >::size().
mapDistribute | ( | const mapDistribute & | map | ) |
Construct copy.
Definition at line 275 of file mapDistribute.C.
|
inline |
Constructed data size.
Definition at line 121 of file mapDistribute.H.
Referenced by extendedCellToFaceStencil::collectData(), extendedFaceToCellStencil::collectData(), distributedTriSurfaceMesh::findNearest(), turbulentTemperatureCoupledBaffleMixedFvPatchScalarField::updateCoeffs(), and turbulentTemperatureCoupledBaffleFvPatchScalarField::updateCoeffs().
|
inline |
Constructed data size.
Definition at line 127 of file mapDistribute.H.
|
inline |
From subsetted data back to original data.
Definition at line 133 of file mapDistribute.H.
Referenced by refinementHistory::distribute(), distributedTriSurfaceMesh::findNearest(), distributedTriSurfaceMesh::getField(), distributedTriSurfaceMesh::getNormal(), distributedTriSurfaceMesh::getRegion(), turbulentTemperatureCoupledBaffleMixedFvPatchScalarField::updateCoeffs(), turbulentTemperatureCoupledBaffleFvPatchScalarField::updateCoeffs(), and extendedCellToFaceStencil::writeStencilStats().
|
inline |
From subsetted data back to original data.
Definition at line 139 of file mapDistribute.H.
|
inline |
From subsetted data to new reconstructed data.
Definition at line 145 of file mapDistribute.H.
Referenced by refinementHistory::distribute(), distributedTriSurfaceMesh::findNearest(), distributedTriSurfaceMesh::getField(), distributedTriSurfaceMesh::getNormal(), distributedTriSurfaceMesh::getRegion(), turbulentTemperatureCoupledBaffleMixedFvPatchScalarField::updateCoeffs(), and turbulentTemperatureCoupledBaffleFvPatchScalarField::updateCoeffs().
|
inline |
From subsetted data to new reconstructed data.
Definition at line 151 of file mapDistribute.H.
|
static |
Calculate a schedule. See above.
Definition at line 34 of file mapDistribute.C.
References Foam::findIndex(), forAll, HashSet< Key, Hash >::insert(), List< T >::setSize(), List< T >::size(), and HashTable< nil, Key, Hash >::toc().
Referenced by directMappedFixedValueFvPatchField< Type >::updateCoeffs(), turbulentTemperatureCoupledBaffleMixedFvPatchScalarField::updateCoeffs(), and turbulentTemperatureCoupledBaffleFvPatchScalarField::updateCoeffs().
const Foam::List< Foam::labelPair > & schedule | ( | ) | const |
Return a schedule. Demand driven. See above.
Definition at line 152 of file mapDistribute.C.
References autoPtr< T >::empty(), and autoPtr< T >::reset().
Referenced by mapDistribute::distribute().
void compact | ( | const boolList & | elemIsUsed | ) |
Compact maps. Gets per field a bool whether it is used (locally)
and works out itself what this side and sender side can remove from maps.
Definition at line 286 of file mapDistribute.C.
References UList< T >::begin(), forAll, Foam::max(), Pstream::myProcNo(), PstreamBase::nonBlocking, Pstream::nProcs(), IPstream::read(), List< T >::setSize(), List< T >::size(), IPstream::waitRequests(), OPstream::waitRequests(), and OPstream::write().
|
static |
Distribute data. Note:schedule only used for Pstream::scheduled.
for now, all others just use send-to-all, receive-from-all.
Definition at line 33 of file mapDistributeTemplates.C.
References Foam::abort(), UList< T >::begin(), Foam::exit(), Foam::FatalError, FatalErrorIn, forAll, List< T >::setSize(), List< T >::size(), T, and List< T >::transfer().
Referenced by extendedCellToFaceStencil::collectData(), extendedFaceToCellStencil::collectData(), mapDistribute::distribute(), mapDistributePolyMesh::distributeCellData(), mapDistributePolyMesh::distributeFaceData(), mapDistributeLagrangian::distributeLagrangianData(), mapDistributePolyMesh::distributePatchData(), mapDistributePolyMesh::distributePointData(), distributedTriSurfaceMesh::findNearest(), distributedTriSurfaceMesh::getField(), distributedTriSurfaceMesh::getNormal(), distributedTriSurfaceMesh::getRegion(), directMappedVelocityFluxFixedValueFvPatchField::updateCoeffs(), directMappedFixedValueFvPatchField< Type >::updateCoeffs(), turbulentTemperatureCoupledBaffleMixedFvPatchScalarField::updateCoeffs(), and turbulentTemperatureCoupledBaffleFvPatchScalarField::updateCoeffs().
|
static |
Distribute data. If multiple processors writing to same.
position adds contributions using cop.
Definition at line 334 of file mapDistributeTemplates.C.
References Foam::abort(), UList< T >::begin(), Foam::exit(), Foam::FatalError, FatalErrorIn, forAll, List< T >::setSize(), List< T >::size(), T, and List< T >::transfer().
Distribute data using default commsType.
Definition at line 205 of file mapDistribute.H.
References PstreamBase::blocking, Pstream::defaultCommsType, mapDistribute::distribute(), PstreamBase::nonBlocking, mapDistribute::schedule(), and PstreamBase::scheduled.
|
inline |
void operator= | ( | const mapDistribute & | rhs | ) |
Definition at line 426 of file mapDistribute.C.
References Foam::abort(), List< T >::clear(), Foam::FatalError, and FatalErrorIn.