globalIndex Class Reference

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...
 

Public Types

enum  accessType : char { OFFSETS, SIZES }
 Disambiguation tag (list construction dispatch) More...
 

Public Member Functions

 globalIndex ()=default
 Default construct. More...
 
 globalIndex (const labelUList &listOffsets)
 
 globalIndex (labelList &&listOffsets)
 
 globalIndex (const labelUList &offsetsOrSizes, enum accessType accType)
 
 globalIndex (const label localSize)
 Construct from local size. More...
 
 globalIndex (const label localSize, const int tag, const label comm, const bool parallel)
 Construct from local size. More...
 
 globalIndex (Istream &is)
 
bool empty () const
 Check for default constructed or global sum == 0. More...
 
label size () const
 Global sum of localSizes. More...
 
labelList sizes () const
 The local sizes. More...
 
const labelUList localStarts () const
 The local starts. More...
 
label maxSize () const
 Global max of localSizes. More...
 
const labelListoffsets () const noexcept
 Const-access to the offsets. 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...
 
labelListoffsets () noexcept
 Write-access to the offsets, for changing after construction. More...
 
void reset (const label localSize)
 Reset from local size. More...
 
void reset (const label localSize, const int tag, const label comm, const bool parallel)
 Reset from local size. More...
 
void reset (const labelUList &sizes, const bool checkOverflow=false)
 
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< labelRangeranges () 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 (labelList &labels) const
 From local to global index (inplace) More...
 
label toLocal (const label i) const
 From global to local on current processor. More...
 
label offset (const label proci) const
 Start of proci data. 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, labelList &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 come from? Binary search. 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 Pstream::commsTypes commsType=Pstream::commsTypes::nonBlocking) const
 Collect data in processor order on master (== procIDs[0]). More...
 
template<class Type >
void gather (const UList< Type > &fld, List< Type > &allFld, const int tag=UPstream::msgType(), const Pstream::commsTypes=Pstream::commsTypes::nonBlocking, const label comm=UPstream::worldComm) const
 Collect data in processor order on master. More...
 
template<class Type , class Addr >
void gather (const IndirectListBase< Type, Addr > &fld, List< Type > &allFld, const int tag=UPstream::msgType(), const Pstream::commsTypes=Pstream::commsTypes::scheduled, const label comm=UPstream::worldComm) const
 Collect data indirectly in processor order on master. More...
 
template<class ProcIDsContainer , class Type >
void gather (const label comm, const ProcIDsContainer &procIDs, List< Type > &fld, const int tag=UPstream::msgType(), const Pstream::commsTypes commsType=Pstream::commsTypes::nonBlocking) const
 
template<class Type >
void gather (List< Type > &fld, const int tag=UPstream::msgType(), const Pstream::commsTypes=Pstream::commsTypes::nonBlocking, const label comm=UPstream::worldComm) const
 Inplace collect data in processor order on master. More...
 
template<class Type , class OutputContainer = List<Type>>
void mpiGather (const UList< Type > &sendData, OutputContainer &allValues, const label comm=UPstream::worldComm) const
 Collect contiguous data using a MPI_Gatherv call. More...
 
template<class Type , class OutputContainer = List<Type>>
OutputContainer mpiGather (const UList< Type > &sendData, const label comm=UPstream::worldComm) const
 Collect contiguous data using a MPI_Gatherv call. 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 Pstream::commsTypes commsType=Pstream::commsTypes::nonBlocking) const
 Distribute data in processor order. Requires fld to be sized! More...
 
template<class Type >
void scatter (const UList< Type > &allFld, UList< Type > &fld, const int tag=UPstream::msgType(), const Pstream::commsTypes=Pstream::commsTypes::nonBlocking, const label comm=UPstream::worldComm) const
 Distribute data in processor order. Requires fld to be sized! 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
 
template<class SubListType >
Foam::labelList calcListOffsets (const List< SubListType > &lists, const bool checkOverflow)
 

Static Public Member Functions

static labelList calcOffsets (const labelUList &localSizes, const bool checkOverflow=false)
 
template<class SubListType >
static labelList calcListOffsets (const List< SubListType > &lists, const bool checkOverflow=false)
 
static List< labelRangecalcRanges (const labelUList &localSizes, const bool checkOverflow=false)
 
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 Pstream::commsTypes=Pstream::commsTypes::nonBlocking)
 Collect data in processor order on master (== procIDs[0]). More...
 
