mirror of
https://develop.openfoam.com/Development/openfoam.git
synced 2025-11-28 03:28:01 +00:00
ENH: simpler use of broadcast (via Pstream::scatter)
- avoids worrying about forgetting a (Pstream::parRun()) guard and reduces code. The Pstream::scatter does the same thing under the hood.
This commit is contained in:
committed by
Andrew Heather
parent
5368b38b8d
commit
f3674eee36
@ -90,21 +90,8 @@ Foam::autoPtr<Foam::fvMesh> Foam::loadOrCreateMesh
|
||||
Pstream::parRun(oldParRun);
|
||||
}
|
||||
|
||||
if (Pstream::parRun())
|
||||
{
|
||||
if (Pstream::master())
|
||||
{
|
||||
// Broadcast: send patches
|
||||
OPBstream toAll(Pstream::masterNo());
|
||||
toAll << patchEntries;
|
||||
}
|
||||
else
|
||||
{
|
||||
// Broadcast: receive patches
|
||||
IPBstream fromMaster(Pstream::masterNo());
|
||||
fromMaster >> patchEntries;
|
||||
}
|
||||
}
|
||||
// Broadcast: send patches to all
|
||||
Pstream::scatter(patchEntries); // == worldComm;
|
||||
|
||||
|
||||
// Dummy meshes
|
||||
|
||||
Reference in New Issue
Block a user