Commit 48155f4a authored by Andreas Marek's avatar Andreas Marek
Browse files

Clenaup of elpa2_bandred_template.X90

parent 2e2e4131
...@@ -178,7 +178,7 @@ ...@@ -178,7 +178,7 @@
#if COMPLEXCASE == 1 #if COMPLEXCASE == 1
complex(kind=COMPLEX_DATATYPE) :: xf, aux1(nbw), aux2(nbw), vrl, tau, vav(nbw,nbw) complex(kind=COMPLEX_DATATYPE) :: xf, aux1(nbw), aux2(nbw), vrl, tau, vav(nbw,nbw)
complex(kind=COMPLEX_DATATYPE), allocatable :: tmpCPU(:,:), vmrCPU(:,:), umcCPU(:,:) complex(kind=COMPLEX_DATATYPE), allocatable :: tmp_CPU(:,:), vmrCPU(:,:), umcCPU(:,:)
complex(kind=COMPLEX_DATATYPE), allocatable :: vr(:) complex(kind=COMPLEX_DATATYPE), allocatable :: vr(:)
#endif #endif
...@@ -1609,6 +1609,7 @@ ...@@ -1609,6 +1609,7 @@
#endif /* WITH_OPENMP */ #endif /* WITH_OPENMP */
endif ! useGPU endif ! useGPU
#endif /* REALCASE == 1 */ #endif /* REALCASE == 1 */
#if COMPLEXCASE == 1 #if COMPLEXCASE == 1
...@@ -1623,19 +1624,19 @@ ...@@ -1623,19 +1624,19 @@
endif endif
#ifdef WITH_MPI #ifdef WITH_MPI
if (l_cols>0) then if (l_cols>0) then
allocate(tmpCPU(l_cols,n_cols), stat=istat, errmsg=errorMessage) allocate(tmp_CPU(l_cols,n_cols), stat=istat, errmsg=errorMessage)
if (istat .ne. 0) then if (istat .ne. 0) then
print *,"bandred_complex: error when allocating tmp "//errorMessage print *,"bandred_complex: error when allocating tmp_CPU "//errorMessage
stop stop
endif endif
call timer%start("mpi_communication") call timer%start("mpi_communication")
call mpi_allreduce(umcCPU, tmpCPU, l_cols*n_cols, MPI_COMPLEX_PRECISION, MPI_SUM, mpi_comm_rows, mpierr) call mpi_allreduce(umcCPU, tmp_CPU, l_cols*n_cols, MPI_COMPLEX_PRECISION, MPI_SUM, mpi_comm_rows, mpierr)
call timer%stop("mpi_communication") call timer%stop("mpi_communication")
umcCPU(1:l_cols,1:n_cols) = tmpCPU(1:l_cols,1:n_cols) umcCPU(1:l_cols,1:n_cols) = tmp_CPU(1:l_cols,1:n_cols)
deallocate(tmpCPU, stat=istat, errmsg=errorMessage) deallocate(tmp_CPU, stat=istat, errmsg=errorMessage)
if (istat .ne. 0) then if (istat .ne. 0) then
print *,"bandred_complex: error when deallocating tmp "//errorMessage print *,"bandred_complex: error when deallocating tmp_CPU "//errorMessage
stop stop
endif endif
endif endif
...@@ -1660,9 +1661,6 @@ ...@@ -1660,9 +1661,6 @@
#endif /* WITH_MPI */ #endif /* WITH_MPI */
! U = U * Tmat**T ! U = U * Tmat**T
if (useGPU) then if (useGPU) then
if (size(umcCPU,dim=1)*size(umcCPU,dim=2) .gt. umc_size) then if (size(umcCPU,dim=1)*size(umcCPU,dim=2) .gt. umc_size) then
...@@ -1809,7 +1807,7 @@ ...@@ -1809,7 +1807,7 @@
call timer%stop("blas") call timer%stop("blas")
endif endif
enddo enddo
#endif #endif /* COMPLEXCASE */
if (.not.(useGPU)) then if (.not.(useGPU)) then
if (allocated(vr)) then if (allocated(vr)) then
...@@ -1934,14 +1932,6 @@ ...@@ -1934,14 +1932,6 @@
endif endif
endif endif
#if COMPLEXCASE == 1
successCUDA = cuda_free(umc_dev)
if (.not.(successCUDA)) then
print *,"bandred_complex: error in cudaFree"
stop
endif
#endif
if (useGPU) then if (useGPU) then
successCUDA = cuda_free(vmr_dev) successCUDA = cuda_free(vmr_dev)
if (.not.(successCUDA)) then if (.not.(successCUDA)) then
...@@ -1958,6 +1948,7 @@ ...@@ -1958,6 +1948,7 @@
&: error in cudaFree" &: error in cudaFree"
stop stop
endif endif
#if REALCASE == 1 #if REALCASE == 1
if (allocated(umcCUDA)) then if (allocated(umcCUDA)) then
deallocate(umcCUDA, stat=istat, errmsg=errorMessage) deallocate(umcCUDA, stat=istat, errmsg=errorMessage)
......
Supports Markdown
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