From 249325b91172d6551959e512fe2d1f5047e76491 Mon Sep 17 00:00:00 2001 From: Anthony Scemama Date: Mon, 6 Jun 2016 10:25:19 +0200 Subject: [PATCH] OMP PARALLEL BUG --- src/Determinants/s2.irp.f | 28 ++++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/src/Determinants/s2.irp.f b/src/Determinants/s2.irp.f index e16bd386..8587098b 100644 --- a/src/Determinants/s2.irp.f +++ b/src/Determinants/s2.irp.f @@ -234,7 +234,7 @@ subroutine get_uJ_s2_uI(psi_keys_tmp,psi_coefs_tmp,n,nmax_coefs,nmax_keys,s2,nst do jj = 1, nstates accu = 0.d0 !$OMP PARALLEL DEFAULT(NONE) & - !$OMP PRIVATE (i,j,kk,idx,tmp,s2_tmp,accu) & + !$OMP PRIVATE (i,j,kk,idx,tmp,s2_tmp) & !$OMP SHARED (ll,jj,psi_keys_tmp,psi_coefs_tmp,N_int,n,nstates) & !$OMP REDUCTION(+:accu) allocate(idx(0:n)) @@ -321,19 +321,19 @@ subroutine diagonalize_s2_betweenstates(keys_tmp,psi_coefs_inout,n,nmax_keys,nma call ortho_lowdin(overlap,size(overlap,1),nstates,psi_coefs_inout,size(psi_coefs_inout,1),n) print*,'passed ortho' - !$OMP PARALLEL DO COLLAPSE(2) DEFAULT(NONE) & - !$OMP PRIVATE(i,j) SHARED(overlap,psi_coefs_inout,nstates,n) - do i = 1, nstates - do j = i+1, nstates - if (i == j) then - overlap(i,i) = u_dot_u(psi_coefs_inout(1,i),n) - else - overlap(i,j) = u_dot_v(psi_coefs_inout(1,j),psi_coefs_inout(1,i),n) - overlap(j,i) = overlap(i,j) - endif - enddo - enddo - !$OMP END PARALLEL + !$OMP PARALLEL DO COLLAPSE(2) DEFAULT(NONE) & + !$OMP PRIVATE(i,j) SHARED(overlap,psi_coefs_inout,nstates,n) + do i = 1, nstates + do j = i+1, nstates + if (i == j) then + overlap(i,i) = u_dot_u(psi_coefs_inout(1,i),n) + else + overlap(i,j) = u_dot_v(psi_coefs_inout(1,j),psi_coefs_inout(1,i),n) + overlap(j,i) = overlap(i,j) + endif + enddo + enddo + !$OMP END PARALLEL DO print*,'Overlap matrix in the basis of the Lowdin orthonormalized states ' do i = 1, nstates write(*,'(10(F16.10,X))')overlap(i,:)