template<class Type , class Addr >
static void gather (const labelUList &offsets, const label comm, const UList< int > &procIDs, const IndirectListBase< Type, Addr > &fld, List< Type > &allFld, const int tag=UPstream::msgType(), const Pstream::commsTypes=Pstream::commsTypes::scheduled)
 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 Pstream::commsTypes=Pstream::commsTypes::nonBlocking)
 
template<class Type >
static void gatherOp (const UList< Type > &fld, List< Type > &allFld, const int tag=UPstream::msgType(), const Pstream::commsTypes=Pstream::commsTypes::nonBlocking)
 Collect data in processor order on master. More...
 
template<class Type >
static void gatherOp (List< Type > &fld, const int tag=UPstream::msgType(), const Pstream::commsTypes=Pstream::commsTypes::nonBlocking)
 Inplace collect data in processor order on master. 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 Pstream::commsTypes=Pstream::commsTypes::nonBlocking)
 Distribute data in processor order. Requires fld to be sized! More...
 

Friends

Istreamoperator>> (Istream &is, globalIndex &gi)
 
Ostreamoperator<< (Ostream &os, const globalIndex &gi)
 

Detailed Description

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);

Source files

Definition at line 68 of file globalIndex.H.

Member Enumeration Documentation

◆ accessType

enum accessType : char

Disambiguation tag (list construction dispatch)

Enumerator
OFFSETS 
SIZES 

Definition at line 93 of file globalIndex.H.

Constructor & Destructor Documentation

◆ globalIndex() [1/7]

globalIndex ( )
default

Default construct.

◆ globalIndex() [2/7]

globalIndex ( const labelUList listOffsets)
inlineexplicit

Copy construct from a list of offsets. No communication required

Definition at line 35 of file globalIndexI.H.

References UList< T >::size().

Here is the call graph for this function:

◆ globalIndex() [3/7]

globalIndex ( labelList &&  listOffsets)
inlineexplicit

Move construct from a list of offsets. No communication required

Definition at line 47 of file globalIndexI.H.

References UList< T >::size().

Here is the call graph for this function:

◆ globalIndex() [4/7]

globalIndex ( const labelUList offsetsOrSizes,
enum accessType  accType 
)
inline

Copy construct from a list of offsets or sizes. No communication required

Definition at line 63 of file globalIndexI.H.

References reset(), and UList< T >::size().

Here is the call graph for this function:

◆ globalIndex() [5/7]

globalIndex ( const label  localSize)
inlineexplicit

Construct from local size.

Communication with default communicator and message tag.

Definition at line 80 of file globalIndexI.H.

References globalIndex::localSize(), and globalIndex::reset().

Here is the call graph for this function:

◆ globalIndex() [6/7]

globalIndex ( const label  localSize,
const int  tag,
const label  comm,
const bool  parallel 
)
inline

Construct from local size.

Communication with given communicator and message tag, unless parallel == false

Parameters
tagmessage tag
commcommunicator
paralleluse parallel comms

Definition at line 87 of file globalIndexI.H.

References reset().

Here is the call graph for this function:

◆ globalIndex() [7/7]

globalIndex ( Istream is)
explicit

Construct from Istream. No communication required

Definition at line 111 of file globalIndex.C.

Member Function Documentation

◆ empty()

bool empty ( ) const
inline

Check for default constructed or global sum == 0.

Definition at line 100 of file globalIndexI.H.

◆ size()

Foam::label size ( ) const
inline

Global sum of localSizes.

Definition at line 151 of file globalIndexI.H.

Referenced by nearWallFields::calcAddressing(), distributedTriSurfaceMesh::globalSize(), globalIndex::mpiGather(), regionSplit::nRegions(), SprayCloud< Foam::DSMCCloud >::penetration(), and fileWriter::writeProcIDs().

Here is the caller graph for this function:

◆ sizes()

Foam::labelList sizes ( ) const

The local sizes.

Definition at line 265 of file globalIndex.C.

References Foam::HashTableOps::values().

Here is the call graph for this function:

◆ localStarts()

const Foam::labelUList localStarts ( ) const
inline

The local starts.

Definition at line 141 of file globalIndexI.H.

References UList< T >::null().

