43#ifndef Foam_processorTopologyNew_H
44#define Foam_processorTopologyNew_H
54template<
class ProcPatch,
class PatchListType>
66 auto& procToProcs = procTopo.procNeighbours_;
67 auto& procToPatch = procTopo.procPatchMap_;
68 auto& schedule = procTopo.patchSchedule_;
77 auto& procSlot = procToProcs[myProci];
79 bitSet isNeighbour(procToProcs.size());
83 const auto* cpp = isA<ProcPatch>(
patches[patchi]);
86 const label nbrProci = cpp->neighbProcNo();
88 isNeighbour.
set(nbrProci);
95 const label maxNbrProci = procSlot.
empty() ? -1 : procSlot.last();
98 procToPatch.resize_nocopy(maxNbrProci + 1);
103 const auto* cpp = isA<ProcPatch>(
patches[patchi]);
106 const label nbrProci = cpp->neighbProcNo();
109 procToPatch[nbrProci] = patchi;
120 label patchEvali = 0;
127 if (!isA<ProcPatch>(
patches[patchi]))
129 schedule[patchEvali++].setInitEvaluate(patchi);
130 schedule[patchEvali++].setEvaluate(patchi);
149 for (
const labelList& nbrProcs : procToProcs)
151 nComms += nbrProcs.size();
155 forAll(procToProcs, proci)
157 for (
const label nbrProci : procToProcs[proci])
159 if (proci < nbrProci)
173 ).procSchedule()[myProci]
176 for (
const label scheduleIndex : mySchedule)
179 label nbrProci = comms[scheduleIndex][0];
180 if (nbrProci == myProci)
182 nbrProci = comms[scheduleIndex][1];
184 const label patchi = procToPatch[nbrProci];
186 if (myProci > nbrProci)
188 schedule[patchEvali++].setInitEvaluate(patchi);
189 schedule[patchEvali++].setEvaluate(patchi);
193 schedule[patchEvali++].setEvaluate(patchi);
194 schedule[patchEvali++].setInitEvaluate(patchi);
205 if (isA<ProcPatch>(
patches[patchi]))
207 schedule[patchEvali++].setInitEvaluate(patchi);
214 if (isA<ProcPatch>(
patches[patchi]))
216 schedule[patchEvali++].setEvaluate(patchi);
A 1D vector of objects of type <T> that resizes itself as necessary to accept the new objects.
void append(const T &val)
Copy append an element to the end of this list.
void resize(const label len)
Adjust allocated size of list.
label nProcs() const noexcept
Number of ranks associated with PstreamBuffers.
static void allGatherList(const List< commsStruct > &comms, List< T > &values, const int tag, const label comm)
static autoPtr< Time > New()
Construct (dummy) Time - no functionObjects or libraries.
bool empty() const noexcept
True if the UList is empty (ie, size() is zero)
static int & msgType() noexcept
Message tag of standard messages.
static commsTypes defaultCommsType
Default commsType.
static bool & parRun() noexcept
Test if this a parallel run.
label size() const noexcept
The number of elements in the list.
A bitSet stores bits (elements with only two states) in packed internal format and supports a variety...
labelList sortedToc() const
The indices of the on bits as a sorted labelList.
void set(const bitSet &bitset)
Set specified bits from another bitset.
Determines the order in which a set of processors should communicate with one another.
int myProcNo() const noexcept
Return processor number.
Determines/represents processor-processor connection. After instantiation contains the processor-proc...
label nProcs() const noexcept
The number of processors used by the topology.
const polyBoundaryMesh & patches
Pair< label > labelPair
A pair of labels.
#define forAll(list, i)
Loop across all elements in list.