Commit 2ec8e44c authored by Wenzhe Yu's avatar Wenzhe Yu 😎

Fix uninitialized memory in elpa2_trans_ev_band_to_full

The old code crashes when calling an MPI_Allreduce. The reason is that
part of the input array (t_tmp in this case) is not initialized.
parent 5795d93d
...@@ -299,6 +299,13 @@ ...@@ -299,6 +299,13 @@
hvm = 0.0_rck ! Must be set to 0 !!! hvm = 0.0_rck ! Must be set to 0 !!!
hvb = 0.0_rck ! Safety only hvb = 0.0_rck ! Safety only
tmp1 = 0.0_rck
tmp2 = 0.0_rck
tmat_complete = 0.0_rck
if (blocking_factor > 1) then
t_tmp = 0.0_rck ! Must be set to 0 !!!
t_tmp2 = 0.0_rck
endif
l_cols = local_index(nqc, my_pcol, np_cols, nblk, -1) ! Local columns of q_mat l_cols = local_index(nqc, my_pcol, np_cols, nblk, -1) ! Local columns of q_mat
do istep=1,((na-1)/nbw-1)/blocking_factor + 1 do istep=1,((na-1)/nbw-1)/blocking_factor + 1
...@@ -485,7 +492,7 @@ ...@@ -485,7 +492,7 @@
call cublas_PRECISION_TRMM('L', 'U', BLAS_TRANS_OR_CONJ, 'N', & call cublas_PRECISION_TRMM('L', 'U', BLAS_TRANS_OR_CONJ, 'N', &
n_cols, l_cols, ONE, tmat_dev, cwy_blocking, & n_cols, l_cols, ONE, tmat_dev, cwy_blocking, &
tmp_dev, n_cols) tmp_dev, n_cols)
call cublas_PRECISION_GEMM('N', 'N', l_rows, l_cols, n_cols, & call cublas_PRECISION_GEMM('N', 'N', l_rows, l_cols, n_cols, &
-ONE, hvm_dev, max_local_rows, tmp_dev, n_cols, ONE, q_dev, ldq) -ONE, hvm_dev, max_local_rows, tmp_dev, n_cols, ONE, q_dev, ldq)
call obj%timer%stop("cublas") call obj%timer%stop("cublas")
else else
......
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