flop_rate_type Derived Type

type, public :: flop_rate_type

derived type for flop rate, contains a timer and a flop recorder


Inherits

type~~flop_rate_type~~InheritsGraph type~flop_rate_type flop_rate_type type~flop_recorder_type flop_recorder_type type~flop_rate_type->type~flop_recorder_type m_flops type~pic_timer_type pic_timer_type type~flop_rate_type->type~pic_timer_type m_timer

Components

Type Visibility Attributes Name Initial
real(kind=dp), private :: m_flop_rate

private by default so that people use the accessor functions

type(flop_recorder_type), private :: m_flops
type(pic_timer_type), private :: m_timer

Type-Bound Procedures

procedure, public :: add_flops => flop_rate_add_flops

  • private subroutine flop_rate_add_flops(self, flops)

    add flops to the flop rate type, this will add the flops to the flop recorder Usage: call my_flop_rate%add_flops(1000)

    Read more…

    Arguments

    Type IntentOptional Attributes Name
    class(flop_rate_type), intent(inout) :: self
    integer(kind=int64), intent(in) :: flops

procedure, public :: get_flop_rate => flop_rate_get_flop_rate

  • private function flop_rate_get_flop_rate(self) result(flop_rate)

    get the flop rate in GFLOP/s, this will calculate the flop rate based on the number of flops and the elapsed time

    Read more…

    Arguments

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

    Return Value real(kind=dp)

procedure, public :: get_flops => flop_rate_get_flops

  • private function flop_rate_get_flops(self) result(flops)

    get the number of flops recorded in the flop rate type

    Read more…

    Arguments

    Type IntentOptional Attributes Name
    class(flop_rate_type), intent(in) :: self

    Return Value integer(kind=int64)

procedure, public :: get_time => flop_rate_get_time

  • private function flop_rate_get_time(self) result(time)

    get the elapsed time in seconds from the timer contained in the flop rate type

    Read more…

    Arguments

    Type IntentOptional Attributes Name
    class(flop_rate_type), intent(in) :: self

    Return Value real(kind=dp)

procedure, public :: report => flop_rate_report

procedure, public :: reset => flop_rate_reset

  • private subroutine flop_rate_reset(self)

    reset the flop rate type, this will reset the timer and the flop recorder

    Read more…

    Arguments

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

procedure, public :: start_time => flop_rate_start_time

procedure, public :: stop_time => flop_rate_stop_time

Source Code

   type flop_rate_type
      !! derived type for flop rate, contains a timer and a flop recorder

      private
      type(pic_timer_type) :: m_timer
      type(flop_recorder_type) :: m_flops

      real(dp) :: m_flop_rate
      !! private by default so that people use the accessor functions
   contains

      procedure :: start_time => flop_rate_start_time
      procedure :: stop_time => flop_rate_stop_time
      procedure :: add_flops => flop_rate_add_flops
      procedure :: get_flops => flop_rate_get_flops
      procedure :: get_time => flop_rate_get_time
      procedure :: get_flop_rate => flop_rate_get_flop_rate
      procedure :: report => flop_rate_report
      procedure :: reset => flop_rate_reset

   end type flop_rate_type