mirror of
https://develop.openfoam.com/Development/openfoam.git
synced 2025-11-28 03:28:01 +00:00
ENH: use broadcasting Pstreams for one-to-all sends
This commit is contained in:
committed by
Andrew Heather
parent
d37cb64efe
commit
1348cd7e7b
@ -6,7 +6,7 @@
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
Copyright (C) 2012-2017 OpenFOAM Foundation
|
||||
Copyright (C) 2015-2021 OpenCFD Ltd.
|
||||
Copyright (C) 2015-2022 OpenCFD Ltd.
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
This file is part of OpenFOAM.
|
||||
@ -88,25 +88,23 @@ Foam::autoPtr<Foam::fvMesh> Foam::loadOrCreateMesh
|
||||
);
|
||||
|
||||
Pstream::parRun(oldParRun);
|
||||
}
|
||||
|
||||
// Send patches
|
||||
for (const int slave : Pstream::subProcs())
|
||||
if (Pstream::parRun())
|
||||
{
|
||||
if (Pstream::master())
|
||||
{
|
||||
OPstream toSlave(Pstream::commsTypes::scheduled, slave);
|
||||
toSlave << patchEntries;
|
||||
// Broadcast: send patches
|
||||
OPBstream toAll(Pstream::masterNo());
|
||||
toAll << patchEntries;
|
||||
}
|
||||
else
|
||||
{
|
||||
// Broadcast: receive patches
|
||||
IPBstream fromMaster(Pstream::masterNo());
|
||||
fromMaster >> patchEntries;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
// Receive patches
|
||||
IPstream fromMaster
|
||||
(
|
||||
Pstream::commsTypes::scheduled,
|
||||
Pstream::masterNo()
|
||||
);
|
||||
fromMaster >> patchEntries;
|
||||
}
|
||||
|
||||
|
||||
|
||||
// Dummy meshes
|
||||
|
||||
Reference in New Issue
Block a user