Commit 958032ef authored by Lorenz Huedepohl's avatar Lorenz Huedepohl

A bit of cleanup of the test programs

- Remove all use of ELPA internal modules, the test programs now
  only use the public ELPA API. This is now enforced, by hiding the
  private modules

- Prefix all test internal modules with "test_" to make it really
  clear that these modules are not to be used by users.
parent cd075538
This diff is collapsed.
......@@ -905,8 +905,7 @@ AC_SUBST([OPENMP_FCFLAGS])
AC_SUBST([OPENMP_LDFLAGS])
AC_SUBST([DOXYGEN_OUTPUT_DIR], [docs])
#rm -rf modules/ private_modules/ .fortran_dependencies/
mkdir -p modules private_modules
mkdir -p modules private_modules test_modules
#gl_VISIBILITY
......
......@@ -67,12 +67,12 @@
!> \author A. Marek (MPCDF)
program print_available_elpa2_kernels
use precision
use elpa
use, intrinsic :: iso_c_binding
implicit none
integer(kind=ik) :: i
integer(kind=c_int) :: i
class(elpa_t), pointer :: e
integer :: option
......
! This file is part of ELPA.
! This file is part of ELPA.
!
! The ELPA library was originally created by the ELPA consortium,
! consisting of the following organizations:
......
......@@ -53,114 +53,113 @@
!> \brief Fortran module tp provide some variables for the LEGACY interface. This is obsolete, please use the new interface
module elpa2_utilities
use elpa
use precision
implicit none
public
integer(kind=ik), parameter :: number_of_real_kernels = ELPA_2STAGE_NUMBER_OF_REAL_KERNELS
integer(kind=ik), parameter :: number_of_complex_kernels = ELPA_2STAGE_NUMBER_OF_COMPLEX_KERNELS
integer(kind=c_int), parameter :: number_of_real_kernels = ELPA_2STAGE_NUMBER_OF_REAL_KERNELS
integer(kind=c_int), parameter :: number_of_complex_kernels = ELPA_2STAGE_NUMBER_OF_COMPLEX_KERNELS
#ifdef WITH_REAL_GENERIC_KERNEL
integer(kind=ik), parameter :: REAL_ELPA_KERNEL_GENERIC = ELPA_2STAGE_REAL_GENERIC
integer(kind=c_int), parameter :: REAL_ELPA_KERNEL_GENERIC = ELPA_2STAGE_REAL_GENERIC
#endif
#ifdef WITH_REAL_GENERIC_SIMPLE_KERNEL
integer(kind=ik), parameter :: REAL_ELPA_KERNEL_GENERIC_SIMPLE = ELPA_2STAGE_REAL_GENERIC_SIMPLE
integer(kind=c_int), parameter :: REAL_ELPA_KERNEL_GENERIC_SIMPLE = ELPA_2STAGE_REAL_GENERIC_SIMPLE
#endif
#ifdef WITH_REAL_BGP_KERNEL
integer(kind=ik), parameter :: REAL_ELPA_KERNEL_BGP = ELPA_2STAGE_REAL_BGP
integer(kind=c_int), parameter :: REAL_ELPA_KERNEL_BGP = ELPA_2STAGE_REAL_BGP
#endif
#ifdef WITH_REAL_BGQ_KERNEL
integer(kind=ik), parameter :: REAL_ELPA_KERNEL_BGQ = ELPA_2STAGE_REAL_BGQ
integer(kind=c_int), parameter :: REAL_ELPA_KERNEL_BGQ = ELPA_2STAGE_REAL_BGQ
#endif
#ifdef WITH_REAL_SSE_ASSEMBLY_KERNEL
integer(kind=ik), parameter :: REAL_ELPA_KERNEL_SSE = ELPA_2STAGE_REAL_SSE_ASSEMBLY
integer(kind=c_int), parameter :: REAL_ELPA_KERNEL_SSE = ELPA_2STAGE_REAL_SSE_ASSEMBLY
#endif
#ifdef WITH_REAL_SSE_BLOCK2_KERNEL
integer(kind=ik), parameter :: REAL_ELPA_KERNEL_SSE_BLOCK2 = ELPA_2STAGE_REAL_SSE_BLOCK2
integer(kind=c_int), parameter :: REAL_ELPA_KERNEL_SSE_BLOCK2 = ELPA_2STAGE_REAL_SSE_BLOCK2
#endif
#ifdef WITH_REAL_SSE_BLOCK4_KERNEL
integer(kind=ik), parameter :: REAL_ELPA_KERNEL_SSE_BLOCK4 = ELPA_2STAGE_REAL_SSE_BLOCK4
integer(kind=c_int), parameter :: REAL_ELPA_KERNEL_SSE_BLOCK4 = ELPA_2STAGE_REAL_SSE_BLOCK4
#endif
#ifdef WITH_REAL_SSE_BLOCK6_KERNEL
integer(kind=ik), parameter :: REAL_ELPA_KERNEL_SSE_BLOCK6 = ELPA_2STAGE_REAL_SSE_BLOCK6
integer(kind=c_int), parameter :: REAL_ELPA_KERNEL_SSE_BLOCK6 = ELPA_2STAGE_REAL_SSE_BLOCK6
#endif
#ifdef WITH_REAL_AVX_BLOCK2_KERNEL
integer(kind=ik), parameter :: REAL_ELPA_KERNEL_AVX_BLOCK2 = ELPA_2STAGE_REAL_AVX_BLOCK2
integer(kind=c_int), parameter :: REAL_ELPA_KERNEL_AVX_BLOCK2 = ELPA_2STAGE_REAL_AVX_BLOCK2
#endif
#ifdef WITH_REAL_AVX_BLOCK4_KERNEL
integer(kind=ik), parameter :: REAL_ELPA_KERNEL_AVX_BLOCK4 = ELPA_2STAGE_REAL_AVX_BLOCK4
integer(kind=c_int), parameter :: REAL_ELPA_KERNEL_AVX_BLOCK4 = ELPA_2STAGE_REAL_AVX_BLOCK4
#endif
#ifdef WITH_REAL_AVX_BLOCK6_KERNEL
integer(kind=ik), parameter :: REAL_ELPA_KERNEL_AVX_BLOCK6 = ELPA_2STAGE_REAL_AVX_BLOCK6
integer(kind=c_int), parameter :: REAL_ELPA_KERNEL_AVX_BLOCK6 = ELPA_2STAGE_REAL_AVX_BLOCK6
#endif
#ifdef WITH_REAL_AVX2_BLOCK2_KERNEL
integer(kind=ik), parameter :: REAL_ELPA_KERNEL_AVX2_BLOCK2 = ELPA_2STAGE_REAL_AVX2_BLOCK2
integer(kind=c_int), parameter :: REAL_ELPA_KERNEL_AVX2_BLOCK2 = ELPA_2STAGE_REAL_AVX2_BLOCK2
#endif
#ifdef WITH_REAL_AVX2_BLOCK4_KERNEL
integer(kind=ik), parameter :: REAL_ELPA_KERNEL_AVX2_BLOCK4 = ELPA_2STAGE_REAL_AVX2_BLOCK4
integer(kind=c_int), parameter :: REAL_ELPA_KERNEL_AVX2_BLOCK4 = ELPA_2STAGE_REAL_AVX2_BLOCK4
#endif
#ifdef WITH_REAL_AVX2_BLOCK6_KERNEL
integer(kind=ik), parameter :: REAL_ELPA_KERNEL_AVX2_BLOCK6 = ELPA_2STAGE_REAL_AVX2_BLOCK6
integer(kind=c_int), parameter :: REAL_ELPA_KERNEL_AVX2_BLOCK6 = ELPA_2STAGE_REAL_AVX2_BLOCK6
#endif
#ifdef WITH_REAL_AVX512_BLOCK2_KERNEL
integer(kind=ik), parameter :: REAL_ELPA_KERNEL_AVX512_BLOCK2 = ELPA_2STAGE_REAL_AVX512_BLOCK2
integer(kind=c_int), parameter :: REAL_ELPA_KERNEL_AVX512_BLOCK2 = ELPA_2STAGE_REAL_AVX512_BLOCK2
#endif
#ifdef WITH_REAL_AVX512_BLOCK4_KERNEL
integer(kind=ik), parameter :: REAL_ELPA_KERNEL_AVX512_BLOCK4 = ELPA_2STAGE_REAL_AVX512_BLOCK4
integer(kind=c_int), parameter :: REAL_ELPA_KERNEL_AVX512_BLOCK4 = ELPA_2STAGE_REAL_AVX512_BLOCK4
#endif
#ifdef WITH_REAL_AVX512_BLOCK6_KERNEL
integer(kind=ik), parameter :: REAL_ELPA_KERNEL_AVX512_BLOCK6 = ELPA_2STAGE_REAL_AVX512_BLOCK6
integer(kind=c_int), parameter :: REAL_ELPA_KERNEL_AVX512_BLOCK6 = ELPA_2STAGE_REAL_AVX512_BLOCK6
#endif
#ifdef WITH_GPU_KERNEL
integer(kind=ik), parameter :: REAL_ELPA_KERNEL_GPU = ELPA_2STAGE_REAL_GPU
integer(kind=c_int), parameter :: REAL_ELPA_KERNEL_GPU = ELPA_2STAGE_REAL_GPU
#endif
integer(kind=ik), parameter :: DEFAULT_REAL_ELPA_KERNEL = ELPA_2STAGE_REAL_DEFAULT
integer(kind=c_int), parameter :: DEFAULT_REAL_ELPA_KERNEL = ELPA_2STAGE_REAL_DEFAULT
#ifdef WITH_COMPLEX_GENERIC_KERNEL
integer(kind=ik), parameter :: COMPLEX_ELPA_KERNEL_GENERIC = ELPA_2STAGE_COMPLEX_GENERIC
integer(kind=c_int), parameter :: COMPLEX_ELPA_KERNEL_GENERIC = ELPA_2STAGE_COMPLEX_GENERIC
#endif
#ifdef WITH_COMPLEX_GENERIC_SIMPLE_KERNEL
integer(kind=ik), parameter :: COMPLEX_ELPA_KERNEL_GENERIC_SIMPLE = ELPA_2STAGE_COMPLEX_GENERIC_SIMPLE
integer(kind=c_int), parameter :: COMPLEX_ELPA_KERNEL_GENERIC_SIMPLE = ELPA_2STAGE_COMPLEX_GENERIC_SIMPLE
#endif
#ifdef WITH_COMPLEX_BGP_KERNEL
integer(kind=ik), parameter :: COMPLEX_ELPA_KERNEL_BGP = ELPA_2STAGE_COMPLEX_BGP
integer(kind=c_int), parameter :: COMPLEX_ELPA_KERNEL_BGP = ELPA_2STAGE_COMPLEX_BGP
#endif
#ifdef WITH_COMPLEX_BGQ_KERNEL
integer(kind=ik), parameter :: COMPLEX_ELPA_KERNEL_BGQ = ELPA_2STAGE_COMPLEX_BGQ
integer(kind=c_int), parameter :: COMPLEX_ELPA_KERNEL_BGQ = ELPA_2STAGE_COMPLEX_BGQ
#endif
#ifdef WITH_COMPLEX_SSE_ASSEMBLY_KERNEL
integer(kind=ik), parameter :: COMPLEX_ELPA_KERNEL_SSE = ELPA_2STAGE_COMPLEX_SSE_ASSEMBLY
integer(kind=c_int), parameter :: COMPLEX_ELPA_KERNEL_SSE = ELPA_2STAGE_COMPLEX_SSE_ASSEMBLY
#endif
#ifdef WITH_COMPLEX_SSE_BLOCK1_KERNEL
integer(kind=ik), parameter :: COMPLEX_ELPA_KERNEL_SSE_BLOCK1 = ELPA_2STAGE_COMPLEX_SSE_BLOCK1
integer(kind=c_int), parameter :: COMPLEX_ELPA_KERNEL_SSE_BLOCK1 = ELPA_2STAGE_COMPLEX_SSE_BLOCK1
#endif
#ifdef WITH_COMPLEX_SSE_BLOCK2_KERNEL
integer(kind=ik), parameter :: COMPLEX_ELPA_KERNEL_SSE_BLOCK2 = ELPA_2STAGE_COMPLEX_SSE_BLOCK2
integer(kind=c_int), parameter :: COMPLEX_ELPA_KERNEL_SSE_BLOCK2 = ELPA_2STAGE_COMPLEX_SSE_BLOCK2
#endif
#ifdef WITH_COMPLEX_AVX_BLOCK1_KERNEL
integer(kind=ik), parameter :: COMPLEX_ELPA_KERNEL_AVX_BLOCK1 = ELPA_2STAGE_COMPLEX_AVX_BLOCK1
integer(kind=c_int), parameter :: COMPLEX_ELPA_KERNEL_AVX_BLOCK1 = ELPA_2STAGE_COMPLEX_AVX_BLOCK1
#endif
#ifdef WITH_COMPLEX_AVX_BLOCK2_KERNEL
integer(kind=ik), parameter :: COMPLEX_ELPA_KERNEL_AVX_BLOCK2 = ELPA_2STAGE_COMPLEX_AVX_BLOCK2
integer(kind=c_int), parameter :: COMPLEX_ELPA_KERNEL_AVX_BLOCK2 = ELPA_2STAGE_COMPLEX_AVX_BLOCK2
#endif
#ifdef WITH_COMPLEX_AVX2_BLOCK1_KERNEL
integer(kind=ik), parameter :: COMPLEX_ELPA_KERNEL_AVX2_BLOCK1 = ELPA_2STAGE_COMPLEX_AVX2_BLOCK1
integer(kind=c_int), parameter :: COMPLEX_ELPA_KERNEL_AVX2_BLOCK1 = ELPA_2STAGE_COMPLEX_AVX2_BLOCK1
#endif
#ifdef WITH_COMPLEX_AVX2_BLOCK2_KERNEL
integer(kind=ik), parameter :: COMPLEX_ELPA_KERNEL_AVX2_BLOCK2 = ELPA_2STAGE_COMPLEX_AVX2_BLOCK2
integer(kind=c_int), parameter :: COMPLEX_ELPA_KERNEL_AVX2_BLOCK2 = ELPA_2STAGE_COMPLEX_AVX2_BLOCK2
#endif
#ifdef WITH_COMPLEX_AVX512_BLOCK1_KERNEL
integer(kind=ik), parameter :: COMPLEX_ELPA_KERNEL_AVX512_BLOCK1 = ELPA_2STAGE_COMPLEX_AVX512_BLOCK1
integer(kind=c_int), parameter :: COMPLEX_ELPA_KERNEL_AVX512_BLOCK1 = ELPA_2STAGE_COMPLEX_AVX512_BLOCK1
#endif
#ifdef WITH_COMPLEX_AVX512_BLOCK2_KERNEL
integer(kind=ik), parameter :: COMPLEX_ELPA_KERNEL_AVX512_BLOCK2 = ELPA_2STAGE_COMPLEX_AVX512_BLOCK2
integer(kind=c_int), parameter :: COMPLEX_ELPA_KERNEL_AVX512_BLOCK2 = ELPA_2STAGE_COMPLEX_AVX512_BLOCK2
#endif
#ifdef WITH_GPU_KERNEL
integer(kind=ik), parameter :: COMPLEX_ELPA_KERNEL_GPU = ELPA_2STAGE_COMPLEX_GPU
integer(kind=c_int), parameter :: COMPLEX_ELPA_KERNEL_GPU = ELPA_2STAGE_COMPLEX_GPU
#endif
integer(kind=ik), parameter :: DEFAULT_COMPLEX_ELPA_KERNEL = ELPA_2STAGE_COMPLEX_DEFAULT
integer(kind=c_int), parameter :: DEFAULT_COMPLEX_ELPA_KERNEL = ELPA_2STAGE_COMPLEX_DEFAULT
character(35), parameter, dimension(number_of_real_kernels) :: &
REAL_ELPA_KERNEL_NAMES = (/"REAL_ELPA_KERNEL_GENERIC ", &
......@@ -198,7 +197,7 @@ module elpa2_utilities
"COMPLEX_ELPA_KERNEL_AVX512_BLOCK2 ", &
"COMPLEX_ELPA_KERNEL_GPU "/)
integer(kind=ik), parameter :: &
integer(kind=c_int), parameter :: &
AVAILABLE_REAL_ELPA_KERNELS(number_of_real_kernels) = &
(/ &
#if WITH_REAL_GENERIC_KERNEL
......@@ -295,7 +294,7 @@ module elpa2_utilities
#endif
/)
integer(kind=ik), parameter :: &
integer(kind=c_int), parameter :: &
AVAILABLE_COMPLEX_ELPA_KERNELS(number_of_complex_kernels) = &
(/ &
#if WITH_COMPLEX_GENERIC_KERNEL
......
......@@ -54,6 +54,7 @@ module ELPA_utilities
#ifdef HAVE_ISO_FORTRAN_ENV
use iso_fortran_env, only : output_unit, error_unit
#endif
use, intrinsic :: iso_c_binding
implicit none
private ! By default, all routines contained are private
......@@ -76,10 +77,9 @@ module ELPA_utilities
!Processor col for global col number
pure function pcol(global_col, nblk, np_cols) result(local_col)
use precision
implicit none
integer(kind=ik), intent(in) :: global_col, nblk, np_cols
integer(kind=ik) :: local_col
integer(kind=c_int), intent(in) :: global_col, nblk, np_cols
integer(kind=c_int) :: local_col
local_col = MOD((global_col-1)/nblk,np_cols)
end function
......@@ -87,10 +87,9 @@ module ELPA_utilities
!Processor row for global row number
pure function prow(global_row, nblk, np_rows) result(local_row)
use precision
implicit none
integer(kind=ik), intent(in) :: global_row, nblk, np_rows
integer(kind=ik) :: local_row
integer(kind=c_int), intent(in) :: global_row, nblk, np_rows
integer(kind=c_int) :: local_row
local_row = MOD((global_row-1)/nblk,np_rows)
end function
......@@ -98,13 +97,11 @@ module ELPA_utilities
function map_global_array_index_to_local_index(iGLobal, jGlobal, iLocal, jLocal , nblk, np_rows, np_cols, my_prow, my_pcol) &
result(possible)
use precision
implicit none
integer(kind=ik) :: pi, pj, li, lj, xi, xj
integer(kind=ik), intent(in) :: iGlobal, jGlobal, nblk, np_rows, np_cols, my_prow, my_pcol
integer(kind=ik), intent(out) :: iLocal, jLocal
integer(kind=c_int) :: pi, pj, li, lj, xi, xj
integer(kind=c_int), intent(in) :: iGlobal, jGlobal, nblk, np_rows, np_cols, my_prow, my_pcol
integer(kind=c_int), intent(out) :: iLocal, jLocal
logical :: possible
possible = .true.
......@@ -157,12 +154,11 @@ module ELPA_utilities
! iflag==0 : Return 0
! iflag> 0 : Return next local index after that row/col
!-------------------------------------------------------------------------------
use precision
implicit none
integer(kind=ik) :: idx, my_proc, num_procs, nblk, iflag
integer(kind=c_int) :: idx, my_proc, num_procs, nblk, iflag
integer(kind=ik) :: iblk
integer(kind=c_int) :: iblk
iblk = (idx-1)/nblk ! global block number, 0 based
......@@ -196,9 +192,8 @@ module ELPA_utilities
! Returns the least common multiple of a and b
! There may be more efficient ways to do this, we use the most simple approach
use precision
implicit none
integer(kind=ik), intent(in) :: a, b
integer(kind=c_int), intent(in) :: a, b
do least_common_multiple = a, a*(b-1), a
if(mod(least_common_multiple,b)==0) exit
......@@ -208,13 +203,12 @@ module ELPA_utilities
end function least_common_multiple
subroutine check_alloc(function_name, variable_name, istat, errorMessage)
use precision
implicit none
character(len=*), intent(in) :: function_name
character(len=*), intent(in) :: variable_name
integer(kind=ik), intent(in) :: istat
integer(kind=c_int), intent(in) :: istat
character(len=*), intent(in) :: errorMessage
if (istat .ne. 0) then
......@@ -224,12 +218,11 @@ module ELPA_utilities
end subroutine
subroutine check_alloc_CUDA_f(file_name, line, successCUDA)
use precision
implicit none
character(len=*), intent(in) :: file_name
integer(kind=ik), intent(in) :: line
integer(kind=c_int), intent(in) :: line
logical :: successCUDA
if (.not.(successCUDA)) then
......@@ -239,12 +232,11 @@ module ELPA_utilities
end subroutine
subroutine check_dealloc_CUDA_f(file_name, line, successCUDA)
use precision
implicit none
character(len=*), intent(in) :: file_name
integer(kind=ik), intent(in) :: line
integer(kind=c_int), intent(in) :: line
logical :: successCUDA
if (.not.(successCUDA)) then
......@@ -254,12 +246,11 @@ module ELPA_utilities
end subroutine
subroutine check_memcpy_CUDA_f(file_name, line, successCUDA)
use precision
implicit none
character(len=*), intent(in) :: file_name
integer(kind=ik), intent(in) :: line
integer(kind=c_int), intent(in) :: line
logical :: successCUDA
if (.not.(successCUDA)) then
......
......@@ -44,16 +44,15 @@
#include "config-f90.h"
!> \brief Fortran module which exports the MPI stubs function, if ELPA as been built without MPI support
module elpa_mpi_stubs
use precision
use iso_c_binding
implicit none
public
integer(kind=ik), parameter :: MPI_COMM_SELF=1, MPI_COMM_WORLD=1, MPI_SUCCESS=0
integer(kind=c_int), parameter :: MPI_COMM_SELF=1, MPI_COMM_WORLD=1, MPI_SUCCESS=0
contains
function MPI_WTIME() result(time)
use iso_c_binding
#ifndef WITH_MPI
use time_c
#endif
......@@ -66,14 +65,11 @@ module elpa_mpi_stubs
end function
subroutine mpi_comm_size(mpi_comm_world, ntasks, mpierr)
use precision
implicit none
integer(kind=ik), intent(in) :: mpi_comm_world
integer(kind=ik), intent(inout) :: ntasks
integer(kind=ik), intent(inout) :: mpierr
integer(kind=c_int), intent(in) :: mpi_comm_world
integer(kind=c_int), intent(inout) :: ntasks
integer(kind=c_int), intent(inout) :: mpierr
ntasks = 1
mpierr = 0
......@@ -83,11 +79,10 @@ module elpa_mpi_stubs
end subroutine mpi_comm_size
subroutine mpi_comm_rank(mpi_comm_world, myid, mpierr)
use precision
implicit none
integer(kind=ik), intent(in) :: mpi_comm_world
integer(kind=ik), intent(inout) :: mpierr
integer(kind=ik), intent(inout) :: myid
integer(kind=c_int), intent(in) :: mpi_comm_world
integer(kind=c_int), intent(inout) :: mpierr
integer(kind=c_int), intent(inout) :: myid
myid = 0
mpierr = 0
......@@ -96,10 +91,9 @@ module elpa_mpi_stubs
end subroutine mpi_comm_rank
subroutine mpi_comm_split(mpi_communicator, color, key, new_comm, mpierr)
use precision
implicit none
integer(kind=ik), intent(in) :: mpi_communicator, color, key
integer(kind=ik), intent(inout) :: new_comm, mpierr
integer(kind=c_int), intent(in) :: mpi_communicator, color, key
integer(kind=c_int), intent(inout) :: new_comm, mpierr
new_comm = mpi_communicator
mpierr = 0
......
......@@ -77,27 +77,19 @@ program test_complex2
! with their original authors, but shall adhere to the licensing terms
! distributed along with the original code in the file "COPYING".
!-------------------------------------------------------------------------------
use precision
use elpa_driver
use elpa_utilities, only : error_unit
#ifdef WITH_OPENMP
use test_util
#endif
use mod_check_for_gpu, only : check_for_gpu
use mod_read_input_parameters
use mod_check_correctness
use mod_setup_mpi
use mod_blacs_infrastructure
use mod_prepare_matrix
use elpa_mpi
use test_read_input_parameters
use test_check_correctness
use test_setup_mpi
use test_blacs_infrastructure
use test_prepare_matrix
#ifdef HAVE_REDIRECT
use redirect
use test_redirect
#endif
#ifdef HAVE_DETAILED_TIMINGS
use timings
#endif
use output_types
use test_output_type
implicit none
!-------------------------------------------------------------------------------
......@@ -130,49 +122,18 @@ program test_complex2
logical :: success
character(len=8) :: task_suffix
integer(kind=ik) :: j
logical :: gpuAvailable
integer(kind=ik) :: numberOfDevices
success = .true.
gpuAvailable = .false.
call read_input_parameters_traditional(na, nev, nblk, write_to_file)
!-------------------------------------------------------------------------------
! MPI Initialization
call setup_mpi(myid, nprocs)
gpuAvailable = check_for_gpu(myid, numberOfDevices)
STATUS = 0
#define DATATYPE COMPLEX
#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")
#endif
!-------------------------------------------------------------------------------
! Selection of number of processor rows/columns
! We try to set up the grid square-like, i.e. start the search for possible
......@@ -234,9 +195,6 @@ program test_complex2
!-------------------------------------------------------------------------------
! 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))
......@@ -245,10 +203,6 @@ program test_complex2
call prepare_matrix(na, myid, sc_desc, a, z, as)
#ifdef HAVE_DETAILED_TIMINGS
call timer%stop("set up matrix")
#endif
! set print flag in elpa1
elpa_print_times = .true.
......@@ -371,14 +325,6 @@ program test_complex2
deallocate(z)
deallocate(ev)
#ifdef HAVE_DETAILED_TIMINGS
call timer%stop("program")
print *," "
print *,"Timings program:"
call timer%print("program")
print *," "
print *,"End timings program"
#endif
#ifdef WITH_MPI
call blacs_gridexit(my_blacs_ctxt)
call mpi_finalize(mpierr)
......
......@@ -78,26 +78,18 @@ program test_real2
! distributed along with the original code in the file "COPYING".
!
!-------------------------------------------------------------------------------
use precision
use elpa_driver
use elpa_utilities, only : error_unit
#ifdef WITH_OPENMP
use test_util
#endif
use mod_check_for_gpu, only : check_for_gpu
use mod_read_input_parameters
use mod_check_correctness
use mod_setup_mpi
use mod_blacs_infrastructure
use mod_prepare_matrix
use elpa_mpi
use test_read_input_parameters
use test_check_correctness
use test_setup_mpi
use test_blacs_infrastructure
use test_prepare_matrix
#ifdef HAVE_REDIRECT
use redirect
#endif
#ifdef HAVE_DETAILED_TIMINGS
use timings
use test_redirect
#endif
use output_types
use test_output_type
implicit none
!-------------------------------------------------------------------------------
......@@ -127,11 +119,8 @@ program test_real2
logical :: success
character(len=8) :: task_suffix
integer(kind=ik) :: j
logical :: gpuAvailable
integer(kind=ik) :: numberOfDevices
success = .true.
gpuAvailable = .false.
call read_input_parameters_traditional(na, nev, nblk, write_to_file)
......@@ -139,40 +128,11 @@ program test_real2
! MPI Initialization
call setup_mpi(myid, nprocs)
gpuAvailable = check_for_gpu(myid, numberOfDevices)
STATUS = 0
#define DATATYPE REAL
#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")
#endif
!-------------------------------------------------------------------------------
! Selection of number of processor rows/columns
! We try to set up the grid square-like, i.e. start the search for possible
......@@ -231,9 +191,6 @@ program test_real2
!-------------------------------------------------------------------------------
! 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 +199,6 @@ program test_real2
call prepare_matrix(na, myid, sc_desc, a, z, as)
#ifdef HAVE_DETAILED_TIMINGS
call timer%stop("set up matrix")
#endif
! set print flag in elpa1
elpa_print_times = .true.
......@@ -363,14 +317,6 @@ program test_real2
deallocate(z)
deallocate(ev)
#ifdef HAVE_DETAILED_TIMINGS
call timer%stop("program")
print *," "
print *,"Timings program:"
call timer%print("program")
print *," "
print *,"End timings program"
#endif
#ifdef WITH_MPI
call blacs_gridexit(my_blacs_ctxt)
call mpi_finalize(mpierr)
......
......@@ -77,27 +77,19 @@ program test_complex2
! with their original authors, but shall adhere to the licensing terms
! distributed along with the original code in the file "COPYING".
!-------------------------------------------------------------------------------
use precision
use elpa_driver
use elpa_utilities, only : error_unit
#ifdef WITH_OPENMP
use test_util
#endif
use mod_check_for_gpu, only : check_for_gpu
use mod_read_input_parameters
use mod_check_correctness
use mod_setup_mpi
use mod_blacs_infrastructure