Skip to content
This repository was archived by the owner on Aug 28, 2024. It is now read-only.

Commit

Permalink
Fixed up some bugs in the way loop timing is reported and fixed it so…
Browse files Browse the repository at this point in the history
… that loops are not timed every time
  • Loading branch information
daminton committed Sep 20, 2021
1 parent 78d1ca4 commit 88c72d6
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 10 deletions.
2 changes: 1 addition & 1 deletion examples/symba_mars_disk/param.in
Original file line number Diff line number Diff line change
Expand Up @@ -31,4 +31,4 @@ MU2KG 1.0
DU2M 1.0
TU2S 1.0
SEED 2 3080983 2220830
FLATTEN_INTERACTIONS yes
INTERACTION_LOOPS ADAPTIVE
2 changes: 1 addition & 1 deletion src/modules/walltime_classes.f90
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
15 changes: 7 additions & 8 deletions src/symba/symba_kick.f90
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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

Expand Down

0 comments on commit 88c72d6

Please sign in to comment.