43 #ifndef Foam_processorTopologyNew_H 44 #define Foam_processorTopologyNew_H 52 template<
class ProcPatch,
class PatchListType>
62 auto& schedule = topo.patchSchedule_;
71 label numProcPatches = 0;
79 if (isA<ProcPatch>(
patches[patchi]))
85 schedule[patchEvali++].setInitEvaluate(patchi);
86 schedule[patchEvali++].setEvaluate(patchi);
97 auto& patchMap = topo.procPatchMap_;
98 patchMap.
resize(2*numProcPatches);
102 const auto* cpp = isA<ProcPatch>(
patches[patchi]);
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);
187 if (isA<ProcPatch>(
patches[patchi]))
189 schedule[patchEvali].setInitEvaluate(patchi);
190 schedule[patchEvali + numProcPatches].setEvaluate(patchi);
void size(const label n)
Older name for setAddressableSize.
void resize(const label len)
Adjust allocated size of list.
T & first()
Access first element of the list, position [0].
static bool & parRun() noexcept
Test if this a parallel run.
static int myProcNo(const label communicator=worldComm)
Rank of this process in the communicator (starting from masterNo()). Can be negative if the process i...
void resize(const label sz)
Resize the hash table for efficiency.
#define forAll(list, i)
Loop across all elements in list.
label procPatchLookup(const label proci) const
Which local boundary is attached to specified neighbour processor.
static label nProcs(const label communicator=worldComm)
Number of ranks in parallel run (for given communicator). It is 1 for serial run. ...
"scheduled" : (MPI_Send, MPI_Recv)
A 1D vector of objects of type <T> that resizes itself as necessary to accept the new objects...
const labelListList & procAdjacency() const
The complete processor to processor connection adjacency table. Globally synchronized information...
label comm() const noexcept
The communicator used during creation of the topology.
Pair< label > labelPair
A pair of labels.
Determines/represents processor-processor connection. After instantiation contains the processor-proc...
Determines the order in which a set of processors should communicate with one another.
void push_back(const T &val)
Copy append an element to the end of this list.
static processorTopology New(const PatchListType &patches, const label comm)
Factory method to create topology, schedule and proc/patch maps.
static commsTypes defaultCommsType
Default commsType.
const polyBoundaryMesh & patches