Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
elpa
elpa
Commits
162baf19
Commit
162baf19
authored
Oct 11, 2019
by
Andreas Marek
Browse files
WIP
parent
65e33ecf
Changes
4
Hide whitespace changes
Inline
Side-by-side
configure.ac
View file @
162baf19
...
...
@@ -208,6 +208,30 @@ if test x"${enable_heterogenous_cluster_support}" = x"yes"; then
fi
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_COMPILE_IFELSE([AC_LANG_SOURCE([
int main(int argc, char **argv) {
...
...
src/helpers/mod_precision.F90
View file @
162baf19
...
...
@@ -53,5 +53,14 @@ module precision
integer
,
parameter
::
ik
=
C_INT32_T
integer
,
parameter
::
lik
=
C_INT64_T
#if HAVE_64BIT_INTEGER_SUPPORT
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
test/Fortran/test.F90
View file @
162baf19
...
...
@@ -102,44 +102,47 @@ error: define either TEST_ALL_KERNELS or a valid TEST_KERNEL
#define KERNEL_KEY "complex_kernel"
#endif
#define TEST_INTEGER integer(kind=C_int64_t)
#include "assert.h"
program
test
use
elpa
!
use elpa
use
test_util
use
test_setup_mpi
use
test_prepare_matrix
!
use test_util
!
use test_setup_mpi
!
use test_prepare_matrix
use
test_read_input_parameters
use
test_blacs_infrastructure
use
test_check_correctness
use
test_analytic
!
use test_blacs_infrastructure
!
use test_check_correctness
!
use test_analytic
#ifdef WITH_SCALAPACK_TESTS
use
test_scalapack
!
use test_scalapack
#endif
#ifdef HAVE_REDIRECT
use
test_redirect
!
use test_redirect
#endif
#ifdef WITH_OPENMP
use
omp_lib
!
use omp_lib
#endif
use
precision
implicit
none
! matrix dimensions
integer
::
na
,
nev
,
nblk
TEST_INTEGER
::
na
,
nev
,
nblk
! mpi
integer
::
myid
,
nprocs
integer
::
na_cols
,
na_rows
! local matrix size
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)
integer
::
mpierr
TEST_INTEGER
::
myid
,
nprocs
TEST_INTEGER
::
na_cols
,
na_rows
! local matrix size
TEST_INTEGER
::
np_cols
,
np_rows
! number of MPI processes per column/row
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)
TEST_INTEGER
::
mpierr
! blacs
integer
::
my_blacs_ctxt
,
sc_desc
(
9
),
info
,
nprow
,
npcol
TEST_INTEGER
::
my_blacs_ctxt
,
sc_desc
(
9
),
info
,
nprow
,
npcol
! The Matrix
MATRIX_TYPE
,
allocatable
::
a
(:,:),
as
(:,:)
...
...
@@ -161,18 +164,18 @@ program test
EV_TYPE
::
diagonalELement
,
subdiagonalElement
#endif
integer
::
error
,
status
TEST_INTEGER
::
error
,
status
type
(
output_t
)
::
write_to_file
class
(
elpa_t
),
pointer
::
e
#ifdef TEST_ALL_KERNELS
integer
::
i
TEST_INTEGER
::
i
#endif
#ifdef TEST_ALL_LAYOUTS
character
(
len
=
1
),
parameter
::
layouts
(
2
)
=
[
'C'
,
'R'
]
integer
::
i_layout
TEST_INTEGER
::
i_layout
#endif
integer
::
kernel
TEST_INTEGER
::
kernel
character
(
len
=
1
)
::
layout
logical
::
do_test_numeric_residual
,
do_test_numeric_residual_generalized
,
&
do_test_analytic_eigenvalues
,
&
...
...
@@ -182,16 +185,16 @@ program test
do_test_hermitian_multiply
#ifdef WITH_OPENMP
integer
::
max_threads
,
threads_caller
TEST_INTEGER
::
max_threads
,
threads_caller
#endif
#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
#endif
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 WITH_MPI
call
MPI_BARRIER
(
MPI_COMM_WORLD
,
mpierr
)
...
...
@@ -282,11 +285,11 @@ program test
#endif /* TEST_QR_DECOMPOSITION */
call
set_up_blacsgrid
(
mpi_comm_world
,
np_rows
,
np_cols
,
layout
,
&
my_blacs_ctxt
,
my_prow
,
my_pcol
)
!
call set_up_blacsgrid(mpi_comm_world, np_rows, np_cols, layout, &
!
my_blacs_ctxt, my_prow, my_pcol)
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
)
!
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)
allocate
(
a
(
na_rows
,
na_cols
))
allocate
(
as
(
na_rows
,
na_cols
))
...
...
@@ -322,10 +325,10 @@ program test
! We also have to take care of special case in 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 */
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
do_test_numeric_residual
=
.true.
#endif
...
...
@@ -346,8 +349,8 @@ program test
#endif /* (TEST_MATRIX_RANDOM) */
#if defined(TEST_MATRIX_RANDOM) && defined(TEST_CHOLESKY)
call
prepare_matrix_random_spd
(
na
,
myid
,
sc_desc
,
a
,
z
,
as
,
&
nblk
,
np_rows
,
np_cols
,
my_prow
,
my_pcol
)
!
call prepare_matrix_random_spd(na, myid, sc_desc, a, z, as, &
!
nblk, np_rows, np_cols, my_prow, my_pcol)
do_test_analytic_eigenvalues
=
.false.
do_test_analytic_eigenvalues_eigenvectors
=
.false.
do_test_frank_eigenvalues
=
.false.
...
...
@@ -355,9 +358,9 @@ program test
#endif /* TEST_MATRIX_RANDOM and TEST_CHOLESKY */
#if defined(TEST_MATRIX_RANDOM) && defined(TEST_GENERALIZED_EIGENPROBLEM)
! call prepare_matrix_random(na, myid, sc_desc, a, z, as)
call
prepare_matrix_random_spd
(
na
,
myid
,
sc_desc
,
b
,
z
,
bs
,
&
nblk
,
np_rows
,
np_cols
,
my_prow
,
my_pcol
)
!
!
call prepare_matrix_random(na, myid, sc_desc, a, z, as)
!
call prepare_matrix_random_spd(na, myid, sc_desc, b, z, bs, &
!
nblk, np_rows, np_cols, my_prow, my_pcol)
do_test_analytic_eigenvalues
=
.false.
do_test_analytic_eigenvalues_eigenvectors
=
.false.
do_test_frank_eigenvalues
=
.false.
...
...
@@ -377,7 +380,7 @@ program test
! ANALYTIC + TEST_SOLVE_TRIDIAGONAL: we need a TOEPLITZ MATRIX
! 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
do_test_numeric_residual
=
.false.
...
...
@@ -421,9 +424,9 @@ program test
#endif
#endif /* TEST_CHOLESKY */
call
prepare_matrix_toeplitz
(
na
,
diagonalElement
,
subdiagonalElement
,
&
d
,
sd
,
ds
,
sds
,
a
,
as
,
nblk
,
np_rows
,
&
np_cols
,
my_prow
,
my_pcol
)
!
call prepare_matrix_toeplitz(na, diagonalElement, subdiagonalElement, &
!
d, sd, ds, sds, a, as, nblk, np_rows, &
!
np_cols, my_prow, my_pcol)
do_test_numeric_residual
=
.false.
...
...
@@ -456,7 +459,7 @@ program test
! We also have to take care of special case in 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_eigenvectors
=
.false.
...
...
@@ -468,7 +471,7 @@ program test
#else /* TEST_EIGENVECTORS */
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_eigenvectors
=
.false.
...
...
@@ -756,49 +759,49 @@ program test
endif
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
)
endif
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
)
endif
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
)
endif
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
)
endif
if
(
do_test_toeplitz_eigenvalues
)
then
#if defined(TEST_EIGENVALUES) || defined(TEST_SOLVE_TRIDIAGONAL)
status
=
check_correctness_eigenvalues_toeplitz
(
na
,
diagonalElement
,
&
subdiagonalElement
,
ev
,
z
,
myid
)
!
status = check_correctness_eigenvalues_toeplitz(na, diagonalElement, &
!
subdiagonalElement, ev, z, myid)
call
check_status
(
status
,
myid
)
#endif
endif
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
)
endif
#ifdef TEST_HERMITIAN_MULTIPLY
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
)
endif
#endif
#ifdef TEST_GENERALIZED_EIGENPROBLEM
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
,
&
my_pcol
,
bs
)
!
status = check_correctness_evp_numeric_residuals(na, nev, as, z, ev, sc_desc, nblk, myid, np_rows,np_cols, my_prow, &
!
my_pcol, bs)
call
check_status
(
status
,
myid
)
endif
#endif
...
...
test/shared/test_read_input_parameters.F90
View file @
162baf19
...
...
@@ -51,12 +51,12 @@ module test_read_input_parameters
implicit
none
type
input_options_t
integer
::
datatype
integer
::
na
,
nev
,
nblk
integer
(
kind
=
MPI_KIND
)
::
datatype
integer
(
kind
=
MPI_KIND
)
::
na
,
nev
,
nblk
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
integer
::
useQrIsSet
,
useGPUIsSet
integer
(
kind
=
MPI_KIND
)
::
useQrIsSet
,
useGPUIsSet
logical
::
doSolveTridi
,
do1stage
,
do2stage
,
justHelpMessage
,
&
doCholesky
,
doInvertTrm
,
doTransposeMultiply
end
type
...
...
@@ -74,7 +74,7 @@ module test_read_input_parameters
type
(
input_options_t
)
::
input_options
character
(
len
=
128
)
::
command_line_argument
integer
::
error
integer
(
kind
=
MPI_KIND
)
::
error
if
(
command_line_argument
==
"--help"
)
then
print
*
,
"usage: elpa_tests [--help] [datatype={real|complex}] [na=number] [nev=number] "
...
...
@@ -213,7 +213,7 @@ module test_read_input_parameters
! Command line arguments
character
(
len
=
128
)
::
arg1
,
arg2
,
arg3
,
arg4
,
arg5
,
arg6
,
arg7
,
arg8
,
arg9
,
arg10
integer
(
kind
=
ik
)
::
mpierr
integer
(
kind
=
MPI_KIND
)
::
mpierr
! default parameters
input_options
%
datatype
=
1
...
...
@@ -344,7 +344,7 @@ module test_read_input_parameters
use
precision
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
logical
::
skip_check_correctness
...
...
@@ -356,14 +356,14 @@ module test_read_input_parameters
use
precision
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
logical
,
intent
(
out
)
::
skip_check_correctness
! Command line arguments
character
(
len
=
128
)
::
arg1
,
arg2
,
arg3
,
arg4
,
arg5
integer
(
kind
=
ik
)
::
mpierr
integer
(
kind
=
MPI_KIND
)
::
mpierr
! default parameters
na
=
5000
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment