43#ifndef Foam_processorTopologyNew_H
44#define Foam_processorTopologyNew_H
52template<
class ProcPatch,
class PatchListType>
62 auto& schedule = topo.patchSchedule_;
71 label numProcPatches = 0;
85 schedule[patchEvali++].setInitEvaluate(patchi);
86 schedule[patchEvali++].setEvaluate(patchi);
97 auto& patchMap = topo.procPatchMap_;
98 patchMap.
reserve(numProcPatches);
105 patchMap.set(cpp->neighbProcNo(), patchi);
132 for (
const labelList& nbrProcs : procToProcs)
134 nComms += nbrProcs.size();
138 forAll(procToProcs, proci)
140 for (
const label nbrProci : procToProcs[proci])
142 if (proci < nbrProci)
157 for (
const label scheduleIndex : mySchedule)
160 label nbrProci = comms[scheduleIndex].
first();
161 if (nbrProci == myProci)
163 nbrProci = comms[scheduleIndex].second();
167 if (myProci > nbrProci)
169 schedule[patchEvali++].setInitEvaluate(patchi);
170 schedule[patchEvali++].setEvaluate(patchi);
174 schedule[patchEvali++].setEvaluate(patchi);
175 schedule[patchEvali++].setInitEvaluate(patchi);
189 schedule[patchEvali].setInitEvaluate(patchi);
190 schedule[patchEvali + numProcPatches].setEvaluate(patchi);
A 1D vector of objects of type <T> that resizes itself as necessary to accept the new objects.
void push_back(const T &val)
Copy append an element to the end of this list.
void reserve(label numEntries)
Reserve space for at least the specified number of elements (not the number of buckets) and regenerat...
void resize(const label len)
Adjust allocated size of list.
T & first()
Access first element of the list, position [0].
static int myProcNo(const label communicator=worldComm)
Rank of this process in the communicator (starting from masterNo()). Negative if the process is not a...
@ scheduled
"scheduled" (MPI standard) : (MPI_Send, MPI_Recv)
static bool parRun(const bool on) noexcept
Set as parallel run on/off.
static label nProcs(const label communicator=worldComm)
Number of ranks in parallel run (for given communicator). It is 1 for serial run.
static commsTypes defaultCommsType
Default commsType.
Determines the order in which a set of processors should communicate with one another.
Determines/represents processor-processor connection. After instantiation contains the processor-proc...
static processorTopology New(const PatchListType &patches, const label comm)
Factory method to create topology, schedule and proc/patch maps.
const labelListList & procAdjacency() const
The complete processor to processor connection adjacency table. Globally synchronized information.
label procPatchLookup(const label proci) const
Which local boundary is attached to specified neighbour processor.
processorTopology(const processorTopology &)=default
Copy construct.
label comm() const noexcept
The communicator used during creation of the topology.
const polyBoundaryMesh & patches
Pair< label > labelPair
A pair of labels.
List< label > labelList
A List of labels.
const Type * isA(const U &obj)
Attempt dynamic_cast to Type.
#define forAll(list, i)
Loop across all elements in list.