Classes | Public Types | Public Member Functions | Static Public Member Functions | Friends | List of all members
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...
 
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 labelListoffsets () const noexcept
 Const-access to the offsets. More...
 
labelListoffsets () 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< 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 (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< labelRangecalcRanges (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

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 62 of file globalIndex.H.

Member Enumeration Documentation

◆ accessType

enum accessType : char

Disambiguation tag (list construction dispatch)

Enumerator
OFFSETS 
SIZES 

Definition at line 102 of file globalIndex.H.

Constructor & Destructor Documentation

◆ globalIndex() [1/12]

globalIndex ( )
defaultnoexcept

Default construct (empty)

◆ globalIndex() [2/12]

globalIndex ( const labelUList listOffsets)
inlineexplicit

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

Definition at line 27 of file globalIndexI.H.

References UList< T >::size().

Here is the call graph for this function:

◆ globalIndex() [3/12]

globalIndex ( labelList &&  listOffsets)
inlineexplicit

Move construct from a list of offsets. No communication required.

Definition at line 39 of file globalIndexI.H.

References UList< T >::size().

Here is the call graph for this function:

◆ globalIndex() [4/12]

globalIndex ( const labelUList offsetsOrSizes,
enum accessType  accType 
)
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().

Here is the call graph for this function:

◆ globalIndex() [5/12]

globalIndex ( const label  localSize,
const label  comm = UPstream::worldComm,
const bool  parallel = UPstream::parRun() 
)
inlineexplicit

Construct from local size, using gather/broadcast with default/specified communicator if parallel.

Parameters
commcommunicator
paralleluse parallel comms

Definition at line 73 of file globalIndexI.H.

◆ globalIndex() [6/12]

globalIndex ( const globalIndex::gatherNone  ,
const label  localSize,
const label  comm = -1 
)
inline

Construct with a single (local size) entry, no communication.

Parameters
commno communicator needed

Definition at line 84 of file globalIndexI.H.

◆ globalIndex() [7/12]

globalIndex ( const globalIndex::gatherOnly  ,
const label  localSize,
const label  comm = UPstream::worldComm 
)
inline

Construct 'one-sided' from local sizes. Uses UPstream::listGatherValues, but no broadcast. Will be empty on non-master processes.

Note
can be used when Pstream::parRun() is false.
Parameters
commcommunicator

Definition at line 98 of file globalIndexI.H.

◆ globalIndex() [8/12]

globalIndex ( const globalIndex::gatherNonLocal  ,
const label  localSize,
const label  comm = UPstream::worldComm 
)
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.

Note
can be used when Pstream::parRun() is false.
Parameters
commcommunicator

Definition at line 110 of file globalIndexI.H.

◆ globalIndex() [9/12]

globalIndex ( Istream is)
explicit

Construct from Istream. No communication required.

Definition at line 115 of file globalIndex.C.

◆ globalIndex() [10/12]

globalIndex ( const label  localSize,
const globalIndex::gatherNone  ,
const label  comm = -1 
)
inline

Construct with a single (local size) entry, no communication.

Parameters
commno communicator needed

Definition at line 1128 of file globalIndex.H.

◆ globalIndex() [11/12]

globalIndex ( const label  localSize,
const globalIndex::gatherOnly  ,
const label  comm = UPstream::worldComm 
)
inline

Construct 'one-sided' from local sizes.

Definition at line 1141 of file globalIndex.H.

◆ globalIndex() [12/12]

globalIndex ( const label  localSize,
const int  tag,
const label  comm,
const bool  parallel 
)
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().

Here is the call graph for this function:

Member Function Documentation

◆ empty()

bool empty ( ) const
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().

Here is the call graph for this function:

◆ size()

Foam::label size ( ) const
inline

Global sum of localSizes. Same as totalSize()

Definition at line 143 of file globalIndexI.H.

◆ totalSize()

Foam::label totalSize ( ) const
inline

◆ sizes()

Foam::labelList sizes ( ) const
inline

The local sizes. Same as localSizes()

Definition at line 149 of file globalIndexI.H.

◆ localStarts()

const Foam::labelUList localStarts ( ) const
inline

The local starts.

Definition at line 196 of file globalIndexI.H.

References UList< label >::null().

Here is the call graph for this function:

◆ localSizes()

Foam::labelList localSizes ( ) const

The local sizes.

Definition at line 271 of file globalIndex.C.

References Foam::HashTableOps::values().

Here is the call graph for this function:

◆ maxSize()

Foam::label maxSize ( ) const
inline

Global max of localSizes.

Definition at line 230 of file globalIndexI.H.

◆ offsets() [1/2]

const Foam::labelList & offsets ( ) const
inlinenoexcept

Const-access to the offsets.

Definition at line 178 of file globalIndexI.H.

Referenced by surfaceNoise::calculate(), and globalIndex::gather().

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 184 of file globalIndexI.H.

◆ nProcs()

Foam::label nProcs ( ) const
inlinenoexcept

The number of processors covered by the offsets.

Definition at line 155 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 162 of file globalIndexI.H.

◆ subProcs()

Foam::labelRange subProcs ( ) const
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().

Here is the caller graph for this function:

◆ clear()

void clear ( )
inline

Reset to be empty (no offsets)

Definition at line 190 of file globalIndexI.H.

Referenced by mergedSurf::clear().

Here is the caller graph for this function:

◆ reset() [1/7]

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.

Parameters
commcommunicator
paralleluse 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().

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

◆ reset() [2/7]

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

Here is the call graph for this function:

◆ reset() [3/7]

void reset ( const globalIndex::gatherNone  ,
const label  localSize,
const label  comm = -1 
)
inline

Reset to a single (local size) entry, no communication.

Parameters
commno communicator needed

Definition at line 365 of file globalIndexI.H.

◆ reset() [4/7]

void reset ( const globalIndex::gatherOnly  ,
const label  localSize,
const label  comm = UPstream::worldComm 
)
inline

Reset as 'one-sided' from local sizes. Uses UPstream::listGatherValues, but no broadcast. Will be empty on non-master processes.

Note
can be used when Pstream::parRun() is false.
Parameters
commcommunicator

Definition at line 378 of file globalIndexI.H.

References UPstream::listGatherValues().

Here is the call graph for this function:

◆ reset() [5/7]

void reset ( const globalIndex::gatherNonLocal  ,
const label  localSize,
const label  comm = UPstream::worldComm 
)
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.

Note
can be used when Pstream::parRun() is false.
Parameters
commcommunicator

Definition at line 390 of file globalIndexI.H.

References UPstream::listGatherValues(), and UPstream::master().

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 253 of file globalIndex.C.

References delta.

◆ localStart() [1/2]

Foam::label localStart ( ) const
inline

◆ localSize() [1/2]

Foam::label localSize ( ) const
inline

◆ maxNonLocalSize() [1/2]

Foam::label maxNonLocalSize ( ) const
inline

The max of localSizes, excluding current processor.

Definition at line 237 of file globalIndexI.H.

References UPstream::myProcNo().

Here is the call graph for this function:

◆ range() [1/2]

Foam::labelRange range ( ) const
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().

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

◆ ranges()

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

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

◆ toGlobal() [2/4]

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

From local to global index.

Definition at line 297 of file globalIndexI.H.

References UPstream::myProcNo().

Here is the call graph for this function:

◆ inplaceToGlobal() [1/2]

void inplaceToGlobal ( labelUList labels) const
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().

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

Here is the call graph for this function:
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 206 of file globalIndexI.H.

◆ localSize() [2/2]

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

Size of proci data.

Definition at line 218 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 320 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 243 of file globalIndexI.H.

◆ isLocal() [2/2]

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

Is on processor proci.

Definition at line 255 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 268 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 284 of file globalIndexI.H.

◆ inplaceToGlobal() [2/2]

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

From local to global index on proci (inplace)

Definition at line 306 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 327 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 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().

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 520 of file globalIndexI.H.

◆ cend()

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

A const_iterator set to beyond the end.

Definition at line 527 of file globalIndexI.H.

◆ begin()

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

A const_iterator set to the beginning.

Definition at line 534 of file globalIndexI.H.

◆ end()

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

A const_iterator set to beyond the end.

Definition at line 541 of file globalIndexI.H.

◆ calcOffsets()

Foam::labelList calcOffsets ( const labelUList localLens,
const bool  checkOverflow = false 
)
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().

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 localLens,
const bool  checkOverflow = false 
)
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().

Here is the call graph for this function:

◆ gatherValues()

void gatherValues ( const label  comm,
const ProcIDsContainer &  procIDs,
const Type &  localValue,
List< Type > &  allValues,
const int  tag = UPstream::msgType(),
const UPstream::commsTypes  preferredCommsType = UPstream::commsTypes::nonBlocking 
)
static

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

Handles contiguous/non-contiguous data.

Parameters
commcommunicator
tagoutput 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().

Here is the call graph for this function:

◆ gather() [1/9]

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  preferredCommsType = UPstream::commsTypes::nonBlocking 
)
static

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

