pic_timer_type Derived Type

type, public :: 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


Inherited by

type~~pic_timer_type~~InheritedByGraph type~pic_timer_type pic_timer_type type~flop_rate_type flop_rate_type type~flop_rate_type->type~pic_timer_type m_timer

Components

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

Type-Bound Procedures

procedure, public :: get_elapsed_time => timer_get_elapsed_time

procedure, public :: print_time => timer_print_time

procedure, public :: start => timer_start

  • private subroutine timer_start(self)

    starts the timer. If OMP is enabled, it will use omp_get_wtime() if not, it will use Fortran’s system_clock

    Read more…

    Arguments

    Type IntentOptional Attributes Name
    class(pic_timer_type), intent(inout) :: self

procedure, public :: stop => timer_stop

  • private subroutine timer_stop(self)

    stop the timer. If OMP is enabled, it will use omp_get_wtime() if not, it will use Fortran’s system_clock

    Read more…

    Arguments

    Type IntentOptional Attributes Name
    class(pic_timer_type), intent(inout) :: self

Source Code

   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