Here is the call graph for this function:

◆ maxSize()

Foam::label maxSize ( ) const
inline

Global max of localSizes.

Definition at line 193 of file globalIndexI.H.

Referenced by Foam::ensightOutput::writeCloudPositions(), and Foam::ensightOutput::Detail::writeFieldContent().

Here is the caller graph for this function:

◆ offsets() [1/2]

const Foam::labelList & offsets ( ) const
inlinenoexcept

Const-access to the offsets.

Definition at line 129 of file globalIndexI.H.

◆ nProcs()

Foam::label nProcs ( ) const
inlinenoexcept

The number of processors covered by the offsets.

Definition at line 106 of file globalIndexI.H.

Referenced by globalIndex::mpiGather().

Here is the caller graph for this function:

◆ allProcs()

Foam::labelRange allProcs ( ) const
inlinenoexcept

Range of process indices for all addressed offsets (processes)

Definition at line 113 of file globalIndexI.H.

◆ subProcs()

Foam::labelRange subProcs ( ) const
inlinenoexcept

Range of process indices for addressed sub-offsets (processes)

Definition at line 121 of file globalIndexI.H.

Referenced by Foam::ensightOutput::writeCloudField(), Foam::ensightOutput::writeCloudPositions(), Foam::ensightOutput::Detail::writeFieldContent(), Foam::vtk::writeListParallel(), and Foam::vtk::writeListsParallel().

Here is the caller graph for this function:

◆ offsets() [2/2]

Foam::labelList & offsets ( )
inlinenoexcept

Write-access to the offsets, for changing after construction.

Definition at line 135 of file globalIndexI.H.

◆ reset() [1/3]

void reset ( const label  localSize)
inline

Reset from local size.

Does communication with default communicator and message tag.

Definition at line 157 of file globalIndexI.H.

References UPstream::msgType(), reset(), and UPstream::worldComm.

Referenced by globalMeshData::globalEdgeNumbering(), globalIndex::globalIndex(), globalMeshData::globalPointNumbering(), distributedTriSurfaceMesh::globalTris(), Foam::ensightOutput::writeCloudField(), and Foam::ensightOutput::Detail::writeFieldContent().

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

◆ reset() [2/3]

void reset ( const label  localSize,
const int  tag,
const label  comm,
const bool  parallel 
)

Reset from local size.

Does communication with given communicator and message tag, unless parallel == false

Parameters
tagmessage tag
commcommunicator
paralleluse parallel comms

Definition at line 180 of file globalIndex.C.

References Pstream::gatherList(), UPstream::myProcNo(), UPstream::nProcs(), reset(), Pstream::scatterList(), and Foam::Zero.

Here is the call graph for this function:

◆ reset() [3/3]

void reset ( const labelUList sizes,
const bool  checkOverflow = false 
)

Reset from list of local sizes, with optional check for label overflow. No communication required

Definition at line 211 of file globalIndex.C.

References Foam::exit(), Foam::FatalError, FatalErrorInFunction, Foam::flatOutput(), Foam::labelMax, Foam::nl, and UList< T >::size().

Here is the call graph for this function:

◆ setLocalSize()

void setLocalSize ( const label  proci,
const label  len 
)

Alter local size for given processor.

Definition at line 247 of file globalIndex.C.

References delta.

◆ localStart() [1/2]

Foam::label localStart ( ) const
inline

My local start.

Definition at line 175 of file globalIndexI.H.

References UPstream::myProcNo().

Referenced by viewFactor::calculate(), cellCellStencil::globalCellCells(), lduPrimitiveMesh::globalCellCells(), globalIndex::mpiGather(), patchMeshWriter::writeGeometry(), polyWriter::writeLineGeometry(), polyWriter::writePolyGeometry(), and patchMeshWriter::writePolys().

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

◆ localSize() [1/2]

Foam::label localSize ( ) const
inline

My local size.

Definition at line 187 of file globalIndexI.H.

References UPstream::myProcNo().

Referenced by createShellMesh::calcPointRegions(), viewFactor::calculate(), mapDistributeBase::exchangeAddressing(), cellCellStencil::globalCellCells(), globalIndex::globalIndex(), globalIndex::mpiGather(), regionSplit::nLocalRegions(), SprayCloud< Foam::DSMCCloud >::penetration(), Foam::ensightOutput::writeCloudField(), Foam::ensightOutput::writeCloudPositions(), Foam::ensightOutput::Detail::writeFieldContent(), Foam::vtk::writeListParallel(), Foam::vtk::writeListsParallel(), and fileWriter::writeProcIDs().

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

