Unverified Commit c6b56c7e authored by Andreas Marek's avatar Andreas Marek
Browse files

Hide some debug messages per default

As always the debug messages appear if the environment variable
is set
parent ce897ae0
......@@ -45,13 +45,14 @@ module mod_check_for_gpu
contains
function check_for_gpu(myid, numberOfDevices) result(gpuAvailable)
function check_for_gpu(myid, numberOfDevices, wantDebug) result(gpuAvailable)
use cuda_functions
use precision
implicit none
include 'mpif.h'
integer(kind=ik), intent(in) :: myid
logical :: success
logical, optional, intent(in) :: wantDebug
logical :: success, wantDebugMessage
integer(kind=ik), intent(out) :: numberOfDevices
integer(kind=ik) :: deviceNumber, mpierr, maxNumberOfDevices
logical :: gpuAvailable
......@@ -59,6 +60,16 @@ module mod_check_for_gpu
gpuAvailable = .false.
if (.not.(present(wantDebug))) then
wantDebugMessage = .false.
else
if (wantDebug) then
wantDebugMessage=.true.
else
wantDebugMessage=.false.
endif
endif
! call getenv("CUDA_PROXY_PIPE_DIRECTORY", envname)
success = cuda_getdevicecount(numberOfDevices)
......@@ -83,8 +94,10 @@ module mod_check_for_gpu
! Usage of GPU is possible since devices have been detected
if (myid==0) then
print *
print '(3(a,i0))','Found ', numberOfDevices, ' GPUs'
if (wantDebugMessage) then
print *
print '(3(a,i0))','Found ', numberOfDevices, ' GPUs'
endif
endif
deviceNumber = mod(myid, numberOfDevices)
......@@ -94,7 +107,9 @@ module mod_check_for_gpu
print *,"Cannot set CudaDevice"
stop
endif
print '(3(a,i0))', 'MPI rank ', myid, ' uses GPU #', deviceNumber
if (wantDebugMessage) then
print '(3(a,i0))', 'MPI rank ', myid, ' uses GPU #', deviceNumber
endif
endif
end function
......
......@@ -253,7 +253,7 @@ contains
endif
if (THIS_REAL_ELPA_KERNEL .eq. REAL_ELPA_KERNEL_GPU) then
if (check_for_gpu(my_pe,numberOfGPUDevices)) then
if (check_for_gpu(my_pe,numberOfGPUDevices, wantDebug=wantDebug)) then
useGPU = .true.
endif
if (nblk .ne. 128) then
......@@ -503,7 +503,7 @@ function solve_evp_complex_2stage(na, nev, a, lda, ev, q, ldq, nblk, &
endif
if (THIS_COMPLEX_ELPA_KERNEL .eq. COMPLEX_ELPA_KERNEL_GPU) then
if (check_for_gpu(my_pe, numberOfGPUDevices)) then
if (check_for_gpu(my_pe, numberOfGPUDevices, wantDebug=wantDebug)) then
useGPU=.true.
endif
if (nblk .ne. 128) then
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment