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
11a6c6d8
Commit
11a6c6d8
authored
Dec 14, 2020
by
Andreas Marek
Browse files
Fix erroneous reference to MPI_COMM_WORLD in checks for GPU
parent
ac019573
Changes
4
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
src/GPU/check_for_gpu.F90
View file @
11a6c6d8
...
...
@@ -48,18 +48,21 @@ module mod_check_for_gpu
contains
function
check_for_gpu
(
myid
,
numberOfDevices
,
wantDebug
)
result
(
gpuAvailable
)
function
check_for_gpu
(
obj
,
myid
,
numberOfDevices
,
wantDebug
)
result
(
gpuAvailable
)
use
cuda_functions
use
precision
use
elpa_mpi
use
elpa_abstract_impl
implicit
none
class
(
elpa_abstract_impl_t
),
intent
(
inout
)
::
obj
integer
(
kind
=
ik
),
intent
(
in
)
::
myid
logical
,
optional
,
intent
(
in
)
::
wantDebug
logical
::
success
,
wantDebugMessage
integer
(
kind
=
ik
),
intent
(
out
)
::
numberOfDevices
integer
(
kind
=
ik
)
::
deviceNumber
,
mpierr
,
maxNumberOfDevices
logical
::
gpuAvailable
integer
(
kind
=
ik
)
::
error
,
mpi_comm_all
!character(len=1024) :: envname
if
(
.not.
(
present
(
wantDebug
)))
then
...
...
@@ -74,6 +77,12 @@ module mod_check_for_gpu
gpuAvailable
=
.false.
call
obj
%
get
(
"mpi_comm_parent"
,
mpi_comm_all
,
error
)
if
(
error
.ne.
ELPA_OK
)
then
print
*
,
"Problem getting option for mpi_comm_parent. Aborting..."
stop
endif
if
(
cublasHandle
.ne.
-1
)
then
gpuAvailable
=
.true.
numberOfDevices
=
-1
...
...
@@ -98,7 +107,7 @@ module mod_check_for_gpu
! make sure that all nodes have the same number of GPU's, otherwise
! we run into loadbalancing trouble
#ifdef WITH_MPI
call
mpi_allreduce
(
numberOfDevices
,
maxNumberOfDevices
,
1
,
MPI_INTEGER
,
MPI_MAX
,
MPI_COMM_WORLD
,
mpierr
)
call
mpi_allreduce
(
numberOfDevices
,
maxNumberOfDevices
,
1
,
MPI_INTEGER
,
MPI_MAX
,
mpi_comm_all
,
mpierr
)
if
(
maxNumberOfDevices
.ne.
numberOfDevices
)
then
print
*
,
"Different number of GPU devices on MPI tasks!"
...
...
src/elpa1/elpa1_template.F90
View file @
11a6c6d8
...
...
@@ -329,7 +329,7 @@ function elpa_solve_evp_&
if
(
useGPU
)
then
call
obj
%
timer
%
start
(
"check_for_gpu"
)
if
(
check_for_gpu
(
my_pe
,
numberOfGPUDevices
,
wantDebug
=
wantDebug
))
then
if
(
check_for_gpu
(
obj
,
my_pe
,
numberOfGPUDevices
,
wantDebug
=
wantDebug
))
then
do_useGPU
=
.true.
! set the neccessary parameters
cudaMemcpyHostToDevice
=
cuda_memcpyHostToDevice
()
...
...
src/elpa1/elpa_multiply_a_b.F90
View file @
11a6c6d8
...
...
@@ -176,7 +176,7 @@
if
(
useGPU
)
then
call
obj
%
timer
%
start
(
"check_for_gpu"
)
if
(
check_for_gpu
(
myid
,
numGPU
))
then
if
(
check_for_gpu
(
obj
,
myid
,
numGPU
))
then
! set the neccessary parameters
cudaMemcpyHostToDevice
=
cuda_memcpyHostToDevice
()
cudaMemcpyDeviceToHost
=
cuda_memcpyDeviceToHost
()
...
...
src/elpa2/elpa2_template.F90
View file @
11a6c6d8
...
...
@@ -360,7 +360,7 @@
do_useGPU
=
.false.
if
(
useGPU
)
then
call
obj
%
timer
%
start
(
"check_for_gpu"
)
if
(
check_for_gpu
(
my_pe
,
numberOfGPUDevices
,
wantDebug
=
wantDebug
))
then
if
(
check_for_gpu
(
obj
,
my_pe
,
numberOfGPUDevices
,
wantDebug
=
wantDebug
))
then
do_useGPU
=
.true.
...
...
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