diff --git a/Grid/parallelIO/BinaryIO.cc b/Grid/parallelIO/BinaryIO.cc index 221a7fe8..ef1b6683 100644 --- a/Grid/parallelIO/BinaryIO.cc +++ b/Grid/parallelIO/BinaryIO.cc @@ -1,3 +1,4 @@ #include -int Grid::BinaryIO::latticeWriteMaxRetry = -1; +int Grid::BinaryIO::latticeWriteMaxRetry = -1; +Grid::BinaryIO::IoPerf Grid::BinaryIO::lastPerf; diff --git a/Grid/parallelIO/BinaryIO.h b/Grid/parallelIO/BinaryIO.h index 1f11add9..e390b575 100644 --- a/Grid/parallelIO/BinaryIO.h +++ b/Grid/parallelIO/BinaryIO.h @@ -79,6 +79,13 @@ inline void removeWhitespace(std::string &key) /////////////////////////////////////////////////////////////////////////////////////////////////// class BinaryIO { public: + struct IoPerf + { + uint64_t size{0},time{0}; + double mbytesPerSecond{0.}; + }; + + static IoPerf lastPerf; static int latticeWriteMaxRetry; ///////////////////////////////////////////////////////////////////////////// @@ -502,12 +509,15 @@ class BinaryIO { timer.Stop(); } + lastPerf.size = sizeof(fobj)*iodata.size()*nrank; + lastPerf.time = timer.useconds(); + lastPerf.mbytesPerSecond = lastPerf.size/1024./1024./(lastPerf.time/1.0e6); std::cout<