Handles contiguous/non-contiguous data, skips empty fields.

Parameters
offsetsoffsets (master only)
commcommunicator
tagoutput 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().

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

◆ gather() [2/9]

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  preferredCommsType = UPstream::commsTypes::nonBlocking 
)
static

Collect indirect data in processor order on master.

Handles contiguous/non-contiguous data, skips empty fields.

Parameters
offsetsoffsets (master only)
commcommunicator
tagoutput 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().

Here is the call graph for this function:

◆ gather() [3/9]

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

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

Note: adjust naming?

Parameters
offsetsoffsets (master only)
commcommunicator
fldin/out field

Definition at line 665 of file globalIndex.H.

References fld, globalIndex::gather(), UPstream::myProcNo(), and globalIndex::offsets().

Here is the call graph for this function:

◆ gather() [4/9]

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
inline

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

Note
the globalIndex offsets needed on master only.
Parameters
commcommunicator
fldinput field
tagoutput field (master only)

Definition at line 691 of file globalIndex.H.

References fld, and globalIndex::gather().

Here is the call graph for this function:

◆ gather() [5/9]

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

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

Note
the globalIndex offsets needed on master only. Note: adjust naming?
Parameters
commcommunicator
fldin/out field

Definition at line 711 of file globalIndex.H.

