Octopus
walltimer_oct_m Module Reference

This module provices a simple timer class which can be used to trigger the writing of a restart file before the requested CPU time is up. More...

Detailed Description

This module provices a simple timer class which can be used to trigger the writing of a restart file before the requested CPU time is up.

It allows to take into account the time required for one iteration and optionally a time margin for completing the restart dump process.

Functions/Subroutines

subroutine, public walltimer_init (auto)
 initialize the timer More...
 
subroutine, public walltimer_end ()
 destructor More...
 
subroutine set_alarm (time)
 set alarm interval in seconds More...
 
subroutine set_restart_alarm (time)
 set restart alarm interval in seconds More...
 
subroutine set_margin (time)
 set safty margin in seconds More...
 
subroutine start ()
 start the timer (save starting time) More...
 
subroutine, public walltimer_tap (print)
 measure time of one iteration More...
 
logical function, public walltimer_alarm (comm, print)
 indicate whether time is up More...
 
logical function, public restart_walltime_period_alarm (comm)
 

Variables

real(real64) start_time
 time the timer was started More...
 
real(real64) last_tap
 time of the last call to tap() More...
 
real(real64) iteration_time
 time difference of two calls to tap() More...
 
real(real64) margin
 additional time margin for writing the restart file More...
 
real(real64) duration
 time when the alarm should trigger More...
 
real(real64) restart_last_tap
 time of the last call for restart More...
 
real(real64) restart_duration
 time period to restart (trigger writing restart file) More...
 
logical active
 if .false. the timer will not issue an alarm. More...
 
logical auto_tap
 if .true., tap() is automatically called in every wakeUp() call. More...
 
logical restart_active
 if .false. the timer will not issue an alarm for the restart period timer More...
 

Function/Subroutine Documentation

◆ walltimer_init()

subroutine, public walltimer_oct_m::walltimer_init ( logical, intent(in), optional  auto)

initialize the timer

Parameters
[in]autoautomatically call walltimer_tap in walltimer_alarm() if .true.

Definition at line 158 of file walltimer.F90.

◆ walltimer_end()

subroutine, public walltimer_oct_m::walltimer_end

destructor

Definition at line 219 of file walltimer.F90.

◆ set_alarm()

subroutine walltimer_oct_m::set_alarm ( real(real64)  time)
private

set alarm interval in seconds

Definition at line 229 of file walltimer.F90.

◆ set_restart_alarm()

subroutine walltimer_oct_m::set_restart_alarm ( real(real64)  time)
private

set restart alarm interval in seconds

Definition at line 240 of file walltimer.F90.

◆ set_margin()

subroutine walltimer_oct_m::set_margin ( real(real64)  time)
private

set safty margin in seconds

Definition at line 251 of file walltimer.F90.

◆ start()

subroutine walltimer_oct_m::start
private

start the timer (save starting time)

disable timer if duration is less than one second.

disable restart period timer if period is less than one minute.

Definition at line 263 of file walltimer.F90.

◆ walltimer_tap()

subroutine, public walltimer_oct_m::walltimer_tap ( logical, intent(in), optional  print)

measure time of one iteration

Definition at line 280 of file walltimer.F90.

◆ walltimer_alarm()

logical function, public walltimer_oct_m::walltimer_alarm ( type(mpi_comm), intent(in)  comm,
logical, intent(in), optional  print 
)

indicate whether time is up

Definition at line 302 of file walltimer.F90.

◆ restart_walltime_period_alarm()

logical function, public walltimer_oct_m::restart_walltime_period_alarm ( type(mpi_comm), intent(in)  comm)

Definition at line 342 of file walltimer.F90.

Variable Documentation

◆ start_time

real(real64) walltimer_oct_m::start_time
private

time the timer was started

Definition at line 136 of file walltimer.F90.

◆ last_tap

real(real64) walltimer_oct_m::last_tap
private

time of the last call to tap()

Definition at line 137 of file walltimer.F90.

◆ iteration_time

real(real64) walltimer_oct_m::iteration_time
private

time difference of two calls to tap()

Definition at line 138 of file walltimer.F90.

◆ margin

real(real64) walltimer_oct_m::margin
private

additional time margin for writing the restart file

Definition at line 139 of file walltimer.F90.

◆ duration

real(real64) walltimer_oct_m::duration
private

time when the alarm should trigger

Definition at line 140 of file walltimer.F90.

◆ restart_last_tap

real(real64) walltimer_oct_m::restart_last_tap
private

time of the last call for restart

Definition at line 141 of file walltimer.F90.

◆ restart_duration

real(real64) walltimer_oct_m::restart_duration
private

time period to restart (trigger writing restart file)

Definition at line 142 of file walltimer.F90.

◆ active

logical walltimer_oct_m::active
private

if .false. the timer will not issue an alarm.

Definition at line 144 of file walltimer.F90.

◆ auto_tap

logical walltimer_oct_m::auto_tap
private

if .true., tap() is automatically called in every wakeUp() call.

Definition at line 145 of file walltimer.F90.

◆ restart_active

logical walltimer_oct_m::restart_active
private

if .false. the timer will not issue an alarm for the restart period timer

Definition at line 146 of file walltimer.F90.