ENH: extend globalIndex mpiGather to use scalar/label components

- MPI_Gatherv requires contiguous data, but a byte-wise transfer can
  quickly exceed the 'int' limits used for MPI sizes/offsets. Thus
  gather label/scalar components when possible to increase the
  effective size limit.

  For non-contiguous types (or large contiguous data) now also
  reverts to manual handling

ENH: handle contiguous data in GAMGAgglomeration gather values

- delegate to globalIndex::gatherValues static method (new)
This commit is contained in:
Mark Olesen
2022-03-28 14:03:05 +02:00
parent 87e3b196b0
commit 6fa23bd7a6
6 changed files with 731 additions and 616 deletions

View File

@ -68,6 +68,29 @@ int main(int argc, char *argv[])
}
// This now compiles (and works)
// - reverts to normal gather for non-contiguous
{
const wordList sendData({"hello", "world"});
// One-sided sizing! master only
const globalIndex allProcAddr
(
sendData.size(),
globalIndex::gatherOnly{}
);
Pout<< "listGather sizes: " << flatOutput(allProcAddr.sizes()) << nl;
// Collect all values
wordList allValues
(
allProcAddr.mpiGather(sendData)
);
Pout<< "all-data: " << allValues << endl;
}
// Gather all values
{
const auto& sendData = localValues;
@ -75,8 +98,8 @@ int main(int argc, char *argv[])
// One-sided sizing! master only
const globalIndex allProcAddr
(
UPstream::listGatherValues<label>(sendData.size()),
globalIndex::SIZES
sendData.size(),
globalIndex::gatherOnly{}
);
Pout<< "listGather sizes: " << flatOutput(allProcAddr.sizes()) << nl;