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
d31f42e0
Commit
d31f42e0
authored
Oct 11, 2019
by
Andreas Marek
Browse files
Seperate the variable type definition of the library and the test programs
parent
65e33ecf
Changes
15
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Makefile.am
View file @
d31f42e0
...
...
@@ -590,6 +590,7 @@ test_program_fcflags = $(AM_FCFLAGS) $(FC_MODOUT)test_modules $(FC_MODINC)test_m
noinst_LTLIBRARIES
+=
libelpatest@SUFFIX@.la
libelpatest@SUFFIX@
_la_FCFLAGS
=
$(test_program_fcflags)
libelpatest@SUFFIX@
_la_SOURCES
=
\
test
/shared/tests_variable_definitions.F90
\
test
/shared/test_util.F90
\
test
/shared/test_read_input_parameters.F90
\
test
/shared/test_check_correctness.F90
\
...
...
@@ -816,6 +817,7 @@ EXTRA_DIST = \
src/general/precision_macros.h
\
src/general/precision_typedefs.h
\
src/general/precision_kinds.F90
\
test
/shared/test_precision_kinds.F90
\
src/general/prow_pcol.F90
\
src/general/sanity.F90
\
test
/Fortran/assert.h
\
...
...
src/helpers/mod_scalapack_interfaces.F90
View file @
d31f42e0
...
...
@@ -44,7 +44,7 @@
#include "config-f90.h"
module
elpa_scalapack_interfaces
use
iso_c_binding
use
precision
!
use precision
implicit
none
...
...
test/Fortran/test.F90
View file @
d31f42e0
...
...
@@ -124,7 +124,7 @@ program test
#ifdef WITH_OPENMP
use
omp_lib
#endif
use
precision
use
precision
_for_tests
implicit
none
...
...
test/shared/test_analytic.F90
View file @
d31f42e0
...
...
@@ -52,7 +52,7 @@ module test_analytic
#else
use
timings_dummy
#endif
use
precision
use
precision
_for_tests
interface
prepare_matrix_analytic
module
procedure
prepare_matrix_analytic_complex_double
...
...
test/shared/test_analytic_template.F90
View file @
d31f42e0
...
...
@@ -46,7 +46,7 @@
&
_
&
&
PRECISION
&
&(
na
,
a
,
nblk
,
myid
,
np_rows
,
np_cols
,
my_prow
,
my_pcol
,
print_times
)
use
precision
use
precision
_for_tests
implicit
none
integer
(
kind
=
ik
),
intent
(
in
)
::
na
,
nblk
,
myid
,
np_rows
,
np_cols
,
my_prow
,
my_pcol
...
...
@@ -123,10 +123,10 @@
&
PRECISION
&
&(
na
,
nev
,
ev
,
z
,
nblk
,
myid
,
np_rows
,
np_cols
,
my_prow
,
my_pcol
,
check_all_evals
,
&
check_eigenvectors
,
print_times
)
result
(
status
)
use
precision
use
precision
_for_tests
implicit
none
#include ".
./../src/general/
precision_kinds.F90"
#include ".
/test_
precision_kinds.F90"
integer
(
kind
=
ik
),
intent
(
in
)
::
na
,
nev
,
nblk
,
myid
,
np_rows
,
&
np_cols
,
my_prow
,
my_pcol
integer
(
kind
=
ik
)
::
status
,
mpierr
...
...
@@ -321,7 +321,7 @@
&
_
&
&
PRECISION
&
&(
na
,
i
,
j
)
result
(
element
)
use
precision
use
precision
_for_tests
implicit
none
integer
(
kind
=
ik
),
intent
(
in
)
::
na
,
i
,
j
...
...
@@ -340,7 +340,7 @@
&
_
&
&
PRECISION
&
&(
na
,
i
,
j
)
result
(
element
)
use
precision
use
precision
_for_tests
implicit
none
integer
(
kind
=
ik
),
intent
(
in
)
::
na
,
i
,
j
...
...
@@ -359,7 +359,7 @@
&
_
&
&
PRECISION
&
&(
na
,
i
)
result
(
element
)
use
precision
use
precision
_for_tests
implicit
none
integer
(
kind
=
ik
),
intent
(
in
)
::
na
,
i
...
...
@@ -376,10 +376,10 @@
&
_
&
&
PRECISION
&
&(
na
,
i
,
j
,
what
)
result
(
element
)
use
precision
use
precision
_for_tests
implicit
none
#include ".
./../src/general/
precision_kinds.F90"
#include ".
/test_
precision_kinds.F90"
integer
(
kind
=
ik
),
intent
(
in
)
::
na
,
i
,
j
,
what
MATH_DATATYPE
(
kind
=
rck
)
::
element
,
mat2x2
(
2
,
2
),
mat
(
5
,
5
)
real
(
kind
=
rk
)
::
a
,
am
,
amp
...
...
@@ -502,10 +502,10 @@
&
_
&
&
PRECISION
&
&(
myid
,
na
,
mat
,
mat_name
)
use
precision
use
precision
_for_tests
implicit
none
#include ".
./../src/general/
precision_kinds.F90"
#include ".
/test_
precision_kinds.F90"
integer
(
kind
=
ik
),
intent
(
in
)
::
myid
,
na
character
(
len
=*
),
intent
(
in
)
::
mat_name
MATH_DATATYPE
(
kind
=
rck
)
::
mat
(
na
,
na
)
...
...
@@ -533,10 +533,10 @@
&
_
&
&
PRECISION
&
&(
myid
,
na
)
use
precision
use
precision
_for_tests
implicit
none
#include ".
./../src/general/
precision_kinds.F90"
#include ".
/test_
precision_kinds.F90"
integer
(
kind
=
ik
),
intent
(
in
)
::
myid
,
na
MATH_DATATYPE
(
kind
=
rck
)
::
A
(
na
,
na
),
S
(
na
,
na
),
L
(
na
,
na
),
res
(
na
,
na
)
integer
(
kind
=
ik
)
::
i
,
j
,
decomposition
(
num_primes
)
...
...
@@ -597,7 +597,7 @@
&
_
&
&
PRECISION
&
&(
myid
)
use
precision
use
precision
_for_tests
implicit
none
integer
(
kind
=
ik
),
intent
(
in
)
::
myid
...
...
test/shared/test_blacs_infrastructure.F90
View file @
d31f42e0
...
...
@@ -94,7 +94,7 @@ module test_blacs_infrastructure
use
elpa_utilities
,
only
:
error_unit
use
test_util
use
precision
use
precision
_for_tests
implicit
none
integer
(
kind
=
ik
),
intent
(
in
)
::
na
,
nblk
,
my_prow
,
my_pcol
,
np_rows
,
&
...
...
test/shared/test_check_correctness_template.F90
View file @
d31f42e0
...
...
@@ -51,7 +51,7 @@
use
elpa_scalapack_interfaces
implicit
none
#include ".
./../src/general/
precision_kinds.F90"
#include ".
/test_
precision_kinds.F90"
integer
(
kind
=
ik
)
::
status
integer
(
kind
=
ik
),
intent
(
in
)
::
na
,
nev
,
nblk
,
myid
,
np_rows
,
np_cols
,
my_prow
,
my_pcol
MATH_DATATYPE
(
kind
=
rck
),
intent
(
in
)
::
as
(:,:),
z
(:,:)
...
...
@@ -295,7 +295,7 @@ function check_correctness_evp_numeric_residuals_&
use
iso_c_binding
implicit
none
#include ".
./../src/general/
precision_kinds.F90"
#include ".
/test_
precision_kinds.F90"
integer
(
kind
=
c_int
)
::
status
integer
(
kind
=
c_int
),
value
::
na
,
nev
,
myid
,
na_rows
,
na_cols
,
nblk
,
np_rows
,
np_cols
,
my_prow
,
my_pcol
...
...
@@ -356,7 +356,7 @@ function check_correctness_evp_gen_numeric_residuals_&
use
iso_c_binding
implicit
none
#include ".
./../src/general/
precision_kinds.F90"
#include ".
/test_
precision_kinds.F90"
integer
(
kind
=
c_int
)
::
status
integer
(
kind
=
c_int
),
value
::
na
,
nev
,
myid
,
na_rows
,
na_cols
,
nblk
,
np_rows
,
np_cols
,
my_prow
,
my_pcol
...
...
@@ -381,7 +381,7 @@ function check_correctness_evp_gen_numeric_residuals_&
&
(
na
,
diagonalElement
,
subdiagonalElement
,
ev
,
z
,
myid
)
result
(
status
)
use
iso_c_binding
implicit
none
#include ".
./../src/general/
precision_kinds.F90"
#include ".
/test_
precision_kinds.F90"
integer
::
status
,
ii
,
j
,
myid
integer
,
intent
(
in
)
::
na
...
...
@@ -456,9 +456,9 @@ function check_correctness_evp_gen_numeric_residuals_&
&
_
&
&
PRECISION
&
&
(
na
,
a
,
as
,
na_rows
,
sc_desc
,
myid
)
result
(
status
)
use
precision
use
precision
_for_tests
implicit
none
#include ".
./../src/general/
precision_kinds.F90"
#include ".
/test_
precision_kinds.F90"
integer
(
kind
=
ik
)
::
status
integer
(
kind
=
ik
),
intent
(
in
)
::
na
,
myid
,
na_rows
...
...
@@ -573,9 +573,9 @@ function check_correctness_evp_gen_numeric_residuals_&
&
_
&
&
PRECISION
&
&
(
na
,
a
,
b
,
c
,
na_rows
,
sc_desc
,
myid
)
result
(
status
)
use
precision
use
precision
_for_tests
implicit
none
#include ".
./../src/general/
precision_kinds.F90"
#include ".
/test_
precision_kinds.F90"
integer
(
kind
=
ik
)
::
status
integer
(
kind
=
ik
),
intent
(
in
)
::
na
,
myid
,
na_rows
MATH_DATATYPE
(
kind
=
rck
),
intent
(
in
)
::
a
(:,:),
b
(:,:),
c
(:,:)
...
...
@@ -682,7 +682,7 @@ function check_correctness_evp_gen_numeric_residuals_&
&
(
na
,
ev
,
z
,
myid
)
result
(
status
)
use
iso_c_binding
implicit
none
#include ".
./../src/general/
precision_kinds.F90"
#include ".
/test_
precision_kinds.F90"
integer
::
status
,
i
,
j
,
myid
integer
,
intent
(
in
)
::
na
...
...
test/shared/test_precision_kinds.F90
0 → 100644
View file @
d31f42e0
#ifdef REALCASE
#ifdef DOUBLE_PRECISION
integer
,
parameter
::
rk
=
C_DOUBLE
integer
,
parameter
::
rck
=
C_DOUBLE
#endif
#ifdef SINGLE_PRECISION
integer
,
parameter
::
rk
=
C_FLOAT
integer
,
parameter
::
rck
=
C_FLOAT
#endif
real
(
kind
=
rck
),
parameter
::
ZERO
=
0.0_rk
,
ONE
=
1.0_rk
#endif
#ifdef COMPLEXCASE
#ifdef DOUBLE_PRECISION
integer
,
parameter
::
rk
=
C_DOUBLE
integer
,
parameter
::
ck
=
C_DOUBLE_COMPLEX
integer
,
parameter
::
rck
=
C_DOUBLE_COMPLEX
#endif
#ifdef SINGLE_PRECISION
integer
,
parameter
::
rk
=
C_FLOAT
integer
,
parameter
::
ck
=
C_FLOAT_COMPLEX
integer
,
parameter
::
rck
=
C_FLOAT_COMPLEX
#endif
complex
(
kind
=
rck
),
parameter
::
ZERO
=
(
0.0_rk
,
0.0_rk
),
ONE
=
(
1.0_rk
,
0.0_rk
)
#endif
test/shared/test_prepare_matrix.F90
View file @
d31f42e0
...
...
@@ -44,6 +44,7 @@
module
test_prepare_matrix
use
precision_for_tests
interface
prepare_matrix_random
module
procedure
prepare_matrix_random_complex_double
module
procedure
prepare_matrix_random_real_double
...
...
test/shared/test_prepare_matrix_template.F90
View file @
d31f42e0
...
...
@@ -48,11 +48,11 @@
&
(
na
,
myid
,
sc_desc
,
a
,
z
,
as
)
use
test_util
use
elpa_scalapack_interfaces
!
use test_util
!
use elpa_scalapack_interfaces
implicit
none
#include ".
./../src/general/
precision_kinds.F90"
#include ".
/test_
precision_kinds.F90"
integer
(
kind
=
ik
),
intent
(
in
)
::
myid
,
na
,
sc_desc
(:)
MATH_DATATYPE
(
kind
=
rck
),
intent
(
inout
)
::
z
(:,:),
a
(:,:),
as
(:,:)
...
...
@@ -162,7 +162,7 @@ subroutine prepare_matrix_random_&
use
iso_c_binding
implicit
none
#include ".
./../src/general/
precision_kinds.F90"
#include ".
/test_
precision_kinds.F90"
integer
(
kind
=
c_int
)
,
value
::
myid
,
na
,
na_rows
,
na_cols
integer
(
kind
=
c_int
)
::
sc_desc
(
1
:
9
)
...
...
@@ -183,10 +183,10 @@ subroutine prepare_matrix_random_&
&
PRECISION
&
&
(
na
,
myid
,
sc_desc
,
a
,
z
,
as
,
nblk
,
np_rows
,
np_cols
,
my_prow
,
my_pcol
)
use
test_util
use
precision
!
use test_util
use
precision
_for_tests
implicit
none
#include ".
./../src/general/
precision_kinds.F90"
#include ".
/test_
precision_kinds.F90"
integer
(
kind
=
ik
),
intent
(
in
)
::
myid
,
na
,
sc_desc
(:)
MATH_DATATYPE
(
kind
=
rck
),
intent
(
inout
)
::
z
(:,:),
a
(:,:),
as
(:,:)
integer
,
intent
(
in
)
::
nblk
,
np_rows
,
np_cols
,
my_prow
,
my_pcol
...
...
@@ -252,7 +252,7 @@ subroutine prepare_matrix_random_spd_&
use
iso_c_binding
implicit
none
#include ".
./../src/general/
precision_kinds.F90"
#include ".
/test_
precision_kinds.F90"
integer
(
kind
=
c_int
)
,
value
::
myid
,
na
,
na_rows
,
na_cols
integer
(
kind
=
c_int
)
::
sc_desc
(
1
:
9
)
...
...
@@ -275,9 +275,10 @@ subroutine prepare_matrix_random_spd_&
&
PRECISION
&
&
(
na
,
diagonalElement
,
subdiagonalElement
,
d
,
sd
,
ds
,
sds
,
a
,
as
,
&
nblk
,
np_rows
,
np_cols
,
my_prow
,
my_pcol
)
use
test_util
!use test_util
use
precision_for_tests
implicit
none
#include ".
./../src/general/
precision_kinds.F90"
#include ".
/test_
precision_kinds.F90"
integer
,
intent
(
in
)
::
na
,
nblk
,
np_rows
,
np_cols
,
my_prow
,
my_pcol
MATH_DATATYPE
(
kind
=
rck
)
::
diagonalElement
,
subdiagonalElement
...
...
@@ -326,7 +327,7 @@ subroutine prepare_matrix_random_spd_&
&
(
na
,
diagonalElement
,
subdiagonalElement
,
d
,
sd
,
ds
,
sds
,
&
nblk
,
np_rows
,
np_cols
,
my_prow
,
my_pcol
)
#endif
use
test_util
!
use test_util
implicit
none
integer
,
intent
(
in
)
::
na
,
nblk
,
np_rows
,
np_cols
,
my_prow
,
my_pcol
...
...
@@ -374,7 +375,8 @@ subroutine prepare_matrix_random_spd_&
&
_
&
&
PRECISION
&
&
(
na
,
a
,
z
,
as
,
nblk
,
np_rows
,
np_cols
,
my_prow
,
my_pcol
)
use
test_util
!use test_util
use
precision_for_tests
implicit
none
integer
,
intent
(
in
)
::
na
,
nblk
,
np_rows
,
np_cols
,
my_prow
,
my_pcol
...
...
test/shared/test_read_input_parameters.F90
View file @
d31f42e0
...
...
@@ -206,7 +206,7 @@ module test_read_input_parameters
end
subroutine
subroutine
read_input_parameters_general
(
input_options
)
use
precision
use
precision
_for_tests
implicit
none
type
(
input_options_t
)
::
input_options
...
...
@@ -341,7 +341,7 @@ module test_read_input_parameters
end
subroutine
subroutine
read_input_parameters_traditional_noskip
(
na
,
nev
,
nblk
,
write_to_file
)
use
precision
use
precision
_for_tests
implicit
none
integer
(
kind
=
ik
),
intent
(
out
)
::
na
,
nev
,
nblk
...
...
@@ -353,7 +353,7 @@ module test_read_input_parameters
end
subroutine
subroutine
read_input_parameters_traditional
(
na
,
nev
,
nblk
,
write_to_file
,
skip_check_correctness
)
use
precision
use
precision
_for_tests
implicit
none
integer
(
kind
=
ik
),
intent
(
out
)
::
na
,
nev
,
nblk
...
...
test/shared/test_scalapack_template.F90
View file @
d31f42e0
...
...
@@ -46,7 +46,7 @@
&
BLAS_CHAR_AND_SY_OR_HE
&
&
evd
(
na
,
a
,
sc_desc
,
ev
,
z
)
implicit
none
#include ".
./../src/general/
precision_kinds.F90"
#include ".
/test_
precision_kinds.F90"
integer
(
kind
=
ik
),
intent
(
in
)
::
na
MATH_DATATYPE
(
kind
=
rck
),
intent
(
in
)
::
a
(:,:)
MATH_DATATYPE
(
kind
=
rck
),
intent
(
inout
)
::
z
(:,:)
...
...
@@ -102,7 +102,7 @@
&
BLAS_CHAR_AND_SY_OR_HE
&
&
evr
(
na
,
a
,
sc_desc
,
nev
,
ev
,
z
)
implicit
none
#include ".
./../src/general/
precision_kinds.F90"
#include ".
/test_
precision_kinds.F90"
integer
(
kind
=
ik
),
intent
(
in
)
::
na
,
nev
MATH_DATATYPE
(
kind
=
rck
),
intent
(
in
)
::
a
(:,:)
MATH_DATATYPE
(
kind
=
rck
),
intent
(
inout
)
::
z
(:,:)
...
...
test/shared/test_setup_mpi.F90
View file @
d31f42e0
...
...
@@ -48,7 +48,7 @@ module test_setup_mpi
subroutine
setup_mpi
(
myid
,
nprocs
)
use
test_util
use
ELPA_utilities
use
precision
use
precision
_for_tests
implicit
none
integer
(
kind
=
ik
)
::
mpierr
...
...
test/shared/test_util.F90
View file @
d31f42e0
...
...
@@ -43,7 +43,7 @@
#include "config-f90.h"
module
test_util
use
iso_c_binding
use
precision
use
precision
_for_tests
#ifdef WITH_MPI
#ifdef HAVE_MPI_MODULE
use
mpi
...
...
@@ -56,13 +56,6 @@ module test_util
integer
,
parameter
::
mpi_comm_world
=
-1
#endif
!integer, parameter :: rk8 = C_DOUBLE
!integer, parameter :: rk4 = C_FLOAT
!integer, parameter :: ck8 = C_DOUBLE_COMPLEX
!integer, parameter :: ck4 = C_FLOAT_COMPLEX
!integer, parameter :: ik = C_INT32_T
!integer, parameter :: lik = C_INT64_T
contains
!>
!> This function translates, if ELPA was build with OpenMP support,
...
...
test/shared/tests_variable_definitions.F90
0 → 100644
View file @
d31f42e0
! This file is part of ELPA.
!
! The ELPA library was originally created by the ELPA consortium,
! consisting of the following organizations:
!
! - Rechenzentrum Garching der Max-Planck-Gesellschaft (RZG),
! - Bergische Universität Wuppertal, Lehrstuhl für angewandte
! Informatik,
! - Technische Universität München, Lehrstuhl für Informatik mit
! Schwerpunkt Wissenschaftliches Rechnen ,
! - Fritz-Haber-Institut, Berlin, Abt. Theorie,
! - Max-Plack-Institut für Mathematik in den Naturwissenschaften,
! Leipzig, Abt. Komplexe Strukutren in Biologie und Kognition,
! and
! - IBM Deutschland GmbH
!
!
! More information can be found here:
! http://elpa.rzg.mpg.de/
!
! ELPA is free software: you can redistribute it and/or modify
! it under the terms of the version 3 of the license of the
! GNU Lesser General Public License as published by the Free
! Software Foundation.
!
! ELPA is distributed in the hope that it will be useful,
! but WITHOUT ANY WARRANTY; without even the implied warranty of
! MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
! GNU Lesser General Public License for more details.
!
! You should have received a copy of the GNU Lesser General Public License
! along with ELPA. If not, see <http://www.gnu.org/licenses/>
!
! ELPA reflects a substantial effort on the part of the original
! ELPA consortium, and we ask you to respect the spirit of the
! license that we chose: i.e., please contribute any changes you
! may have back to the original ELPA library distribution, and keep
! any derivatives of ELPA under the same license that we chose for
! the original distribution, the GNU Lesser General Public License.
!
! This file was written by A. Marek, MPC
#include "config-f90.h"
module
precision_for_tests
use
iso_c_binding
,
only
:
C_FLOAT
,
C_DOUBLE
,
C_FLOAT_COMPLEX
,
C_DOUBLE_COMPLEX
,
C_INT32_T
,
C_INT64_T
,
C_INT
implicit
none
integer
,
parameter
::
rk8
=
C_DOUBLE
integer
,
parameter
::
rk4
=
C_FLOAT
integer
,
parameter
::
ck8
=
C_DOUBLE_COMPLEX
integer
,
parameter
::
ck4
=
C_FLOAT_COMPLEX
integer
,
parameter
::
ik
=
C_INT32_T
integer
,
parameter
::
lik
=
C_INT64_T
integer
,
parameter
::
BLAS_KIND
=
C_INT32_T
end
module
precision_for_tests
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