From e28347a3d18f5cdf954af75393dbcc5223778d34 Mon Sep 17 00:00:00 2001 From: Remi Lehe Date: Tue, 12 Jun 2018 17:09:05 -0700 Subject: Print the walltime --- Source/WarpXEvolve.cpp | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'Source/WarpXEvolve.cpp') diff --git a/Source/WarpXEvolve.cpp b/Source/WarpXEvolve.cpp index 350376824..0dfe752ac 100644 --- a/Source/WarpXEvolve.cpp +++ b/Source/WarpXEvolve.cpp @@ -109,8 +109,8 @@ WarpX::EvolveES (int numsteps) { bool to_make_plot = (plot_int > 0) && ((step+1) % plot_int == 0); - amrex::Print()<< "STEP " << step+1 << " ends." << " TIME = " << cur_time - << " DT = " << dt[0] << "\n"; + amrex::Print()<< "STEP " << step+1 << " ends." << " TIME = " + << cur_time << " DT = " << dt[0] << "\n"; // sync up time for (int i = 0; i <= finest_level; ++i) { @@ -167,6 +167,7 @@ WarpX::EvolveEM (int numsteps) } bool max_time_reached = false; + Real walltime, walltime_start = ParallelDescriptor::second(); for (int step = istep[0]; step < numsteps_max && cur_time < stop_time; ++step) { if (warpx_py_print_step) { @@ -268,6 +269,9 @@ WarpX::EvolveEM (int numsteps) amrex::Print()<< "STEP " << step+1 << " ends." << " TIME = " << cur_time << " DT = " << dt[0] << "\n"; + walltime = ParallelDescriptor::second() - walltime_start; + amrex::Print()<< "Walltime = " << walltime + << " s; Avg. per step = " << walltime/(step+1) << " s\n"; // sync up time for (int i = 0; i <= max_level; ++i) { -- cgit v1.2.3