test12 Program

Uses

  • program~~test12~~UsesGraph program~test12 test12 forunittest forunittest program~test12->forunittest kinds kinds program~test12->kinds module~fortime fortime program~test12->module~fortime module~fortime->kinds

Calls

program~~test12~~CallsGraph program~test12 test12 check check program~test12->check mpi_finalize mpi_finalize program~test12->mpi_finalize mpi_init mpi_init program~test12->mpi_init proc~mtimer_start timer%mtimer_start program~test12->proc~mtimer_start proc~mtimer_stop timer%mtimer_stop program~test12->proc~mtimer_stop proc~mtimer_write timer%mtimer_write program~test12->proc~mtimer_write proc~print_time print_time proc~mtimer_stop->proc~print_time colorize colorize proc~print_time->colorize

Variables

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

Source Code

program test12

   use kinds
   use fortime
   use forunittest

   implicit none

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


   ! MPI time with nloops
   call mpi_init(ierr)
   call t%mtimer_start()
   do nl = 1, nloops
      call sleep(1) ! Perform operations ntimes
   end do
   call t%mtimer_stop(message = 'MPI time:')
   call mpi_finalize(ierr)
   call t%mtimer_write('test/test12_mtimes') ! Optionally, write the elapsed time to a file

   call ut%check(res=t%mpi_time, expected=real(nloops,rk)*1.0_rk, tol=1.0e-1_rk, msg='test12')

#endif

end program test12