milupHPC documentation
  • src
  • utils
h5profiler.cpp
Go to the documentation of this file.
1// Acknowledgment: Johannes Martin (GitHub: jammartin)
2#include "../../include/utils/h5profiler.h"
3
4H5Profiler::H5Profiler(const std::string& outfile) :
5 h5file { HighFive::File(outfile,
6 HighFive::File::ReadWrite | HighFive::File::Create | HighFive::File::Truncate,
7 HighFive::MPIOFileDriver(MPI_COMM_WORLD, MPI_INFO_NULL)) },
8 step { 0 }, disabled { false }
9{
10 Logger(DEBUG) << "H5Profiler instance created (Singleton)";
11}
12
13/*void H5Profiler::createTimeDataSet(const std::string& path, int steps){
14 dataSets[path] = h5file.createDataSet<double>(path, HighFive::DataSpace({std::size_t(steps),
15 std::size_t(numProcs)}));
16 timeElapsed[path] = 0.;
17}
18
19void H5Profiler::time(const std::string &path){
20 timeStart[path] = MPI_Wtime();
21}
22
23void H5Profiler::timePause(const std::string& path){
24 timeElapsed[path] += MPI_Wtime() - timeStart[path];
25}
26
27void H5Profiler::time2file(const std::string& path, int myRank, bool onlyWrite){
28 if (!onlyWrite) timePause(path);
29 if (!disabled) dataSets[path].select({std::size_t(step), std::size_t(myRank)}, {1, 1}).write(timeElapsed[path]);
30 timeElapsed[path] = 0.;
31}*/
H5Profiler::H5Profiler
H5Profiler(H5Profiler const &)=delete
Logger
Logger class.
Definition: logger.h:80
DEBUG
@ DEBUG
Definition: logger.h:47

milupHPC - src/utils/h5profiler.cpp Source File
Generated on Wed Aug 31 2022 12:16:53 by Doxygen 1.9.3