32 use,
intrinsic :: iso_fortran_env
43 real(real64) :: start_time
44 real(real64) :: last_tap
45 real(real64) :: iteration_time
46 real(real64) :: margin
47 real(real64) :: duration
48 real(real64) :: restart_last_tap
49 real(real64) :: restart_duration
53 logical :: restart_active
66 logical,
optional,
intent(in) :: auto
68 real(real64) :: alarm_time, write_time, restart_alarm_time
105 if (write_time > alarm_time/
m_four) write_time = alarm_time/
m_four
118 restart_active = .false.
152 restart_duration = time
175 last_tap = start_time
176 restart_last_tap = start_time
181 if (restart_duration > 60.0_real64) restart_active = .
true.
188 logical,
optional,
intent(in) :: print
196 iteration_time = now - last_tap
200 write(
message(1),
'("Walltimer_tap: elapsed time = ",F6.2," (", 3F10.5, "), active = ",L1 )') &
201 now - start_time, duration, iteration_time, margin, active
210 type(mpi_comm),
intent(in) :: comm
211 logical,
optional,
intent(in) :: print
223 write(
message(1),
'("Walltimer_alarm: elapsed time = ",F6.2," (", 3F10.5, "), active = ",L1 )') &
224 now - start_time, duration, iteration_time, margin, active
230 walltimer_alarm = active .and. (now > start_time + duration - iteration_time - margin)
239 write(
message(1),
'("Walltimer stopping execution after = ",F6.2," minutes.")') (now - start_time)/60.0_real64
250 type(mpi_comm),
intent(in) :: comm
270 restart_last_tap = now
271 write(
message(1),
'(a)')
"Restart walltime period is reached: writing restart data"
real(real64), parameter, public m_zero
real(real64), parameter, public m_four
real(real64), parameter, public m_one
subroutine, public messages_switch_status(status)
create status file for asynchronous communication
subroutine, public messages_info(no_lines, iunit, verbose_limit, stress, all_nodes, namespace)
character(len=256), dimension(max_lines), public message
to be output by fatal, warning
integer, public mpi_err
used to store return values of mpi calls
type(namespace_t), public global_namespace
This module provices a simple timer class which can be used to trigger the writing of a restart file ...
subroutine, public walltimer_init(auto)
initialize the timer
subroutine, public walltimer_end()
destructor
subroutine set_alarm(time)
set alarm interval in seconds
logical function, public walltimer_alarm(comm, print)
indicate whether time is up
logical function, public restart_walltime_period_alarm(comm)
subroutine start()
start the timer (save starting time)
subroutine, public walltimer_tap(print)
measure time of one iteration
subroutine set_restart_alarm(time)
set restart alarm interval in seconds
subroutine set_margin(time)
set safty margin in seconds