timer Module

Provides a lightweight @p timer_t derived type built on so that the timers remain meaningful for future MPI-parallel runs where per-process wall time is the quantity of interest.

Typical use: @code type(timer_t) :: t call timer_start(t) call expensive_work() call timer_stop(t) call timer_report(t, 'expensive_work') @endcode



Derived Types

type, public ::  timer_t

Wall-clock timer accumulator.

Read more…

Components

Type Visibility Attributes Name Initial
integer(kind=int64), public :: count_start = 0_int64

p: system_clock count recorded at the most recent @p timer_start call.

integer(kind=int64), public :: count_total = 0_int64

Accumulated elapsed @p system_clock counts across all start/stop pairs.

integer, public :: n_calls = 0

Number of completed start/stop pairs.

logical, public :: running = .false.

p: .true. between a @p timer_start and the corresponding @p timer_stop.


Functions

public function timer_elapsed_s(t)

Return accumulated wall time in seconds.

Read more…

Arguments

Type IntentOptional Attributes Name
type(timer_t), intent(in) :: t

Timer to query.

Return Value real(kind=real64)

public function timer_elapsed_running_s(t)

Return elapsed wall time in seconds, including the current running segment.

Read more…

Arguments

Type IntentOptional Attributes Name
type(timer_t), intent(in) :: t

Timer to query.

Return Value real(kind=real64)


Subroutines

public subroutine timer_start(t)

Start (or resume) the timer.

Read more…

Arguments

Type IntentOptional Attributes Name
type(timer_t), intent(inout) :: t

Timer to start.

public subroutine timer_stop(t)

Stop the timer and accumulate elapsed counts.

Read more…

Arguments

Type IntentOptional Attributes Name
type(timer_t), intent(inout) :: t

Timer to stop.

public subroutine timer_reset(t)

Reset a timer to the zero state.

Arguments

Type IntentOptional Attributes Name
type(timer_t), intent(inout) :: t

Timer to reset.

public subroutine timer_report(t, label)

Print a one-line performance report to stdout.

Read more…

Arguments

Type IntentOptional Attributes Name
type(timer_t), intent(in) :: t

Timer to report.

character(len=*), intent(in) :: label

Descriptive region name.