Skip to content
Snippets Groups Projects
Commit b68c1fc5 authored by Mark OLESEN's avatar Mark OLESEN
Browse files

BUG: parallel foamToEnsight fails depending on lagrangian order (fixes #1873)

- the problem arises when output fields are missing on some
  processors.

  When the information is combined, the resulting HashTables can have
  different insertion orders. This poses an issue when there are hash
  key collisions and thus different chaining.

- Use sorted order.
parent a589f48d
No related branches found
No related tags found
No related merge requests found
......@@ -71,10 +71,10 @@ if (doLagrangian)
}
}
forAllConstIters(theseCloudFields, fieldIter)
// Field order may differ on individual processors, so sort by name
for (const word& fieldName : theseCloudFields.sortedToc())
{
const word& fieldName = fieldIter.key();
const word& fieldType = fieldIter.object();
const word& fieldType = theseCloudFields[fieldName];
IOobject fieldObject
(
......@@ -92,9 +92,13 @@ if (doLagrangian)
// but that combination does not work.
// So check the header and sync globally
const bool parRun = Pstream::parRun();
Pstream::parRun() = false;
fieldExists =
fieldObject.typeHeaderOk<IOField<scalar>>(false);
Pstream::parRun() = parRun;
reduce(fieldExists, orOp<bool>());
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment