|
|
This file is part of OpenFOAM. OpenFOAM is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. OpenFOAM is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with OpenFOAM; if not, write to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
Given the processor topology works out a non-blocking communication
schedule. Instead of doing all sends first and having a lot of buffering
this works out how to have each processor do a sequence of sends and
receives such that there can never be the case that two processors are
waiting for each other to send something.
*this[procI] is for processor procI a list with for every iteration
the neighbour it has to communicate with. It does not prespecify which
half should start sending or receiving. You might want to group the two
close together or separate them in time as long as one is sending and the
other is receiving.
A typical use with matched send and receives is something like:
const labelList& mySchedule = operator[](Pstream::myProcNo()];
forAll(mySchedule, iterI)
{
label nb = mySchedule[iterI];
if (nb < Pstream::myProcNo())
{
// Send to neighbour
..
// Receive from neighbour
..
}
else
{
// Receive from neighbour
..
// Send to neighbour
..
}
}
Definition in file commSchedule.H.
Go to the source code of this file.
Namespaces | |
| namespace | Foam |
Classes | |
| class | commSchedule |