Skip to content
Snippets Groups Projects
Commit c1ad4295 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 3b3cffc7
Branches
Tags
No related merge requests found
......@@ -67,10 +67,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.val();
const word& fieldType = theseCloudFields[fieldName];
IOobject fieldObject
(
......@@ -88,9 +88,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% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment