FORCES
FORtran lib for Comp. Env. Sys.
|
Timing routines. More...
Functions/Subroutines | |
subroutine, public | timer_check (timer) |
Check a timer. | |
subroutine, public | timer_clear (timer) |
Reset a timer. | |
real(sp) function, public | timer_get (timer) |
Return a timer. | |
subroutine, public | timer_print (timer) |
Print a timer. | |
subroutine, public | timer_start (timer) |
Start a timer. | |
subroutine, public | timer_stop (timer) |
Stop a timer. | |
subroutine, public | timers_init |
Initialise timer module. | |
Variables | |
integer(i4), parameter, public | max_timers = 500 |
max number of timers allowed | |
integer(i4), save, public | cycles_max |
max value of clock allowed by system | |
real(sp), save, public | clock_rate |
clock_rate in seconds for each cycle | |
integer(i4), dimension(max_timers), save, public | cycles1 |
cycle number at start for each timer | |
integer(i4), dimension(max_timers), save, public | cycles2 |
cycle number at stop for each timer | |
real(sp), dimension(max_timers), save, public | cputime |
accumulated cpu time in each timer | |
character(len=8), dimension(max_timers), save, public | status |
timer status string | |
Timing routines.
This module uses F90 cpu time routines to allowing setting of multiple CPU timers.
COPYING
and COPYING.LESSER
provided with this software. The complete GNU license text can also be found at http://www.gnu.org/licenses/. subroutine, public mo_timer::timer_check | ( | integer(i4), intent(in) | timer | ) |
Check a timer.
This routine checks a given timer. This is primarily used to periodically accumulate time in the timer to prevent timer cycles from wrapping around max_cycles.
Example
Check timer 3
[in] | integer(i4) :: timer | timer number |
Definition at line 117 of file mo_timer.f90.
References status, timer_start(), and timer_stop().
subroutine, public mo_timer::timer_clear | ( | integer(i4), intent(in), optional | timer | ) |
Reset a timer.
This routine resets a given timer or all timers to 0.
Example
! Clear timer 3
Clear all timers
[in] | integer(i4), optional :: timer | timer number if given. If missing, all timers will be reset. |
Definition at line 155 of file mo_timer.f90.
References cputime.
real(sp) function, public mo_timer::timer_get | ( | integer(i4), intent(in) | timer | ) |
Return a timer.
This routine returns the result of a given timer. This can be called instead of timer_print so that the calling routine can print it in desired format.
Example
Return timer 3
[in] | integer(i4) :: timer | timer number |
Definition at line 189 of file mo_timer.f90.
References cputime, status, timer_get(), timer_start(), and timer_stop().
Referenced by timer_get().
subroutine, public mo_timer::timer_print | ( | integer(i4), intent(in) | timer | ) |
Print a timer.
This routine prints the accumulated cpu time in given timer.
Example
Prints timer 3
[in] | integer(i4) :: timer | timer number |
Definition at line 225 of file mo_timer.f90.
References cputime, status, timer_start(), and timer_stop().
subroutine, public mo_timer::timer_start | ( | integer(i4), intent(in) | timer | ) |
Start a timer.
This routine starts a given timer.
Example
Start timer 3
[in] | integer(i4) :: timer | timer number |
Definition at line 266 of file mo_timer.f90.
References cycles1, and status.
Referenced by timer_check(), timer_get(), and timer_print().
subroutine, public mo_timer::timer_stop | ( | integer(i4), intent(in) | timer | ) |
Stop a timer.
This routine stops a given timer. Example
Stop timer 3
[in] | integer(i4) :: timer | timer number |
Definition at line 300 of file mo_timer.f90.
References clock_rate, cputime, cycles1, cycles2, cycles_max, and status.
Referenced by timer_check(), timer_get(), and timer_print().
subroutine, public mo_timer::timers_init |
Initialise timer module.
This routine initializes some machine parameters necessary for computing cpu time from F90 intrinsics.
Example
Initialize timers (before running timers)
Definition at line 358 of file mo_timer.f90.
References clock_rate, cputime, cycles1, cycles2, cycles_max, and status.
real(sp), save, public mo_timer::clock_rate |
clock_rate in seconds for each cycle
Definition at line 82 of file mo_timer.f90.
Referenced by timer_stop(), and timers_init().
real(sp), dimension(max_timers), save, public mo_timer::cputime |
accumulated cpu time in each timer
Definition at line 88 of file mo_timer.f90.
Referenced by timer_clear(), timer_get(), timer_print(), timer_stop(), and timers_init().
integer(i4), dimension(max_timers), save, public mo_timer::cycles1 |
cycle number at start for each timer
Definition at line 84 of file mo_timer.f90.
Referenced by timer_start(), timer_stop(), and timers_init().
integer(i4), dimension(max_timers), save, public mo_timer::cycles2 |
cycle number at stop for each timer
Definition at line 86 of file mo_timer.f90.
Referenced by timer_stop(), and timers_init().
integer(i4), save, public mo_timer::cycles_max |
max value of clock allowed by system
Definition at line 80 of file mo_timer.f90.
Referenced by timer_stop(), and timers_init().
integer(i4), parameter, public mo_timer::max_timers = 500 |
max number of timers allowed
Definition at line 78 of file mo_timer.f90.
character(len = 8), dimension(max_timers), save, public mo_timer::status |
timer status string
Definition at line 90 of file mo_timer.f90.
Referenced by timer_check(), timer_get(), timer_print(), timer_start(), timer_stop(), and timers_init().