diff options
author | Erik Schnetter <schnetter@aei.mpg.de> | 2004-12-02 22:23:00 +0000 |
---|---|---|
committer | Erik Schnetter <schnetter@aei.mpg.de> | 2004-12-02 22:23:00 +0000 |
commit | 95e5f55cd9ab8394653ffc80285bb3f9f405fdc2 (patch) | |
tree | 0d98b2924a04bb972503cc5a487857fe5f2a809b | |
parent | 5d162dd488c6e8c4616ca262fb92e7d40e85a75a (diff) |
Carpet: Allow termination only every coarse grid time step
Check whether the termination condition holds only every coarse grid
time step. This reduces the number of MPI_Allreduce calls
dramatically; previously, we would call MPI_Allreduce after each
iteration, even if there is no grid fine enough that anything would
happen at this iteration.
This also prevents possible trouble with restarting, which currently
works only when the checkpointing happens after a full coarse grid
time step.
darcs-hash:20041202222326-891bb-5e247813a2a863ca1f7e9933dae7a547e0535aff.gz
-rw-r--r-- | Carpet/Carpet/src/Evolve.cc | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/Carpet/Carpet/src/Evolve.cc b/Carpet/Carpet/src/Evolve.cc index 5207d34ac..3a2db3a9d 100644 --- a/Carpet/Carpet/src/Evolve.cc +++ b/Carpet/Carpet/src/Evolve.cc @@ -51,8 +51,16 @@ namespace Carpet { bool term; // Early shortcut - if (terminate_next || CCTK_TerminationReached(cgh)) { + if (iteration % maxreflevelfact != 0) { + // Terminate only after complete coarse grid steps + // TODO: once checkpointing works correctly, change this to + // "after complete time steps" + return false; + + } else if (terminate_next || CCTK_TerminationReached(cgh)) { + + // Terminate if someone or something said so term = true; } else { |