Commit b2ca1a60 authored by Andreas Marek's avatar Andreas Marek
Browse files

Reproduce old timing functionality of ELPA1 with the new timer objects

parent 65ee2226
......@@ -61,11 +61,6 @@ function elpa_solve_evp_&
& (na, nev, a, lda, ev, q, ldq, nblk, matrixCols, mpi_comm_rows, mpi_comm_cols, mpi_comm_all, &
useGPU) result(success)
use precision
#ifdef HAVE_DETAILED_TIMINGS
use timings
#else
use timings_dummy
#endif
use iso_c_binding
use elpa_mpi
use elpa
......@@ -105,13 +100,6 @@ function elpa_solve_evp_&
class(elpa_t), pointer :: e
print *, "timer%start"
call timer%start("elpa_solve_evp_&
&MATH_DATATYPE&
&_1stage_&
&PRECISION&
&_legacy_interface")
call mpi_comm_rank(mpi_comm_rows,my_prow,mpierr)
call mpi_comm_rank(mpi_comm_cols,my_pcol,mpierr)
......@@ -172,29 +160,44 @@ function elpa_solve_evp_&
return
endif
call e%set("timings", 1)
call e%solve(a(1:lda,1:matrixCols), ev, q(1:ldq,1:matrixCols), successInternal)
time_evp_fwd = e%get_time("elpa_solve_evp_&
&MATH_DATATYPE&
&_1stage_&
&PRECISION&
&","forward")
if(my_prow==0 .and. my_pcol==0 .and. elpa_print_times) write(error_unit,*) 'Time tridiag_real :',time_evp_fwd
time_evp_solve = e%get_time("elpa_solve_evp_&
&MATH_DATATYPE&
&_1stage_&
&PRECISION&
&","solve")
if(my_prow==0 .and. my_pcol==0 .and. elpa_print_times) write(error_unit,*) 'Time solve_tridi :',time_evp_solve
time_evp_back = e%get_time("elpa_solve_evp_&
&MATH_DATATYPE&
&_1stage_&
&PRECISION&
&","back")
if(my_prow==0 .and. my_pcol==0 .and. elpa_print_times) write(error_unit,*) 'Time trans_ev_real:',time_evp_back
if (successInternal .ne. ELPA_OK) then
print *, "Cannot solve with ELPA 1stage"
success = .false.
return
endif
time_evp_fwd = e%get_double("time_evp_fwd")
time_evp_solve = e%get_double("time_evp_solve")
time_evp_back = e%get_double("time_evp_back")
call elpa_deallocate(e)
call elpa_uninit()
print *, "timer%stop"
call timer%stop("elpa_solve_evp_&
&MATH_DATATYPE&
&_1stage_&
&PRECISION&
&_legacy_interface")
end function
! vim: syntax=fortran
......@@ -89,9 +89,6 @@ program test_complex_double_precision
use redirect
#endif
#ifdef HAVE_DETAILED_TIMINGS
use timings
#endif
use output_types
implicit none
......@@ -141,33 +138,6 @@ program test_complex_double_precision
#define ELPA1
#include "../../elpa_print_headers.X90"
#ifdef HAVE_DETAILED_TIMINGS
! initialise the timing functionality
#ifdef HAVE_LIBPAPI
call timer%measure_flops(.true.)
#endif
call timer%measure_allocated_memory(.true.)
call timer%measure_virtual_memory(.true.)
call timer%measure_max_allocated_memory(.true.)
call timer%set_print_options(&
#ifdef HAVE_LIBPAPI
print_flop_count=.true., &
print_flop_rate=.true., &
#endif
print_allocated_memory = .true. , &
print_virtual_memory=.true., &
print_max_allocated_memory=.true.)
call timer%enable()
call timer%start("program: test_complex_double_precision")
#endif
!-------------------------------------------------------------------------------
! Selection of number of processor rows/columns
! We try to set up the grid square-like, i.e. start the search for possible
......@@ -238,9 +208,6 @@ program test_complex_double_precision
!-------------------------------------------------------------------------------
! Allocate matrices and set up a test matrix for the eigenvalue problem
#ifdef HAVE_DETAILED_TIMINGS
call timer%start("set up matrix")
#endif
allocate(a (na_rows,na_cols))
allocate(z (na_rows,na_cols))
allocate(as(na_rows,na_cols))
......@@ -248,10 +215,7 @@ program test_complex_double_precision
allocate(ev(na))
call prepare_matrix(na, myid, sc_desc, a, z, as)
#ifdef HAVE_DETAILED_TIMINGS
call timer%stop("set up matrix")
#endif
elpa_print_times = .true.
!-------------------------------------------------------------------------------
! Calculate eigenvalues/eigenvectors
......@@ -317,14 +281,6 @@ program test_complex_double_precision
deallocate(z)
deallocate(ev)
#ifdef HAVE_DETAILED_TIMINGS
call timer%stop("program: test_complex_double_precision")
print *," "
print *,"Timings program: test_complex_double_precision"
call timer%print("program: test_complex_double_precision")
print *," "
print *,"End timings program: test_complex_double_precision"
#endif
#ifdef WITH_MPI
call blacs_gridexit(my_blacs_ctxt)
call mpi_finalize(mpierr)
......
......@@ -61,9 +61,6 @@ program test_cholesky
use elpa_mpi
#ifdef HAVE_REDIRECT
use redirect
#endif
#ifdef HAVE_DETAILED_TIMINGS
use timings
#endif
use output_types
......@@ -121,33 +118,6 @@ program test_cholesky
STATUS = 0
#ifdef HAVE_DETAILED_TIMINGS
! initialise the timing functionality
#ifdef HAVE_LIBPAPI
call timer%measure_flops(.true.)
#endif
call timer%measure_allocated_memory(.true.)
call timer%measure_virtual_memory(.true.)
call timer%measure_max_allocated_memory(.true.)
call timer%set_print_options(&
#ifdef HAVE_LIBPAPI
print_flop_count=.true., &
print_flop_rate=.true., &
#endif
print_allocated_memory = .true. , &
print_virtual_memory=.true., &
print_max_allocated_memory=.true.)
call timer%enable()
call timer%start("program")
#endif
do np_cols = NINT(SQRT(REAL(nprocs))),2,-1
if(mod(nprocs,np_cols) == 0 ) exit
enddo
......@@ -198,9 +168,6 @@ program test_cholesky
!-------------------------------------------------------------------------------
! Allocate matrices and set up a test matrix for the eigenvalue problem
#ifdef HAVE_DETAILED_TIMINGS
call timer%start("set up matrix")
#endif
allocate(a (na_rows,na_cols))
allocate(b (na_rows,na_cols))
allocate(c (na_rows,na_cols))
......@@ -222,10 +189,6 @@ program test_cholesky
enddo
as(:,:) = a(:,:)
#ifdef HAVE_DETAILED_TIMINGS
call timer%stop("set up matrix")
#endif
!-------------------------------------------------------------------------------
! Calculate eigenvalues/eigenvectors
......@@ -307,17 +270,6 @@ program test_cholesky
deallocate(ev)
#ifdef HAVE_DETAILED_TIMINGS
call timer%stop("program")
print *," "
print *,"Timings program:"
print *," "
call timer%print("program")
print *," "
print *,"End timings program"
print *," "
#endif
#ifdef WITH_MPI
call blacs_gridexit(my_blacs_ctxt)
call mpi_finalize(mpierr)
......
......@@ -93,9 +93,6 @@ program test_complex_gpu_version_double_precision
use redirect
#endif
#ifdef HAVE_DETAILED_TIMINGS
use timings
#endif
use output_types
implicit none
......@@ -149,33 +146,6 @@ program test_complex_gpu_version_double_precision
#define ELPA1
#include "../../elpa_print_headers.X90"
#ifdef HAVE_DETAILED_TIMINGS
! initialise the timing functionality
#ifdef HAVE_LIBPAPI
call timer%measure_flops(.true.)
#endif
call timer%measure_allocated_memory(.true.)
call timer%measure_virtual_memory(.true.)
call timer%measure_max_allocated_memory(.true.)
call timer%set_print_options(&
#ifdef HAVE_LIBPAPI
print_flop_count=.true., &
print_flop_rate=.true., &
#endif
print_allocated_memory = .true. , &
print_virtual_memory=.true., &
print_max_allocated_memory=.true.)
call timer%enable()
call timer%start("program: test_complex_gpu_version_double_precision")
#endif
!-------------------------------------------------------------------------------
! Selection of number of processor rows/columns
! We try to set up the grid square-like, i.e. start the search for possible
......@@ -250,9 +220,6 @@ program test_complex_gpu_version_double_precision
!-------------------------------------------------------------------------------
! Allocate matrices and set up a test matrix for the eigenvalue problem
#ifdef HAVE_DETAILED_TIMINGS
call timer%start("set up matrix")
#endif
allocate(a (na_rows,na_cols))
allocate(z (na_rows,na_cols))
allocate(as(na_rows,na_cols))
......@@ -261,9 +228,6 @@ program test_complex_gpu_version_double_precision
call prepare_matrix(na, myid, sc_desc, a, z, as)
#ifdef HAVE_DETAILED_TIMINGS
call timer%stop("set up matrix")
#endif
!-------------------------------------------------------------------------------
! Calculate eigenvalues/eigenvectors
......@@ -328,14 +292,6 @@ program test_complex_gpu_version_double_precision
deallocate(z)
deallocate(ev)
#ifdef HAVE_DETAILED_TIMINGS
call timer%stop("program: test_complex_gpu_version_double_precision")
print *," "
print *,"Timings program: test_complex_gpu_version_double_precision"
call timer%print("program: test_complex_gpu_version_double_precision")
print *," "
print *,"End timings program: test_complex_gpu_version_double_precision"
#endif
#ifdef WITH_MPI
call blacs_gridexit(my_blacs_ctxt)
call mpi_finalize(mpierr)
......
......@@ -61,9 +61,6 @@ program test_invert_trm
use elpa_mpi
#ifdef HAVE_REDIRECT
use redirect
#endif
#ifdef HAVE_DETAILED_TIMINGS
use timings
#endif
use output_types
......@@ -121,33 +118,6 @@ program test_invert_trm
STATUS = 0
#ifdef HAVE_DETAILED_TIMINGS
! initialise the timing functionality
#ifdef HAVE_LIBPAPI
call timer%measure_flops(.true.)
#endif
call timer%measure_allocated_memory(.true.)
call timer%measure_virtual_memory(.true.)
call timer%measure_max_allocated_memory(.true.)
call timer%set_print_options(&
#ifdef HAVE_LIBPAPI
print_flop_count=.true., &
print_flop_rate=.true., &
#endif
print_allocated_memory = .true. , &
print_virtual_memory=.true., &
print_max_allocated_memory=.true.)
call timer%enable()
call timer%start("program")
#endif
do np_cols = NINT(SQRT(REAL(nprocs))),2,-1
if(mod(nprocs,np_cols) == 0 ) exit
enddo
......@@ -198,9 +168,6 @@ program test_invert_trm
!-------------------------------------------------------------------------------
! Allocate matrices and set up a test matrix for the eigenvalue problem
#ifdef HAVE_DETAILED_TIMINGS
call timer%start("set up matrix")
#endif
allocate(a (na_rows,na_cols))
allocate(b (na_rows,na_cols))
allocate(bs(na_rows,na_cols))
......@@ -222,10 +189,6 @@ program test_invert_trm
enddo
as(:,:) = a(:,:)
#ifdef HAVE_DETAILED_TIMINGS
call timer%stop("set up matrix")
#endif
!-------------------------------------------------------------------------------
! Calculate eigenvalues/eigenvectors
......@@ -334,17 +297,6 @@ program test_invert_trm
deallocate(ev)
#ifdef HAVE_DETAILED_TIMINGS
call timer%stop("program")
print *," "
print *,"Timings program:"
print *," "
call timer%print("program")
print *," "
print *,"End timings program"
print *," "
#endif
#ifdef WITH_MPI
call blacs_gridexit(my_blacs_ctxt)
call mpi_finalize(mpierr)
......
......@@ -61,9 +61,6 @@ program test_transpose_multiply
use elpa_mpi
#ifdef HAVE_REDIRECT
use redirect
#endif
#ifdef HAVE_DETAILED_TIMINGS
use timings
#endif
use output_types
......@@ -115,33 +112,6 @@ program test_transpose_multiply
STATUS = 0
#ifdef HAVE_DETAILED_TIMINGS
! initialise the timing functionality
#ifdef HAVE_LIBPAPI
call timer%measure_flops(.true.)
#endif
call timer%measure_allocated_memory(.true.)
call timer%measure_virtual_memory(.true.)
call timer%measure_max_allocated_memory(.true.)
call timer%set_print_options(&
#ifdef HAVE_LIBPAPI
print_flop_count=.true., &
print_flop_rate=.true., &
#endif
print_allocated_memory = .true. , &
print_virtual_memory=.true., &
print_max_allocated_memory=.true.)
call timer%enable()
call timer%start("program")
#endif
do np_cols = NINT(SQRT(REAL(nprocs))),2,-1
if(mod(nprocs,np_cols) == 0 ) exit
enddo
......@@ -192,9 +162,6 @@ program test_transpose_multiply
!-------------------------------------------------------------------------------
! Allocate matrices and set up a test matrix for the eigenvalue problem
#ifdef HAVE_DETAILED_TIMINGS
call timer%start("set up matrix")
#endif
allocate(a (na_rows,na_cols))
allocate(b (na_rows,na_cols))
allocate(c (na_rows,na_cols))
......@@ -207,10 +174,6 @@ program test_transpose_multiply
b(:,:) = 2.0_ck8 * a(:,:)
c(:,:) = 0.0_ck8
#ifdef HAVE_DETAILED_TIMINGS
call timer%stop("set up matrix")
#endif
!-------------------------------------------------------------------------------
! Calculate eigenvalues/eigenvectors
......@@ -292,17 +255,6 @@ program test_transpose_multiply
deallocate(tmp2)
deallocate(ev)
#ifdef HAVE_DETAILED_TIMINGS
call timer%stop("program")
print *," "
print *,"Timings program:"
print *," "
call timer%print("program")
print *," "
print *,"End timings program"
print *," "
#endif
#ifdef WITH_MPI
call blacs_gridexit(my_blacs_ctxt)
call mpi_finalize(mpierr)
......
......@@ -90,9 +90,6 @@ program test_real_double_precision
use elpa_mpi
#ifdef HAVE_REDIRECT
use redirect
#endif
#ifdef HAVE_DETAILED_TIMINGS
use timings
#endif
use output_types
......@@ -143,33 +140,6 @@ program test_real_double_precision
#define ELPA1
#include "../../elpa_print_headers.X90"
#ifdef HAVE_DETAILED_TIMINGS
! initialise the timing functionality
#ifdef HAVE_LIBPAPI
call timer%measure_flops(.true.)
#endif
call timer%measure_allocated_memory(.true.)
call timer%measure_virtual_memory(.true.)
call timer%measure_max_allocated_memory(.true.)
call timer%set_print_options(&
#ifdef HAVE_LIBPAPI
print_flop_count=.true., &
print_flop_rate=.true., &
#endif
print_allocated_memory = .true. , &
print_virtual_memory=.true., &
print_max_allocated_memory=.true.)
call timer%enable()
call timer%start("program: test_real_double_precision")
#endif
do np_cols = NINT(SQRT(REAL(nprocs))),2,-1
if(mod(nprocs,np_cols) == 0 ) exit
enddo
......@@ -182,10 +152,10 @@ program test_real_double_precision
print *
print '(a)','Standard eigenvalue problem - ELPA1, REAL version'
print *
print '((a,i0))', 'Matrix size: ', na
print '((a,i0))', 'Matrix size: ', na
print '((a,i0))', 'Num eigenvectors: ', nev
print '((a,i0))', 'Blocksize: ', nblk
print '((a,i0))', 'Num MPI proc: ', nprocs
print '((a,i0))', 'Blocksize: ', nblk
print '((a,i0))', 'Num MPI proc: ', nprocs
print '((a))', 'Using gpu: NO'
print '((a,i0))', 'Num gpu devices: ', 0
print '((a))', 'Number type: real'
......@@ -231,9 +201,6 @@ program test_real_double_precision
!-------------------------------------------------------------------------------
! Allocate matrices and set up a test matrix for the eigenvalue problem
#ifdef HAVE_DETAILED_TIMINGS
call timer%start("set up matrix")
#endif
allocate(a (na_rows,na_cols))
allocate(z (na_rows,na_cols))
allocate(as(na_rows,na_cols))
......@@ -242,9 +209,6 @@ program test_real_double_precision
call prepare_matrix(na, myid, sc_desc, a, z, as)
#ifdef HAVE_DETAILED_TIMINGS
call timer%stop("set up matrix")
#endif
elpa_print_times = .true.
!-------------------------------------------------------------------------------
! Calculate eigenvalues/eigenvectors
......@@ -311,17 +275,6 @@ program test_real_double_precision
deallocate(z)
deallocate(ev)
#ifdef HAVE_DETAILED_TIMINGS
call timer%stop("program: test_real_double_precision")
print *," "
print *,"Timings program: test_real_double_precision"
print *," "
call timer%print("program: test_real_double_precision")
print *," "
print *,"End timings program: test_real_double_precision"
print *," "
#endif
#ifdef WITH_MPI
call blacs_gridexit(my_blacs_ctxt)
call mpi_finalize(mpierr)
......
......@@ -89,9 +89,6 @@ program test_real
use elpa_mpi
#ifdef HAVE_REDIRECT
use redirect
#endif
#ifdef HAVE_DETAILED_TIMINGS
use timings
#endif
use output_types
implicit none
......@@ -136,32 +133,6 @@ program test_real
! MPI Initialization
call setup_mpi(myid, nprocs)
#ifdef HAVE_DETAILED_TIMINGS