References fld, and globalIndex::gather().

Here is the call graph for this function:

◆ gather() [6/9]

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.

Parameters
commcommunicator

Definition at line 350 of file globalIndexTemplates.C.

References List< T >::clear(), and Foam::PstreamDetail::gather().

Here is the call graph for this function:

◆ gather() [7/9]

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.

Parameters
commcommunicator

Definition at line 386 of file globalIndexTemplates.C.

References List< T >::clear(), and Foam::PstreamDetail::gather().

Here is the call graph for this function:

◆ gather() [8/9]

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.

Returns
output (master), zero-sized on non-master
Parameters
commcommunicator

Definition at line 422 of file globalIndexTemplates.C.

References Foam::PstreamDetail::gather().

Here is the call graph for this function:

◆ gather() [9/9]

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.

Returns
output (master), zero-sized on non-master
Parameters
commcommunicator

Definition at line 437 of file globalIndexTemplates.C.

References Foam::PstreamDetail::gather().

Here is the call graph for this function:

◆ gatherInplace()

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.

Parameters
commcommunicator

Definition at line 452 of file globalIndexTemplates.C.

References fld, and Foam::PstreamDetail::gather().

Referenced by particleTracksSampler::gatherInplace(), and SprayCloud< Foam::DSMCCloud >::penetration().

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

◆ mpiGather() [1/2]

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.

Attention
The nProcs for globalIndex and communicator must match!!

The allData is output (master), zero-sized on non-master

Parameters
commcommunicator

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

Here is the call graph for this function:

◆ mpiGather() [2/2]

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.

Attention
The nProcs for globalIndex and communicator must match!!
Returns
output (master), zero-sized on non-master
Parameters
commcommunicator

Definition at line 643 of file globalIndexTemplates.C.

◆ mpiGatherInplace()

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.

Attention
The nProcs for globalIndex and communicator must match!!

After the gather, the field is zero-sized on non-master.

Parameters
commcommunicator

Definition at line 659 of file globalIndexTemplates.C.

References fld.

◆ mpiGatherOp() [1/2]

void mpiGatherOp ( const UList< Type > &  sendData,
OutputContainer &  allData,
const label  comm = UPstream::worldComm,
const UPstream::commsTypes  commsType = UPstream::commsTypes::nonBlocking,
const int  tag = UPstream::msgType() 
)
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

Parameters
commcommunicator

Definition at line 687 of file globalIndexTemplates.C.

References UList< T >::size().

Here is the call graph for this function:

◆ mpiGatherOp() [2/2]

OutputContainer mpiGatherOp ( const UList< Type > &  sendData,
const label  comm = UPstream::worldComm,
const UPstream::commsTypes  commsType = UPstream::commsTypes::nonBlocking,
const int  tag = UPstream::msgType() 
)
static

Use MPI_Gatherv call to collect contiguous data when possible (in serial: performs a simple copy).

Communication with default/specified communicator.

Returns
output (master), zero-sized on non-master
Parameters
commcommunicator

Definition at line 712 of file globalIndexTemplates.C.

◆ mpiGatherInplaceOp()

void mpiGatherInplaceOp ( List< Type > &  fld,
const label  comm = UPstream::worldComm,
const UPstream::commsTypes  commsType = UPstream::commsTypes::nonBlocking,
const int  tag = UPstream::msgType() 
)
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.

Parameters
commcommunicator

