get the flop rate in GFLOP/s, this will calculate the flop rate based on the number of flops and the elapsed time
Usage: flop_rate = my_flop_rate%get_flop_rate()
where my_flop_rate is an instance of flop_rate_type
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(flop_rate_type), | intent(inout) | :: | self |
Type | Visibility | Attributes | Name | Initial | |||
---|---|---|---|---|---|---|---|
integer(kind=int64), | private | :: | flops | ||||
real(kind=dp), | private | :: | time |
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 !! !! Usage: flop_rate = my_flop_rate%get_flop_rate() !! !! where my_flop_rate is an instance of flop_rate_type !! class(flop_rate_type), intent(inout) :: self real(dp) :: flop_rate real(dp) :: time integer(int64) :: flops flops = self%m_flops%get() time = self%m_timer%get_elapsed_time() if (time <= 0.0_dp) then print *, "Warning: Time is zero or negative, setting flop rate to zero." self%m_flop_rate = 0.0_dp flop_rate = 0.0_dp return else self%m_flop_rate = flops/time/1.0e9_dp flop_rate = self%m_flop_rate end if end function flop_rate_get_flop_rate