Calculates a unique integer (label so might not have enough room - 2G max) for processor + local index. E.g. More...
Classes | |
class | const_iterator |
Forward input iterator with const access. More... | |
struct | gatherNone |
Dispatch tag. Construct with a single (local size) entry, no communication. More... | |
struct | gatherNonLocal |
Dispatch tag. Construct 'one-sided' from the non-master local sizes using gather but no broadcast. More... | |
struct | gatherOnly |
Dispatch tag. Construct 'one-sided' from local sizes, using gather but no broadcast. More... | |
Public Types | |
enum | accessType : char { OFFSETS, SIZES } |
Disambiguation tag (list construction dispatch) More... | |
Public Member Functions | |
globalIndex () noexcept=default | |
Default construct (empty) More... | |
globalIndex (const labelUList &listOffsets) | |
Copy construct from a list of offsets. No communication required. More... | |
globalIndex (labelList &&listOffsets) | |
Move construct from a list of offsets. No communication required. More... | |
globalIndex (const labelUList &offsetsOrSizes, enum accessType accType) | |
Copy construct from a list of offsets or sizes. No communication required. More... | |
globalIndex (const label localSize, const label comm=UPstream::worldComm, const bool parallel=UPstream::parRun()) | |
Construct from local size, using gather/broadcast with default/specified communicator if parallel. More... | |
globalIndex (const globalIndex::gatherNone, const label localSize, const label comm=-1) | |
Construct with a single (local size) entry, no communication. More... | |
globalIndex (const globalIndex::gatherOnly, const label localSize, const label comm=UPstream::worldComm) | |
Construct 'one-sided' from local sizes. Uses UPstream::listGatherValues, but no broadcast. Will be empty on non-master processes. More... | |
globalIndex (const globalIndex::gatherNonLocal, const label localSize, const label comm=UPstream::worldComm) | |
Construct 'one-sided' from the non-master local sizes (ie, master size is treated as 0). Uses UPstream::listGatherValues, but no broadcast. Will be empty on non-master processes. More... | |
globalIndex (Istream &is) | |
Construct from Istream. No communication required. More... | |
bool | empty () const |
Check for default constructed or global sum == 0. More... | |
label | size () const |
Global sum of localSizes. Same as totalSize() More... | |
label | totalSize () const |
Global sum of localSizes. More... | |
labelList | sizes () const |
The local sizes. Same as localSizes() More... | |
const labelUList | localStarts () const |
The local starts. More... | |
labelList | localSizes () const |
The local sizes. More... | |
label | maxSize () const |
Global max of localSizes. More... | |
const labelList & | offsets () const noexcept |
Const-access to the offsets. More... | |
labelList & | offsets () noexcept |
Write-access to the offsets, for changing after construction. More... | |
label | nProcs () const noexcept |
The number of processors covered by the offsets. More... | |
labelRange | allProcs () const noexcept |
Range of process indices for all addressed offsets (processes) More... | |
labelRange | subProcs () const noexcept |
Range of process indices for addressed sub-offsets (processes) More... | |
void | clear () |
Reset to be empty (no offsets) More... | |
void | reset (const label localSize, const label comm=UPstream::worldComm, const bool parallel=UPstream::parRun()) |
Reset from local size, using gather/broadcast with default/specified communicator if parallel. More... | |
void | reset (const labelUList &localLens, const bool checkOverflow=false) |
Reset from list of local sizes, with optional check for label overflow. No communication required. More... | |
void | reset (const globalIndex::gatherNone, const label localSize, const label comm=-1) |
Reset to a single (local size) entry, no communication. More... | |
void | reset (const globalIndex::gatherOnly, const label localSize, const label comm=UPstream::worldComm) |
Reset as 'one-sided' from local sizes. Uses UPstream::listGatherValues, but no broadcast. Will be empty on non-master processes. More... | |
void | reset (const globalIndex::gatherNonLocal, const label localSize, const label comm=UPstream::worldComm) |
Reset as 'one-sided' from the non-master local sizes (ie, master size is treated as 0). Uses UPstream::listGatherValues, but no broadcast. Will be empty on non-master processes. More... | |
void | setLocalSize (const label proci, const label len) |
Alter local size for given processor. More... | |
label | localStart () const |
My local start. More... | |
label | localSize () const |
My local size. More... | |
label | maxNonLocalSize () const |
The max of localSizes, excluding current processor. More... | |
labelRange | range () const |
Return start/size range of local processor data. More... | |
List< labelRange > | ranges () const |
Return start/size ranges for all data. More... | |
bool | isLocal (const label i) const |
Is on local processor. More... | |
label | toGlobal (const label i) const |
From local to global index. More... | |
labelList | toGlobal (const labelUList &labels) const |
From local to global index. More... | |
void | inplaceToGlobal (labelUList &labels) const |
From local to global index (inplace) More... | |
label | toLocal (const label i) const |
From global to local on current processor. More... | |
label | localStart (const label proci) const |
Start of proci data. More... | |
label | localSize (const label proci) const |
Size of proci data. More... | |
label | maxNonLocalSize (const label proci) const |
The max of localSizes, excluding the specified processor. More... | |
labelRange | range (const label proci) const |
Return start/size range of proci data. More... | |
bool | isLocal (const label proci, const label i) const |
Is on processor proci. More... | |
label | toGlobal (const label proci, const label i) const |
From local to global on proci. More... | |
labelList | toGlobal (const label proci, const labelUList &labels) const |
From local to global on proci. More... | |
void | inplaceToGlobal (const label proci, labelUList &labels) const |
From local to global index on proci (inplace) More... | |
label | toLocal (const label proci, const label i) const |
From global to local on proci. More... | |
label | whichProcID (const label i) const |
Which processor does global id come from? More... | |
const_iterator | cbegin () const noexcept |
A const_iterator set to the beginning. More... | |
const const_iterator | cend () const noexcept |
A const_iterator set to beyond the end. More... | |
const_iterator | begin () const noexcept |
A const_iterator set to the beginning. More... | |
const const_iterator | end () const noexcept |
A const_iterator set to beyond the end. More... | |
template<class ProcIDsContainer , class Type > | |
void | gather (const label comm, const ProcIDsContainer &procIDs, const UList< Type > &fld, List< Type > &allFld, const int tag=UPstream::msgType(), const UPstream::commsTypes ct=UPstream::commsTypes::nonBlocking) const |
Collect data in processor order on master (== procIDs[0]). More... | |
template<class ProcIDsContainer , class Type > | |
void | gather (const label comm, const ProcIDsContainer &procIDs, List< Type > &fld, const int tag=UPstream::msgType(), const UPstream::commsTypes ct=UPstream::commsTypes::nonBlocking) const |
Inplace collect in processor order on master (== procIDs[0]). More... | |
template<class Type > | |
void | gather (const UList< Type > &sendData, List< Type > &allData, const int tag=UPstream::msgType(), const UPstream::commsTypes=UPstream::commsTypes::nonBlocking, const label comm=UPstream::worldComm) const |
Collect data in processor order on master (in serial: performs a simple copy). More... | |
template<class Type , class Addr > | |
void | gather (const IndirectListBase< Type, Addr > &sendData, List< Type > &allData, const int tag=UPstream::msgType(), const UPstream::commsTypes=UPstream::commsTypes::nonBlocking, const label comm=UPstream::worldComm) const |
Collect data indirectly in processor order on master (in serial: performs a simple copy). More... | |
template<class Type , class OutputContainer = List<Type>> | |
OutputContainer | gather (const UList< Type > &sendData, const int tag=UPstream::msgType(), const UPstream::commsTypes=UPstream::commsTypes::nonBlocking, const label comm=UPstream::worldComm) const |
Collect data in processor order on master (in serial: performs a simple copy). More... | |
template<class Type , class Addr , class OutputContainer = List<Type>> | |
OutputContainer | gather (const IndirectListBase< Type, Addr > &sendData, const int tag=UPstream::msgType(), const UPstream::commsTypes=UPstream::commsTypes::nonBlocking, const label comm=UPstream::worldComm) const |
Collect data indirectly in processor order on master. More... | |
template<class Type > | |
void | gatherInplace (List< Type > &fld, const int tag=UPstream::msgType(), const UPstream::commsTypes=UPstream::commsTypes::nonBlocking, const label comm=UPstream::worldComm) const |
Inplace collect data in processor order on master (in serial: a no-op). More... | |
template<class Type , class OutputContainer = List<Type>> | |
void | mpiGather (const UList< Type > &sendData, OutputContainer &allData, const label comm=UPstream::worldComm, const UPstream::commsTypes=UPstream::commsTypes::nonBlocking, const int tag=UPstream::msgType()) const |
Use MPI_Gatherv call for contiguous data when possible (in serial: performs a simple copy). More... | |
template<class Type , class OutputContainer = List<Type>> | |
OutputContainer | mpiGather (const UList< Type > &sendData, const label comm=UPstream::worldComm, const UPstream::commsTypes=UPstream::commsTypes::nonBlocking, const int tag=UPstream::msgType()) const |
Use MPI_Gatherv call for contiguous data when possible (in serial: performs a simple copy). More... | |
template<class Type > | |
void | mpiGatherInplace (List< Type > &fld, const label comm=UPstream::worldComm, const UPstream::commsTypes=UPstream::commsTypes::nonBlocking, const int tag=UPstream::msgType()) const |
Use MPI_Gatherv call to inplace collect contiguous data when possible. (in serial: a no-op). More... | |
template<class ProcIDsContainer , class Type > | |
void | scatter (const label comm, const ProcIDsContainer &procIDs, const UList< Type > &allFld, UList< Type > &fld, const int tag=UPstream::msgType(), const UPstream::commsTypes ct=UPstream::commsTypes::nonBlocking) const |
Distribute data in processor order. More... | |
template<class Type > | |
void | scatter (const UList< Type > &allData, UList< Type > &localData, const int tag=UPstream::msgType(), const UPstream::commsTypes=UPstream::commsTypes::nonBlocking, const label comm=UPstream::worldComm) const |
Distribute data in processor order. More... | |
template<class Type , class OutputContainer = List<Type>> | |
OutputContainer | scatter (const UList< Type > &allData, const int tag=UPstream::msgType(), const UPstream::commsTypes=UPstream::commsTypes::nonBlocking, const label comm=UPstream::worldComm) const |
Distribute data in processor order (in serial: performs a simple copy). More... | |
template<class Type , class CombineOp > | |
void | get (List< Type > &allFld, const labelUList &globalIds, const CombineOp &cop, const label comm=UPstream::worldComm, const int tag=UPstream::msgType()) const |
Get (potentially remote) data. Elements required given as global indices. More... | |
globalIndex (const label localSize, const globalIndex::gatherNone, const label comm=-1) | |
Construct with a single (local size) entry, no communication. More... | |
globalIndex (const label localSize, const globalIndex::gatherOnly, const label comm=UPstream::worldComm) | |
Construct 'one-sided' from local sizes. More... | |
globalIndex (const label localSize, const int tag, const label comm, const bool parallel) | |
Construct from local size, using gather/broadcast with default/specified communicator if parallel. More... | |
void | reset (const label localSize, const int tag, const label comm, const bool parallel) |
Reset from local size, using gather/broadcast with default/specified communicator if parallel. More... | |
label | offset (const label proci) const |
Prefer localStart() to avoid confusing with offsets() More... | |
void | reset (const label localSize, const globalIndex::gatherOnly, const label comm=UPstream::worldComm) |
Reset as 'one-sided' from local sizes [gather, but no broadcast] Will be empty on non-master processes. More... | |
template<class SubListType > | |
Foam::labelList | calcListOffsets (const List< SubListType > &lists, const bool checkOverflow) |
Static Public Member Functions | |
static labelList | calcOffsets (const labelUList &localLens, const bool checkOverflow=false) |
Calculate offsets from a list of local sizes, with optional check for label overflow. More... | |
template<class SubListType > | |
static labelList | calcListOffsets (const List< SubListType > &lists, const bool checkOverflow=false) |
Calculate offsets from list of lists, with optional check for label overflow. More... | |
static List< labelRange > | calcRanges (const labelUList &localLens, const bool checkOverflow=false) |
Calculate ranges (offset/size) from a list of local sizes, with optional check for label overflow. More... | |
template<class ProcIDsContainer , class Type > | |
static void | gatherValues (const label comm, const ProcIDsContainer &procIDs, const Type &localValue, List< Type > &allValues, const int tag=UPstream::msgType(), const UPstream::commsTypes=UPstream::commsTypes::nonBlocking) |
Collect single values in processor order on master (== procIDs[0]). More... | |
template<class ProcIDsContainer , class Type > | |
static void | gather (const labelUList &offsets, const label comm, const ProcIDsContainer &procIDs, const UList< Type > &fld, List< Type > &allFld, const int tag=UPstream::msgType(), const UPstream::commsTypes=UPstream::commsTypes::nonBlocking) |
Collect data in processor order on master (== procIDs[0]). More... | |
template<class ProcIDsContainer , class Type , class Addr > | |
static void | gather (const labelUList &offsets, const label comm, const ProcIDsContainer &procIDs, const IndirectListBase< Type, Addr > &fld, List< Type > &allFld, const int tag=UPstream::msgType(), const UPstream::commsTypes=UPstream::commsTypes::nonBlocking) |
Collect indirect data in processor order on master. More... | |
template<class ProcIDsContainer , class Type > | |
static void | gather (const labelUList &offsets, const label comm, const ProcIDsContainer &procIDs, List< Type > &fld, const int tag=UPstream::msgType(), const UPstream::commsTypes ct=UPstream::commsTypes::nonBlocking) |
Inplace collect in processor order on master (== procIDs[0]). More... | |
template<class Type , class OutputContainer = List<Type>> | |
static void | mpiGatherOp (const UList< Type > &sendData, OutputContainer &allData, const label comm=UPstream::worldComm, const UPstream::commsTypes=UPstream::commsTypes::nonBlocking, const int tag=UPstream::msgType()) |
Use MPI_Gatherv call to collect contiguous data when possible (in serial: performs a simple copy). More... | |
template<class Type , class OutputContainer = List<Type>> | |
static OutputContainer | mpiGatherOp (const UList< Type > &sendData, const label comm=UPstream::worldComm, const UPstream::commsTypes=UPstream::commsTypes::nonBlocking, const int tag=UPstream::msgType()) |
Use MPI_Gatherv call to collect contiguous data when possible (in serial: performs a simple copy). More... | |
template<class Type > | |
static void | mpiGatherInplaceOp (List< Type > &fld, const label comm=UPstream::worldComm, const UPstream::commsTypes=UPstream::commsTypes::nonBlocking, const int tag=UPstream::msgType()) |
Use MPI_Gatherv call to inplace collect contiguous data when possible. (in serial: a no-op). More... | |
template<class Type > | |
static void | gatherOp (const UList< Type > &sendData, List< Type > &allData, const int tag=UPstream::msgType(), const UPstream::commsTypes=UPstream::commsTypes::nonBlocking, const label comm=UPstream::worldComm) |
Collect data in processor order on master (in serial: performs a simple copy). More... | |
template<class Type , class Addr > | |
static void | gatherOp (const IndirectListBase< Type, Addr > &sendData, List< Type > &allData, const int tag=UPstream::msgType(), const UPstream::commsTypes=UPstream::commsTypes::nonBlocking, const label comm=UPstream::worldComm) |
Collect data in processor order on master (in serial: performs a simple copy). More... | |
template<class Type , class OutputContainer = List<Type>> | |
static OutputContainer | gatherOp (const UList< Type > &sendData, const int tag=UPstream::msgType(), const UPstream::commsTypes=UPstream::commsTypes::nonBlocking, const label comm=UPstream::worldComm) |
Collect and return data in processor order on master (in serial: performs a simple copy). More... | |
template<class Type , class Addr , class OutputContainer = List<Type>> | |
static OutputContainer | gatherOp (const IndirectListBase< Type, Addr > &sendData, const int tag=UPstream::msgType(), const UPstream::commsTypes=UPstream::commsTypes::nonBlocking, const label comm=UPstream::worldComm) |
Collect and return data in processor order on master (in serial: performs a simple copy). More... | |
template<class Type > | |
static void | gatherInplaceOp (List< Type > &fld, const int tag=UPstream::msgType(), const UPstream::commsTypes=UPstream::commsTypes::nonBlocking, const label comm=UPstream::worldComm) |
Inplace collect data in processor order on master (in serial: a no-op). More... | |
template<class ProcIDsContainer , class Type > | |
static void | scatter (const labelUList &offsets, const label comm, const ProcIDsContainer &procIDs, const UList< Type > &allFld, UList< Type > &fld, const int tag=UPstream::msgType(), const UPstream::commsTypes=UPstream::commsTypes::nonBlocking) |
Distribute data in processor order. More... | |
Friends | |
Istream & | operator>> (Istream &is, globalIndex &gi) |
Ostream & | operator<< (Ostream &os, const globalIndex &gi) |
Calculates a unique integer (label so might not have enough room - 2G max) for processor + local index. E.g.
globalIndex globalFaces(mesh.nFaces()); label globalFacei = globalFaces.toGlobal(facei);
Definition at line 62 of file globalIndex.H.
enum accessType : char |
Disambiguation tag (list construction dispatch)
Enumerator | |
---|---|
OFFSETS | |
SIZES |
Definition at line 102 of file globalIndex.H.
|
defaultnoexcept |
Default construct (empty)
|
inlineexplicit |
Copy construct from a list of offsets. No communication required.
Definition at line 27 of file globalIndexI.H.
References UList< T >::size().
|
inlineexplicit |
Move construct from a list of offsets. No communication required.
Definition at line 39 of file globalIndexI.H.
References UList< T >::size().
|
inline |
Copy construct from a list of offsets or sizes. No communication required.
Definition at line 55 of file globalIndexI.H.
References UList< T >::size().
|
inlineexplicit |
Construct from local size, using gather/broadcast with default/specified communicator if parallel.
comm | communicator |
parallel | use parallel comms |
Definition at line 73 of file globalIndexI.H.
|
inline |
Construct with a single (local size) entry, no communication.
comm | no communicator needed |
Definition at line 84 of file globalIndexI.H.
|
inline |
Construct 'one-sided' from local sizes. Uses UPstream::listGatherValues, but no broadcast. Will be empty on non-master processes.
comm | communicator |
Definition at line 98 of file globalIndexI.H.
|
inline |
Construct 'one-sided' from the non-master local sizes (ie, master size is treated as 0). Uses UPstream::listGatherValues, but no broadcast. Will be empty on non-master processes.
comm | communicator |
Definition at line 110 of file globalIndexI.H.
|
explicit |
Construct from Istream. No communication required.
Definition at line 115 of file globalIndex.C.
|
inline |
Construct with a single (local size) entry, no communication.
comm | no communicator needed |
Definition at line 1128 of file globalIndex.H.
|
inline |
Construct 'one-sided' from local sizes.
Definition at line 1141 of file globalIndex.H.
|
inline |
Construct from local size, using gather/broadcast with default/specified communicator if parallel.
Definition at line 1156 of file globalIndex.H.
References globalIndex::localSize(), and globalIndex::reset().
|
inline |
Check for default constructed or global sum == 0.
Definition at line 130 of file globalIndexI.H.
References UList< T >::back(), and UList< T >::empty().
|
inline |
Global sum of localSizes. Same as totalSize()
Definition at line 143 of file globalIndexI.H.
|
inline |
Global sum of localSizes.
Definition at line 136 of file globalIndexI.H.
Referenced by nearWallFields::calcAddressing(), distributedTriSurfaceMesh::globalSize(), globalIndex::mpiGather(), particleTracksSampler::nParticle(), regionSplit::nRegions(), SprayCloud< Foam::DSMCCloud >::penetration(), and particleTracksSampler::setSampleRate().
|
inline |
The local sizes. Same as localSizes()
Definition at line 149 of file globalIndexI.H.
|
inline |
The local starts.
Definition at line 196 of file globalIndexI.H.
References UList< label >::null().
Foam::labelList localSizes | ( | ) | const |
The local sizes.
Definition at line 271 of file globalIndex.C.
References Foam::HashTableOps::values().
|
inline |
Global max of localSizes.
Definition at line 230 of file globalIndexI.H.
|
inlinenoexcept |
Const-access to the offsets.
Definition at line 178 of file globalIndexI.H.
Referenced by surfaceNoise::calculate(), and globalIndex::gather().
|
inlinenoexcept |
Write-access to the offsets, for changing after construction.
Definition at line 184 of file globalIndexI.H.
|
inlinenoexcept |
The number of processors covered by the offsets.
Definition at line 155 of file globalIndexI.H.
Referenced by globalIndex::mpiGather().
|
inlinenoexcept |
Range of process indices for all addressed offsets (processes)
Definition at line 162 of file globalIndexI.H.
|
inlinenoexcept |
Range of process indices for addressed sub-offsets (processes)
Definition at line 170 of file globalIndexI.H.
Referenced by faBoundaryMesh::checkParallelSync(), polyBoundaryMesh::checkParallelSync(), and PatchTools::gatherAndMerge().
|
inline |
Reset to be empty (no offsets)
Definition at line 190 of file globalIndexI.H.
Referenced by mergedSurf::clear().
void reset | ( | const label | localSize, |
const label | comm = UPstream::worldComm , |
||
const bool | parallel = UPstream::parRun() |
||
) |
Reset from local size, using gather/broadcast with default/specified communicator if parallel.
comm | communicator |
parallel | use parallel comms |
Definition at line 187 of file globalIndex.C.
References UPstream::allGatherValues(), UPstream::myProcNo(), UPstream::nProcs(), UPstream::parRun(), List< T >::resize(), and Foam::Zero.
Referenced by surfaceNoise::calculate(), PatchTools::gatherAndMerge(), globalMeshData::globalEdgeNumbering(), globalIndex::globalIndex(), globalMeshData::globalPointNumbering(), distributedTriSurfaceMesh::globalTris(), particleTracksSampler::reset(), globalIndex::reset(), and particleTracksSampler::resetCloud().
void reset | ( | const labelUList & | localLens, |
const bool | checkOverflow = false |
||
) |
Reset from list of local sizes, with optional check for label overflow. No communication required.
Definition at line 222 of file globalIndex.C.
References UList< T >::size().
|
inline |
Reset to a single (local size) entry, no communication.
comm | no communicator needed |
Definition at line 365 of file globalIndexI.H.
|
inline |
Reset as 'one-sided' from local sizes. Uses UPstream::listGatherValues, but no broadcast. Will be empty on non-master processes.
comm | communicator |
Definition at line 378 of file globalIndexI.H.
References UPstream::listGatherValues().
|
inline |
Reset as 'one-sided' from the non-master local sizes (ie, master size is treated as 0). Uses UPstream::listGatherValues, but no broadcast. Will be empty on non-master processes.
comm | communicator |
Definition at line 390 of file globalIndexI.H.
References UPstream::listGatherValues(), and UPstream::master().
void setLocalSize | ( | const label | proci, |
const label | len | ||
) |
Alter local size for given processor.
Definition at line 253 of file globalIndex.C.
References delta.
|
inline |
My local start.
Definition at line 212 of file globalIndexI.H.
References UPstream::myProcNo().
Referenced by viewFactor::calculate(), cellCellStencil::globalCellCells(), lduPrimitiveMesh::globalCellCells(), globalIndex::mpiGather(), globalIndex::offset(), patchMeshWriter::writeGeometry(), polyWriter::writeLineGeometry(), Foam::vtk::writeListParallel(), polyWriter::writePolyGeometry(), and patchMeshWriter::writePolys().
|
inline |
My local size.
Definition at line 224 of file globalIndexI.H.
References UPstream::myProcNo().
Referenced by holeToFace::calcClosure(), createShellMesh::calcPointRegions(), viewFactor::calculate(), mapDistributeBase::exchangeAddressing(), cellCellStencil::globalCellCells(), globalIndex::globalIndex(), globalIndex::mpiGather(), regionSplit::nLocalRegions(), surfaceNoise::readSurfaceData(), and globalIndex::reset().
|
inline |
The max of localSizes, excluding current processor.
Definition at line 237 of file globalIndexI.H.
References UPstream::myProcNo().
|
inline |
Return start/size range of local processor data.
Definition at line 249 of file globalIndexI.H.
References UPstream::myProcNo(), and range.
Referenced by faBoundaryMesh::checkParallelSync(), polyBoundaryMesh::checkParallelSync(), PatchTools::gatherAndMerge(), globalIndex::mpiGather(), and surfaceNoise::readSurfaceData().
Foam::List< Foam::labelRange > ranges | ( | ) | const |
Return start/size ranges for all data.
Definition at line 294 of file globalIndex.C.
References Foam::HashTableOps::values().
|
inline |
Is on local processor.
Definition at line 261 of file globalIndexI.H.
References UPstream::myProcNo().
Referenced by decompositionMethod::calcCellCells(), mapDistributeBase::calcCompactAddressing(), addPatchCellLayer::calcExtrudeInfo(), and mapDistributeBase::renumber().
|
inline |
From local to global index.
Definition at line 277 of file globalIndexI.H.
References UPstream::myProcNo().
Referenced by MGridGenGAMGAgglomeration::agglomerate(), nearWallFields::calcAddressing(), decompositionMethod::calcCellCells(), holeToFace::calcClosure(), createShellMesh::calcPointRegions(), viewFactor::calculate(), cellCellStencil::globalCellCells(), addPatchCellLayer::globalEdgeFaces(), inverseDistance::holeExtrapolationStencil(), viewFactor::initialise(), viewFactor::insertMatrixElements(), inverseDistance::markDonors(), globalMeshData::mergePoints(), regionSplit2D::regionSplit2D(), addPatchCellLayer::setRefinement(), and cellVolumeWeight::update().
|
inline |
From local to global index.
Definition at line 297 of file globalIndexI.H.
References UPstream::myProcNo().
|
inline |
From local to global index (inplace)
Definition at line 320 of file globalIndexI.H.
References UPstream::myProcNo().
Referenced by faceAreaWeightAMI2D::calculate(), faceAreaWeightAMI::calculate(), PatchTools::gatherAndMerge(), and inverseDistance::holeExtrapolationStencil().
|
inline |
From global to local on current processor.
FatalError if not on local processor.
Definition at line 342 of file globalIndexI.H.
References UPstream::myProcNo().
Referenced by fvMeshPrimitiveLduAddressing::addAddressing(), decompositionMethod::calcCellCells(), mapDistributeBase::calcCompactAddressing(), addPatchCellLayer::calcExtrudeInfo(), viewFactor::calculate(), viewFactor::initialise(), distributedTriSurfaceMesh::localQueries(), and mapDistributeBase::renumber().
|
inline |
Start of proci data.
Definition at line 206 of file globalIndexI.H.
|
inline |
Size of proci data.
Definition at line 218 of file globalIndexI.H.
Foam::label maxNonLocalSize | ( | const label | proci | ) | const |
The max of localSizes, excluding the specified processor.
Definition at line 320 of file globalIndex.C.
References Foam::max().
|
inline |
Return start/size range of proci data.
Definition at line 243 of file globalIndexI.H.
|
inline |
Is on processor proci.
Definition at line 255 of file globalIndexI.H.
|
inline |
From local to global on proci.
Definition at line 268 of file globalIndexI.H.
|
inline |
From local to global on proci.
Definition at line 284 of file globalIndexI.H.
|
inline |
From local to global index on proci (inplace)
Definition at line 306 of file globalIndexI.H.
|
inline |
From global to local on proci.
Definition at line 327 of file globalIndexI.H.
References Foam::abort(), Foam::FatalError, FatalErrorInFunction, and Foam::nl.
|
inline |
Which processor does global id come from?
Does an initial check for isLocal first (assumed to occur reasonably frequently) followed by a binary search. Fatal for out of range ids (eg, negative or >= totalSize()
Definition at line 348 of file globalIndexI.H.
References Foam::abort(), Foam::FatalError, FatalErrorInFunction, Foam::findLower(), and UPstream::myProcNo().
Referenced by fvMeshPrimitiveLduAddressing::addAddressing(), mapDistributeBase::calcCompactAddressing(), addPatchCellLayer::calcExtrudeInfo(), viewFactor::calculate(), distributedTriSurfaceMesh::findNearest(), viewFactor::initialise(), distributedTriSurfaceMesh::localQueries(), and mapDistributeBase::renumber().
|
inlinenoexcept |
A const_iterator set to the beginning.
Definition at line 520 of file globalIndexI.H.
|
inlinenoexcept |
A const_iterator set to beyond the end.
Definition at line 527 of file globalIndexI.H.
|
inlinenoexcept |
A const_iterator set to the beginning.
Definition at line 534 of file globalIndexI.H.
|
inlinenoexcept |
A const_iterator set to beyond the end.
Definition at line 541 of file globalIndexI.H.
|
static |
Calculate offsets from a list of local sizes, with optional check for label overflow.
Definition at line 50 of file globalIndex.C.
References UList< T >::size(), and Foam::HashTableOps::values().
|
static |
Calculate offsets from list of lists, with optional check for label overflow.
|
static |
Calculate ranges (offset/size) from a list of local sizes, with optional check for label overflow.
Definition at line 83 of file globalIndex.C.
References UList< T >::size(), and Foam::HashTableOps::values().
|
static |
Collect single values in processor order on master (== procIDs[0]).
Handles contiguous/non-contiguous data.
comm | communicator |
tag | output field (master only) |
Definition at line 62 of file globalIndexTemplates.C.
References List< T >::clear(), Foam::blockMeshTools::read(), List< T >::resize_nocopy(), and Foam::vtk::write().
|
static |
Collect data in processor order on master (== procIDs[0]).
Handles contiguous/non-contiguous data, skips empty fields.
offsets | offsets (master only) |
comm | communicator |
tag | output field (master only) |
Definition at line 148 of file globalIndexTemplates.C.
References UList< T >::back(), UList< T >::data_bytes(), UList< T >::empty(), fld, Foam::blockMeshTools::read(), List< T >::resize_nocopy(), UList< T >::size_bytes(), and Foam::vtk::write().
Referenced by faBoundaryMesh::checkParallelSync(), polyBoundaryMesh::checkParallelSync(), globalIndex::gather(), PatchTools::gatherAndMerge(), debugWriter::mergeField(), surfaceWriter::mergeFieldTemplate(), surfaceNoise::surfaceAverage(), and surfaceNoise::writeSurfaceData().
|
static |
Collect indirect data in processor order on master.
Handles contiguous/non-contiguous data, skips empty fields.
offsets | offsets (master only) |
comm | communicator |
tag | output field (master only) |
Definition at line 250 of file globalIndexTemplates.C.
References UList< T >::back(), UList< T >::empty(), fld, Foam::PstreamDetail::gather(), and List< T >::resize_nocopy().
|
inlinestatic |
Inplace collect in processor order on master (== procIDs[0]).
Note: adjust naming?
offsets | offsets (master only) |
comm | communicator |
fld | in/out field |
Definition at line 665 of file globalIndex.H.
References fld, globalIndex::gather(), UPstream::myProcNo(), and globalIndex::offsets().
|
inline |
Collect data in processor order on master (== procIDs[0]).
comm | communicator |
fld | input field |
tag | output field (master only) |
Definition at line 691 of file globalIndex.H.
References fld, and globalIndex::gather().
|
inline |
Inplace collect in processor order on master (== procIDs[0]).
comm | communicator |
fld | in/out field |
Definition at line 711 of file globalIndex.H.
References fld, and globalIndex::gather().
void gather | ( | const UList< Type > & | sendData, |
List< Type > & | allData, | ||
const int | tag = UPstream::msgType() , |
||
const UPstream::commsTypes | commsType = UPstream::commsTypes::nonBlocking , |
||
const label | comm = UPstream::worldComm |
||
) | const |
Collect data in processor order on master (in serial: performs a simple copy).
Communication with default/specified communicator, message tag.
comm | communicator |
Definition at line 350 of file globalIndexTemplates.C.
References List< T >::clear(), and Foam::PstreamDetail::gather().
void gather | ( | const IndirectListBase< Type, Addr > & | sendData, |
List< Type > & | allData, | ||
const int | tag = UPstream::msgType() , |
||
const UPstream::commsTypes | commsType = UPstream::commsTypes::nonBlocking , |
||
const label | comm = UPstream::worldComm |
||
) | const |
Collect data indirectly in processor order on master (in serial: performs a simple copy).
Communication with default/specified communicator, message tag.
comm | communicator |
Definition at line 386 of file globalIndexTemplates.C.
References List< T >::clear(), and Foam::PstreamDetail::gather().
OutputContainer gather | ( | const UList< Type > & | sendData, |
const int | tag = UPstream::msgType() , |
||
const UPstream::commsTypes | commsType = UPstream::commsTypes::nonBlocking , |
||
const label | comm = UPstream::worldComm |
||
) | const |
Collect data in processor order on master (in serial: performs a simple copy).
Communication with default/specified communicator, message tag.
comm | communicator |
Definition at line 422 of file globalIndexTemplates.C.
References Foam::PstreamDetail::gather().
OutputContainer gather | ( | const IndirectListBase< Type, Addr > & | sendData, |
const int | tag = UPstream::msgType() , |
||
const UPstream::commsTypes | commsType = UPstream::commsTypes::nonBlocking , |
||
const label | comm = UPstream::worldComm |
||
) | const |
Collect data indirectly in processor order on master.
Communication with default/specified communicator, message tag.
comm | communicator |
Definition at line 437 of file globalIndexTemplates.C.
References Foam::PstreamDetail::gather().
void gatherInplace | ( | List< Type > & | fld, |
const int | tag = UPstream::msgType() , |
||
const UPstream::commsTypes | commsType = UPstream::commsTypes::nonBlocking , |
||
const label | comm = UPstream::worldComm |
||
) | const |
Inplace collect data in processor order on master (in serial: a no-op).
Communication with default/specified communicator, message tag. After the gather, the field is zero-sized on the slaves.
comm | communicator |
Definition at line 452 of file globalIndexTemplates.C.
References fld, and Foam::PstreamDetail::gather().
Referenced by particleTracksSampler::gatherInplace(), and SprayCloud< Foam::DSMCCloud >::penetration().
void mpiGather | ( | const UList< Type > & | sendData, |
OutputContainer & | allData, | ||
const label | comm = UPstream::worldComm , |
||
const UPstream::commsTypes | commsType = UPstream::commsTypes::nonBlocking , |
||
const int | tag = UPstream::msgType() |
||
) | const |
Use MPI_Gatherv call for contiguous data when possible (in serial: performs a simple copy).
Communication with default/specified communicator.
The allData is output (master), zero-sized on non-master
comm | communicator |
Definition at line 479 of file globalIndexTemplates.C.
References UList< T >::cdata(), UList< T >::cdata_bytes(), Foam::PstreamDetail::gather(), globalIndex::localSize(), globalIndex::localStart(), globalIndex::nProcs(), globalIndex::range(), List< T >::resize(), UList< T >::size(), UList< T >::size_bytes(), and globalIndex::totalSize().
OutputContainer mpiGather | ( | const UList< Type > & | sendData, |
const label | comm = UPstream::worldComm , |
||
const UPstream::commsTypes | commsType = UPstream::commsTypes::nonBlocking , |
||
const int | tag = UPstream::msgType() |
||
) | const |
Use MPI_Gatherv call for contiguous data when possible (in serial: performs a simple copy).
Communication with default/specified communicator.
comm | communicator |
Definition at line 643 of file globalIndexTemplates.C.
void mpiGatherInplace | ( | List< Type > & | fld, |
const label | comm = UPstream::worldComm , |
||
const UPstream::commsTypes | commsType = UPstream::commsTypes::nonBlocking , |
||
const int | tag = UPstream::msgType() |
||
) | const |
Use MPI_Gatherv call to inplace collect contiguous data when possible. (in serial: a no-op).
Communication with default/specified communicator.
After the gather, the field is zero-sized on non-master.
comm | communicator |
Definition at line 659 of file globalIndexTemplates.C.
References fld.
|
static |
Use MPI_Gatherv call to collect contiguous data when possible (in serial: performs a simple copy).
Communication with default/specified communicator.
The allData is output (master), zero-sized on non-master
comm | communicator |
Definition at line 687 of file globalIndexTemplates.C.
References UList< T >::size().
|
static |
Use MPI_Gatherv call to collect contiguous data when possible (in serial: performs a simple copy).
Communication with default/specified communicator.
comm | communicator |
Definition at line 712 of file globalIndexTemplates.C.
|
static |
Use MPI_Gatherv call to inplace collect contiguous data when possible. (in serial: a no-op).
Communication with default/specified communicator.
After the gather, the field is zero-sized on non-master.
comm | communicator |
Definition at line 728 of file globalIndexTemplates.C.
References fld.
|
static |
Collect data in processor order on master (in serial: performs a simple copy).
Communication with default/specified communicator, message tag.
The allFld is output (master), zero-sized on non-master
comm | communicator |
Definition at line 756 of file globalIndexTemplates.C.
References Foam::PstreamDetail::gather(), and UList< T >::size().
Referenced by coordSet::gatherSort(), and mergedSurf::merge().
|
static |
Collect data in processor order on master (in serial: performs a simple copy).
Communication with default/specified communicator, message tag.
The allFld is output (master), zero-sized on non-master
comm | communicator |
Definition at line 780 of file globalIndexTemplates.C.
References Foam::PstreamDetail::gather(), and IndirectListBase< T, Addr >::size().
|
static |
Collect and return data in processor order on master (in serial: performs a simple copy).
Communication with default/specified communicator, message tag.
comm | communicator |
Definition at line 804 of file globalIndexTemplates.C.
|
static |
Collect and return data in processor order on master (in serial: performs a simple copy).
Communication with default/specified communicator, message tag.
comm | communicator |
Definition at line 819 of file globalIndexTemplates.C.
|
static |
Inplace collect data in processor order on master (in serial: a no-op).
Communication with default/specified communicator, message tag.
After the gather, the field is zero-sized on the slaves.
comm | communicator |
Definition at line 834 of file globalIndexTemplates.C.
References fld, and Foam::PstreamDetail::gather().
|
static |
Distribute data in processor order.
Requires fld to be correctly sized! Communication with default/specified communicator, message tag.
offsets | offsets (master only) |
comm | communicator |
Definition at line 853 of file globalIndexTemplates.C.
References UList< T >::cdata_bytes(), UList< T >::empty(), fld, Foam::blockMeshTools::read(), UList< T >::size_bytes(), and Foam::vtk::write().
Referenced by surfaceNoise::readSurfaceData(), and globalIndex::scatter().
|
inline |
Distribute data in processor order.
Requires fld to be correctly sized! Communication with default/specified communicator, message tag.
comm | communicator |
Definition at line 1050 of file globalIndex.H.
References fld, and globalIndex::scatter().
void scatter | ( | const UList< Type > & | allData, |
UList< Type > & | localData, | ||
const int | tag = UPstream::msgType() , |
||
const UPstream::commsTypes | commsType = UPstream::commsTypes::nonBlocking , |
||
const label | comm = UPstream::worldComm |
||
) | const |
Distribute data in processor order.
Requires fld to be correctly sized! Communication with default/specified communicator, message tag.
comm | communicator |
Definition at line 957 of file globalIndexTemplates.C.
References UList< T >::deepCopy(), and Foam::PstreamDetail::scatter().
OutputContainer scatter | ( | const UList< Type > & | allData, |
const int | tag = UPstream::msgType() , |
||
const UPstream::commsTypes | commsType = UPstream::commsTypes::nonBlocking , |
||
const label | comm = UPstream::worldComm |
||
) | const |
Distribute data in processor order (in serial: performs a simple copy).
Communication with default/specified communicator, message tag.
comm | communicator |
Definition at line 989 of file globalIndexTemplates.C.
References Foam::PstreamDetail::scatter().
void get | ( | List< Type > & | allFld, |
const labelUList & | globalIds, | ||
const CombineOp & | cop, | ||
const label | comm = UPstream::worldComm , |
||
const int | tag = UPstream::msgType() |
||
) | const |
Get (potentially remote) data. Elements required given as global indices.
Communication with default/specified communicator, message tag.
comm | communicator |
Definition at line 1021 of file globalIndexTemplates.C.
References PstreamBuffers::allProcs(), PstreamBuffers::finishedSends(), fld, CompactListList< T >::offsets(), os(), PstreamBuffers::recvDataCount(), List< T >::resize_nocopy(), and UList< T >::size().
|
inline |
Reset from local size, using gather/broadcast with default/specified communicator if parallel.
Definition at line 1172 of file globalIndex.H.
References globalIndex::localSize(), and globalIndex::reset().
|
inline |
Prefer localStart() to avoid confusing with offsets()
Definition at line 1186 of file globalIndex.H.
References globalIndex::localStart().
|
inline |
Reset as 'one-sided' from local sizes [gather, but no broadcast] Will be empty on non-master processes.
comm | communicator |
Definition at line 1196 of file globalIndex.H.
References globalIndex::localSize(), and globalIndex::reset().
Foam::labelList calcListOffsets | ( | const List< SubListType > & | lists, |
const bool | checkOverflow | ||
) |
Definition at line 29 of file globalIndexTemplates.C.
References UList< T >::size(), and Foam::HashTableOps::values().
|
friend |
|
friend |
Copyright © 2011-2018 OpenFOAM | OPENFOAM® is a registered trademark of OpenCFD Ltd.