BUG: parallel blocking writing surface noise output (fixes #2663)

- old logic (v2206 and earlier) always disabled writing on non-master,
  but other parts of the code were more recently updated to use lazy
  evaluation of surface data (with parallel communication)

- now retain full write/no-write logic identically on all ranks. Take
  care of master/non-master at the final output stage.
This commit is contained in:
Mark Olesen
2022-12-19 16:05:12 +01:00
parent 0a01492397
commit aebd79ff59
4 changed files with 47 additions and 45 deletions

View File

@ -157,30 +157,28 @@ namespace Foam
}
// * * * * * * * * * * * * * Protected Member Functions * * * * * * * * * * //
// * * * * * * * * * * * * * * * Local Functions * * * * * * * * * * * * * * //
void Foam::noiseModel::readWriteOption
namespace Foam
{
// Get bool option (eg, read/write) and provide Info feedback
static void readWriteOption
(
const dictionary& dict,
const word& lookup,
bool& option
) const
)
{
dict.readIfPresent(lookup, option);
// Only writing on the master process
option = option && Pstream::master();
if (option)
{
Info<< " " << lookup << ": " << "yes" << endl;
}
else
{
Info<< " " << lookup << ": " << "no" << endl;
}
Info<< " " << lookup << ": " << (option ? "yes" : "no") << endl;
}
} // End namespace Foam
// * * * * * * * * * * * * * Protected Member Functions * * * * * * * * * * //
Foam::scalar Foam::noiseModel::checkUniformTimeStep
(
@ -255,7 +253,7 @@ void Foam::noiseModel::writeFileHeader
Ostream& os,
const string& x,
const string& y,
const List<Tuple2<string, token>>& headerValues
const UList<Tuple2<string, token>>& headerValues
) const
{
writeHeader(os, x + " vs " + y);