diff options
author | Erik Schnetter <schnetter@cct.lsu.edu> | 2007-08-24 22:18:00 +0000 |
---|---|---|
committer | Erik Schnetter <schnetter@cct.lsu.edu> | 2007-08-24 22:18:00 +0000 |
commit | 7e0d8b79c5cf2f3e356f51cfc43f0b2571445bed (patch) | |
tree | 5ef856bb6e9e015af9cfb15fe84b344c6fdc03ec /Carpet/Carpet/src/Timing.cc | |
parent | 8ba6af739f3a3600bc7b348fd23e0a4881fbfcf0 (diff) |
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
Diffstat (limited to 'Carpet/Carpet/src/Timing.cc')
-rw-r--r-- | Carpet/Carpet/src/Timing.cc | 19 |
1 files changed, 17 insertions, 2 deletions
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; } |