Commit c6228eab authored by Miriam Hinzen's avatar Miriam Hinzen

Calculate sphere integral in vmts only for mpi rank 0

parent a0f14ff2
......@@ -250,7 +250,7 @@
CALL MPI_BCAST(input%jspins,1,MPI_INTEGER,0,mpi%mpi_comm,ierr)
CALL MPI_BCAST(atoms%n_u,1,MPI_INTEGER,0,mpi%mpi_comm,ierr)
CALL MPI_BCAST(atoms%lmaxd,1,MPI_INTEGER,0,mpi%mpi_comm,ierr)
call MPI_BCAST( input%preconditioning_param, 1, MPI_DOUBLE, 0, mpi%mpi_comm, ierr )
call MPI_BCAST( input%preconditioning_param, 1, MPI_DOUBLE_PRECISION, 0, mpi%mpi_comm, ierr )
#endif
CALL ylmnorm_init(atoms%lmaxd)
!
......
......@@ -27,6 +27,7 @@ CONTAINS
LOGICAL :: l_nocoAlloc, l_denMatAlloc, l_vaczAlloc, l_pw_wAlloc
CALL MPI_BCAST(potden%iter,1,MPI_INTEGER,0,mpi%mpi_comm,ierr)
CALL MPI_BCAST(potden%potdenType,1,MPI_INTEGER,0,mpi%mpi_comm,ierr)
l_nocoAlloc = .FALSE.
l_denMatAlloc = .FALSE.
......@@ -51,7 +52,7 @@ CONTAINS
CALL MPI_BCAST(potden%pw,n,MPI_DOUBLE_COMPLEX,0,mpi%mpi_comm,ierr)
n = atoms%jmtd * (sphhar%nlhd+1) * atoms%ntype * input%jspins
CALL MPI_BCAST(potden%mt,n,MPI_DOUBLE,0,mpi%mpi_comm,ierr)
CALL MPI_BCAST(potden%mt,n,MPI_DOUBLE_PRECISION,0,mpi%mpi_comm,ierr)
IF (l_pw_wAlloc) THEN
n = stars%ng3 * SIZE(potden%pw_w,2)
......@@ -60,7 +61,7 @@ CONTAINS
IF (l_vaczAlloc) THEN
n = vacuum%nmzd * 2 * SIZE(potden%vacz,3)
CALL MPI_BCAST(potden%vacz,n,MPI_DOUBLE,0,mpi%mpi_comm,ierr)
CALL MPI_BCAST(potden%vacz,n,MPI_DOUBLE_PRECISION,0,mpi%mpi_comm,ierr)
n = vacuum%nmzxyd * (stars%ng2-1) * 2 * SIZE(potden%vacxy,4)
CALL MPI_BCAST(potden%vacxy,n,MPI_DOUBLE_COMPLEX,0,mpi%mpi_comm,ierr)
......
......@@ -45,7 +45,7 @@ CONTAINS
! reduce mt
n = atoms%jmtd * ( sphhar%nlhd + 1 ) * atoms%ntype * input%jspins
allocate( r_b(n) )
call MPI_REDUCE( potden%mt, r_b, n, MPI_DOUBLE, MPI_SUM, 0, mpi%mpi_comm, ierr )
call MPI_REDUCE( potden%mt, r_b, n, MPI_DOUBLE_PRECISION, MPI_SUM, 0, mpi%mpi_comm, ierr )
if( mpi%irank == 0 ) call CPP_BLAS_scopy( n, r_b, 1, potden%mt, 1 )
deallocate( r_b )
......@@ -62,7 +62,7 @@ CONTAINS
if( allocated( potden%vacz ) ) then
n = vacuum%nmzd * 2 * size( potden%vacz, 3 )
allocate( r_b(n) )
call MPI_REDUCE( potden%vacz, r_b, n, MPI_DOUBLE, MPI_SUM, 0, mpi%mpi_comm, ierr )
call MPI_REDUCE( potden%vacz, r_b, n, MPI_DOUBLE_PRECISION, MPI_SUM, 0, mpi%mpi_comm, ierr )
if( mpi%irank == 0 ) call CPP_BLAS_scopy( n, r_b, 1, potden%vacz, 1 )
deallocate( r_b )
end if
......
Start testing: Jun 08 16:47 CEST
----------------------------------------------------------
End testing: Jun 08 16:47 CEST
......@@ -98,6 +98,7 @@ contains
end do
! q=0 term: see (A12) (Coulomb case) or (A13) (Yukawa case)
if( mpi%irank == 0 ) then
s = 0.
do n = 1, atoms%ntype
if ( potdenType /= POTDEN_TYPE_POTYUK ) then
......@@ -106,7 +107,7 @@ contains
s = s + atoms%neq(n) * real( qlm(0,0,n) ) * g0(n)
end if
end do
if ( mpi%irank == 0 ) then
!if( mpi%irank == 0 ) then
psq(1) = qpw(1) + ( sfp_const / cell%omtil ) * s
end if
......
......@@ -142,6 +142,7 @@ contains
! SPHERE INTERIOR CONTRIBUTION to the coefficients calculated from the
! values of the sphere Coulomb/Yukawa potential on the sphere boundary
if( mpi%irank == 0 ) then
if ( potdenType == POTDEN_TYPE_POTYUK ) then
allocate( il(0:atoms%lmaxd, 1:atoms%jmtd), kl(0:atoms%lmaxd, 1:atoms%jmtd) )
end if
......@@ -189,6 +190,8 @@ contains
end do
end if
end if
end subroutine vmts
end module m_vmts
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