derived type for a timer, contains the start, stop, and count variables can work with or without omp. If PIC is compiled with OpenMP the default timer will be the omp time. This is mostly to minimize problems with threading and system clock
Type | Visibility | Attributes | Name | Initial | |||
---|---|---|---|---|---|---|---|
integer(kind=default_int), | private | :: | count_rate | = | 1_default_int | ||
logical, | private | :: | is_running | = | .false. | ||
integer(kind=default_int), | private | :: | start_count | = | 0_default_int | ||
real(kind=dp), | private | :: | start_time | = | 0.0_dp | ||
integer(kind=default_int), | private | :: | stop_count | = | 0_default_int | ||
real(kind=dp), | private | :: | stop_time | = | 0.0_dp | ||
real(kind=dp), | private | :: | walltime |
Returns the elapsed time as a real(dp) variable
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(pic_timer_type), | intent(in) | :: | self |
Prints the elapsed time at the time of calling
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(pic_timer_type), | intent(in) | :: | self |
starts the timer. If OMP is enabled, it will use omp_get_wtime() if not, it will use Fortran’s system_clock
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(pic_timer_type), | intent(inout) | :: | self |
stop the timer. If OMP is enabled, it will use omp_get_wtime() if not, it will use Fortran’s system_clock
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(pic_timer_type), | intent(inout) | :: | self |
type :: pic_timer_type !! derived type for a timer, contains the start, stop, and count variables !! can work with or without omp. If PIC is compiled with OpenMP the default !! timer will be the omp time. This is mostly to minimize problems with threading !! and system clock private real(dp) :: start_time = 0.0_dp real(dp) :: stop_time = 0.0_dp real(dp) :: walltime logical :: is_running = .false. integer(default_int) :: start_count = 0_default_int integer(default_int) :: stop_count = 0_default_int integer(default_int) :: count_rate = 1_default_int contains procedure :: start => timer_start procedure :: stop => timer_stop procedure :: print_time => timer_print_time procedure :: get_elapsed_time => timer_get_elapsed_time end type pic_timer_type