56 label nOutstanding = 0;
58 for (
const label commi : procComms)
60 if (commToSchedule[commi] == -1)
79 schedule_(comms.size()),
87 label proc0 = comms[commI][0];
88 label proc1 = comms[commI][1];
90 if (proc0 < 0 || proc0 >= nProcs || proc1 < 0 || proc1 >= nProcs)
93 <<
"Illegal processor(s): "
97 procToComms[proc0].
append(commI);
98 procToComms[proc1].
append(commI);
104 Pout<<
"commSchedule : Wanted communication:" <<
endl;
111 << twoProcs[0] <<
" with " << twoProcs[1] <<
endl;
116 Pout<<
"commSchedule : Schedule:" <<
endl;
123 for (
int i = 0; i < nProcs; i++)
132 for (
int i = 0; i < nProcs; i++)
143 label nScheduled = 0;
150 while (nScheduled < comms.
size())
152 label oldNScheduled = nScheduled;
166 label proc0 = comms[commI][0];
167 label proc1 = comms[commI][1];
171 commToSchedule[commI] == -1
196 commToSchedule[maxCommI] = nScheduled++;
197 busy[comms[maxCommI][0]] =
true;
198 busy[comms[maxCommI][1]] =
true;
203 label nIterComms = nScheduled-oldNScheduled;
209 forAll(commToSchedule, commI)
211 label sched = commToSchedule[commI];
213 if (sched >= oldNScheduled && sched < nScheduled)
215 label proc0 = comms[commI][0];
216 procToComm[proc0] = commI;
217 label proc1 = comms[commI][1];
218 procToComm[proc1] = commI;
224 os <<
setw(3) << iter <<
" |";
227 if (procToComm[proci] == -1)
233 os <<
setw(3) << procToComm[proci];
260 label commI = schedule_[i];
261 const labelPair& twoProcs = comms[commI];
263 nProcScheduled[twoProcs[0]]++;
264 nProcScheduled[twoProcs[1]]++;
267 forAll(procSchedule_, proci)
269 procSchedule_[proci].
setSize(nProcScheduled[proci]);
275 label commI = schedule_[i];
276 const labelPair& twoProcs = comms[commI];
278 label proc0 = twoProcs[0];
279 procSchedule_[proc0][nProcScheduled[proc0]++] = commI;
281 label proc1 = twoProcs[1];
282 procSchedule_[proc1][nProcScheduled[proc1]++] = commI;
287 Pout<<
"commSchedule::commSchedule : Per processor:" <<
endl;
289 forAll(procSchedule_, proci)
291 const labelList& procComms = procSchedule_[proci];
293 Pout<<
"Processor " << proci <<
" talks to processors:" <<
endl;
297 const labelPair& twoProcs = comms[procComms[i]];
299 label nbr = (twoProcs[1] == proci ? twoProcs[0] : twoProcs[1]);
Istream and Ostream manipulators taking arguments.
Useful combination of include files which define Sin, Sout and Serr and the use of IO streams general...
Various functions to operate on Lists.
Input/output from string buffers.
A 1D vector of objects of type <T> that resizes itself as necessary to accept the new objects.
void setSize(const label n)
Alias for resize()
void append(const T &val)
Append an element at the end of the list.
Output to string buffer, using a OSstream. Always UNCOMPRESSED.
void size(const label n)
Older name for setAddressableSize.
Determines the order in which a set of processors should communicate with one another.
splitCell * master() const
#define defineTypeNameAndDebug(Type, DebugSwitch)
Define the typeName and debug information.
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
OBJstream os(runTime.globalPath()/outputName)
static label outstandingComms(const labelList &commToSchedule, DynamicList< label > &procComms)
Omanip< int > setw(const int i)
Ostream & endl(Ostream &os)
Add newline and flush stream.
labelList sortedOrder(const UList< T > &input)
Return the (stable) sort order for the list.
errorManip< error > abort(error &err)
static constexpr const zero Zero
Global zero (0)
prefixOSstream Pout
OSstream wrapped stdout (std::cout) with parallel prefix.
#define forAll(list, i)
Loop across all elements in list.