mirror of
https://develop.openfoam.com/Development/openfoam.git
synced 2025-11-28 03:28:01 +00:00
- when combining lists in processor order this simplifies code and
reduces memory overhead.
Write this:
----
labelList collected;
const globalIndex sizing(input.size());
sizing.gather(input, collected);
----
OR
----
labelList collected;
globalIndex::gatherOp(input, collected);
----
Instead of this:
----
labelList collected;
List<labelList> scratch(Pstream::nProcs());
scratch[Pstream::myProcNo()] = input;
Pstream::gatherList(scratch);
if (Pstream::master())
{
collected = ListListOps::combine<labelList>
(
scratch,
accessOp<labelList>()
);
}
scratch.clear();
----