Commit 162baf19 authored by Andreas Marek's avatar Andreas Marek
Browse files

WIP

parent 65e33ecf
...@@ -208,6 +208,30 @@ if test x"${enable_heterogenous_cluster_support}" = x"yes"; then ...@@ -208,6 +208,30 @@ if test x"${enable_heterogenous_cluster_support}" = x"yes"; then
fi fi
AM_CONDITIONAL([HAVE_HETEROGENOUS_CLUSTER_SUPPORT],[test x"$enable_heterogenous_cluster_support" = x"yes"]) AM_CONDITIONAL([HAVE_HETEROGENOUS_CLUSTER_SUPPORT],[test x"$enable_heterogenous_cluster_support" = x"yes"])
dnl 64bit integer support for BLACS/LAPACK/SCALAPACK
AC_MSG_CHECKING(whether 64bit integers should be used for math libraries (BLAS/LAPACK/SCALAPACK))
AC_ARG_ENABLE([64bit-integer-support],
AS_HELP_STRING([--64bit-integer-support],
[allows to link against the 64bit integer versions of the math libraries BLAS, LAPACK, and SCALAPACK]),
[
if test x"$enableval" = x"yes"; then
enable_64bit_integer_support=yes
else
enable_64bit_integer_support=no
fi
],
[enable_64bit_integer_support="no"])
AC_MSG_RESULT([$enable_64bit_integer_support])
if test x"${enable_64bit_integer_support}" = x"yes"; then
AC_DEFINE([HAVE_64BIT_INTEGER_SUPPORT], [1], [allow to link against the 64bit integer versions of math libraries])
fi
AM_CONDITIONAL([HAVE_64BIT_INTEGER_SUPPORT],[test x"$enable_64bit_integer_support" = x"yes"])
AC_MSG_CHECKING(whether C compiler can use _Generic ) AC_MSG_CHECKING(whether C compiler can use _Generic )
AC_COMPILE_IFELSE([AC_LANG_SOURCE([ AC_COMPILE_IFELSE([AC_LANG_SOURCE([
int main(int argc, char **argv) { int main(int argc, char **argv) {
......
...@@ -53,5 +53,14 @@ module precision ...@@ -53,5 +53,14 @@ module precision
integer, parameter :: ik = C_INT32_T integer, parameter :: ik = C_INT32_T
integer, parameter :: lik = C_INT64_T integer, parameter :: lik = C_INT64_T
#if HAVE_64BIT_INTEGER_SUPPORT
integer, parameter :: BLAS_KIND = C_INT32_T integer, parameter :: BLAS_KIND = C_INT32_T
integer, parameter :: BLAS_KIND_TEST = C_INT64_T
integer, parameter :: MPI_KIND = C_INT64_T
#else
integer, parameter :: BLAS_KIND = C_INT32_T
integer, parameter :: MPI_KIND = C_INT32_T
#endif
end module precision end module precision
...@@ -102,44 +102,47 @@ error: define either TEST_ALL_KERNELS or a valid TEST_KERNEL ...@@ -102,44 +102,47 @@ error: define either TEST_ALL_KERNELS or a valid TEST_KERNEL
#define KERNEL_KEY "complex_kernel" #define KERNEL_KEY "complex_kernel"
#endif #endif
#define TEST_INTEGER integer(kind=C_int64_t)
#include "assert.h" #include "assert.h"
program test program test
use elpa !use elpa
use test_util !use test_util
use test_setup_mpi !use test_setup_mpi
use test_prepare_matrix !use test_prepare_matrix
use test_read_input_parameters use test_read_input_parameters
use test_blacs_infrastructure !use test_blacs_infrastructure
use test_check_correctness !use test_check_correctness
use test_analytic !use test_analytic
#ifdef WITH_SCALAPACK_TESTS #ifdef WITH_SCALAPACK_TESTS
use test_scalapack !use test_scalapack
#endif #endif
#ifdef HAVE_REDIRECT #ifdef HAVE_REDIRECT
use test_redirect !use test_redirect
#endif #endif
#ifdef WITH_OPENMP #ifdef WITH_OPENMP
use omp_lib !use omp_lib
#endif #endif
use precision use precision
implicit none implicit none
! matrix dimensions ! matrix dimensions
integer :: na, nev, nblk TEST_INTEGER :: na, nev, nblk
! mpi ! mpi
integer :: myid, nprocs TEST_INTEGER :: myid, nprocs
integer :: na_cols, na_rows ! local matrix size TEST_INTEGER :: na_cols, na_rows ! local matrix size
integer :: np_cols, np_rows ! number of MPI processes per column/row TEST_INTEGER :: np_cols, np_rows ! number of MPI processes per column/row
integer :: my_prow, my_pcol ! local MPI task position (my_prow, my_pcol) in the grid (0..np_cols -1, 0..np_rows -1) TEST_INTEGER :: my_prow, my_pcol ! local MPI task position (my_prow, my_pcol) in the grid (0..np_cols -1, 0..np_rows -1)
integer :: mpierr TEST_INTEGER :: mpierr
! blacs ! blacs
integer :: my_blacs_ctxt, sc_desc(9), info, nprow, npcol TEST_INTEGER :: my_blacs_ctxt, sc_desc(9), info, nprow, npcol
! The Matrix ! The Matrix
MATRIX_TYPE, allocatable :: a(:,:), as(:,:) MATRIX_TYPE, allocatable :: a(:,:), as(:,:)
...@@ -161,18 +164,18 @@ program test ...@@ -161,18 +164,18 @@ program test
EV_TYPE :: diagonalELement, subdiagonalElement EV_TYPE :: diagonalELement, subdiagonalElement
#endif #endif
integer :: error, status TEST_INTEGER :: error, status
type(output_t) :: write_to_file type(output_t) :: write_to_file
class(elpa_t), pointer :: e class(elpa_t), pointer :: e
#ifdef TEST_ALL_KERNELS #ifdef TEST_ALL_KERNELS
integer :: i TEST_INTEGER :: i
#endif #endif
#ifdef TEST_ALL_LAYOUTS #ifdef TEST_ALL_LAYOUTS
character(len=1), parameter :: layouts(2) = [ 'C', 'R' ] character(len=1), parameter :: layouts(2) = [ 'C', 'R' ]
integer :: i_layout TEST_INTEGER :: i_layout
#endif #endif
integer :: kernel TEST_INTEGER :: kernel
character(len=1) :: layout character(len=1) :: layout
logical :: do_test_numeric_residual, do_test_numeric_residual_generalized, & logical :: do_test_numeric_residual, do_test_numeric_residual_generalized, &
do_test_analytic_eigenvalues, & do_test_analytic_eigenvalues, &
...@@ -182,16 +185,16 @@ program test ...@@ -182,16 +185,16 @@ program test
do_test_hermitian_multiply do_test_hermitian_multiply
#ifdef WITH_OPENMP #ifdef WITH_OPENMP
integer :: max_threads, threads_caller TEST_INTEGER :: max_threads, threads_caller
#endif #endif
#ifdef SPLIT_COMM_MYSELF #ifdef SPLIT_COMM_MYSELF
integer :: mpi_comm_rows, mpi_comm_cols, mpi_string_length, mpierr2 TEST_INTEGER :: mpi_comm_rows, mpi_comm_cols, mpi_string_length, mpierr2
character(len=MPI_MAX_ERROR_STRING) :: mpierr_string character(len=MPI_MAX_ERROR_STRING) :: mpierr_string
#endif #endif
call read_input_parameters_traditional(na, nev, nblk, write_to_file, skip_check_correctness) call read_input_parameters_traditional(na, nev, nblk, write_to_file, skip_check_correctness)
call setup_mpi(myid, nprocs) !call setup_mpi(myid, nprocs)
#ifdef HAVE_REDIRECT #ifdef HAVE_REDIRECT
#ifdef WITH_MPI #ifdef WITH_MPI
call MPI_BARRIER(MPI_COMM_WORLD, mpierr) call MPI_BARRIER(MPI_COMM_WORLD, mpierr)
...@@ -282,11 +285,11 @@ program test ...@@ -282,11 +285,11 @@ program test
#endif /* TEST_QR_DECOMPOSITION */ #endif /* TEST_QR_DECOMPOSITION */
call set_up_blacsgrid(mpi_comm_world, np_rows, np_cols, layout, & !call set_up_blacsgrid(mpi_comm_world, np_rows, np_cols, layout, &
my_blacs_ctxt, my_prow, my_pcol) ! my_blacs_ctxt, my_prow, my_pcol)
call set_up_blacs_descriptor(na, nblk, my_prow, my_pcol, np_rows, np_cols, & !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) ! na_rows, na_cols, sc_desc, my_blacs_ctxt, info)
allocate(a (na_rows,na_cols)) allocate(a (na_rows,na_cols))
allocate(as(na_rows,na_cols)) allocate(as(na_rows,na_cols))
...@@ -322,10 +325,10 @@ program test ...@@ -322,10 +325,10 @@ program test
! We also have to take care of special case in TEST_EIGENVECTORS ! We also have to take care of special case in TEST_EIGENVECTORS
#if !defined(TEST_EIGENVECTORS) #if !defined(TEST_EIGENVECTORS)
call prepare_matrix_random(na, myid, sc_desc, a, z, as) !call prepare_matrix_random(na, myid, sc_desc, a, z, as)
#else /* TEST_EIGENVECTORS */ #else /* TEST_EIGENVECTORS */
if (nev .ge. 1) then if (nev .ge. 1) then
call prepare_matrix_random(na, myid, sc_desc, a, z, as) !call prepare_matrix_random(na, myid, sc_desc, a, z, as)
#ifndef TEST_HERMITIAN_MULTIPLY #ifndef TEST_HERMITIAN_MULTIPLY
do_test_numeric_residual = .true. do_test_numeric_residual = .true.
#endif #endif
...@@ -346,8 +349,8 @@ program test ...@@ -346,8 +349,8 @@ program test
#endif /* (TEST_MATRIX_RANDOM) */ #endif /* (TEST_MATRIX_RANDOM) */
#if defined(TEST_MATRIX_RANDOM) && defined(TEST_CHOLESKY) #if defined(TEST_MATRIX_RANDOM) && defined(TEST_CHOLESKY)
call prepare_matrix_random_spd(na, myid, sc_desc, a, z, as, & !call prepare_matrix_random_spd(na, myid, sc_desc, a, z, as, &
nblk, np_rows, np_cols, my_prow, my_pcol) ! nblk, np_rows, np_cols, my_prow, my_pcol)
do_test_analytic_eigenvalues = .false. do_test_analytic_eigenvalues = .false.
do_test_analytic_eigenvalues_eigenvectors = .false. do_test_analytic_eigenvalues_eigenvectors = .false.
do_test_frank_eigenvalues = .false. do_test_frank_eigenvalues = .false.
...@@ -355,9 +358,9 @@ program test ...@@ -355,9 +358,9 @@ program test
#endif /* TEST_MATRIX_RANDOM and TEST_CHOLESKY */ #endif /* TEST_MATRIX_RANDOM and TEST_CHOLESKY */
#if defined(TEST_MATRIX_RANDOM) && defined(TEST_GENERALIZED_EIGENPROBLEM) #if defined(TEST_MATRIX_RANDOM) && defined(TEST_GENERALIZED_EIGENPROBLEM)
! call prepare_matrix_random(na, myid, sc_desc, a, z, as) !! call prepare_matrix_random(na, myid, sc_desc, a, z, as)
call prepare_matrix_random_spd(na, myid, sc_desc, b, z, bs, & ! call prepare_matrix_random_spd(na, myid, sc_desc, b, z, bs, &
nblk, np_rows, np_cols, my_prow, my_pcol) ! nblk, np_rows, np_cols, my_prow, my_pcol)
do_test_analytic_eigenvalues = .false. do_test_analytic_eigenvalues = .false.
do_test_analytic_eigenvalues_eigenvectors = .false. do_test_analytic_eigenvalues_eigenvectors = .false.
do_test_frank_eigenvalues = .false. do_test_frank_eigenvalues = .false.
...@@ -377,7 +380,7 @@ program test ...@@ -377,7 +380,7 @@ program test
! ANALYTIC + TEST_SOLVE_TRIDIAGONAL: we need a TOEPLITZ MATRIX ! ANALYTIC + TEST_SOLVE_TRIDIAGONAL: we need a TOEPLITZ MATRIX
! ANALTIC + TEST_CHOLESKY: no correctness check yet implemented ! ANALTIC + TEST_CHOLESKY: no correctness check yet implemented
call prepare_matrix_analytic(na, a, nblk, myid, np_rows, np_cols, my_prow, my_pcol) !call prepare_matrix_analytic(na, a, nblk, myid, np_rows, np_cols, my_prow, my_pcol)
as(:,:) = a as(:,:) = a
do_test_numeric_residual = .false. do_test_numeric_residual = .false.
...@@ -421,9 +424,9 @@ program test ...@@ -421,9 +424,9 @@ program test
#endif #endif
#endif /* TEST_CHOLESKY */ #endif /* TEST_CHOLESKY */
call prepare_matrix_toeplitz(na, diagonalElement, subdiagonalElement, & !call prepare_matrix_toeplitz(na, diagonalElement, subdiagonalElement, &
d, sd, ds, sds, a, as, nblk, np_rows, & ! d, sd, ds, sds, a, as, nblk, np_rows, &
np_cols, my_prow, my_pcol) ! np_cols, my_prow, my_pcol)
do_test_numeric_residual = .false. do_test_numeric_residual = .false.
...@@ -456,7 +459,7 @@ program test ...@@ -456,7 +459,7 @@ program test
! We also have to take care of special case in TEST_EIGENVECTORS ! We also have to take care of special case in TEST_EIGENVECTORS
#if !defined(TEST_EIGENVECTORS) #if !defined(TEST_EIGENVECTORS)
call prepare_matrix_frank(na, a, z, as, nblk, np_rows, np_cols, my_prow, my_pcol) !call prepare_matrix_frank(na, a, z, as, nblk, np_rows, np_cols, my_prow, my_pcol)
do_test_analytic_eigenvalues = .false. do_test_analytic_eigenvalues = .false.
do_test_analytic_eigenvalues_eigenvectors = .false. do_test_analytic_eigenvalues_eigenvectors = .false.
...@@ -468,7 +471,7 @@ program test ...@@ -468,7 +471,7 @@ program test
#else /* TEST_EIGENVECTORS */ #else /* TEST_EIGENVECTORS */
if (nev .ge. 1) then if (nev .ge. 1) then
call prepare_matrix_frank(na, a, z, as, nblk, np_rows, np_cols, my_prow, my_pcol) !call prepare_matrix_frank(na, a, z, as, nblk, np_rows, np_cols, my_prow, my_pcol)
do_test_analytic_eigenvalues = .false. do_test_analytic_eigenvalues = .false.
do_test_analytic_eigenvalues_eigenvectors = .false. do_test_analytic_eigenvalues_eigenvectors = .false.
...@@ -756,49 +759,49 @@ program test ...@@ -756,49 +759,49 @@ program test
endif endif
if (do_test_analytic_eigenvalues) then if (do_test_analytic_eigenvalues) then
status = check_correctness_analytic(na, nev, ev, z, nblk, myid, np_rows, np_cols, my_prow, my_pcol, check_all_evals, .false.) !status = check_correctness_analytic(na, nev, ev, z, nblk, myid, np_rows, np_cols, my_prow, my_pcol, check_all_evals, .false.)
call check_status(status, myid) call check_status(status, myid)
endif endif
if (do_test_analytic_eigenvalues_eigenvectors) then if (do_test_analytic_eigenvalues_eigenvectors) then
status = check_correctness_analytic(na, nev, ev, z, nblk, myid, np_rows, np_cols, my_prow, my_pcol, check_all_evals, .true.) !status = check_correctness_analytic(na, nev, ev, z, nblk, myid, np_rows, np_cols, my_prow, my_pcol, check_all_evals, .true.)
call check_status(status, myid) call check_status(status, myid)
endif endif
if(do_test_numeric_residual) then if(do_test_numeric_residual) then
status = check_correctness_evp_numeric_residuals(na, nev, as, z, ev, sc_desc, nblk, myid, np_rows,np_cols, my_prow, my_pcol) !status = check_correctness_evp_numeric_residuals(na, nev, as, z, ev, sc_desc, nblk, myid, np_rows,np_cols, my_prow, my_pcol)
call check_status(status, myid) call check_status(status, myid)
endif endif
if (do_test_frank_eigenvalues) then if (do_test_frank_eigenvalues) then
status = check_correctness_eigenvalues_frank(na, ev, z, myid) !status = check_correctness_eigenvalues_frank(na, ev, z, myid)
call check_status(status, myid) call check_status(status, myid)
endif endif
if (do_test_toeplitz_eigenvalues) then if (do_test_toeplitz_eigenvalues) then
#if defined(TEST_EIGENVALUES) || defined(TEST_SOLVE_TRIDIAGONAL) #if defined(TEST_EIGENVALUES) || defined(TEST_SOLVE_TRIDIAGONAL)
status = check_correctness_eigenvalues_toeplitz(na, diagonalElement, & !status = check_correctness_eigenvalues_toeplitz(na, diagonalElement, &
subdiagonalElement, ev, z, myid) ! subdiagonalElement, ev, z, myid)
call check_status(status, myid) call check_status(status, myid)
#endif #endif
endif endif
if (do_test_cholesky) then if (do_test_cholesky) then
status = check_correctness_cholesky(na, a, as, na_rows, sc_desc, myid ) !status = check_correctness_cholesky(na, a, as, na_rows, sc_desc, myid )
call check_status(status, myid) call check_status(status, myid)
endif endif
#ifdef TEST_HERMITIAN_MULTIPLY #ifdef TEST_HERMITIAN_MULTIPLY
if (do_test_hermitian_multiply) then if (do_test_hermitian_multiply) then
status = check_correctness_hermitian_multiply(na, a, b, c, na_rows, sc_desc, myid ) !status = check_correctness_hermitian_multiply(na, a, b, c, na_rows, sc_desc, myid )
call check_status(status, myid) call check_status(status, myid)
endif endif
#endif #endif
#ifdef TEST_GENERALIZED_EIGENPROBLEM #ifdef TEST_GENERALIZED_EIGENPROBLEM
if(do_test_numeric_residual_generalized) then if(do_test_numeric_residual_generalized) then
status = check_correctness_evp_numeric_residuals(na, nev, as, z, ev, sc_desc, nblk, myid, np_rows,np_cols, my_prow, & !status = check_correctness_evp_numeric_residuals(na, nev, as, z, ev, sc_desc, nblk, myid, np_rows,np_cols, my_prow, &
my_pcol, bs) !my_pcol, bs)
call check_status(status, myid) call check_status(status, myid)
endif endif
#endif #endif
......
...@@ -51,12 +51,12 @@ module test_read_input_parameters ...@@ -51,12 +51,12 @@ module test_read_input_parameters
implicit none implicit none
type input_options_t type input_options_t
integer :: datatype integer(kind=MPI_KIND) :: datatype
integer :: na, nev, nblk integer(kind=MPI_KIND) :: na, nev, nblk
type(output_t) :: write_to_file type(output_t) :: write_to_file
integer :: this_real_kernel, this_complex_kernel integer(kind=MPI_KIND) :: this_real_kernel, this_complex_kernel
logical :: realKernelIsSet, complexKernelIsSet logical :: realKernelIsSet, complexKernelIsSet
integer :: useQrIsSet, useGPUIsSet integer(kind=MPI_KIND) :: useQrIsSet, useGPUIsSet
logical :: doSolveTridi, do1stage, do2stage, justHelpMessage, & logical :: doSolveTridi, do1stage, do2stage, justHelpMessage, &
doCholesky, doInvertTrm, doTransposeMultiply doCholesky, doInvertTrm, doTransposeMultiply
end type end type
...@@ -74,7 +74,7 @@ module test_read_input_parameters ...@@ -74,7 +74,7 @@ module test_read_input_parameters
type(input_options_t) :: input_options type(input_options_t) :: input_options
character(len=128) :: command_line_argument character(len=128) :: command_line_argument
integer :: error integer(kind=MPI_KIND) :: error
if (command_line_argument == "--help") then if (command_line_argument == "--help") then
print *,"usage: elpa_tests [--help] [datatype={real|complex}] [na=number] [nev=number] " print *,"usage: elpa_tests [--help] [datatype={real|complex}] [na=number] [nev=number] "
...@@ -213,7 +213,7 @@ module test_read_input_parameters ...@@ -213,7 +213,7 @@ module test_read_input_parameters
! Command line arguments ! Command line arguments
character(len=128) :: arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9, arg10 character(len=128) :: arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9, arg10
integer(kind=ik) :: mpierr integer(kind=MPI_KIND) :: mpierr
! default parameters ! default parameters
input_options%datatype = 1 input_options%datatype = 1
...@@ -344,7 +344,7 @@ module test_read_input_parameters ...@@ -344,7 +344,7 @@ module test_read_input_parameters
use precision use precision
implicit none implicit none
integer(kind=ik), intent(out) :: na, nev, nblk integer(kind=MPI_KIND), intent(out) :: na, nev, nblk
type(output_t), intent(out) :: write_to_file type(output_t), intent(out) :: write_to_file
logical :: skip_check_correctness logical :: skip_check_correctness
...@@ -356,14 +356,14 @@ module test_read_input_parameters ...@@ -356,14 +356,14 @@ module test_read_input_parameters
use precision use precision
implicit none implicit none
integer(kind=ik), intent(out) :: na, nev, nblk integer(kind=MPI_KIND), intent(out) :: na, nev, nblk
type(output_t), intent(out) :: write_to_file type(output_t), intent(out) :: write_to_file
logical, intent(out) :: skip_check_correctness logical, intent(out) :: skip_check_correctness
! Command line arguments ! Command line arguments
character(len=128) :: arg1, arg2, arg3, arg4, arg5 character(len=128) :: arg1, arg2, arg3, arg4, arg5
integer(kind=ik) :: mpierr integer(kind=MPI_KIND) :: mpierr
! default parameters ! default parameters
na = 5000 na = 5000
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment