From 7e0d8b79c5cf2f3e356f51cfc43f0b2571445bed Mon Sep 17 00:00:00 2001 From: Erik Schnetter Date: Fri, 24 Aug 2007 22:18:00 +0000 Subject: Carpet: Use the correct number of integrator substeps for timing statistics Use the correct number of integrator substeps when calculating the number of grid points which were evolved. darcs-hash:20070824221859-dae7b-217e2d225b9ed686472a032b27fdc3b903356e92.gz --- Carpet/Carpet/src/Timing.cc | 19 +++++++++++++++++-- 1 file changed, 17 insertions(+), 2 deletions(-) (limited to 'Carpet') diff --git a/Carpet/Carpet/src/Timing.cc b/Carpet/Carpet/src/Timing.cc index 7b01d2e74..f1a436d5f 100644 --- a/Carpet/Carpet/src/Timing.cc +++ b/Carpet/Carpet/src/Timing.cc @@ -91,8 +91,23 @@ namespace Carpet { } // for m // Take number of RHS evaluations per time step into account - local_updates = local_num_grid_points * num_integrator_substeps; - global_updates = global_num_grid_points * num_integrator_substeps; + static int int_steps = -1; + if (int_steps == -1) { + if (num_integrator_substeps != -1) { + // if the user parameter is set, use it + int_steps = num_integrator_substeps; + } else if (CCTK_IsFunctionAliased ("MoLNumIntegratorSubsteps")) { + // if there is an aliased function, use it + int_steps = MoLNumIntegratorSubsteps (); + } else { + // use a sensible default, even if it is wrong -- it is better + // to have timing information which is wrong by a constant + // factor than to abort the code + int_steps = 1; + } + } + local_updates = local_num_grid_points * int_steps; + global_updates = global_num_grid_points * int_steps; } -- cgit v1.2.3