50 void Foam::Pstream::calcLinearComm(
const label nProcs)
52 linearCommunication_.
setSize(nProcs);
61 linearCommunication_[0] = commsStruct
73 linearCommunication_[
procID] = commsStruct
86 void Foam::Pstream::collectReceives
89 const List<DynamicList<label> >& receives,
90 DynamicList<label>& allReceives
93 const DynamicList<label>& myChildren = receives[procID];
97 allReceives.append(myChildren[childI]);
98 collectReceives(myChildren[childI], receives, allReceives);
129 void Foam::Pstream::calcTreeComm(label nProcs)
132 while ((1 << nLevels) < nProcs)
137 List<DynamicList<label> > receives(nProcs);
143 label childOffset = offset/2;
145 for (label level = 0; level < nLevels; level++)
148 while (receiveID < nProcs)
151 label sendID = receiveID + childOffset;
155 receives[receiveID].append(sendID);
156 sends[sendID] = receiveID;
168 List<DynamicList<label> > allReceives(nProcs);
169 for (label procID = 0; procID < nProcs; procID++)
171 collectReceives(procID, receives, allReceives[procID]);
175 treeCommunication_.setSize(nProcs);
177 for (label procID = 0; procID < nProcs; procID++)
179 treeCommunication_[procID] = commsStruct
184 receives[procID].shrink(),
185 allReceives[procID].shrink()
193 void Foam::Pstream::initCommunicationSchedule()
195 calcLinearComm(nProcs());
196 calcTreeComm(nProcs());
203 int Foam::Pstream::myProcNo_(0);
206 bool Foam::Pstream::parRun_(
false);
212 const int Foam::Pstream::msgType_(1);