Commit c11b61b7 authored by Gustav Bihlmayer's avatar Gustav Bihlmayer

Merge branch 'develop' of iffgit.fz-juelich.de:fleur/fleur into develop

parents df58eb05 55d11190
stages:
- build
- test
- deploy
- coverage
- build-pgi
- test-pgi
- build-intel
- test-intel
- deploy
build-gfortran:
image: iffregistry.fz-juelich.de/fleur/fleur:latest
......@@ -42,9 +43,13 @@ pages:
cache:
paths:
- build
- public
script:
- cd /builds/fleur/fleur/build ; make doc
- mv docs/html/ ../public/
environment:
name: Doxygen
url: https://fleur.iffgit.fz-juelich.de/fleur
artifacts:
paths:
- public
......@@ -111,3 +116,24 @@ test-intel:
- schedules
- web
- triggers
gfortran-coverage:
image: iffregistry.fz-juelich.de/fleur/fleur:latest
stage: coverage
script:
- cd /builds/fleur/fleur; ./configure.sh -l coverage -flags --coverage GITLAB; cd build.coverage; make
- lcov --capture --initial -d CMakeFiles -o baseline.info
- ulimit -s unlimited ;export juDFT_MPI="mpirun -n 2 --allow-run-as-root ";ctest
- lcov --capture -d CMakeFiles -o after.info
- lcov --add-tracefile baseline.info --add-tracefile after.info -o combined.info
- genhtml combined.info --output-directory html_out
- mkdir ../public;mv html_out ../public/coverage_html
artifacts:
paths:
- public
environment:
name: Coverage
url: https://fleur.iffgit.fz-juelich.de/fleur/coverage_html
only:
- web
- schedules
\ No newline at end of file
......@@ -103,4 +103,9 @@ module purge
ml Architecture/KNL
module load intel-para CMake HDF5 libxml2/.2.9.7 ELPA/2017.11.001-hybrid
/work/ias-1/s.rost/fleur_booster/fleur/build/fleur
```
\ No newline at end of file
```
## Developing Fleur
We agreed to use a unified indentation-width of 3.
Hint: [vim](http://vim.wikia.com/wiki/Converting_tabs_to_spaces) [emacs](https://www.gnu.org/software/emacs/manual/html_node/efaq/Changing-the-length-of-a-Tab.html)
\ No newline at end of file
......@@ -54,7 +54,7 @@ then
fi
if [ "$CLI_FLAGS" ]
then
cmake_flags="$CMAKE_Fortran_FLAGS $cmake_flags"
cmake_flags="$CLI_FLAGS $cmake_flags"
fi
for lib in $FLEUR_INCLUDEDIR $CLI_INCLUDEDIR
do
......
......@@ -298,7 +298,7 @@ IMPLICIT NONE
!Simple driver to solve Generalized Eigenvalue Problem using the ChASE library
IMPLICIT NONE
TYPE(t_mpimat), INTENT(INOUT) :: hmat,smat
TYPE(t_mpimat), INTENT(INOUT) :: hmat,smat
INTEGER, INTENT(IN) :: ikpt
INTEGER, INTENT(IN) :: jsp
INTEGER, INTENT(IN) :: iter
......@@ -310,7 +310,7 @@ IMPLICIT NONE
INTEGER :: info,myid,np
REAL :: scale !scaling of eigenvalues from scalapack
CLASS(t_mat), ALLOCATABLE :: zMatTemp
TYPE(t_mat) :: zMatTemp
TYPE(t_mpimat) :: chase_mat
REAL, ALLOCATABLE :: eigenvalues(:)
include 'mpif.h'
......@@ -356,9 +356,9 @@ IMPLICIT NONE
CALL chase_mat%generate_full_matrix()
ALLOCATE(eigenvalues(nev+nex))
eigenvalues = 0.0
ALLOCATE(t_mpimat::zmatTemp)
!ALLOCATE(t_mpimat::zmatTemp)
CALL zMatTemp%init(hmat%l_real,hmat%global_size1,nev+nex,MPI_COMM_SELF,.TRUE.) !Generate a pseudo-distributed matrix
IF (hmat%l_real) THEN
IF(iter.EQ.1) THEN
CALL mpi_chase_r(chase_mat%data_r, zMatTemp%data_r, eigenvalues, 25, 1e-10, 'R', 'S' )
......@@ -374,33 +374,26 @@ IMPLICIT NONE
CALL mpi_chase_c(chase_mat%data_c, zMatTemp%data_c, eigenvalues, 25, 1e-10, 'A', 'S' )
END IF
ENDIF
ne = nev
IF (myid==0) CALL write_eig(chase_eig_id,ikpt,jsp,nev+nex,nev+nex,&
eigenvalues(:(nev+nex)),zmat=zMatTemp)
!Back-Transform
CALL hmat%from_non_dist(zmattemp)
call zmatTemp%free()
! --> recover the generalized eigenvectors z by solving z' = l^t * z
IF (smat%l_real) THEN
CALL PDTRTRI('U','N',smat%global_size1,smat%data_r,1,1,smat%blacs_desc,info)
CALL PDGEMM('N','N',smat%global_size1,smat%global_size1,smat%global_size1,1.0,smat%data_r,1,1,smat%blacs_desc,zmatTemp%data_r,1,1,zmattemp%blacs_desc,0.0,hmat%data_r,1,1,hmat%blacs_desc)
CALL pdtrtrs('U','N','N',hmat%global_size1,hmat%global_size1,smat%data_r,1,1,smat%blacs_desc,&
hmat%data_r,1,1,smat%blacs_desc,info)
ELSE
STOP 'chase no complex'
CALL pztrtrs('U','N','N',hmat%global_size1,hmat%global_size1,smat%data_c,1,1,smat%blacs_desc,&
hmat%data_c,1,1,smat%blacs_desc,info)
END IF
IF (info.NE.0) THEN
WRITE (6,*) 'Error in p?trtrs: info =',info
CALL juDFT_error("Diagonalization failed",calledby="chase_diag")
ENDIF
!!$ CALL hmat%copy(zmatTemp,1,1) !Copy matrix into distributed form
!!$ call zmatTemp%free()
!!$
!!$ ! --> recover the generalized eigenvectors z by solving z' = l^t * z
!!$ IF (smat%l_real) THEN
!!$ CALL pdtrtrs('U','N','N',hmat%global_size1,hmat%global_size1,smat%data_r,1,1,smat%blacs_desc,&
!!$ hmat%data_r,1,1,smat%blacs_desc,info)
!!$ ELSE
!!$ CALL pztrtrs('U','N','N',hmat%global_size1,hmat%global_size1,smat%data_c,1,1,smat%blacs_desc,&
!!$ hmat%data_c,1,1,smat%blacs_desc,info)
!!$ END IF
!!$ IF (info.NE.0) THEN
!!$ WRITE (6,*) 'Error in p?trtrs: info =',info
!!$ CALL juDFT_error("Diagonalization failed",calledby="chase_diag")
!!$ ENDIF
! Redistribute eigvec from ScaLAPACK distribution to each process
! having all eigenvectors corresponding to his eigenvalues as above
......
......@@ -37,6 +37,9 @@ C ..
C .. Intrinsic Functions ..
INTRINSIC abs,exp,min,sqrt
C ..
a = 0.0
b = 0.0
ierr = 0
nqnt = fn - fl - 0.99e0
n = msh
del = 5.e-5
......
......@@ -72,6 +72,8 @@ CONTAINS
ENDDO
rn = atoms%rmsh(1,n)*( d**(msh-1) )
ALLOCATE ( f(msh,2),vrd(msh) )
f = 0.0
vrd = 0.0
! extend core potential (linear with slope t1 / a.u.)
vrd(:atoms%jri(n))=vr(:atoms%jri(n))
t1=0.125
......@@ -189,6 +191,8 @@ CONTAINS
ENDDO
rn = atoms%rmsh(1,n)*( d**(msh-1) )
ALLOCATE ( f(msh,2),vrd(msh) )
f = 0.0
vrd = 0.0
! extend core potential (linear with slope t1 / a.u.)
vrd(:atoms%jri(n))=vr(:atoms%jri(n))
t1=0.125
......
......@@ -133,8 +133,21 @@ SUBROUTINE hsfock(nk,atoms,hybrid,lapw,dimension,kpts,jsp,input,hybdat,eig_irr,s
! read in lower triangle part of overlap matrix from direct acces file olap
nbasfcn = MERGE(lapw%nv(1)+lapw%nv(2)+2*atoms%nlotot,lapw%nv(1)+atoms%nlotot,noco%l_noco)
call olap%alloc(sym%invs,nbasfcn)
call read_olap(olap, kpts%nkpt*(jsp-1) + nk)
if (.not.olap%l_real) olap%data_c=conjg(olap%data_c)
call read_olap(olap, kpts%nkpt*(jsp-1)+nk)
IF (olap%l_real) THEN
DO i=1,nbasfcn
DO j=1,i
olap%data_r(i,j) = olap%data_r(j,i)
END DO
END DO
ELSE
DO i=1,nbasfcn
DO j=1,i
olap%data_c(i,j) = CONJG(olap%data_c(j,i))
END DO
END DO
olap%data_c=conjg(olap%data_c)
END IF
IF(hybrid%l_calhf) THEN
ncstd = sum( (/ ( (hybdat%nindxc(l,itype)*(2*l+1)*atoms%neq(itype),l=0,hybdat%lmaxc(itype)), itype = 1,atoms%ntype) /) )
......@@ -194,21 +207,16 @@ SUBROUTINE hsfock(nk,atoms,hybrid,lapw,dimension,kpts,jsp,input,hybdat,eig_irr,s
IF(dimension%neigd.LT.hybrid%nbands(nk)) STOP 'mhsfock: neigd < nbands(nk) ; '&
'trafo from wavefunctions to APW requires at least nbands(nk) '
call z%alloc(olap%l_real,nbasfcn,dimension%neigd)
call read_z(z,nk) !what about spin?
! calculate trafo
ic = lapw%nv(jsp) + atoms%nlotot
z%matsize1=ic
z%matsize2=hybrid%nbands(nk)
olap%matsize1=ic
olap%matsize2=ic
call z%init(olap%l_real,nbasfcn,dimension%neigd)
call read_z(z,kpts%nkpt*(jsp-1)+nk)
z%matsize2 = hybrid%nbands(nk) ! reduce "visible matsize" for the following computations
call olap%multiply(z,trafo)
call invtrafo%alloc(olap%l_real,hybrid%nbands(nk),ic)
CALL invtrafo%alloc(olap%l_real,hybrid%nbands(nk),nbasfcn)
CALL trafo%TRANSPOSE(invtrafo)
IF(.NOT.invtrafo%l_real) invtrafo%data_c = CONJG(invtrafo%data_c)
DO i=1,hybrid%nbands(nk)
DO j=1,i-1
IF (ex%l_real) THEN
......@@ -224,30 +232,8 @@ SUBROUTINE hsfock(nk,atoms,hybrid,lapw,dimension,kpts,jsp,input,hybdat,eig_irr,s
CALL timestop("time for performing T^-1*mat_ex*T^-1*")
DO i = 1, v_x%matsize1
DO j = 1, i
IF (v_x%l_real) THEN
IF ((i.LE.5).AND.(j.LE.5)) THEN
WRITE(1231,'(2i7,2f15.8)') i, j, v_x%data_r(i,j), v_x%data_r(j,i)
END IF
ELSE
ENDIF
END DO
END DO
CALL symmetrizeh(atoms,kpts%bkf(:,nk),dimension,jsp,lapw,gpt,sym,hybdat%kveclo_eig,cell,nsymop,psym,v_x)
DO i = 1, v_x%matsize1
DO j = 1, i
IF (v_x%l_real) THEN
IF ((i.LE.5).AND.(j.LE.5)) THEN
WRITE(1232,'(2i7,2f15.8)') i, j, v_x%data_r(i,j), v_x%data_r(j,i)
END IF
ELSE
ENDIF
END DO
END DO
CALL write_v_x(v_x,kpts%nkpt*(jsp-1) + nk)
END IF ! hybrid%l_calhf
......
......@@ -22,7 +22,7 @@ SUBROUTINE symmetrizeh(atoms,bk,DIMENSION,jsp,lapw,gpt,sym,kveclo,cell,nsymop,ps
TYPE(t_cell), INTENT(IN) :: cell
TYPE(t_atoms), INTENT(IN) :: atoms
TYPE(t_lapw), INTENT(IN) :: lapw
TYPE(T_mat), INTENT(INOUT) :: hmat
TYPE(t_mat), INTENT(INOUT) :: hmat
! scalars
INTEGER, INTENT(IN) :: nsymop, jsp
......@@ -65,6 +65,15 @@ SUBROUTINE symmetrizeh(atoms,bk,DIMENSION,jsp,lapw,gpt,sym,kveclo,cell,nsymop,ps
LOGICAL :: ldum(lapw%nv(jsp)+atoms%nlotot,lapw%nv(jsp)+atoms%nlotot)
TYPE(t_mat) :: hmatTemp
CALL hmatTemp%init(hmat%l_real,hmat%matsize1,hmat%matsize2)
IF(hmat%l_real) THEN
hmatTemp%data_r = hmat%data_r
ELSE
hmatTemp%data_c = CONJG(hmat%data_c)
END IF
! calculate rotations in reciprocal space
DO isym = 1,nsymop
iop = psym(isym)
......@@ -166,19 +175,19 @@ SUBROUTINE symmetrizeh(atoms,bk,DIMENSION,jsp,lapw,gpt,sym,kveclo,cell,nsymop,ps
IF(iop.LE.sym%nop) THEN
IF((igpt.NE.0).AND.(igpt1.NE.0)) THEN
ic = ic + 1
IF (hmat%l_real) THEN
cdum = cdum + CONJG(cfac(i,isym))*hmat%data_r(igpt1,igpt)*cfac(j,isym)
IF (hmatTemp%l_real) THEN
cdum = cdum + CONJG(cfac(i,isym))*hmatTemp%data_r(igpt1,igpt)*cfac(j,isym)
ELSE
cdum = cdum + CONJG(cfac(i,isym))*hmat%data_c(igpt1,igpt)*cfac(j,isym)
cdum = cdum + CONJG(cfac(i,isym))*hmatTemp%data_c(igpt1,igpt)*cfac(j,isym)
END IF
END IF
ELSE
IF((igpt.NE.0).AND.(igpt1.NE.0)) THEN
ic = ic + 1
IF (hmat%l_real) THEN
cdum = cdum + CONJG(CONJG(cfac(i,isym))*hmat%data_r(igpt1,igpt)*cfac(j,isym))
IF (hmatTemp%l_real) THEN
cdum = cdum + CONJG(CONJG(cfac(i,isym))*hmatTemp%data_r(igpt1,igpt)*cfac(j,isym))
ELSE
cdum = cdum + CONJG(CONJG(cfac(i,isym))*hmat%data_c(igpt1,igpt)*cfac(j,isym))
cdum = cdum + CONJG(CONJG(cfac(i,isym))*hmatTemp%data_c(igpt1,igpt)*cfac(j,isym))
END IF
END IF
END IF
......@@ -200,6 +209,7 @@ SUBROUTINE symmetrizeh(atoms,bk,DIMENSION,jsp,lapw,gpt,sym,kveclo,cell,nsymop,ps
hmat%data_r(igpt1,igpt) = CONJG(cdum/(CONJG(cfac(i,isym))*cfac(j,isym)))
ldum(igpt,igpt1) = .FALSE.
END IF
hmat%data_r(igpt,igpt1) = hmat%data_r(igpt1,igpt)
ELSE
IF (iop.LE.sym%nop) THEN
hmat%data_c(igpt1,igpt) = cdum/(CONJG(cfac(i,isym))*cfac(j,isym))
......@@ -208,6 +218,7 @@ SUBROUTINE symmetrizeh(atoms,bk,DIMENSION,jsp,lapw,gpt,sym,kveclo,cell,nsymop,ps
hmat%data_c(igpt1,igpt) = CONJG(cdum/(CONJG(cfac(i,isym))*cfac(j,isym)))
ldum(igpt,igpt1) = .FALSE.
END IF
hmat%data_c(igpt,igpt1) = CONJG(hmat%data_c(igpt1,igpt))
END IF
END IF
END DO
......@@ -408,10 +419,10 @@ SUBROUTINE symmetrizeh(atoms,bk,DIMENSION,jsp,lapw,gpt,sym,kveclo,cell,nsymop,ps
ic1 = 0
DO igpt2 = igpt_lo1, igpt_lo2
ic1 = ic1 + 1
IF (hmat%l_real) THEN
cdum2 = cdum2 + CONJG(c_rot(ic1,igpt,ilo,ratom,isym)) * hmat%data_r(igpt1,lapw%nv(jsp)+igpt2)
IF (hmatTemp%l_real) THEN
cdum2 = cdum2 + CONJG(c_rot(ic1,igpt,ilo,ratom,isym)) * hmatTemp%data_r(igpt1,lapw%nv(jsp)+igpt2)
ELSE
cdum2 = cdum2 + CONJG(c_rot(ic1,igpt,ilo,ratom,isym)) * hmat%data_c(igpt1,lapw%nv(jsp)+igpt2)
cdum2 = cdum2 + CONJG(c_rot(ic1,igpt,ilo,ratom,isym)) * hmatTemp%data_c(igpt1,lapw%nv(jsp)+igpt2)
END IF
END DO
......@@ -494,13 +505,13 @@ SUBROUTINE symmetrizeh(atoms,bk,DIMENSION,jsp,lapw,gpt,sym,kveclo,cell,nsymop,ps
ic2 = 0
DO igpt3 = igpt1_lo1, igpt1_lo2
ic2 = ic2 + 1
IF (hmat%l_real) THEN
IF (hmatTemp%l_real) THEN
cdum2 = cdum2 + CONJG(c_rot(ic1,igpt,ilo,ratom,isym)) *&
hmat%data_r(lapw%nv(jsp)+igpt3,lapw%nv(jsp)+igpt2) *&
hmatTemp%data_r(lapw%nv(jsp)+igpt3,lapw%nv(jsp)+igpt2) *&
c_rot(ic2,igpt1,ilo1,ratom1,isym)
ELSE
cdum2 = cdum2 + CONJG(c_rot(ic1,igpt,ilo,ratom,isym)) *&
hmat%data_c(lapw%nv(jsp)+igpt3,lapw%nv(jsp)+igpt2) *&
hmatTemp%data_c(lapw%nv(jsp)+igpt3,lapw%nv(jsp)+igpt2) *&
c_rot(ic2,igpt1,ilo1,ratom1,isym)
END IF
END DO
......
......@@ -72,8 +72,8 @@ SUBROUTINE initParallelProcesses(atoms,vacuum,input,stars,sliceplot,banddos,&
CALL MPI_BCAST(sphhar%memd,1,MPI_INTEGER,0,mpi%mpi_comm,ierr)
CALL MPI_BCAST(dimension%jspd,1,MPI_INTEGER,0,mpi%mpi_comm,ierr)
CALL MPI_BCAST(dimension%nstd,1,MPI_INTEGER,0,mpi%mpi_comm,ierr)
CALL MPI_BCAST(dimension%nn3d,1,MPI_INTEGER,0,mpi%mpi_comm,ierr)
CALL MPI_BCAST(dimension%nn2d,1,MPI_INTEGER,0,mpi%mpi_comm,ierr)
CALL MPI_BCAST(stars%kimax,1,MPI_INTEGER,0,mpi%mpi_comm,ierr)
CALL MPI_BCAST(stars%kimax2,1,MPI_INTEGER,0,mpi%mpi_comm,ierr)
CALL MPI_BCAST(dimension%ncvd,1,MPI_INTEGER,0,mpi%mpi_comm,ierr)
CALL MPI_BCAST(dimension%nvd,1,MPI_INTEGER,0,mpi%mpi_comm,ierr)
CALL MPI_BCAST(dimension%neigd,1,MPI_INTEGER,0,mpi%mpi_comm,ierr)
......@@ -158,9 +158,9 @@ SUBROUTINE initParallelProcesses(atoms,vacuum,input,stars,sliceplot,banddos,&
ALLOCATE(stars%kv2(2,stars%ng2),stars%kv3(3,stars%ng3))
ALLOCATE(stars%nstr2(stars%ng2),stars%nstr(stars%ng3))
ALLOCATE(stars%sk2(stars%ng2),stars%sk3(stars%ng3),stars%phi2(stars%ng2))
ALLOCATE(stars%igfft(0:dimension%nn3d-1,2),stars%igfft2(0:dimension%nn2d-1,2))
ALLOCATE(stars%igfft(0:stars%kimax,2),stars%igfft2(0:stars%kimax2,2))
ALLOCATE(stars%rgphs(-stars%mx1:stars%mx1,-stars%mx2:stars%mx2,-stars%mx3:stars%mx3))
ALLOCATE(stars%pgfft(0:dimension%nn3d-1),stars%pgfft2(0:dimension%nn2d-1))
ALLOCATE(stars%pgfft(0:stars%kimax),stars%pgfft2(0:stars%kimax2))
IF(ALLOCATED(stars%ufft)) DEALLOCATE(stars%ufft)
ALLOCATE(stars%ufft(0:27*stars%mx1*stars%mx2*stars%mx3-1),stars%ustep(stars%ng3))
......@@ -175,7 +175,7 @@ SUBROUTINE initParallelProcesses(atoms,vacuum,input,stars,sliceplot,banddos,&
ALLOCATE(hybrid%lcutwf(atoms%ntype))
IF (xcpot%is_gga()) THEN
ALLOCATE (stars%ft2_gfx(0:dimension%nn2d-1),stars%ft2_gfy(0:dimension%nn2d-1))
ALLOCATE (stars%ft2_gfx(0:stars%kimax2),stars%ft2_gfy(0:stars%kimax2))
ALLOCATE (oneD%pgft1x(0:oneD%odd%nn2d-1),oneD%pgft1xx(0:oneD%odd%nn2d-1),&
oneD%pgft1xy(0:oneD%odd%nn2d-1),&
oneD%pgft1y(0:oneD%odd%nn2d-1),oneD%pgft1yy(0:oneD%odd%nn2d-1))
......
......@@ -79,8 +79,8 @@ CONTAINS
CALL dimens(mpi,input,sym,stars,atoms,sphhar,DIMENSION,vacuum,&
obsolete,kpts,oneD,hybrid)
DIMENSION%nn2d= (2*stars%mx1+1)* (2*stars%mx2+1)
DIMENSION%nn3d= (2*stars%mx1+1)* (2*stars%mx2+1)* (2*stars%mx3+1)
stars%kimax2= (2*stars%mx1+1)* (2*stars%mx2+1)-1
stars%kimax = (2*stars%mx1+1)* (2*stars%mx2+1)* (2*stars%mx3+1)-1
!-odim
IF (oneD%odd%d1) THEN
oneD%odd%k3 = stars%mx3
......@@ -100,7 +100,7 @@ CONTAINS
ALLOCATE ( atoms%ncv(atoms%ntype),atoms%neq(atoms%ntype),atoms%ngopr(atoms%nat) )
ALLOCATE ( sphhar%nlh(sphhar%ntypsd),sphhar%nmem(0:sphhar%nlhd,sphhar%ntypsd) )
ALLOCATE ( stars%nstr2(stars%ng2),atoms%ntypsy(atoms%nat),stars%nstr(stars%ng3) )
ALLOCATE ( stars%igfft(0:DIMENSION%nn3d-1,2),stars%igfft2(0:DIMENSION%nn2d-1,2),atoms%nflip(atoms%ntype) )
ALLOCATE ( stars%igfft(0:stars%kimax,2),stars%igfft2(0:stars%kimax2,2),atoms%nflip(atoms%ntype) )
ALLOCATE ( atoms%ncst(atoms%ntype) )
ALLOCATE ( vacuum%izlay(vacuum%layerd,2) )
ALLOCATE ( sym%invarop(atoms%nat,sym%nop),sym%invarind(atoms%nat) )
......@@ -113,7 +113,7 @@ CONTAINS
ALLOCATE ( atoms%taual(3,atoms%nat),atoms%volmts(atoms%ntype),atoms%zatom(atoms%ntype) )
ALLOCATE ( stars%rgphs(-stars%mx1:stars%mx1,-stars%mx2:stars%mx2,-stars%mx3:stars%mx3) )
ALLOCATE ( kpts%bk(3,kpts%nkpt),kpts%wtkpt(kpts%nkpt) )
ALLOCATE ( stars%pgfft(0:DIMENSION%nn3d-1),stars%pgfft2(0:DIMENSION%nn2d-1) )
ALLOCATE ( stars%pgfft(0:stars%kimax),stars%pgfft2(0:stars%kimax2) )
ALLOCATE ( stars%ufft(0:27*stars%mx1*stars%mx2*stars%mx3-1) )
ALLOCATE ( atoms%bmu(atoms%ntype) )
ALLOCATE ( atoms%l_geo(atoms%ntype) )
......@@ -165,7 +165,7 @@ CONTAINS
stars,oneD,hybrid,kpts,a1,a2,a3,namex,relcor)
!
IF (xcpot%is_gga()) THEN
ALLOCATE (stars%ft2_gfx(0:DIMENSION%nn2d-1),stars%ft2_gfy(0:DIMENSION%nn2d-1))
ALLOCATE (stars%ft2_gfx(0:stars%kimax2),stars%ft2_gfy(0:stars%kimax2))
ALLOCATE (oneD%pgft1x(0:oneD%odd%nn2d-1),oneD%pgft1xx(0:oneD%odd%nn2d-1),&
oneD%pgft1xy(0:oneD%odd%nn2d-1),&
oneD%pgft1y(0:oneD%odd%nn2d-1),oneD%pgft1yy(0:oneD%odd%nn2d-1))
......
......@@ -382,8 +382,8 @@ SUBROUTINE postprocessInput(mpi,input,field,sym,stars,atoms,vacuum,obsolete,kpts
oneD%odd%nop = sym%nop
END IF
dimension%nn2d = (2*stars%mx1+1)*(2*stars%mx2+1)
dimension%nn3d = (2*stars%mx1+1)*(2*stars%mx2+1)*(2*stars%mx3+1)
stars%kimax2= (2*stars%mx1+1)* (2*stars%mx2+1)-1
stars%kimax = (2*stars%mx1+1)* (2*stars%mx2+1)* (2*stars%mx3+1)-1
IF (oneD%odd%d1) THEN
oneD%odd%k3 = stars%mx3
oneD%odd%nn2d = (2*(oneD%odd%k3)+1)*(2*(oneD%odd%M)+1)
......@@ -398,9 +398,9 @@ SUBROUTINE postprocessInput(mpi,input,field,sym,stars,atoms,vacuum,obsolete,kpts
ALLOCATE (stars%kv2(2,stars%ng2),stars%kv3(3,stars%ng3))
ALLOCATE (stars%nstr2(stars%ng2),stars%nstr(stars%ng3))
ALLOCATE (stars%sk2(stars%ng2),stars%sk3(stars%ng3),stars%phi2(stars%ng2))
ALLOCATE (stars%igfft(0:dimension%nn3d-1,2),stars%igfft2(0:dimension%nn2d-1,2))
ALLOCATE (stars%igfft(0:stars%kimax,2),stars%igfft2(0:stars%kimax2,2))
ALLOCATE (stars%rgphs(-stars%mx1:stars%mx1,-stars%mx2:stars%mx2,-stars%mx3:stars%mx3))
ALLOCATE (stars%pgfft(0:dimension%nn3d-1),stars%pgfft2(0:dimension%nn2d-1))
ALLOCATE (stars%pgfft(0:stars%kimax),stars%pgfft2(0:stars%kimax2))
ALLOCATE (stars%ufft(0:27*stars%mx1*stars%mx2*stars%mx3-1),stars%ustep(stars%ng3))
stars%sk2(:) = 0.0
......@@ -482,7 +482,7 @@ SUBROUTINE postprocessInput(mpi,input,field,sym,stars,atoms,vacuum,obsolete,kpts
! Missing xc functionals initializations
IF (xcpot%is_gga()) THEN
ALLOCATE (stars%ft2_gfx(0:dimension%nn2d-1),stars%ft2_gfy(0:dimension%nn2d-1))
ALLOCATE (stars%ft2_gfx(0:stars%kimax2),stars%ft2_gfy(0:stars%kimax2))
ALLOCATE (oneD%pgft1x(0:oneD%odd%nn2d-1),oneD%pgft1xx(0:oneD%odd%nn2d-1),&
oneD%pgft1xy(0:oneD%odd%nn2d-1),&
oneD%pgft1y(0:oneD%odd%nn2d-1),oneD%pgft1yy(0:oneD%odd%nn2d-1))
......
......@@ -415,7 +415,6 @@ CONTAINS
l_cont = .TRUE.
IF (hybrid%l_hybrid) THEN
IF(hybrid%l_calhf) THEN
iterHF = iterHF + 1
l_cont = l_cont.AND.(iterHF < input%itmax)
l_cont = l_cont.AND.(input%mindistance<=results%last_distance)
CALL check_time_for_next_iteration(iterHF,l_cont)
......
......@@ -282,6 +282,8 @@
END IF
END IF
ALLOCATE (stars%igq_fft(0:stars%kq1_fft*stars%kq2_fft*stars%kq3_fft-1))
ALLOCATE (stars%igq2_fft(0:stars%kq1_fft*stars%kq2_fft-1))
#ifdef CPP_MPI
CALL mpi_bc_all(&
& mpi,stars,sphhar,atoms,obsolete,&
......@@ -292,8 +294,6 @@
! Set up pointer for backtransformation from g-vector in positive
! domain of carge density fftibox into stars
ALLOCATE (stars%igq_fft(0:stars%kq1_fft*stars%kq2_fft*stars%kq3_fft-1))
ALLOCATE (stars%igq2_fft(0:stars%kq1_fft*stars%kq2_fft-1))
CALL prp_qfft_map(stars,sym,input,stars%igq2_fft,stars%igq_fft)
atoms%nlotot = 0
......
......@@ -14,5 +14,7 @@ if (${FLEUR_USE_MPI})
mpi/mpi_reduce_potden.F90
mpi/mpi_make_groups.F90
mpi/mpi_dist_forcetheorem.F90
mpi/mpi_bc_tool.F90
)
endif()
......@@ -46,6 +46,8 @@ CONTAINS
#ifdef CPP_MPI
EXTERNAL MPI_BCAST
call priv_mpi_bc_stars(mpi,stars)
IF (mpi%irank.EQ.0) THEN
i(1)=1 ; i(2)=input%coretail_lmax;i(3)=atoms%ntype ; i(5)=1 ; i(6)=input%isec1
i(7)=stars%ng2 ; i(8)=stars%ng3 ; i(9)=vacuum%nmz ; i(10)=vacuum%nmzxy ; i(11)=obsolete%lepr
......@@ -134,7 +136,7 @@ CONTAINS
CALL MPI_BCAST (field%efield%C2,n,MPI_REAL,0,mpi%mpi_comm,ierr)
END IF
CALL MPI_BCAST(stars%ustep,stars%ng3,MPI_DOUBLE_COMPLEX,0,mpi%mpi_comm,ierr)
n = sphhar%memd*(sphhar%nlhd+1)*sphhar%ntypsd
CALL MPI_BCAST(sphhar%clnu,n,MPI_DOUBLE_COMPLEX,0,mpi%mpi_comm,ierr)
CALL MPI_BCAST(sphhar%mlh,n,MPI_INTEGER,0,mpi%mpi_comm,ierr)
......@@ -152,17 +154,14 @@ CONTAINS
CALL MPI_BCAST(sym%invsatnr,atoms%nat,MPI_INTEGER,0,mpi%mpi_comm,ierr)
CALL MPI_BCAST(atoms%ngopr,atoms%nat,MPI_INTEGER,0,mpi%mpi_comm,ierr)
CALL MPI_BCAST(sym%mrot,9*sym%nop,MPI_INTEGER,0,mpi%mpi_comm,ierr)
CALL MPI_BCAST(stars%ig2,stars%ng3,MPI_INTEGER,0,mpi%mpi_comm,ierr)
n = (2*stars%mx1+1)*(2*stars%mx2+1)*(2*stars%mx3+1)
CALL MPI_BCAST(stars%ig,n,MPI_INTEGER,0,mpi%mpi_comm,ierr)
CALL MPI_BCAST(stars%rgphs,n,MPI_DOUBLE_COMPLEX,0,mpi%mpi_comm,ierr)
CALL MPI_BCAST(input%ellow,1,MPI_DOUBLE_PRECISION,0,mpi%mpi_comm,ierr)
CALL MPI_BCAST(input%elup,1,MPI_DOUBLE_PRECISION,0,mpi%mpi_comm,ierr)
CALL MPI_BCAST(input%rkmax,1,MPI_DOUBLE_PRECISION,0,mpi%mpi_comm,ierr)
CALL MPI_BCAST(atoms%rmt,atoms%ntype,MPI_DOUBLE_PRECISION,0,mpi%mpi_comm,ierr)
CALL MPI_BCAST(atoms%volmts,atoms%ntype,MPI_DOUBLE_PRECISION,0,mpi%mpi_comm,ierr)
CALL MPI_BCAST(atoms%dx,atoms%ntype,MPI_DOUBLE_PRECISION,0,mpi%mpi_comm,ierr)
CALL MPI_BCAST(stars%sk3,stars%ng3,MPI_DOUBLE_PRECISION,0,mpi%mpi_comm,ierr)
CALL MPI_BCAST(enpara%evac0,2*dimension%jspd*1,MPI_DOUBLE_PRECISION,0,mpi%mpi_comm,ierr)
CALL MPI_BCAST(cell%amat,9,MPI_DOUBLE_PRECISION,0,mpi%mpi_comm,ierr)
CALL MPI_BCAST(cell%bmat,9,MPI_DOUBLE_PRECISION,0,mpi%mpi_comm,ierr)
......@@ -193,20 +192,8 @@ CONTAINS
CALL MPI_BCAST(sym%invarind,atoms%nat,MPI_INTEGER,0,mpi%mpi_comm,ierr)
CALL MPI_BCAST(sym%invtab,sym%nop,MPI_INTEGER,0,mpi%mpi_comm,ierr)
CALL MPI_BCAST(sym%invsatnr,atoms%nat,MPI_INTEGER,0,mpi%mpi_comm,ierr)
CALL MPI_BCAST(stars%kq2_fft,1,MPI_INTEGER,0,mpi%mpi_comm,ierr)
CALL MPI_BCAST(stars%kq3_fft,1,MPI_INTEGER,0,mpi%mpi_comm,ierr)
CALL MPI_BCAST(stars%kv2,2*stars%ng2,MPI_INTEGER,0,mpi%mpi_comm,ierr)
CALL MPI_BCAST(stars%kv3,3*stars%ng3,MPI_INTEGER,0,mpi%mpi_comm,ierr)
CALL MPI_BCAST(stars%ng3_fft,1,MPI_INTEGER,0,mpi%mpi_comm,ierr)
CALL MPI_BCAST(vacuum%izlay,vacuum%layerd*2,MPI_INTEGER,0,mpi%mpi_comm,ierr)
CALL MPI_BCAST(stars%nstr,stars%ng3,MPI_INTEGER,0,mpi%mpi_comm,ierr)
CALL MPI_BCAST(stars%nstr2,stars%ng2,MPI_INTEGER,0,mpi%mpi_comm,ierr)
CALL MPI_BCAST(stars%igfft,dimension%nn3d*2,MPI_INTEGER,0,mpi%mpi_comm,ierr)
CALL MPI_BCAST(stars%kq1_fft,1,MPI_INTEGER,0,mpi%mpi_comm,ierr)
CALL MPI_BCAST(stars%kmxq_fft,1,MPI_INTEGER,0,mpi%mpi_comm,ierr)
CALL MPI_BCAST(stars%pgfft,dimension%nn3d,MPI_DOUBLE_PRECISION,0,mpi%mpi_comm,ierr)
CALL MPI_BCAST(stars%igfft2,size(stars%igfft2),MPI_INTEGER,0,mpi%mpi_comm,ierr)
CALL MPI_BCAST(atoms%zatom,atoms%ntype,MPI_DOUBLE_PRECISION,0,mpi%mpi_comm,ierr)
CALL MPI_BCAST(field%efield%sig_b,2,MPI_DOUBLE_PRECISION,0,mpi%mpi_comm,ierr)
CALL MPI_BCAST(input%zelec,1,MPI_DOUBLE_PRECISION,0,mpi%mpi_comm,ierr)
......@@ -238,10 +225,8 @@ CONTAINS
n = 7*7*3*sym%nop
CALL MPI_BCAST(sym%d_wgn,n,MPI_DOUBLE_COMPLEX,0,mpi%mpi_comm,ierr)
CALL MPI_BCAST(oneD%nstr1,oneD%odd%n2d,MPI_INTEGER,0,mpi%mpi_comm,ierr)
CALL MPI_BCAST(stars%sk2,stars%ng2,MPI_DOUBLE_PRECISION,0,mpi%mpi_comm,ierr)
CALL MPI_BCAST(oneD%tau1,3*oneD%odd%nop,MPI_DOUBLE_PRECISION,0,mpi%mpi_comm,ierr)
IF (oneD%odd%d1) THEN
CALL MPI_BCAST(stars%phi2,stars%ng2,MPI_DOUBLE_PRECISION,0,mpi%mpi_comm,ierr)
CALL MPI_BCAST(oneD%tau1,3*oneD%odd%nop,MPI_DOUBLE_PRECISION,0,mpi%mpi_comm,ierr)
CALL MPI_BCAST(oneD%mrot1,9*oneD%odd%nop,MPI_DOUBLE_PRECISION,0,mpi%mpi_comm,ierr)
CALL MPI_BCAST(oneD%kv1,2*oneD%odd%n2d,MPI_INTEGER,0,mpi%mpi_comm,ierr)
......@@ -282,4 +267,50 @@ CONTAINS
RETURN
#endif
END SUBROUTINE mpi_bc_all
SUBROUTINE priv_mpi_bc_stars(mpi,stars)
USE m_types
USE m_mpi_bc_tool
IMPLICIT NONE
TYPE(t_mpi),INTENT(in)::mpi
TYPE(t_stars),INTENT(inout)::stars
include 'mpif.h'
INTEGER :: i(18),ierr,ft2_gf_dim
i(1)=stars%ng2 ; i(2)=stars%ng3 ; i(3)=stars%mx1 ; i(4)=stars%mx2 ; i(5)=stars%mx3
i(6) = stars%kimax ; i(7) = stars%kimax2 ; i(8)=size(stars%ft2_gfy)
i(9) = stars%kq1_fft;i(10) = stars%kq2_fft;i(11) = stars%kq3_fft;i(12)=stars%kmxq_fft
i(13)= stars%kxc1_fft;i(14)= stars%kxc2_fft;i(15)= stars%kxc3_fft
i(16)= stars%ng3_fft;i(17)= stars%kmxxc_fft;i(18)= stars%nxc3_fft
CALL MPI_BCAST(i,SIZE(i),MPI_INTEGER,0,mpi%mpi_comm,ierr)
stars%ng2=i(1) ; stars%ng3=i(2) ; stars%mx1=i(3) ; stars%mx2=i(4) ; stars%mx3=i(5)
stars%kimax=i(6) ; stars%kimax2=i(7) ; ft2_gf_dim=i(8)
stars%kq1_fft=i(9);stars%kq2_fft=i(10); stars%kq3_fft=i(11);stars%kmxq_fft=i(12)
stars%kxc1_fft=i(13);stars%kxc2_fft=i(14);stars%kxc3_fft=i(15)
stars%ng3_fft=i(16);stars%kmxxc_fft=i(17);stars%nxc3_fft=i(18)
CALL mpi_bc(stars%ustep,0,mpi%mpi_comm)
CALL mpi_bc(stars%ig2,0,mpi%mpi_comm)
CALL mpi_bc(stars%ig,0,mpi%mpi_comm)
CALL mpi_bc(stars%rgphs,0,mpi%mpi_comm)
CALL mpi_bc(stars%sk3,0,mpi%mpi_comm)
CALL mpi_bc(stars%kv2,0,mpi%mpi_comm)
CALL mpi_bc(stars%kv3,0,mpi%mpi_comm)
CALL mpi_bc(stars%nstr,0,mpi%mpi_comm)
CALL mpi_bc(stars%nstr2,0,mpi%mpi_comm)
CALL mpi_bc(stars%igfft,0,mpi%mpi_comm)