From 88c72d6567a801ce6ec3d58a057ff4990e5fce61 Mon Sep 17 00:00:00 2001 From: David A Minton Date: Mon, 20 Sep 2021 18:11:56 -0400 Subject: [PATCH] Fixed up some bugs in the way loop timing is reported and fixed it so that loops are not timed every time --- examples/symba_mars_disk/param.in | 2 +- src/modules/walltime_classes.f90 | 2 +- src/symba/symba_kick.f90 | 15 +++++++-------- 3 files changed, 9 insertions(+), 10 deletions(-) diff --git a/examples/symba_mars_disk/param.in b/examples/symba_mars_disk/param.in index b75341794..fd0cc9134 100644 --- a/examples/symba_mars_disk/param.in +++ b/examples/symba_mars_disk/param.in @@ -31,4 +31,4 @@ MU2KG 1.0 DU2M 1.0 TU2S 1.0 SEED 2 3080983 2220830 -FLATTEN_INTERACTIONS yes +INTERACTION_LOOPS ADAPTIVE diff --git a/src/modules/walltime_classes.f90 b/src/modules/walltime_classes.f90 index 97db74f73..4ecc912d1 100644 --- a/src/modules/walltime_classes.f90 +++ b/src/modules/walltime_classes.f90 @@ -226,7 +226,7 @@ module function walltime_interaction_check(self, param, ninteractions) result(lt self%stage = self%stage + 1 ltimeit = (self%stage == 2) else - self%step_counter = max(self%step_counter + 1, INTERACTION_TIMER_CADENCE) + self%step_counter = min(self%step_counter + 1, INTERACTION_TIMER_CADENCE) ltimeit = .false. if (self%step_counter == INTERACTION_TIMER_CADENCE) then ltimeit = (ninteractions /= self%last_interactions) diff --git a/src/symba/symba_kick.f90 b/src/symba/symba_kick.f90 index 119899ae4..9d2e10666 100644 --- a/src/symba/symba_kick.f90 +++ b/src/symba/symba_kick.f90 @@ -17,7 +17,7 @@ module subroutine symba_kick_getacch_int_pl(self, param) type(interaction_timer), save :: itimer logical, save :: lfirst character(len=STRMAX) :: tstr, nstr, cstr, mstr - character(len=10) :: lstyle + character(len=11) :: lstyle character(len=1) :: schar if (param%ladaptive_interactions) then @@ -59,16 +59,15 @@ module subroutine symba_kick_getacch_int_pl(self, param) case(1) write(mstr,*) itimer%stage1_metric case(2) + if (param%lflatten_interactions) then + write(lstyle,*) "FLAT " + else + write(lstyle,*) "TRIANGULAR" + end if write(mstr,*) itimer%stage2_metric + call io_log_one_message(INTERACTION_TIMER_LOG_OUT, "The fastest loop method tested is " // trim(adjustl(lstyle))) end select call io_log_one_message(INTERACTION_TIMER_LOG_OUT, adjustl(lstyle) // " " // trim(adjustl(cstr)) // " " // trim(adjustl(nstr)) // " " // trim(adjustl(mstr))) - if (param%lflatten_interactions) then - write(lstyle,*) "FLAT " - else - write(lstyle,*) "TRIANGULAR" - end if - call io_log_one_message(INTERACTION_TIMER_LOG_OUT, "The fastest loop method tested is " // trim(adjustl(lstyle))) - end if end if