test8 Program

Uses

  • program~~test8~~UsesGraph program~test8 test8 forunittest forunittest program~test8->forunittest module~fortime fortime program~test8->module~fortime iso_fortran_env iso_fortran_env module~fortime->iso_fortran_env

Calls

program~~test8~~CallsGraph program~test8 test8 check check program~test8->check proc~otimer_start timer%otimer_start program~test8->proc~otimer_start proc~otimer_stop timer%otimer_stop program~test8->proc~otimer_stop proc~otimer_write timer%otimer_write program~test8->proc~otimer_write omp_get_wtime omp_get_wtime proc~otimer_start->omp_get_wtime proc~otimer_stop->omp_get_wtime proc~print_time print_time proc~otimer_stop->proc~print_time proc~write_to_file write_to_file proc~otimer_write->proc~write_to_file colorize colorize proc~print_time->colorize

Variables

Type Attributes Name Initial
integer :: nl
integer :: nloops = 3
type(timer) :: t
type(unit_test) :: ut

Source Code

program test8

   use fortime, only: timer
   use forunittest, only: unit_test, rk

   implicit none

#if defined(USE_OMP)
   type(timer) :: t
   type(unit_test) :: ut
   integer :: nl, nloops=3


   ! OMP time with nloops
   call t%otimer_start()
   do nl = 1, nloops
      call sleep(1) ! Perform operations ntimes
   end do
   call t%otimer_stop(nloops = nloops, message = 'OMP time:')
   call t%otimer_write('test/test8_otimes.txt') ! Optionally, write the elapsed time to a file

   call ut%check(res=t%omp_time, expected=1.0_rk, tol=1.0e-1_rk, msg='test8')

#endif

end program test8