message: added timer to hdf5 test
diff: @@ -171,10 +171,30 @@ void hdf5Stream::Write(CommandWrite *cmdW, Config &cfg,
  {
  std::cout << " Write data " << std::endl;
  }
  + double timeStart, timeEnd;
  + double writeTime;
  + double maxWriteTime, minWriteTime;
  + MPI_Barrier(MPI_COMM_WORLD);
  + timeStart = MPI_Wtime();
  for (const auto ov : cmdW->variables)
  {
  putHDF5Array(ov, step);
  }
  + timeEnd = MPI_Wtime();
  + writeTime = timeEnd-timeStart;
  + MPI_Allreduce(&writeTime, &maxWriteTime, 1, MPI_DOUBLE, MPI_MAX,
  + MPI_COMM_WORLD);
  + MPI_Allreduce(&writeTime, &minWriteTime, 1, MPI_DOUBLE, MPI_MIN,
  + MPI_COMM_WORLD);
  + if (settings.myRank == 0)
  + {
  + std::cout << " Max write time = " << maxWriteTime << std::endl;
  + std::cout << " Min write time = " << minWriteTime << std::endl;
  + std::ofstream wr_perf_log;
  + wr_perf_log.open("write_perf.txt", std::ios::app);
  + wr_perf_log << std::to_string(maxWriteTime)+", "+std::to_string(minWriteTime)+"\n";
  + wr_perf_log.close();
  + }
  }
  void hdf5Stream::getHDF5Array(std::shared_ptr<VariableInfo> ov, size_t step)
  @@ -252,7 +272,11 @@ adios2::StepStatus hdf5Stream::Read(CommandRead *cmdR, Config &cfg,
  }
  std::cout << std::endl;
  }
  -
  + double timeStart, timeEnd;
  + double readTime;
  + double maxReadTime, minReadTime;
  + MPI_Barrier(MPI_COMM_WORLD);
  + timeStart = MPI_Wtime();
  if (step == 1)
  {
  /* Get the number of available steps in the HDF5 file */
  @@ -299,7 +323,21 @@ adios2::StepStatus hdf5Stream::Read(CommandRead *cmdR, Config &cfg,
  {
  getHDF5Array(ov, step);
  }
  -
  + timeEnd = MPI_Wtime();
  + readTime = timeEnd-timeStart;
  + MPI_Allreduce(&readTime, &maxReadTime, 1, MPI_DOUBLE, MPI_MAX,
  + MPI_COMM_WORLD);
  + MPI_Allreduce(&readTime, &minReadTime, 1, MPI_DOUBLE, MPI_MIN,
  + MPI_COMM_WORLD);
  + if (settings.myRank == 0)
  + {
  + std::cout << " Max read time = " << maxReadTime << std::endl;
  + std::cout << " Min read time = " << minReadTime << std::endl;
  + std::ofstream rd_perf_log;
  + rd_perf_log.open("read_perf.txt", std::ios::app);
  + rd_perf_log << std::to_string(maxReadTime)+", "+std::to_string(minReadTime)+"\n";
  + rd_perf_log.close();
  + }
  return adios2::StepStatus::OK;
  }
  void hdf5Stream::Close()
  