◆ maxNonLocalSize() [1/2]

Foam::label maxNonLocalSize ( ) const
inline

The max of localSizes, excluding current processor.

Definition at line 200 of file globalIndexI.H.

References UPstream::myProcNo().

Referenced by Foam::ensightOutput::writeCloudField(), Foam::vtk::writeListParallel(), and Foam::vtk::writeListsParallel().

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

◆ range() [1/2]

Foam::labelRange range ( ) const
inline

Return start/size range of local processor data.

Definition at line 212 of file globalIndexI.H.

References UPstream::myProcNo(), and range.

Here is the call graph for this function:

◆ ranges()

Foam::List< Foam::labelRange > ranges ( ) const

Return start/size ranges for all data.

Definition at line 288 of file globalIndex.C.

References Foam::HashTableOps::values().

Here is the call graph for this function:

◆ isLocal() [1/2]

bool isLocal ( const label  i) const
inline

Is on local processor.

Definition at line 224 of file globalIndexI.H.

References UPstream::myProcNo().

Referenced by decompositionMethod::calcCellCells(), mapDistributeBase::calcCompactAddressing(), addPatchCellLayer::calcExtrudeInfo(), and mapDistributeBase::renumber().

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

◆ toGlobal() [1/4]

Foam::label toGlobal ( const label  i) const
inline

From local to global index.

Definition at line 240 of file globalIndexI.H.

References UPstream::myProcNo().

Referenced by nearWallFields::calcAddressing(), decompositionMethod::calcCellCells(), createShellMesh::calcPointRegions(), viewFactor::calculate(), cellCellStencil::globalCellCells(), addPatchCellLayer::globalEdgeFaces(), viewFactor::insertMatrixElements(), inverseDistance::markDonors(), globalMeshData::mergePoints(), MGridGenGAMGAgglomeration::MGridGenGAMGAgglomeration(), regionSplit2D::regionSplit2D(), addPatchCellLayer::setRefinement(), and cellVolumeWeight::update().

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

◆ toGlobal() [2/4]

Foam::labelList toGlobal ( const labelUList labels) const
inline

From local to global index.

Definition at line 260 of file globalIndexI.H.

References UPstream::myProcNo().

Here is the call graph for this function:

◆ inplaceToGlobal() [1/2]

void inplaceToGlobal ( labelList labels) const
inline

From local to global index (inplace)

Definition at line 283 of file globalIndexI.H.

References UPstream::myProcNo().

Referenced by faceAreaWeightAMI2D::calculate(), and faceAreaWeightAMI::calculate().

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

◆ toLocal() [1/2]

Foam::label toLocal ( const label  i) const
inline

From global to local on current processor.

FatalError if not on local processor.

Definition at line 305 of file globalIndexI.H.

References UPstream::myProcNo().

Referenced by fvMeshPrimitiveLduAddressing::addAddressing(), decompositionMethod::calcCellCells(), mapDistributeBase::calcCompactAddressing(), addPatchCellLayer::calcExtrudeInfo(), distributedTriSurfaceMesh::localQueries(), and mapDistributeBase::renumber().

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

◆ offset()

Foam::label offset ( const label  proci) const
inline

Start of proci data.

Definition at line 163 of file globalIndexI.H.

Referenced by SprayCloud< Foam::DSMCCloud >::penetration(), and Foam::vtk::writeListParallel().

Here is the caller graph for this function:

◆ localStart() [2/2]

Foam::label localStart ( const label  proci) const
inline

Start of proci data.

Definition at line 169 of file globalIndexI.H.

◆ localSize() [2/2]

Foam::label localSize ( const label  proci) const
inline

Size of proci data.

Definition at line 181 of file globalIndexI.H.

◆ maxNonLocalSize() [2/2]

Foam::label maxNonLocalSize ( const label  proci) const

The max of localSizes, excluding the specified processor.

Definition at line 314 of file globalIndex.C.

References Foam::max().

Here is the call graph for this function:

◆ range() [2/2]

Foam::labelRange range ( const label  proci) const
inline

