Skip to content

Commit

Permalink
Handle too small elapsed time error
Browse files Browse the repository at this point in the history
  • Loading branch information
gha3mi committed Jan 7, 2024
1 parent 525505c commit 1521ce4
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/forbenchmark_coarray.f90
Original file line number Diff line number Diff line change
Expand Up @@ -329,6 +329,7 @@ end function Fun
end select

if (present(flops)) then
if (this%marks_co(this%imark)%elapsed_time <= epsilon(0.0_rk)) error stop 'Elapsed time is too small.'
this%marks_co(this%imark)%flops = flops(this%argi,this%argr)/this%marks_co(this%imark)%elapsed_time
print'(a,f7.3,a)', ' Performance :', this%marks_co(this%imark)%flops,' [GFLOPS/image]'
else
Expand Down Expand Up @@ -359,6 +360,7 @@ end function Fun
this%marks(this%imark)%elapsed_time_min = elapsed_time_min
this%marks(this%imark)%elapsed_time_max = elapsed_time_max

if (this%marks(1)%elapsed_time_max <= epsilon(0.0_rk)) error stop 'Maximum elapsed time for the reference benchmark is too small.'
this%marks(this%imark)%speedup_max_total = this%marks(this%imark)%elapsed_time_max/this%marks(1)%elapsed_time_max


Expand Down
2 changes: 2 additions & 0 deletions src/forbenchmark_default.f90
Original file line number Diff line number Diff line change
Expand Up @@ -265,6 +265,8 @@ end function Fun
#endif
end select

if (this%marks(this%imark)%elapsed_time <= epsilon(0.0_rk)) error stop 'Elapsed time is too small'

this%marks(this%imark)%speedup = this%marks(this%imark)%elapsed_time/this%marks(1)%elapsed_time

if (present(flops)) then
Expand Down

0 comments on commit 1521ce4

Please sign in to comment.