BUG: vtk write of uniform field in parallel (fixes #2349)

- used low-level MPI gather, but the wrapping routine contains an
  additional safety check for is_contiguous which is not defined for
  various std::pair<..> combination.

  So std::pair<label,vector> (which is actually contiguous, but not
  declared as is_contiguous) would falsely trip the check.

  Avoid by simply gathering unbundled values instead.
This commit is contained in:
Mark Olesen
2022-02-01 15:17:51 +01:00
parent 7a6891905e
commit ddcc04dadc
3 changed files with 38 additions and 11 deletions

View File

@ -5,7 +5,7 @@
\\ / A nd | www.openfoam.com
\\/ M anipulation |
-------------------------------------------------------------------------------
Copyright (C) 2021 OpenCFD Ltd.
Copyright (C) 2021-2022 OpenCFD Ltd.
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
@ -180,6 +180,36 @@ int main(int argc, char *argv[])
}
}
// This will likely fail - not declared as is_contiguous
// Cannot even catch since it triggers an abort()
#if 0
{
std::pair<label,vector> sendData(Pstream::myProcNo(), vector::one);
const bool oldThrowingError = FatalError.throwing(true);
try
{
List<std::pair<label,vector>> countValues
(
UPstream::listGatherValues<std::pair<label, vector>>
(
sendData
)
);
Pout<< "listGather: " << flatOutput(countValues) << nl;
}
catch (const Foam::error& err)
{
Info<< err.message().c_str() << nl;
}
FatalError.throwing(oldThrowingError);
}
#endif
Info<< "\nEnd\n" << endl;
return 0;