ENH: make format of ExecutionTime = ... output configurable (issue #788)

- controlled by the the 'printExecutionFormat' InfoSwitch in
  etc/controlDict

      // Style for "ExecutionTime = " output
      // - 0 = seconds (with trailing 's')
      // - 1 = day-hh:mm:ss

   ExecutionTime = 112135.2 s  ClockTime = 113017 s

   ExecutionTime = 1-07:08:55.20  ClockTime = 1-07:23:37

- Callable via the new Time::printExecutionTime() method,
  which also helps to reduce clutter in the applications.
  Eg,

     runTime.printExecutionTime(Info);

  vs

     Info<< "ExecutionTime = " << runTime.elapsedCpuTime() << " s"
         << "  ClockTime = " << runTime.elapsedClockTime() << " s"
         << nl << endl;

--

ENH: return elapsedClockTime() and clockTimeIncrement as double

- previously returned as time_t, which is less portable.
This commit is contained in:
Mark Olesen
2018-04-27 15:00:34 +02:00
parent 0743b61a3c
commit dd8341f659
125 changed files with 311 additions and 388 deletions

View File

@ -48,6 +48,7 @@ int main(int argc, char *argv[])
<< "clock: iso " << clock::dateTime() << nl;
}
Info<< "since epoch = " << clockValue::now().str() << nl;
{
clockValue a;
@ -67,6 +68,7 @@ int main(int argc, char *argv[])
Info<< "elapsed = " << a.elapsed() << nl;
Info<< "elapsed = " << a.elapsed().seconds() << nl;
Info<< "elapsed = " << a.elapsed().str() << nl;
clockValue b = clockValue::now();

View File

@ -323,10 +323,7 @@ int main(int argc, char *argv[])
}
}
Info<< "ExecutionTime = " << runTime.elapsedCpuTime() << " s"
<< " ClockTime = " << runTime.elapsedClockTime() << " s"
<< nl << endl;
runTime.printExecutionTime(Info);
}
Info<< "End\n" << endl;

View File

@ -405,10 +405,7 @@ int main(int argc, char *argv[])
}
}
Info<< "ExecutionTime = " << runTime.elapsedCpuTime() << " s"
<< " ClockTime = " << runTime.elapsedClockTime() << " s"
<< nl << endl;
runTime.printExecutionTime(Info);
}
Info<< "pc:" << pc.patchPatchPointConstraintPoints().size() << endl;

View File

@ -77,17 +77,13 @@ int main(int argc, char *argv[])
Info<< "Time = " << runTime.timeName() << nl << endl;
Info<< "Reading : ExecutionTime = " << runTime.elapsedCpuTime() << " s"
<< " ClockTime = " << runTime.elapsedClockTime() << " s"
<< nl << endl;
Info<< "Reading : ";
runTime.printExecutionTime(Info);
mesh.update();
Info<< "Overset calculation : ExecutionTime = "
<< runTime.elapsedCpuTime() << " s"
<< " ClockTime = " << runTime.elapsedClockTime() << " s"
<< nl << endl;
Info<< "Overset calculation : ";
runTime.printExecutionTime(Info);
if (false)
{
@ -110,11 +106,7 @@ int main(int argc, char *argv[])
runTime.write();
Info<< "ExecutionTime = " << runTime.elapsedCpuTime() << " s"
<< " ClockTime = " << runTime.elapsedClockTime() << " s"
<< nl << endl;
runTime.printExecutionTime(Info);
Info<< "End\n" << endl;

View File

@ -65,9 +65,7 @@ int main(int argc, char *argv[])
<< endl;
}
Info<< "ExecutionTime = " << runTime.elapsedCpuTime() << " s"
<< " ClockTime = " << runTime.elapsedClockTime() << " s"
<< nl << endl;
runTime.printExecutionTime(Info);
runTime++;
Pout<< "Writing particles to time " << runTime.timeName() << endl;
@ -89,11 +87,7 @@ int main(int argc, char *argv[])
}
}
Info<< "ExecutionTime = " << runTime.elapsedCpuTime() << " s"
<< " ClockTime = " << runTime.elapsedClockTime() << " s"
<< nl << endl;
runTime.printExecutionTime(Info);
Info<< "End\n" << endl;