Skip to content

Commit

Permalink
add function to get time resolution
Browse files Browse the repository at this point in the history
  • Loading branch information
degawa committed Sep 20, 2021
1 parent 471f8b7 commit 8342d89
Showing 1 changed file with 10 additions and 3 deletions.
13 changes: 10 additions & 3 deletions himenoBMT.f90
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,6 @@ program HimenoBMTxp_F90
integer(int32) :: imax, jmax, kmax !&

integer(int32) :: numItr
integer(int32) :: count, count_rate, count_max
real(real32) :: flop, mflops, score, error
real(real64) :: time_begin_s, time_end_s, time_elapsed_s, dt

Expand Down Expand Up @@ -81,8 +80,7 @@ program HimenoBMTxp_F90
print *, " mimax=", mimax, " mjmax=", mjmax, " mkmax=", mkmax
print *, " imax=", imax, " jmax=", jmax, " kmax=", kmax

call system_clock(count, count_rate, count_max)
dt = 1.0/dble(count_rate)
dt = get_time_measurement_resolusion()
print "(a,e12.5)", "Time measurement accuracy : ", dt

! Rehearsal measurment to estimate the number of iterations
Expand Down Expand Up @@ -142,6 +140,15 @@ program HimenoBMTxp_F90

contains

function get_time_measurement_resolusion() result(time_interval)
implicit none
integer(int32) :: count, count_rate, count_max
real(real64) :: time_interval

call system_clock(count, count_rate, count_max)
time_interval = 1.0/dble(count_rate)
end function get_time_measurement_resolusion

function get_current_time() result(currentTime)
implicit none
integer(int32) :: count, count_rate, count_max
Expand Down

0 comments on commit 8342d89

Please sign in to comment.