ENH: improve startup time for foamToEnsight conversion (issue #240).

Old code:
    Found 10990 time steps
    Search for moving mesh ... no moving mesh detected.
    Startup in 329.09 s

Updated:
    Found 10990 time steps
    Search for moving mesh ... no moving mesh detected.
    Startup in 1.6 s

- Cause was checking "polyMesh/points" via an IOobject.
  Short-circuit with a check for a polyMesh/ directory first.

  Limit the check to the master-node as well to further reduce
  load on the file-system.

------------------------------

ENH: improve per-step conversion times for foamToEnsight.

Old code:
    Converting 11001 time steps
    Time [0] = 0       Wrote in 1.53 s
    Time [1] = 1       Wrote in 1.52 s
    ...
    Time [100] = 100   Elapsed time 205.35 s

Updated:
    Converting 11001 time steps
    Time [0] = 0       Wrote in 1.4 s
    Time [1] = 1       Wrote in 0.07 s
    ...
    Time [100] = 100   Elapsed time 42.4 s

- Speedup by hashing test results from the first conversion step
  instead of checking each time.

  Check data on all nodes to avoid problems with incomplete writes.

------------------------------

BUG: moving mesh detection failed for foamToEnsightParts

- adjusted to agree with updated foamToEnsight

------------------------------

Note:

- foamToEnsightParts (serial) still has about twice the throughput of
  foamToEnsight.
This commit is contained in:
Mark Olesen
2016-09-21 18:15:19 +02:00
parent 6c56d61846
commit 0c168c43fa
6 changed files with 138 additions and 57 deletions

View File

@ -1,21 +1,33 @@
// ignore special fields or fields that we don't handle
//
bool variableGood = true;
for (label n1=0; n1<timeDirs.size() && variableGood; ++n1)
// ignore special fields (_0 fields),
// ignore fields we don't handle,
// ignore fields that are not available for all time-steps
// hash by field-name in fieldsToUse
if (!fieldsToUse.found(fieldName))
{
// ignore _0 fields
if (fieldName.size() > 2 && fieldName(fieldName.size() - 2, 2) == "_0")
bool variableGood = false;
forAll(timeDirs, n1)
{
variableGood = false;
}
else
{
variableGood = IOobject
variableGood =
(
fieldName,
timeDirs[n1].name(),
mesh,
IOobject::NO_READ
).typeHeaderOk<volScalarField>(false);
fieldName.size() > 2 && fieldName(fieldName.size() - 2, 2) == "_0"
? false
: IOobject
(
fieldName,
timeDirs[n1].name(),
mesh,
IOobject::NO_READ
).typeHeaderOk<volScalarField>(false)
);
if (variableGood)
{
break;
}
}
reduce(variableGood, andOp<bool>());
fieldsToUse.set(fieldName, variableGood);
}