75 const List<labelPair>& comms
78 schedule_(comms.size()),
82 List<DynamicList<label>> procToComms(nProcs);
86 const label proc0 = comms[commPairi].first();
87 const label proc1 = comms[commPairi].second();
89 if (proc0 < 0 || proc0 >= nProcs || proc1 < 0 || proc1 >= nProcs)
92 <<
"Illegal processor(s): "
96 procToComms[proc0].push_back(commPairi);
97 procToComms[proc1].push_back(commPairi);
103 Pout<<
"commSchedule : Wanted communication:" <<
endl;
110 << twoProcs.first() <<
" <-> " << twoProcs.second() <<
endl;
115 Pout<<
"commSchedule : Schedule:" <<
endl;
122 for (
int i = 0; i < nProcs; i++)
131 for (
int i = 0; i < nProcs; i++)
142 label nScheduled = 0;
147 labelList commToSchedule(comms.size(), -1);
149 while (nScheduled < comms.size())
151 label oldNScheduled = nScheduled;
165 const label proc0 = comms[commPairi].first();
166 const label proc1 = comms[commPairi].second();
170 commToSchedule[commPairi] == -1
197 commToSchedule[maxComm] = nScheduled++;
198 busy[comms[maxComm].first()] =
true;
199 busy[comms[maxComm].second()] =
true;
204 label nIterComms = nScheduled-oldNScheduled;
210 forAll(commToSchedule, commPairi)
212 const label sched = commToSchedule[commPairi];
214 if (sched >= oldNScheduled && sched < nScheduled)
216 const label proc0 = comms[commPairi].first();
217 const label proc1 = comms[commPairi].second();
218 procToComm[proc0] = commPairi;
219 procToComm[proc1] = commPairi;
225 os <<
setw(3) << iter <<
" |";
228 if (procToComm[proci] == -1)
234 os <<
setw(3) << procToComm[proci];
259 for (
const label commPairi : schedule_)
261 const labelPair& twoProcs = comms[commPairi];
263 nProcScheduled[twoProcs.first()]++;
264 nProcScheduled[twoProcs.second()]++;
268 forAll(procSchedule_, proci)
270 procSchedule_[proci].resize_nocopy(nProcScheduled[proci]);
276 for (
const label commPairi : schedule_)
278 const labelPair& twoProcs = comms[commPairi];
280 const label proc0 = twoProcs.
first();
281 const label proc1 = twoProcs.second();
283 procSchedule_[proc0][nProcScheduled[proc0]++] = commPairi;
284 procSchedule_[proc1][nProcScheduled[proc1]++] = commPairi;
289 Pout<<
"commSchedule::commSchedule : Per processor:" <<
endl;
291 forAll(procSchedule_, proci)
293 const labelList& procComms = procSchedule_[proci];
295 Pout<<
"Processor " << proci <<
" talks to processors:" <<
endl;
297 for (
const label commPairi : procComms)
299 const labelPair& twoProcs = comms[commPairi];