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
44122b1f
Commit
44122b1f
authored
Nov 27, 2017
by
Andreas Marek
Browse files
Frank matrix in test programs
parent
4c7521e0
Changes
7
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
generate_automake_test_programs.py
View file @
44122b1f
...
@@ -23,6 +23,13 @@ gpu_flag = {
...
@@ -23,6 +23,13 @@ gpu_flag = {
matrix_flag
=
{
matrix_flag
=
{
"random"
:
"-DTEST_MATRIX_RANDOM"
,
"random"
:
"-DTEST_MATRIX_RANDOM"
,
"analytic"
:
"-DTEST_MATRIX_ANALYTIC"
,
"analytic"
:
"-DTEST_MATRIX_ANALYTIC"
,
"toeplitz"
:
"-DTEST_MATRIX_TOEPLITZ"
,
"frank"
:
"-DTEST_MATRIX_FRANK"
,
}
qr_flag
=
{
0
:
"-DTEST_QR_DECOMPOSITION=0"
,
1
:
"-DTEST_QR_DECOMPOSITION=1"
,
}
}
test_type_flag
=
{
test_type_flag
=
{
...
@@ -31,7 +38,6 @@ test_type_flag = {
...
@@ -31,7 +38,6 @@ test_type_flag = {
"solve_tridiagonal"
:
"-DTEST_SOLVE_TRIDIAGONAL"
,
"solve_tridiagonal"
:
"-DTEST_SOLVE_TRIDIAGONAL"
,
"cholesky"
:
"-DTEST_CHOLESKY"
,
"cholesky"
:
"-DTEST_CHOLESKY"
,
"hermitian_multiply"
:
"-DTEST_HERMITIAN_MULTIPLY"
,
"hermitian_multiply"
:
"-DTEST_HERMITIAN_MULTIPLY"
,
"qr"
:
"-DTEST_QR_DECOMPOSITION"
,
}
}
layout_flag
=
{
layout_flag
=
{
...
@@ -39,31 +45,49 @@ layout_flag = {
...
@@ -39,31 +45,49 @@ layout_flag = {
"square"
:
""
"square"
:
""
}
}
for
m
,
g
,
t
,
p
,
d
,
s
,
l
in
product
(
for
m
,
g
,
q
,
t
,
p
,
d
,
s
,
l
in
product
(
sorted
(
matrix_flag
.
keys
()),
sorted
(
matrix_flag
.
keys
()),
sorted
(
gpu_flag
.
keys
()),
sorted
(
gpu_flag
.
keys
()),
sorted
(
qr_flag
.
keys
()),
sorted
(
test_type_flag
.
keys
()),
sorted
(
test_type_flag
.
keys
()),
sorted
(
prec_flag
.
keys
()),
sorted
(
prec_flag
.
keys
()),
sorted
(
domain_flag
.
keys
()),
sorted
(
domain_flag
.
keys
()),
sorted
(
solver_flag
.
keys
()),
sorted
(
solver_flag
.
keys
()),
sorted
(
layout_flag
.
keys
())):
sorted
(
layout_flag
.
keys
())):
# exclude some test combinations
# analytic tests only for "eigenvectors" and not on GPU
if
(
m
==
"analytic"
and
(
g
==
1
or
t
!=
"eigenvectors"
)):
if
(
m
==
"analytic"
and
(
g
==
1
or
t
!=
"eigenvectors"
)):
continue
continue
# Frank tests only for "eigenvectors" and eigenvalues and real double precision case
if
(
m
==
"frank"
and
((
t
!=
"eigenvectors"
or
t
!=
"eigenvalues"
)
and
(
d
!=
"real"
or
p
!=
"double"
))):
continue
if
(
s
in
[
"scalapack_all"
,
"scalapack_part"
]
and
(
g
==
1
or
t
!=
"eigenvectors"
or
m
!=
"analytic"
)):
if
(
s
in
[
"scalapack_all"
,
"scalapack_part"
]
and
(
g
==
1
or
t
!=
"eigenvectors"
or
m
!=
"analytic"
)):
continue
continue
if
(
t
==
"solve_tridiagonal"
and
(
s
==
"2stage"
or
d
==
"complex"
)):
# solve tridiagonal only for real toeplitz matrix in 1stage
if
(
t
==
"solve_tridiagonal"
and
(
s
!=
"1stage"
or
d
!=
"real"
or
m
!=
"toeplitz"
)):
continue
continue
if
(
t
==
"cholesky"
and
(
s
==
"2stage"
)):
# cholesky tests only 1stage and teoplitz matrix
if
(
t
==
"cholesky"
and
(
m
!=
"toeplitz"
or
s
==
"2stage"
)):
continue
if
(
t
==
"eigenvalues"
and
(
m
==
"random"
)):
continue
continue
if
(
t
==
"hermitian_multiply"
and
(
s
==
"2stage"
)):
if
(
t
==
"hermitian_multiply"
and
(
s
==
"2stage"
)):
continue
continue
if
(
t
==
"qr"
and
(
s
==
"1stage"
or
d
==
"complex"
)):
if
(
t
==
"hermitian_multiply"
and
(
m
==
"toeplitz"
)):
continue
# qr only for 2stage real
if
(
q
==
1
and
(
s
!=
"2stage"
or
d
!=
"real"
or
t
!=
"eigenvectors"
or
g
==
1
or
m
!=
"random"
)):
continue
continue
for
kernel
in
[
"all_kernels"
,
"default_kernel"
]
if
s
==
"2stage"
else
[
"nokernel"
]:
for
kernel
in
[
"all_kernels"
,
"default_kernel"
]
if
s
==
"2stage"
else
[
"nokernel"
]:
...
@@ -102,13 +126,18 @@ for m, g, t, p, d, s, l in product(
...
@@ -102,13 +126,18 @@ for m, g, t, p, d, s, l in product(
raise
Exception
(
"Oh no!"
)
raise
Exception
(
"Oh no!"
)
endifs
+=
1
endifs
+=
1
name
=
"test_{0}_{1}_{2}_{3}{4}{5}{6}{7}"
.
format
(
name
=
"test_{0}_{1}_{2}_{3}{4}
_
{5}{6}{7}
{8}
"
.
format
(
d
,
p
,
t
,
s
,
d
,
p
,
t
,
s
,
""
if
kernel
==
"nokernel"
else
"_"
+
kernel
,
""
if
kernel
==
"nokernel"
else
"_"
+
kernel
,
"_gpu"
if
g
else
""
,
"gpu_"
if
g
else
""
,
"_analytic"
if
m
==
"analytic"
else
""
,
"qr_"
if
q
else
""
,
m
,
"_all_layouts"
if
l
==
"all_layouts"
else
""
)
"_all_layouts"
if
l
==
"all_layouts"
else
""
)
print
(
"if BUILD_KCOMPUTER"
)
print
(
"bin_PROGRAMS += "
+
name
)
print
(
"else"
)
print
(
"noinst_PROGRAMS += "
+
name
)
print
(
"noinst_PROGRAMS += "
+
name
)
print
(
"endif"
)
print
(
"check_SCRIPTS += "
+
name
+
".sh"
)
print
(
"check_SCRIPTS += "
+
name
+
".sh"
)
print
(
name
+
"_SOURCES = test/Fortran/test.F90"
)
print
(
name
+
"_SOURCES = test/Fortran/test.F90"
)
print
(
name
+
"_LDADD = $(test_program_ldadd)"
)
print
(
name
+
"_LDADD = $(test_program_ldadd)"
)
...
@@ -120,6 +149,7 @@ for m, g, t, p, d, s, l in product(
...
@@ -120,6 +149,7 @@ for m, g, t, p, d, s, l in product(
test_type_flag
[
t
],
test_type_flag
[
t
],
solver_flag
[
s
],
solver_flag
[
s
],
gpu_flag
[
g
],
gpu_flag
[
g
],
qr_flag
[
q
],
matrix_flag
[
m
]]
+
extra_flags
))
matrix_flag
[
m
]]
+
extra_flags
))
print
(
"endif
\n
"
*
endifs
)
print
(
"endif
\n
"
*
endifs
)
test/Fortran/test.F90
View file @
44122b1f
...
@@ -145,7 +145,7 @@ program test
...
@@ -145,7 +145,7 @@ program test
logical
::
check_all_evals
logical
::
check_all_evals
#if defined(TEST_EIGENVALUES) || defined(TEST_SOLVE_TRIDIAGONAL) || defined(TEST_EIGENVECTORS) ||
defined(
TEST_QR_DECOMPOSITION
)
|| defined(TEST_HERMITIAN_MULTIPLY)
#if defined(TEST_EIGENVALUES) || defined(TEST_SOLVE_TRIDIAGONAL) || defined(TEST_EIGENVECTORS) || TEST_QR_DECOMPOSITION
== 1
|| defined(TEST_HERMITIAN_MULTIPLY)
EV_TYPE
,
allocatable
::
d
(:),
sd
(:),
ds
(:),
sds
(:)
EV_TYPE
,
allocatable
::
d
(:),
sd
(:),
ds
(:),
sds
(:)
EV_TYPE
::
diagonalELement
,
subdiagonalElement
EV_TYPE
::
diagonalELement
,
subdiagonalElement
#endif
#endif
...
@@ -167,19 +167,12 @@ program test
...
@@ -167,19 +167,12 @@ program test
#endif
#endif
integer
::
kernel
integer
::
kernel
character
(
len
=
1
)
::
layout
character
(
len
=
1
)
::
layout
#ifdef TEST_COMPLEX
logical
::
do_test_numeric_residual
,
do_test_analytic_eigenvalues
,
&
EV_TYPE
::
norm
,
normmax
do_test_analytic_eigenvalues_eigenvectors
,
&
MATRIX_TYPE
,
allocatable
::
tmp1
(:,:),
tmp2
(:,:)
do_test_frank_eigenvalues
,
&
#ifdef TEST_DOUBLE
do_test_toeplitz_eigenvalues
,
do_test_cholesky
,
&
MATRIX_TYPE
,
parameter
::
CONE
=
(
1.0_c_double
,
0.0_c_double
),
&
do_test_hermitian_multiply
CZERO
=
(
0.0_c_double
,
0.0_c_double
)
EV_TYPE
::
pzlange
,
zlange
#else
MATRIX_TYPE
,
parameter
::
CONE
=
(
1.0_c_float
,
0.0_c_float
),
&
CZERO
=
(
0.0_c_float
,
0.0_c_float
)
EV_TYPE
::
pclange
,
clange
#endif
#endif
call
read_input_parameters_traditional
(
na
,
nev
,
nblk
,
write_to_file
)
call
read_input_parameters_traditional
(
na
,
nev
,
nblk
,
write_to_file
)
call
setup_mpi
(
myid
,
nprocs
)
call
setup_mpi
(
myid
,
nprocs
)
#ifdef HAVE_REDIRECT
#ifdef HAVE_REDIRECT
...
@@ -191,6 +184,23 @@ program test
...
@@ -191,6 +184,23 @@ program test
check_all_evals
=
.true.
check_all_evals
=
.true.
do_test_numeric_residual
=
.false.
do_test_analytic_eigenvalues
=
.false.
do_test_analytic_eigenvalues_eigenvectors
=
.false.
do_test_frank_eigenvalues
=
.false.
do_test_toeplitz_eigenvalues
=
.false.
do_test_cholesky
=
.false.
#if defined(TEST_CHOLESKY)
do_test_cholesky
=
.true.
#endif
do_test_hermitian_multiply
=
.false.
#if defined(TEST_HERMITIAN_MULTIPLY)
do_test_hermitian_multiply
=
.true.
#endif
status
=
0
if
(
elpa_init
(
CURRENT_API_VERSION
)
/
=
ELPA_OK
)
then
if
(
elpa_init
(
CURRENT_API_VERSION
)
/
=
ELPA_OK
)
then
print
*
,
"ELPA API version not supported"
print
*
,
"ELPA API version not supported"
stop
1
stop
1
...
@@ -230,14 +240,14 @@ program test
...
@@ -230,14 +240,14 @@ program test
print
*
,
''
print
*
,
''
endif
endif
#if
def
TEST_QR_DECOMPOSITION
#if TEST_QR_DECOMPOSITION
== 1
#if TEST_GPU == 1
#if TEST_GPU == 1
#ifdef WITH_MPI
#ifdef WITH_MPI
call
mpi_finalize
(
mpierr
)
call
mpi_finalize
(
mpierr
)
#endif
#endif
stop
77
stop
77
#endif
#endif
/* TEST_GPU */
if
(
nblk
.lt.
64
)
then
if
(
nblk
.lt.
64
)
then
if
(
myid
.eq.
0
)
then
if
(
myid
.eq.
0
)
then
print
*
,
"At the moment QR decomposition need blocksize of at least 64"
print
*
,
"At the moment QR decomposition need blocksize of at least 64"
...
@@ -251,7 +261,8 @@ program test
...
@@ -251,7 +261,8 @@ program test
#endif
#endif
stop
77
stop
77
endif
endif
#endif
#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
)
...
@@ -269,7 +280,7 @@ program test
...
@@ -269,7 +280,7 @@ program test
allocate
(
c
(
na_rows
,
na_cols
))
allocate
(
c
(
na_rows
,
na_cols
))
#endif
#endif
#if defined(TEST_EIGENVALUES) || defined(TEST_SOLVE_TRIDIAGONAL) || defined(TEST_EIGENVECTORS) ||
defined(
TEST_QR_DECOMPOSITION
)
|| defined(TEST_CHOLESKY)
#if defined(TEST_EIGENVALUES) || defined(TEST_SOLVE_TRIDIAGONAL) || defined(TEST_EIGENVECTORS) || TEST_QR_DECOMPOSITION
== 1
|| defined(TEST_CHOLESKY)
allocate
(
d
(
na
),
ds
(
na
))
allocate
(
d
(
na
),
ds
(
na
))
allocate
(
sd
(
na
),
sds
(
na
))
allocate
(
sd
(
na
),
sds
(
na
))
allocate
(
ev_analytic
(
na
))
allocate
(
ev_analytic
(
na
))
...
@@ -279,59 +290,85 @@ program test
...
@@ -279,59 +290,85 @@ program test
z
(:,:)
=
0.0
z
(:,:)
=
0.0
ev
(:)
=
0.0
ev
(:)
=
0.0
#if defined(TEST_EIGENVECTORS) || defined(TEST_HERMITIAN_MULTIPLY) || defined(TEST_QR_DECOMPOSITION)
#if defined(TEST_MATRIX_RANDOM) && !defined(TEST_SOLVE_TRIDIAGONAL) && !defined(TEST_CHOLESKY) && !defined(TEST_EIGENVALUES)
#ifdef TEST_MATRIX_ANALYTIC
! the random matrix can be used in allmost all tests; but for some no
call
prepare_matrix_analytic
(
na
,
a
,
nblk
,
myid
,
np_rows
,
np_cols
,
my_prow
,
my_pcol
)
! correctness checks have been implemented; do not allow these
as
(:,:)
=
a
! combinations
#else
! RANDOM + TEST_SOLVE_TRIDIAGONAL: we need a TOEPLITZ MATRIX
if
(
nev
.ge.
1
)
then
! RANDOM + TEST_CHOLESKY: no correctness check yet implemented
! RANDOM + TEST_EIGENVALUES: no correctness check known
! 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
)
do_test_analytic_eigenvalues
=
.false.
do_test_analytic_eigenvalues_eigenvectors
=
.false.
do_test_frank_eigenvalues
=
.false.
do_test_toeplitz_eigenvalues
=
.false.
#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
)
do_test_analytic_eigenvalues
=
.false.
do_test_analytic_eigenvalues_eigenvectors
=
.false.
do_test_frank_eigenvalues
=
.false.
do_test_toeplitz_eigenvalues
=
.false.
#ifndef TEST_HERMITIAN_MULTIPLY
do_test_numeric_residual
=
.true.
#endif
else
else
! zero eigenvectors and not analytic test => toeplitz matrix
if
(
myid
.eq.
0
)
then
#ifdef TEST_SINGLE
print
*
,
"At the moment with the random matrix you need nev >=1"
diagonalElement
=
0.45_c_float
endif
subdiagonalElement
=
0.78_c_float
#ifdef WITH_MPI
#else
call
mpi_finalize
(
mpierr
)
diagonalElement
=
0.45_c_double
subdiagonalElement
=
0.78_c_double
#endif
#endif
call
prepare_matrix_toeplitz
(
na
,
diagonalElement
,
subdiagonalElement
,
&
stop
77
d
,
sd
,
ds
,
sds
,
a
,
as
,
nblk
,
np_rows
,
&
np_cols
,
my_prow
,
my_pcol
)
endif
#ifdef TEST_HERMITIAN_MULTIPLY
endif
#ifdef TEST_REAL
#ifdef TEST_DOUBLE
#endif /* TEST_EIGENVECTORS */
b
(:,:)
=
2.0_c_double
*
a
(:,:)
#endif /* (TEST_MATRIX_RANDOM) */
c
(:,:)
=
1.0_c_double
#if defined(TEST_MATRIX_RANDOM) && (defined(TEST_SOLVE_TRIDIAGONAL) || defined(TEST_CHOLESKY) || defined(TEST_EIGENVALUES))
#else
#error "Random matrix is not allowed in this configuration"
b
(:,:)
=
2.0_c_float
*
a
(:,:)
c
(:,:)
=
1.0_c_float
#endif
#endif
#endif
#if defined(TEST_MATRIX_ANALYTIC) && !defined(TEST_SOLVE_TRIDIAGONAL) && !defined(TEST_CHOLESKY)
! the analytic matrix can be used in allmost all tests; but for some no
! correctness checks have been implemented; do not allow these
! combinations
! ANALYTIC + TEST_SOLVE_TRIDIAGONAL: we need a TOEPLITZ MATRIX
! ANALTIC + TEST_CHOLESKY: no correctness check yet implemented
#ifdef TEST_COMPLEX
call
prepare_matrix_analytic
(
na
,
a
,
nblk
,
myid
,
np_rows
,
np_cols
,
my_prow
,
my_pcol
)
as
(:,:)
=
a
#ifdef TEST_DOUBLE
do_test_numeric_residual
=
.false.
b
(:,:)
=
2.0_c_double
*
a
(:,:)
do_test_analytic_eigenvalues_eigenvectors
=
.false.
c
(:,:)
=
(
1.0_c_double
,
0.0_c_double
)
#ifndef TEST_HERMITIAN_MULTIPLY
#else
do_test_analytic_eigenvalues
=
.true.
b
(:,:)
=
2.0_c_float
*
a
(:,:)
c
(:,:)
=
(
1.0_c_float
,
0.0_c_float
)
#endif
#endif
#if defined(TEST_EIGENVECTORS)
if
(
nev
.ge.
1
)
then
do_test_analytic_eigenvalues_eigenvectors
=
.true.
do_test_numeric_residual
=
.true.
else
do_test_analytic_eigenvalues_eigenvectors
=
.false.
do_test_numeric_residual
=
.false.
endif
#endif
#endif
do_test_frank_eigenvalues
=
.false.
#endif /* TEST_HERMITIAN_MULTIPLY */
do_test_toeplitz_eigenvalues
=
.false.
#endif /* TEST_MATRIX_ANALYTIC */
#endif /* TEST_MATRIX_ANALYTIC */
#
endif /*
defined(TEST_
EIGENVECTORS) || defined(TEST_HERMITIAN_MULTIPLY) || defined(TEST_QR_DECOMPOSITION) */
#
if
defined(TEST_
MATRIX_ANALYTIC) && (defined(TEST_SOLVE_TRIDIAGONAL) || defined(TEST_CHOLESKY))
#error "Analytic matrix is not allowd in this configuration"
#
if defined(TEST_EIGENVALUES) || defined(TEST_SOLVE_TRIDIAGONAL)
#
endif
#if defined(TEST_MATRIX_TOEPLITZ)
! The Toeplitz matrix works in each test
#ifdef TEST_SINGLE
#ifdef TEST_SINGLE
diagonalElement
=
0.45_c_float
diagonalElement
=
0.45_c_float
subdiagonalElement
=
0.78_c_float
subdiagonalElement
=
0.78_c_float
...
@@ -339,13 +376,8 @@ program test
...
@@ -339,13 +376,8 @@ program test
diagonalElement
=
0.45_c_double
diagonalElement
=
0.45_c_double
subdiagonalElement
=
0.78_c_double
subdiagonalElement
=
0.78_c_double
#endif
#endif
call
prepare_matrix_toeplitz
(
na
,
diagonalElement
,
subdiagonalElement
,
&
d
,
sd
,
ds
,
sds
,
a
,
as
,
nblk
,
np_rows
,
&
np_cols
,
my_prow
,
my_pcol
)
#endif /* EIGENVALUES OR TRIDIAGONAL */
#if defined(TEST_CHOLESKY)
#if defined(TEST_CHOLESKY)
#ifdef TEST_SINGLE
#ifdef TEST_SINGLE
diagonalElement
=
(
2.546_c_float
,
0.0_c_float
)
diagonalElement
=
(
2.546_c_float
,
0.0_c_float
)
subdiagonalElement
=
(
0.0_c_float
,
0.0_c_float
)
subdiagonalElement
=
(
0.0_c_float
,
0.0_c_float
)
...
@@ -353,12 +385,107 @@ program test
...
@@ -353,12 +385,107 @@ program test
diagonalElement
=
(
2.546_c_double
,
0.0_c_double
)
diagonalElement
=
(
2.546_c_double
,
0.0_c_double
)
subdiagonalElement
=
(
0.0_c_double
,
0.0_c_double
)
subdiagonalElement
=
(
0.0_c_double
,
0.0_c_double
)
#endif
#endif
#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
)
#endif /* TEST_CHOLESKY */
do_test_numeric_residual
=
.false.
#if defined(TEST_EIGENVECTORS)
if
(
nev
.ge.
1
)
then
do_test_numeric_residual
=
.true.
else
do_test_numeric_residual
=
.false.
endif
#endif
do_test_analytic_eigenvalues
=
.false.
do_test_analytic_eigenvalues_eigenvectors
=
.false.
do_test_frank_eigenvalues
=
.false.
#if defined(TEST_CHOLESKY)
do_test_toeplitz_eigenvalues
=
.false.
#else
do_test_toeplitz_eigenvalues
=
.true.
#endif
#endif /* TEST_MATRIX_TOEPLITZ */
#if defined(TEST_MATRIX_FRANK) && !defined(TEST_SOLVE_TRIDIAGONAL) && !defined(TEST_CHOLESKY)
! the random matrix can be used in allmost all tests; but for some no
! correctness checks have been implemented; do not allow these
! combinations
! FRANK + TEST_SOLVE_TRIDIAGONAL: we need a TOEPLITZ MATRIX
! FRANK + TEST_CHOLESKY: no correctness check yet implemented
! 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
)
do_test_analytic_eigenvalues
=
.false.
do_test_analytic_eigenvalues_eigenvectors
=
.false.
#ifndef TEST_HERMITIAN_MULTIPLY
do_test_frank_eigenvalues
=
.true.
#endif
do_test_toeplitz_eigenvalues
=
.false.
#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
)
do_test_analytic_eigenvalues
=
.false.
do_test_analytic_eigenvalues_eigenvectors
=
.false.
#ifndef TEST_HERMITIAN_MULTIPLY
do_test_frank_eigenvalues
=
.true.
#endif
do_test_toeplitz_eigenvalues
=
.false.
do_test_numeric_residual
=
.false.
else
do_test_analytic_eigenvalues
=
.false.
do_test_analytic_eigenvalues_eigenvectors
=
.false.
#ifndef TEST_HERMITIAN_MULTIPLY
do_test_frank_eigenvalues
=
.true.
#endif
do_test_toeplitz_eigenvalues
=
.false.
do_test_numeric_residual
=
.false.
endif
#endif /* TEST_EIGENVECTORS */
#endif /* (TEST_MATRIX_FRANK) */
#if defined(TEST_MATRIX_FRANK) && (defined(TEST_SOLVE_TRIDIAGONAL) || defined(TEST_CHOLESKY))
#error "FRANK matrix is not allowed in this configuration"
#endif
#ifdef TEST_HERMITIAN_MULTIPLY
#ifdef TEST_REAL
#ifdef TEST_DOUBLE
b
(:,:)
=
2.0_c_double
*
a
(:,:)
c
(:,:)
=
0.0_c_double
#else
b
(:,:)
=
2.0_c_float
*
a
(:,:)
c
(:,:)
=
0.0_c_float
#endif
#endif /* TEST_REAL */
#ifdef TEST_COMPLEX
#ifdef TEST_DOUBLE
b
(:,:)
=
2.0_c_double
*
a
(:,:)
c
(:,:)
=
(
0.0_c_double
,
0.0_c_double
)
#else
b
(:,:)
=
2.0_c_float
*
a
(:,:)
c
(:,:)
=
(
0.0_c_float
,
0.0_c_float
)
#endif
#endif /* TEST_COMPLEX */
#endif /* TEST_HERMITIAN_MULTIPLY */
e
=>
elpa_allocate
()
e
=>
elpa_allocate
()
...
@@ -381,22 +508,20 @@ program test
...
@@ -381,22 +508,20 @@ program test
call
e
%
set
(
"process_col"
,
my_pcol
,
error
)
call
e
%
set
(
"process_col"
,
my_pcol
,
error
)
assert_elpa_ok
(
error
)
assert_elpa_ok
(
error
)
#endif
#endif
call
e
%
set
(
"timings"
,
1
,
error
)
call
e
%
set
(
"timings"
,
1
)
assert_elpa_ok
(
e
%
setup
())
assert_elpa_ok
(
e
%
setup
())
#ifdef TEST_SOLVER_1STAGE
#ifdef TEST_SOLVER_1STAGE
call
e
%
set
(
"solver"
,
ELPA_SOLVER_1STAGE
)
call
e
%
set
(
"solver"
,
ELPA_SOLVER_1STAGE
,
error
)
#else
#else
call
e
%
set
(
"solver"
,
ELPA_SOLVER_2STAGE
)
call
e
%
set
(
"solver"
,
ELPA_SOLVER_2STAGE
,
error
)
#endif
#endif
assert_elpa_ok
(
error
)
assert_elpa_ok
(
error
)
call
e
%
set
(
"gpu"
,
TEST_GPU
,
error
)
call
e
%
set
(
"gpu"
,
TEST_GPU
,
error
)
assert_elpa_ok
(
error
)
assert_elpa_ok
(
error
)
#if
def
TEST_QR_DECOMPOSITION
#if TEST_QR_DECOMPOSITION
== 1
call
e
%
set
(
"qr"
,
1
,
error
)
call
e
%
set
(
"qr"
,
1
,
error
)
assert_elpa_ok
(
error
)
assert_elpa_ok
(
error
)
#endif
#endif
...
@@ -420,7 +545,7 @@ program test
...
@@ -420,7 +545,7 @@ program test
cycle
cycle
endif
endif
! actually used kernel might be different if forced via environment variables
! actually used kernel might be different if forced via environment variables
call
e
%
get
(
KERNEL_KEY
,
kernel
)
call
e
%
get
(
KERNEL_KEY
,
kernel
,
error
)
#endif
#endif
if
(
myid
==
0
)
then
if
(
myid
==
0
)
then
print
*
,
elpa_int_value_to_string
(
KERNEL_KEY
,
kernel
)
//
" kernel"
print
*
,
elpa_int_value_to_string
(
KERNEL_KEY
,
kernel
)
//
" kernel"
...
@@ -432,8 +557,12 @@ program test
...
@@ -432,8 +557,12 @@ program test
#endif
#endif
! The actual solve step
! The actual solve step
#if defined(TEST_EIGENVECTORS) || defined(TEST_QR_DECOMPOSITION)
#if defined(TEST_EIGENVECTORS)
#if TEST_QR_DECOMPOSITION == 1
call
e
%
timer_start
(
"e%eigenvectors_qr()"
)
#else
call
e
%
timer_start
(
"e%eigenvectors()"
)
call
e
%
timer_start
(
"e%eigenvectors()"
)
#endif
#ifdef TEST_SCALAPACK_ALL
#ifdef TEST_SCALAPACK_ALL
call
solve_scalapack_all
(
na
,
a
,
sc_desc
,
ev
,
z
)
call
solve_scalapack_all
(
na
,
a
,
sc_desc
,
ev
,
z
)
#elif TEST_SCALAPACK_PART
#elif TEST_SCALAPACK_PART
...
@@ -442,8 +571,12 @@ program test
...
@@ -442,8 +571,12 @@ program test
#else
#else