Return start/size range of proci data.

Definition at line 206 of file globalIndexI.H.

◆ isLocal() [2/2]

bool isLocal ( const label  proci,
const label  i 
) const
inline

Is on processor proci.

Definition at line 218 of file globalIndexI.H.

◆ toGlobal() [3/4]

Foam::label toGlobal ( const label  proci,
const label  i 
) const
inline

From local to global on proci.

Definition at line 231 of file globalIndexI.H.

◆ toGlobal() [4/4]

Foam::labelList toGlobal ( const label  proci,
const labelUList labels 
) const
inline

From local to global on proci.

Definition at line 247 of file globalIndexI.H.

◆ inplaceToGlobal() [2/2]

void inplaceToGlobal ( const label  proci,
labelList labels 
) const
inline

From local to global index on proci (inplace)

Definition at line 269 of file globalIndexI.H.

◆ toLocal() [2/2]

Foam::label toLocal ( const label  proci,
const label  i 
) const
inline

From global to local on proci.

Definition at line 290 of file globalIndexI.H.

References Foam::abort(), Foam::FatalError, FatalErrorInFunction, and Foam::nl.

Here is the call graph for this function:

◆ whichProcID()

Foam::label whichProcID ( const label  i) const
inline

Which processor does global come from? Binary search.

Definition at line 311 of file globalIndexI.H.

References Foam::abort(), Foam::FatalError, FatalErrorInFunction, and Foam::findLower().

Referenced by fvMeshPrimitiveLduAddressing::addAddressing(), mapDistributeBase::calcCompactAddressing(), addPatchCellLayer::calcExtrudeInfo(), distributedTriSurfaceMesh::findNearest(), distributedTriSurfaceMesh::localQueries(), and mapDistributeBase::renumber().

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

◆ cbegin()

Foam::globalIndex::const_iterator cbegin ( ) const
inlinenoexcept

A const_iterator set to the beginning.

Definition at line 437 of file globalIndexI.H.

◆ cend()

const Foam::globalIndex::const_iterator cend ( ) const
inlinenoexcept

A const_iterator set to beyond the end.

Definition at line 444 of file globalIndexI.H.

◆ begin()

Foam::globalIndex::const_iterator begin ( ) const
inlinenoexcept

A const_iterator set to the beginning.

Definition at line 451 of file globalIndexI.H.

◆ end()

const Foam::globalIndex::const_iterator end ( ) const
inlinenoexcept

A const_iterator set to beyond the end.

Definition at line 458 of file globalIndexI.H.

◆ calcOffsets()

Foam::labelList calcOffsets ( const labelUList localSizes,
const bool  checkOverflow = false 
)
static

Calculate offsets from a list of local sizes, with optional check for label overflow

Definition at line 36 of file globalIndex.C.

References Foam::exit(), Foam::FatalError, FatalErrorInFunction, Foam::flatOutput(), Foam::labelMax, Foam::nl, UList< T >::size(), and Foam::HashTableOps::values().

Here is the call graph for this function:

◆ calcListOffsets() [1/2]

static labelList calcListOffsets ( const List< SubListType > &  lists,
const bool  checkOverflow = false 
)
static

Calculate offsets from list of lists, with optional check for label overflow

◆ calcRanges()

Foam::List< Foam::labelRange > calcRanges ( const labelUList localSizes,
const bool  checkOverflow = false 
)
static

Calculate ranges (offset/size) from a list of local sizes, with optional check for label overflow

Definition at line 74 of file globalIndex.C.

References Foam::exit(), Foam::FatalError, FatalErrorInFunction, Foam::flatOutput(), Foam::labelMax, Foam::nl, UList< T >::size(), and Foam::HashTableOps::values().

Here is the call graph for this function:

◆ gather() [1/8]

void gather ( const labelUList offsets,
const label  comm,
const ProcIDsContainer &  procIDs,
const UList< Type > &  fld,
List< Type > &  allFld,
const int  tag = UPstream::msgType(),
const Pstream::commsTypes  commsType = Pstream::commsTypes::nonBlocking 
)
static

Collect data in processor order on master (== procIDs[0]).

Offsets needed on master only.

Parameters
commcommunicator

Definition at line 75 of file globalIndexTemplates.C.

