Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
elpa
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
11
Issues
11
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
Operations
Operations
Incidents
Environments
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
elpa
elpa
Commits
d97f8400
Commit
d97f8400
authored
Aug 05, 2017
by
Andreas Marek
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Adapt test cases for zero eigenvectors
parent
f2157961
Changes
4
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
99 additions
and
30 deletions
+99
-30
src/elpa1/legacy_interface/elpa1_template.F90
src/elpa1/legacy_interface/elpa1_template.F90
+9
-7
test/Fortran/test.F90
test/Fortran/test.F90
+28
-8
test/shared/test_analytic.F90
test/shared/test_analytic.F90
+7
-2
test/shared/test_check_correctness_template.F90
test/shared/test_check_correctness_template.F90
+55
-13
No files found.
src/elpa1/legacy_interface/elpa1_template.F90
View file @
d97f8400
...
...
@@ -182,13 +182,15 @@ function elpa_solve_evp_&
if
(
my_prow
==
0
.and.
my_pcol
==
0
.and.
elpa_print_times
)
write
(
error_unit
,
*
)
'Time solve_tridi :'
,
time_evp_solve
time_evp_back
=
e
%
get_time
(
"elpa_solve_evp_&
&MATH_DATATYPE&
&_1stage_&
&PRECISION&
&"
,
"back"
)
if
(
my_prow
==
0
.and.
my_pcol
==
0
.and.
elpa_print_times
)
write
(
error_unit
,
*
)
'Time trans_ev_real:'
,
time_evp_back
if
(
nev
.ge.
1
)
then
time_evp_back
=
e
%
get_time
(
"elpa_solve_evp_&
&MATH_DATATYPE&
&_1stage_&
&PRECISION&
&"
,
"back"
)
if
(
my_prow
==
0
.and.
my_pcol
==
0
.and.
elpa_print_times
)
write
(
error_unit
,
*
)
'Time trans_ev_real:'
,
time_evp_back
endif
if
(
successInternal
.ne.
ELPA_OK
)
then
print
*
,
"Cannot solve with ELPA 1stage"
...
...
test/Fortran/test.F90
View file @
d97f8400
...
...
@@ -136,7 +136,7 @@ program test
MATRIX_TYPE
,
allocatable
::
z
(:,:)
! eigenvalues
EV_TYPE
,
allocatable
::
ev
(:)
#if defined(TEST_EIGENVALUES) || defined(TEST_SOLVE_TRIDIAGONAL)
#if defined(TEST_EIGENVALUES) || defined(TEST_SOLVE_TRIDIAGONAL)
|| defined(TEST_EIGENVECTORS)
EV_TYPE
,
allocatable
::
d
(:),
sd
(:),
ev_analytic
(:),
ds
(:),
sds
(:)
EV_TYPE
::
diagonalELement
,
subdiagonalElement
#endif
...
...
@@ -215,7 +215,7 @@ program test
allocate
(
z
(
na_rows
,
na_cols
))
allocate
(
ev
(
na
))
#if defined(TEST_EIGENVALUES) || defined(TEST_SOLVE_TRIDIAGONAL)
#if defined(TEST_EIGENVALUES) || defined(TEST_SOLVE_TRIDIAGONAL)
|| defined(TEST_EIGENVECTORS)
allocate
(
d
(
na
),
ds
(
na
))
allocate
(
sd
(
na
),
sds
(
na
))
allocate
(
ev_analytic
(
na
))
...
...
@@ -228,9 +228,23 @@ program test
#ifdef TEST_EIGENVECTORS
#ifdef TEST_MATRIX_ANALYTIC
call
prepare_matrix_analytic
(
na
,
a
,
nblk
,
myid
,
np_rows
,
np_cols
,
my_prow
,
my_pcol
)
as
(:,:)
=
a
as
(:,:)
=
a
#else
if
(
nev
.ge.
1
)
then
call
prepare_matrix
(
na
,
myid
,
sc_desc
,
a
,
z
,
as
)
else
! zero eigenvectors and not analytic test => toeplitz matrix
#ifdef TEST_SINGLE
diagonalElement
=
0.45_c_float
subdiagonalElement
=
0.78_c_float
#else
call
prepare_matrix
(
na
,
myid
,
sc_desc
,
a
,
z
,
as
)
diagonalElement
=
0.45_c_double
subdiagonalElement
=
0.78_c_double
#endif
call
prepare_toeplitz_matrix
(
na
,
diagonalElement
,
subdiagonalElement
,
&
d
,
sd
,
ds
,
sds
,
a
,
as
,
nblk
,
np_rows
,
&
np_cols
,
my_prow
,
my_pcol
)
endif
#endif
#endif
...
...
@@ -246,7 +260,7 @@ program test
call
prepare_toeplitz_matrix
(
na
,
diagonalElement
,
subdiagonalElement
,
&
d
,
sd
,
ds
,
sds
,
a
,
as
,
nblk
,
np_rows
,
&
np_cols
,
my_prow
,
my_pcol
)
#endif
#endif
/* EIGENVALUES OR TRIDIAGONAL */
e
=>
elpa_allocate
()
...
...
@@ -360,7 +374,13 @@ program test
#ifdef TEST_MATRIX_ANALYTIC
status
=
check_correctness_analytic
(
na
,
nev
,
ev
,
z
,
nblk
,
myid
,
np_rows
,
np_cols
,
my_prow
,
my_pcol
)
#else
status
=
check_correctness
(
na
,
nev
,
as
,
z
,
ev
,
sc_desc
,
nblk
,
myid
,
np_rows
,
np_cols
,
my_prow
,
my_pcol
)
if
(
nev
.ge.
1
)
then
status
=
check_correctness
(
na
,
nev
,
as
,
z
,
ev
,
sc_desc
,
nblk
,
myid
,
np_rows
,
np_cols
,
my_prow
,
my_pcol
)
else
! zero eigenvectors and no analytic test => toeplitz
status
=
check_correctness_eigenvalues_toeplitz
(
na
,
diagonalElement
,
&
subdiagonalElement
,
ev
,
z
,
myid
)
endif
#endif
call
check_status
(
status
,
myid
)
#endif
...
...
@@ -383,7 +403,7 @@ program test
#ifdef TEST_ALL_KERNELS
a
(:,:)
=
as
(:,:)
#if defined(TEST_EIGENVALUES) || defined(TEST_SOLVE_TRIDIAGONAL)
#if defined(TEST_EIGENVALUES) || defined(TEST_SOLVE_TRIDIAGONAL)
|| defined(TEST_EIGENVECTORS)
d
=
ds
sd
=
sds
#endif
...
...
@@ -397,7 +417,7 @@ program test
deallocate
(
z
)
deallocate
(
ev
)
#if defined(TEST_EIGENVALUES) || defined(TEST_SOLVE_TRIDIAGONAL)
#if defined(TEST_EIGENVALUES) || defined(TEST_SOLVE_TRIDIAGONAL)
|| defined(TEST_EIGENVECTORS)
deallocate
(
d
,
ds
)
deallocate
(
sd
,
sds
)
deallocate
(
ev_analytic
)
...
...
test/shared/test_analytic.F90
View file @
d97f8400
...
...
@@ -145,8 +145,13 @@ module test_analytic
if
(
myid
==
0
)
print
*
,
'Maximum error in eigenvalues :'
,
max_ev_diff
if
(
myid
==
0
)
print
*
,
'Maximum error in eigenvectors :'
,
glob_max_z_diff
status
=
0
if
(
max_ev_diff
.gt.
5e-14_rk8
.or.
max_ev_diff
.eq.
ZERO
)
status
=
1
if
(
glob_max_z_diff
.gt.
6e-11_rk8
.or.
glob_max_z_diff
.eq.
ZERO
)
status
=
1
if
(
nev
.gt.
2
)
then
if
(
max_ev_diff
.gt.
5e-14_rk8
.or.
max_ev_diff
.eq.
ZERO
)
status
=
1
if
(
glob_max_z_diff
.gt.
6e-11_rk8
.or.
glob_max_z_diff
.eq.
ZERO
)
status
=
1
else
if
(
max_ev_diff
.gt.
5e-14_rk8
)
status
=
1
if
(
glob_max_z_diff
.gt.
6e-11_rk8
)
status
=
1
endif
end
function
function
decompose
(
num
,
decomposition
)
result
(
possible
)
...
...
test/shared/test_check_correctness_template.F90
View file @
d97f8400
...
...
@@ -197,22 +197,43 @@
if
(
myid
==
0
)
print
*
,
'Error Residual :'
,
errmax
#if REALCASE == 1
if
(
nev
.ge.
2
)
then
#ifdef DOUBLE_PRECISION_REAL
if
(
errmax
.gt.
5e-12_rk8
.or.
errmax
.eq.
0.0_rk8
)
then
if
(
errmax
.gt.
5e-12_rk8
.or.
errmax
.eq.
0.0_rk8
)
then
#else
if
(
errmax
.gt.
3e-3_rk4
.or.
errmax
.eq.
0.0_rk4
)
then
if
(
errmax
.gt.
3e-3_rk4
.or.
errmax
.eq.
0.0_rk4
)
then
#endif
status
=
1
endif
else
#ifdef DOUBLE_PRECISION_REAL
if
(
errmax
.gt.
5e-12_rk8
)
then
#else
if
(
errmax
.gt.
3e-3_rk4
)
then
#endif
status
=
1
endif
endif
#endif
#if COMPLEXCASE == 1
if
(
nev
.gt.
2
)
then
#ifdef DOUBLE_PRECISION_COMPLEX
if
(
errmax
.gt.
5e-12_rk8
.or.
errmax
.eq.
0.0_rk8
)
then
if
(
errmax
.gt.
5e-12_rk8
.or.
errmax
.eq.
0.0_rk8
)
then
#else
if
(
errmax
.gt.
3e-3_rk4
.or.
errmax
.eq.
0.0_rk4
)
then
if
(
errmax
.gt.
3e-3_rk4
.or.
errmax
.eq.
0.0_rk4
)
then
#endif
status
=
1
endif
else
#ifdef DOUBLE_PRECISION_COMPLEX
if
(
errmax
.gt.
5e-12_rk8
)
then
#else
if
(
errmax
.gt.
3e-3_rk4
)
then
#endif
status
=
1
status
=
1
endif
endif
#endif
! 2. Eigenvector orthogonality
...
...
@@ -224,7 +245,6 @@
#else /* WITH_MPI */
call
PRECISION_GEMM
(
BLAS_TRANS_OR_CONJ
,
'N'
,
nev
,
nev
,
na
,
ONE
,
z
,
na
,
z
,
na
,
ZERO
,
tmp1
,
na
)
#endif /* WITH_MPI */
!TODO for the C interface, not all information is passed (zeros instead)
!TODO than this part of the test cannot be done
!TODO either we will not have this part of test at all, or it will be improved
...
...
@@ -266,22 +286,44 @@
if
(
myid
==
0
)
print
*
,
'Error Orthogonality:'
,
errmax
#if REALCASE == 1
if
(
nev
.ge.
2
)
then
#ifdef DOUBLE_PRECISION_REAL
if
(
errmax
.gt.
5e-12_rk8
.or.
errmax
.eq.
0.0_rk8
)
then
if
(
errmax
.gt.
5e-12_rk8
.or.
errmax
.eq.
0.0_rk8
)
then
#else
if
(
errmax
.gt.
9e-4_rk4
.or.
errmax
.eq.
0.0_rk4
)
then
if
(
errmax
.gt.
9e-4_rk4
.or.
errmax
.eq.
0.0_rk4
)
then
#endif
status
=
1
endif
else
#ifdef DOUBLE_PRECISION_REAL
if
(
errmax
.gt.
5e-12_rk8
)
then
#else
if
(
errmax
.gt.
9e-4_rk4
)
then
#endif
status
=
1
endif
endif
#endif
#if COMPLEXCASE == 1
if
(
nev
.ge.
2
)
then
#ifdef DOUBLE_PRECISION_COMPLEX
if
(
errmax
.gt.
5e-12_rk8
.or.
errmax
.eq.
0.0_rk8
)
then
#else
if
(
errmax
.gt.
9e-4_rk4
.or.
errmax
.eq.
0.0_rk4
)
then
#endif
status
=
1
endif
else
#ifdef DOUBLE_PRECISION_COMPLEX
if
(
errmax
.gt.
5e-12_rk8
.or.
errmax
.eq.
0.0
_rk8
)
then
if
(
errmax
.gt.
5e-12
_rk8
)
then
#else
if
(
errmax
.gt.
9e-4_rk4
.or.
errmax
.eq.
0.0
_rk4
)
then
if
(
errmax
.gt.
9e-4
_rk4
)
then
#endif
status
=
1
endif
endif
#endif
status
=
1
endif
end
function
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a 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