Skip to content

Commit

Permalink
when running on GPUs, have job_info output "GPU time used" (#2930)
Browse files Browse the repository at this point in the history
this is basically just MPI hours, but now the output is more clear
  • Loading branch information
zingale committed Jul 26, 2024
1 parent df7e675 commit d8dd29e
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
4 changes: 2 additions & 2 deletions Source/driver/Castro.H
Original file line number Diff line number Diff line change
Expand Up @@ -1418,8 +1418,8 @@ protected:


///
/// for keeping track of the amount of CPU time used -- this will persist
/// after restarts
/// for keeping track of the amount of CPU or GPU time used -- this will persist
/// after restarts
///
static amrex::Real previousCPUTimeUsed;
static amrex::Real startCPUTime;
Expand Down
5 changes: 5 additions & 0 deletions Source/driver/Castro_io.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -564,8 +564,13 @@ Castro::writeJobInfo (const std::string& dir, const Real io_time)
jobInfoFile << "hydro tile size: " << hydro_tile_size << "\n";

jobInfoFile << "\n";
#ifdef AMREX_USE_GPU
jobInfoFile << "GPU time used since start of simulation (GPU-hours): " <<
getCPUTime()/3600.0;
#else
jobInfoFile << "CPU time used since start of simulation (CPU-hours): " <<
getCPUTime()/3600.0;
#endif

jobInfoFile << "\n\n";

Expand Down

0 comments on commit d8dd29e

Please sign in to comment.