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
f8b7ddb9
Commit
f8b7ddb9
authored
Jun 12, 2018
by
Andreas Marek
Browse files
Fix a newly introduced error in OpenMP code path
parent
6385071d
Changes
4
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
src/elpa1/elpa1_merge_systems_real_template.F90
View file @
f8b7ddb9
...
...
@@ -438,7 +438,6 @@
#ifdef WITH_OPENMP
call
obj
%
timer
%
start
(
"OpenMP parallel"
//
PRECISION_SUFFIX
)
! OPENMP_CHANGE here
!$OMP PARALLEL PRIVATE(i,my_thread,delta,s,info,j)
my_thread
=
omp_get_thread_num
()
!$OMP DO
...
...
src/elpa1/legacy_interface/elpa_solve_tridi.F90
View file @
f8b7ddb9
...
...
@@ -62,6 +62,9 @@
&
_
impl
use
elpa
use
elpa_abstract_impl
#ifdef WITH_OPENMP
use
omp_lib
#endif
implicit
none
integer
(
kind
=
ik
)
::
na
,
nev
,
ldq
,
nblk
,
matrixCols
,
mpi_comm_rows
,
mpi_comm_cols
real
(
kind
=
REAL_DATATYPE
)
::
d
(
na
),
e
(
na
)
...
...
@@ -75,6 +78,9 @@
logical
::
success
! the return value
integer
::
error
class
(
elpa_t
),
pointer
::
obj
#ifdef WITH_OPENMP
integer
::
nrThreads
#endif
!call timer%start("elpa_solve_tridi_&
!&PRECISION&
...
...
@@ -132,6 +138,14 @@
return
endif
#ifdef WITH_OPENMP
nrThreads
=
omp_get_max_threads
()
call
obj
%
set
(
"omp_threads"
,
nrThreads
,
error
)
#else
call
obj
%
set
(
"omp_threads"
,
1
,
error
)
#endif
if
(
wantDebug
)
then
call
obj
%
set
(
"debug"
,
1
,
error
)
if
(
error
.ne.
ELPA_OK
)
then
...
...
src/elpa_index.c
View file @
f8b7ddb9
...
...
@@ -708,14 +708,12 @@ static int omp_threads_cardinality(elpa_index_t index) {
if
(
set_max_threads_glob
==
0
)
{
max_threads_glob
=
omp_get_max_threads
();
set_max_threads_glob
=
1
;
//printf("Setting global max threads to %d \n",max_threads_glob);
}
#else
max_threads_glob
=
1
;
set_max_threads_glob
=
1
;
#endif
max_threads
=
max_threads_glob
;
//printf("Setting max threads to %d \n",max_threads);
return
max_threads
;
}
...
...
@@ -726,11 +724,15 @@ static int omp_threads_enumerate(elpa_index_t index, int i) {
static
int
omp_threads_is_valid
(
elpa_index_t
index
,
int
n
,
int
new_value
)
{
int
max_threads
;
#ifdef WITH_OPENMP
max_threads
=
max_threads_glob
;
if
(
set_max_threads_glob
==
0
)
{
max_threads_glob
=
omp_get_max_threads
();
set_max_threads_glob
=
1
;
}
#else
max_threads
=
1
;
max_threads_glob
=
1
;
set_max_threads_glob
=
1
;
#endif
//printf("In valid
max
threads
to %d \n",
max_threads
)
;
max
_
threads
=
max_threads
_glob
;
return
(
1
<=
new_value
)
&&
(
new_value
<=
max_threads
);
}
...
...
test/Fortran/test.F90
View file @
f8b7ddb9
...
...
@@ -120,6 +120,9 @@ program test
#ifdef HAVE_REDIRECT
use
test_redirect
#endif
#ifdef WITH_OPENMP
use
omp_lib
#endif
implicit
none
...
...
@@ -176,6 +179,10 @@ program test
do_test_toeplitz_eigenvalues
,
do_test_cholesky
,
&
do_test_hermitian_multiply
#ifdef WITH_OPENMP
integer
::
max_threads
#endif
call
read_input_parameters_traditional
(
na
,
nev
,
nblk
,
write_to_file
,
skip_check_correctness
)
call
setup_mpi
(
myid
,
nprocs
)
#ifdef HAVE_REDIRECT
...
...
@@ -568,6 +575,12 @@ program test
assert_elpa_ok
(
error
)
#endif
#ifdef WITH_OPENMP
max_threads
=
omp_get_max_threads
()
call
e
%
set
(
"omp_threads"
,
max_threads
,
error
)
assert_elpa_ok
(
error
)
#endif
if
(
myid
==
0
)
print
*
,
""
#ifdef TEST_ALL_KERNELS
...
...
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