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

New interface tests: return code and timings

parent b286352c
......@@ -56,6 +56,9 @@ program test_interface
use mod_read_input_parameters
use mod_blacs_infrastructure
use mod_check_correctness
#ifdef HAVE_DETAILED_TIMINGS
use timings
#endif
implicit none
......@@ -90,6 +93,35 @@ program test_interface
call read_input_parameters(na, nev, nblk, write_to_file)
call setup_mpi(myid, nprocs)
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
......@@ -104,6 +136,9 @@ program test_interface
call set_up_blacs_descriptor(na, nblk, my_prow, my_pcol, np_rows, np_cols, &
na_rows, na_cols, sc_desc, my_blacs_ctxt, info)
#ifdef HAVE_DETAILED_TIMINGS
call timer%start("set up matrix")
#endif
allocate(a (na_rows,na_cols), as(na_rows,na_cols))
allocate(z (na_rows,na_cols))
......@@ -114,10 +149,16 @@ program test_interface
ev(:) = 0.0
call prepare_matrix_double(na, myid, sc_desc, a, z, as)
#ifdef HAVE_DETAILED_TIMINGS
call timer%stop("set up matrix")
#endif
if (elpa_init(20170403) /= ELPA_OK) then
error stop "ELPA API version not supported"
endif
#ifdef HAVE_DETAILED_TIMINGS
call timer%start("prepare_elpa")
#endif
e = elpa_create(na, nev, na_rows, na_cols, nblk, mpi_comm_world, my_prow, my_pcol, success)
assert(success == ELPA_OK)
......@@ -132,9 +173,18 @@ program test_interface
call e%set("solver", ELPA_SOLVER_1STAGE, success)
assert(success == ELPA_OK)
#ifdef HAVE_DETAILED_TIMINGS
call timer%stop("prepare_elpa")
#endif
#ifdef HAVE_DETAILED_TIMINGS
call timer%start("solve")
#endif
call e%solve(a, ev, z, success)
assert(success == ELPA_OK)
#ifdef HAVE_DETAILED_TIMINGS
call timer%stop("solve")
#endif
call e%destroy()
......@@ -147,8 +197,21 @@ program test_interface
deallocate(z)
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)
#endif
call EXIT(STATUS)
end program
......@@ -56,6 +56,9 @@ program test_interface
use mod_read_input_parameters
use mod_blacs_infrastructure
use mod_check_correctness
#ifdef HAVE_DETAILED_TIMINGS
use timings
#endif
implicit none
......@@ -90,6 +93,35 @@ program test_interface
call read_input_parameters(na, nev, nblk, write_to_file)
call setup_mpi(myid, nprocs)
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
......@@ -104,6 +136,9 @@ program test_interface
call set_up_blacs_descriptor(na, nblk, my_prow, my_pcol, np_rows, np_cols, &
na_rows, na_cols, sc_desc, my_blacs_ctxt, info)
#ifdef HAVE_DETAILED_TIMINGS
call timer%start("set up matrix")
#endif
allocate(a (na_rows,na_cols), as(na_rows,na_cols))
allocate(z (na_rows,na_cols))
......@@ -114,10 +149,15 @@ program test_interface
ev(:) = 0.0
call prepare_matrix_double(na, myid, sc_desc, a, z, as)
#ifdef HAVE_DETAILED_TIMINGS
call timer%stop("set up matrix")
#endif
if (elpa_init(20170403) /= ELPA_OK) then
error stop "ELPA API version not supported"
endif
#ifdef HAVE_DETAILED_TIMINGS
call timer%start("prepare_elpa")
#endif
e = elpa_create(na, nev, na_rows, na_cols, nblk, mpi_comm_world, my_prow, my_pcol, success)
assert(success == ELPA_OK)
......@@ -135,9 +175,18 @@ program test_interface
call e%set("gpu", 1, success)
assert(success == ELPA_OK)
#ifdef HAVE_DETAILED_TIMINGS
call timer%stop("prepare_elpa")
#endif
#ifdef HAVE_DETAILED_TIMINGS
call timer%start("solve")
#endif
call e%solve(a, ev, z, success)
assert(success == ELPA_OK)
#ifdef HAVE_DETAILED_TIMINGS
call timer%stop("solve")
#endif
call e%destroy()
......@@ -150,8 +199,23 @@ program test_interface
deallocate(z)
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)
#endif
call EXIT(STATUS)
end program
......@@ -56,6 +56,9 @@ program test_interface
use mod_read_input_parameters
use mod_blacs_infrastructure
use mod_check_correctness
#ifdef HAVE_DETAILED_TIMINGS
use timings
#endif
implicit none
......@@ -90,6 +93,35 @@ program test_interface
call read_input_parameters(na, nev, nblk, write_to_file)
call setup_mpi(myid, nprocs)
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
......@@ -104,6 +136,9 @@ program test_interface
call set_up_blacs_descriptor(na, nblk, my_prow, my_pcol, np_rows, np_cols, &
na_rows, na_cols, sc_desc, my_blacs_ctxt, info)
#ifdef HAVE_DETAILED_TIMINGS
call timer%start("set up matrix")
#endif
allocate(a (na_rows,na_cols), as(na_rows,na_cols))
allocate(z (na_rows,na_cols))
......@@ -114,10 +149,16 @@ program test_interface
ev(:) = 0.0
call prepare_matrix_double(na, myid, sc_desc, a, z, as)
#ifdef HAVE_DETAILED_TIMINGS
call timer%stop("set up matrix")
#endif
if (elpa_init(20170403) /= ELPA_OK) then
error stop "ELPA API version not supported"
endif
#ifdef HAVE_DETAILED_TIMINGS
call timer%start("prepare_elpa")
#endif
e = elpa_create(na, nev, na_rows, na_cols, nblk, mpi_comm_world, my_prow, my_pcol, success)
assert(success == ELPA_OK)
......@@ -135,9 +176,18 @@ program test_interface
call e%set("complex_kernel", ELPA_2STAGE_COMPLEX_GENERIC, success)
assert(success == ELPA_OK)
#ifdef HAVE_DETAILED_TIMINGS
call timer%stop("prepare_elpa")
#endif
#ifdef HAVE_DETAILED_TIMINGS
call timer%start("solve")
#endif
call e%solve(a, ev, z, success)
assert(success == ELPA_OK)
#ifdef HAVE_DETAILED_TIMINGS
call timer%stop("solve")
#endif
call e%destroy()
......@@ -149,9 +199,22 @@ program test_interface
deallocate(as)
deallocate(z)
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)
#endif
call EXIT(STATUS)
end program
......@@ -56,6 +56,9 @@ program test_interface
use mod_read_input_parameters
use mod_blacs_infrastructure
use mod_check_correctness
#ifdef HAVE_DETAILED_TIMINGS
use timings
#endif
implicit none
......@@ -90,6 +93,34 @@ program test_interface
call read_input_parameters(na, nev, nblk, write_to_file)
call setup_mpi(myid, nprocs)
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
......@@ -104,6 +135,9 @@ program test_interface
call set_up_blacs_descriptor(na, nblk, my_prow, my_pcol, np_rows, np_cols, &
na_rows, na_cols, sc_desc, my_blacs_ctxt, info)
#ifdef HAVE_DETAILED_TIMINGS
call timer%start("set up matrix")
#endif
allocate(a (na_rows,na_cols), as(na_rows,na_cols))
allocate(z (na_rows,na_cols))
......@@ -114,10 +148,16 @@ program test_interface
ev(:) = 0.0
call prepare_matrix_double(na, myid, sc_desc, a, z, as)
#ifdef HAVE_DETAILED_TIMINGS
call timer%stop("set up matrix")
#endif
if (elpa_init(20170403) /= ELPA_OK) then
error stop "ELPA API version not supported"
endif
#ifdef HAVE_DETAILED_TIMINGS
call timer%start("prepare_elpa")
#endif
e = elpa_create(na, nev, na_rows, na_cols, nblk, mpi_comm_world, my_prow, my_pcol, success)
assert(success == ELPA_OK)
......@@ -138,10 +178,17 @@ program test_interface
call e%set("complex_kernel", ELPA_2STAGE_COMPLEX_GPU, success)
assert(success == ELPA_OK)
#ifdef HAVE_DETAILED_TIMINGS
call timer%stop("prepare_elpa")
#endif
#ifdef HAVE_DETAILED_TIMINGS
call timer%start("solve")
#endif
call e%solve(a, ev, z, success)
assert(success == ELPA_OK)
#ifdef HAVE_DETAILED_TIMINGS
call timer%stop("solve")
#endif
call e%destroy()
call elpa_uninit()
......@@ -152,9 +199,21 @@ program test_interface
deallocate(as)
deallocate(z)
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)
#endif
call EXIT(STATUS)
end program
......@@ -56,6 +56,9 @@ program test_interface
use mod_read_input_parameters
use mod_blacs_infrastructure
use mod_check_correctness
#ifdef HAVE_DETAILED_TIMINGS
use timings
#endif
implicit none
......@@ -90,6 +93,35 @@ program test_interface
call read_input_parameters(na, nev, nblk, write_to_file)
call setup_mpi(myid, nprocs)
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
......@@ -104,6 +136,9 @@ program test_interface
call set_up_blacs_descriptor(na, nblk, my_prow, my_pcol, np_rows, np_cols, &
na_rows, na_cols, sc_desc, my_blacs_ctxt, info)
#ifdef HAVE_DETAILED_TIMINGS
call timer%start("set up matrix")
#endif
allocate(a (na_rows,na_cols), as(na_rows,na_cols))
allocate(z (na_rows,na_cols))
......@@ -114,10 +149,16 @@ program test_interface
ev(:) = 0.0
call prepare_matrix_single(na, myid, sc_desc, a, z, as)
#ifdef HAVE_DETAILED_TIMINGS
call timer%stop("set up matrix")
#endif
if (elpa_init(20170403) /= ELPA_OK) then
error stop "ELPA API version not supported"
endif
#ifdef HAVE_DETAILED_TIMINGS
call timer%start("prepare_elpa")
#endif
e = elpa_create(na, nev, na_rows, na_cols, nblk, mpi_comm_world, my_prow, my_pcol, success)
assert(success == ELPA_OK)
......@@ -131,9 +172,18 @@ program test_interface
call e%set("solver", ELPA_SOLVER_1STAGE, success)
assert(success == ELPA_OK)
#ifdef HAVE_DETAILED_TIMINGS
call timer%stop("prepare_elpa")
#endif
#ifdef HAVE_DETAILED_TIMINGS
call timer%start("solve")
#endif
call e%solve(a, ev, z, success)
assert(success == ELPA_OK)
#ifdef HAVE_DETAILED_TIMINGS
call timer%stop("solve")
#endif
call e%destroy()
......@@ -145,9 +195,20 @@ program test_interface
deallocate(as)
deallocate(z)
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)
#endif
call EXIT(STATUS)
end program
......@@ -56,6 +56,9 @@ program test_interface
use mod_read_input_parameters
use mod_blacs_infrastructure
use mod_check_correctness
#ifdef HAVE_DETAILED_TIMINGS
use timings
#endif
implicit none
......@@ -89,6 +92,34 @@ program test_interface
call read_input_parameters(na, nev, nblk, write_to_file)
call setup_mpi(myid, nprocs)
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