benchmark Program

Uses

  • program~~benchmark~~UsesGraph program~benchmark benchmark fortime fortime program~benchmark->fortime kinds kinds program~benchmark->kinds module~foreig foreig program~benchmark->module~foreig module~foreig->kinds

Calls

program~~benchmark~~CallsGraph program~benchmark benchmark interface~eig foreig::eig program~benchmark->interface~eig timer_start timer_start program~benchmark->timer_start timer_stop timer_stop program~benchmark->timer_stop proc~eig_rel foreig::eig_rel interface~eig->proc~eig_rel proc~dgeev_rel foreig::dgeev_rel proc~eig_rel->proc~dgeev_rel proc~dggev_rel foreig::dggev_rel proc~eig_rel->proc~dggev_rel proc~dsyev_rel foreig::dsyev_rel proc~eig_rel->proc~dsyev_rel

Variables

Type Attributes Name Initial
real(kind=rk), dimension(:,:), allocatable :: A
real(kind=rk), dimension(:,:), allocatable :: eig_vec
real(kind=rk), dimension(:), allocatable :: eig_val
integer :: m
integer :: i
integer :: ntests
type(timer) :: t

Source Code

program benchmark

   use kinds
   use foreig, only: eig
   use fortime, only: timer
   
   implicit none

   real(rk), dimension(:,:), allocatable :: A
   real(rk), dimension(:,:), allocatable :: eig_vec
   real(rk), dimension(:),   allocatable :: eig_val
   integer                               :: m, i, ntests
   type(timer)                           :: t

   m = 100

   allocate(A(m,m), eig_vec(m,m), eig_val(m))
   call random_number(A)
   A = A*10.0_rk


   ntests = 5

   call t%timer_start()
   do i = 1, ntests
      call eig(A, eig_vec, eig_val, method='syev')
   end do
   call t%timer_stop(nloops=ntests, message='Elapsed time (syev): ')


   call t%timer_start()
   do i = 1, ntests
      call eig(A, eig_vec, eig_val, method='geev')
   end do
   call t%timer_stop(nloops=ntests, message='Elapsed time (geev): ')


   call t%timer_start()
   do i = 1, ntests
      call eig(A, eig_vec, eig_val, method='ggev')
   end do
   call t%timer_stop(nloops=ntests, message='Elapsed time (ggev): ')


   deallocate(A, eig_vec, eig_val)

end program benchmark