Definition at line 728 of file globalIndexTemplates.C.

References fld.

◆ gatherOp() [1/4]

void gatherOp ( const UList< Type > &  sendData,
List< Type > &  allData,
const int  tag = UPstream::msgType(),
const UPstream::commsTypes  commsType = UPstream::commsTypes::nonBlocking,
const label  comm = UPstream::worldComm 
)
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

Parameters
commcommunicator

Definition at line 756 of file globalIndexTemplates.C.

References Foam::PstreamDetail::gather(), and UList< T >::size().

Referenced by coordSet::gatherSort(), and mergedSurf::merge().

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

◆ gatherOp() [2/4]

void gatherOp ( 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 
)
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

Parameters
commcommunicator

Definition at line 780 of file globalIndexTemplates.C.

References Foam::PstreamDetail::gather(), and IndirectListBase< T, Addr >::size().

Here is the call graph for this function:

◆ gatherOp() [3/4]

OutputContainer gatherOp ( const UList< Type > &  sendData,
const int  tag = UPstream::msgType(),
const UPstream::commsTypes  commsType = UPstream::commsTypes::nonBlocking,
const label  comm = UPstream::worldComm 
)
static

Collect and return data in processor order on master (in serial: performs a simple copy).

Communication with default/specified communicator, message tag.

Returns
output (master), zero-sized on non-master
Parameters
commcommunicator

Definition at line 804 of file globalIndexTemplates.C.

◆ gatherOp() [4/4]

OutputContainer gatherOp ( const IndirectListBase< Type, Addr > &  sendData,
const int  tag = UPstream::msgType(),
const UPstream::commsTypes  commsType = UPstream::commsTypes::nonBlocking,
const label  comm = UPstream::worldComm 
)
static

Collect and return data in processor order on master (in serial: performs a simple copy).

Communication with default/specified communicator, message tag.

Returns
output (master), zero-sized on non-master
Parameters
commcommunicator

Definition at line 819 of file globalIndexTemplates.C.

◆ gatherInplaceOp()

void gatherInplaceOp ( List< Type > &  fld,
const int  tag = UPstream::msgType(),
const UPstream::commsTypes  commsType = UPstream::commsTypes::nonBlocking,
const label  comm = UPstream::worldComm 
)
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.

Parameters
commcommunicator

Definition at line 834 of file globalIndexTemplates.C.

References fld, and Foam::PstreamDetail::gather().

Here is the call graph for this function:

◆ scatter() [1/4]

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  preferredCommsType = UPstream::commsTypes::nonBlocking 
)
static

Distribute data in processor order.

Requires fld to be correctly sized! Communication with default/specified communicator, message tag.

Parameters
offsetsoffsets (master only)
commcommunicator

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

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

◆ scatter() [2/4]

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
inline

Distribute data in processor order.

Requires fld to be correctly sized! Communication with default/specified communicator, message tag.

Note
the globalIndex offsets needed on master only.
Parameters
commcommunicator

Definition at line 1050 of file globalIndex.H.

References fld, and globalIndex::scatter().

Here is the call graph for this function:

◆ scatter() [3/4]

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.

Note
the globalIndex offsets needed on master only.
Parameters
commcommunicator

Definition at line 957 of file globalIndexTemplates.C.

References UList< T >::deepCopy(), and Foam::PstreamDetail::scatter().

Here is the call graph for this function:

◆ scatter() [4/4]

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.

Note
the globalIndex offsets needed on master only.
Parameters
commcommunicator

Definition at line 989 of file globalIndexTemplates.C.

References Foam::PstreamDetail::scatter().

Here is the call graph for this function:

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

Communication with default/specified communicator, message tag.

Parameters
commcommunicator

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

Here is the call graph for this function:

◆ reset() [6/7]

void reset ( const label  localSize,
const int  tag,
const label  comm,
const bool  parallel 
)
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().

Here is the call graph for this function:

◆ offset()

label offset ( const label  proci) const
inline

Prefer localStart() to avoid confusing with offsets()

Definition at line 1186 of file globalIndex.H.

References globalIndex::localStart().

Here is the call graph for this function:

◆ reset() [7/7]

void reset ( const label  localSize,
const globalIndex::gatherOnly  ,
const label  comm = UPstream::worldComm 
)
inline

Reset as 'one-sided' from local sizes [gather, but no broadcast] Will be empty on non-master processes.

Note
can be used when Pstream::parRun() is false.
Parameters
commcommunicator

Definition at line 1196 of file globalIndex.H.

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

Here is the call graph for this function:

◆ calcListOffsets() [2/2]

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

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: