ENH: handle 64-bit memory information (#3060)

- on large memory systems (eg, 6TB) the process information
  exceeds an 'int' range, so adjust parsing of the /proc/..
  to use int64

ENH: update/modernize OSspecific system information

ENH: minor update of profiling code

- std::string, noexcept, lazier evaluations

STYLE: use direct call of memInfo
This commit is contained in:
Mark Olesen
2023-12-15 14:05:32 +01:00
parent 2045de8345
commit 7e0acfa4ed
30 changed files with 391 additions and 354 deletions

View File

@ -463,8 +463,7 @@ int main(int argc, char *argv[])
// ------------------------------------------------------------------------
cpuTime timer;
memInfo mem;
Info<< "Initial memory " << mem.update().size() << " kB" << endl;
Info<< "Initial memory " << Foam::memInfo{}.size() << " kB" << endl;
#include "createNamedMeshes.H"
#include "createMeshAccounting.H"
@ -496,7 +495,7 @@ int main(int argc, char *argv[])
Info<< "Startup in "
<< timer.cpuTimeIncrement() << " s, "
<< mem.update().size() << " kB" << nl << endl;
<< Foam::memInfo{}.size() << " kB" << nl << endl;
forAll(timeDirs, timei)
@ -587,7 +586,7 @@ int main(int argc, char *argv[])
Info<< "Wrote in "
<< timer.cpuTimeIncrement() << " s, "
<< mem.update().size() << " kB" << nl << nl;
<< Foam::memInfo{}.size() << " kB" << nl << nl;
}
// Write cases
@ -606,7 +605,7 @@ int main(int argc, char *argv[])
Info<< "\nEnd: "
<< timer.elapsedCpuTime() << " s, "
<< mem.update().peak() << " kB (peak)" << nl << endl;
<< Foam::memInfo{}.peak() << " kB (peak)" << nl << endl;
return 0;
}

View File

@ -712,15 +712,14 @@ int main(int argc, char *argv[])
// ------------------------------------------------------------------------
cpuTime timer;
memInfo mem;
Info<< "Initial memory " << mem.update().size() << " kB" << endl;
Info<< "Initial memory " << Foam::memInfo{}.size() << " kB" << endl;
#include "createNamedMeshes.H"
#include "createMeshAccounting.H"
Info<< "VTK mesh topology: "
<< timer.cpuTimeIncrement() << " s, "
<< mem.update().size() << " kB" << endl;
<< Foam::memInfo{}.size() << " kB" << endl;
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
@ -860,13 +859,13 @@ int main(int argc, char *argv[])
Info<< "Wrote in "
<< timer.cpuTimeIncrement() << " s, "
<< mem.update().size() << " kB" << endl;
<< Foam::memInfo{}.size() << " kB" << endl;
}
Info<< "\nEnd: "
<< timer.elapsedCpuTime() << " s, "
<< mem.update().peak() << " kB (peak)\n" << endl;
<< Foam::memInfo{}.peak() << " kB (peak)\n" << endl;
return 0;
}