References Foam::exit(), Foam::FatalError, FatalErrorInFunction, fld, UList< T >::last(), Foam::blockMeshTools::read(), List< T >::resize_nocopy(), and Foam::vtk::write().

Referenced by globalIndex::gather(), PatchTools::gatherAndMerge(), and GAMGAgglomeration::procAgglomerateRestrictAddressing().

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

◆ gather() [2/8]

void gather ( const labelUList offsets,
const label  comm,
const UList< int > &  procIDs,
const IndirectListBase< Type, Addr > &  fld,
List< Type > &  allFld,
const int  tag = UPstream::msgType(),
const Pstream::commsTypes  commsType = Pstream::commsTypes::scheduled 
)
static

Collect indirect data in processor order on master.

Offsets needed on master only.

Parameters
commcommunicator

Definition at line 230 of file globalIndexTemplates.C.

References Foam::exit(), Foam::FatalError, fld, UList< T >::last(), List< T >::resize_nocopy(), UList< T >::size(), and WarningInFunction.

Here is the call graph for this function:

◆ gather() [3/8]

void gather ( const label  comm,
const ProcIDsContainer &  procIDs,
const UList< Type > &  fld,
List< Type > &  allFld,
const int  tag = UPstream::msgType(),
const Pstream::commsTypes  commsType = Pstream::commsTypes::nonBlocking 
) const
inline

Collect data in processor order on master (== procIDs[0]).

Offsets needed on master only.

Parameters
commcommunicator

Definition at line 413 of file globalIndex.H.

References fld, and globalIndex::gather().

Here is the call graph for this function:

◆ gather() [4/8]

void gather ( const UList< Type > &  fld,
List< Type > &  allFld,
const int  tag = UPstream::msgType(),
const Pstream::commsTypes  commsType = Pstream::commsTypes::nonBlocking,
const label  comm = UPstream::worldComm 
) const

Collect data in processor order on master.

Does communication with default communicator and message tag.

Parameters
commcommunicator

Definition at line 294 of file globalIndexTemplates.C.

References fld.

◆ gather() [5/8]

void gather ( const IndirectListBase< Type, Addr > &  fld,
List< Type > &  allFld,
const int  tag = UPstream::msgType(),
const Pstream::commsTypes  commsType = Pstream::commsTypes::scheduled,
const label  comm = UPstream::worldComm 
) const

Collect data indirectly in processor order on master.

Does communication with default communicator and message tag.

Parameters
commcommunicator

Definition at line 316 of file globalIndexTemplates.C.

References fld.

◆ gather() [6/8]

void gather ( const labelUList offsets,
const label  comm,
const ProcIDsContainer &  procIDs,
List< Type > &  fld,
const int  tag = UPstream::msgType(),
const Pstream::commsTypes  commsType = Pstream::commsTypes::nonBlocking 
)
static

Inplace collect in processor order on master (== procIDs[0]). Needs offsets only on master.

Parameters
commcommunicator

Definition at line 339 of file globalIndexTemplates.C.

References fld.

◆ gather() [7/8]

void gather ( const label  comm,
const ProcIDsContainer &  procIDs,
List< Type > &  fld,
const int  tag = UPstream::msgType(),
const Pstream::commsTypes  commsType = Pstream::commsTypes::nonBlocking 
) const
inline

Inplace collect in processor order on master (== procIDs[0]). Needs offsets only on master.

Parameters
commcommunicator

Definition at line 467 of file globalIndex.H.

References fld, and globalIndex::gather().

Here is the call graph for this function:

◆ gather() [8/8]

void gather ( List< Type > &  fld,
const int  tag = UPstream::msgType(),
const Pstream::commsTypes  commsType = Pstream::commsTypes::nonBlocking,
const label  comm = UPstream::worldComm 
) const

Inplace collect data in processor order on master.

Does communication with default communicator and message tag. After the gather, the field is zero-sized on the slaves.

Parameters
commcommunicator

Definition at line 361 of file globalIndexTemplates.C.

References fld.

◆ mpiGather() [1/2]

void mpiGather ( const UList< Type > &  sendData,
OutputContainer &  allValues,
const label  comm = UPstream::worldComm 
) const

Collect contiguous data using a MPI_Gatherv call.

Attention
The nProcs for globalIndex and communicator must match!!
Parameters
commcommunicator

Definition at line 393 of file globalIndexTemplates.C.

References Foam::abort(), UList< T >::cdata_bytes(), Foam::FatalError, FatalErrorInFunction, globalIndex::localSize(), globalIndex::localStart(), Foam::nl, globalIndex::nProcs(), List< T >::resize(), List< T >::resize_nocopy(), globalIndex::size(), and UList< T >::size_bytes().

Here is the call graph for this function:

◆ mpiGather() [2/2]

OutputContainer mpiGather ( const UList< Type > &  sendData,
const label  comm = UPstream::worldComm 
) const

Collect contiguous data using a MPI_Gatherv call.

Attention
The nProcs for globalIndex and communicator must match!!
Parameters
commcommunicator

Definition at line 459 of file globalIndexTemplates.C.

◆ gatherOp() [1/2]

void gatherOp ( const UList< Type > &  fld,
List< Type > &  allFld,
const int  tag = UPstream::msgType(),
const Pstream::commsTypes  commsType = Pstream::commsTypes::nonBlocking 
)
static

Collect data in processor order on master.

Does communication with default communicator and message tag.

Definition at line 472 of file globalIndexTemplates.C.

References fld.

Referenced by sampledSet::gather(), mergedSurf::merge(), and surfaceWriter::mergeFieldTemplate().

Here is the caller graph for this function:

◆ gatherOp() [2/2]

void gatherOp ( List< Type > &  fld,
const int  tag = UPstream::msgType(),
const Pstream::commsTypes  commsType = Pstream::commsTypes::nonBlocking 
)
static

Inplace collect data in processor order on master.

Does communication with default communicator and message tag. After the gather, the field is zero-sized on the slaves.

Definition at line 485 of file globalIndexTemplates.C.

References fld.

◆ scatter() [1/3]

void scatter ( const labelUList offsets,
const label  comm,
const ProcIDsContainer &  procIDs,
const UList< Type > &  allFld,
UList< Type > &  fld,
const int  tag = UPstream::msgType(),
const Pstream::commsTypes  commsType = Pstream::commsTypes::nonBlocking 
)
static

Distribute data in processor order. Requires fld to be sized!

Parameters
commcommunicator

Definition at line 497 of file globalIndexTemplates.C.

References Foam::exit(), Foam::FatalError, FatalErrorInFunction, fld, Foam::blockMeshTools::read(), and Foam::vtk::write().

Referenced by globalIndex::scatter().

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

◆ scatter() [2/3]

void scatter ( const label  comm,
const ProcIDsContainer &  procIDs,
const UList< Type > &  allFld,
UList< Type > &  fld,
const int  tag = UPstream::msgType(),
const Pstream::commsTypes  commsType = Pstream::commsTypes::nonBlocking 
) const
inline

Distribute data in processor order. Requires fld to be sized!

Parameters
commcommunicator

Definition at line 554 of file globalIndex.H.

References fld, and globalIndex::scatter().

Here is the call graph for this function:

◆ scatter() [3/3]

void scatter ( const UList< Type > &  allFld,
UList< Type > &  fld,
const int  tag = UPstream::msgType(),
const Pstream::commsTypes  commsType = Pstream::commsTypes::nonBlocking,
const label  comm = UPstream::worldComm 
) const

Distribute data in processor order. Requires fld to be sized!

Does communication with default communicator and message tag.

Parameters
commcommunicator

Definition at line 649 of file globalIndexTemplates.C.

References fld.

◆ get()

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

Parameters
commcommunicator

Definition at line 672 of file globalIndexTemplates.C.

References PstreamBuffers::finishedSends(), fld, forAll, CompactListList< T, Container >::offsets(), os(), List< T >::resize_nocopy(), and UList< T >::size().

Here is the call graph for this function:

◆ calcListOffsets() [2/2]

Foam::labelList calcListOffsets ( const List< SubListType > &  lists,
const bool  checkOverflow 
)

Definition at line 36 of file globalIndexTemplates.C.

References Foam::exit(), Foam::FatalError, FatalErrorInFunction, Foam::labelMax, Foam::nl, and Foam::HashTableOps::values().

Here is the call graph for this function:

Friends And Related Function Documentation

◆ operator>>

Istream& operator>> ( Istream is,
globalIndex gi 
)
friend

◆ operator<<

Ostream& operator<< ( Ostream os,
const globalIndex gi 
)
friend

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