Commit 1a151f89 authored by Gregor Michalicek's avatar Gregor Michalicek

Make fleur_MPI compilable again

This is done mainly by adding CPP_NEVER ifdefs to the MPI branches in
the hybrid code path.
parent 4fd491c3
......@@ -64,7 +64,7 @@
USE m_olap
USE m_spmvec
USE m_hsefunctional ,ONLY: dynamic_hse_adjustment
#ifdef CPP_MPI
#if defined(CPP_MPI)&&defined(CPP_NEVER)
USE m_mpi_work_dist
USE m_mpi_tags
#endif
......@@ -139,7 +139,7 @@
COMPLEX :: dcprod(hybrid%nbands(nk),hybrid%nbands(nk),3)
COMPLEX(8) :: exch_vv(hybrid%nbands(nk),hybrid%nbands(nk))
#ifdef CPP_MPI
#if defined(CPP_MPI)&&defined(CPP_NEVER)
COMPLEX(8) :: buf_vv(hybrid%nbands(nk),nbands(nk))
#endif
COMPLEX :: hessian(3,3)
......@@ -176,7 +176,7 @@
#endif
LOGICAL :: occup(dimension%neigd)
#ifdef CPP_MPI
#if defined(CPP_MPI)&&defined(CPP_NEVER)
INCLUDE "mpif.h"
INTEGER :: ierr,ierr2,length,rank
CHARACTER(LEN=MPI_MAX_ERROR_STRING) :: errmsg
......
......@@ -31,7 +31,7 @@ CONTAINS
REAL,ALLOCATABLE,INTENT(OUT):: eig_irr(:,:)
INTEGER:: ok,nk,nrec1,i,j,ll,l1,l2,ng,itype,n,l,n1,n2,nn
INTEGER :: ok,nk,nrec1,i,j,ll,l1,l2,ng,itype,n,l,n1,n2,nn
TYPE(t_zmat),ALLOCATABLE :: zmat(:)
......@@ -43,6 +43,14 @@ CONTAINS
LOGICAL:: skip_kpt(kpts%nkpt)
REAL :: g(3)
#if defined(CPP_MPI)&&defined(CPP_NEVER)
INTEGER :: sndreqd, rcvreqd, rcvreq(kpts%nkpt)
INTEGER(KIND=MPI_ADDRESS_KIND) :: addr
INTEGER :: ierr(3)
INCLUDE 'mpif.h'
#endif
skip_kpt=.FALSE.
IF( hybrid%l_calhf ) THEN
......@@ -63,10 +71,10 @@ CONTAINS
zmat(:)%l_real=l_real
! Reading the eig file
DO nk = 1,kpts%nkpt
# ifdef CPP_MPI
#if defined(CPP_MPI)&&defined(CPP_NEVER)
! jump to next k-point if this process is not present in communicator
IF ( skip_kpt(nk) ) CYCLE
# endif
#endif
nrec1 = kpts%nkpt*(jsp-1) + nk
zmat(nk)%nbasfcn=dimension%nbasfcn
zmat(nk)%nbands=dimension%neigd2
......@@ -105,10 +113,10 @@ CONTAINS
degenerat = 1
hybrid%nobd = 0
DO nk=1 ,kpts%nkpt
# ifdef CPP_MPI
#if defined(CPP_MPI)&&defined(CPP_NEVER)
! jump to next k-point if this k-point is not treated at this process
IF ( skip_kpt(nk) ) CYCLE
# endif
#endif
DO i=1,hybrid%ne_eig(nk)
DO j=i+1,hybrid%ne_eig(nk)
IF( ABS(eig_irr(i,nk)-eig_irr(j,nk)) < 1E-07) THEN !0.015
......@@ -153,7 +161,7 @@ CONTAINS
PRINT *,"bands:",nk, hybrid%nobd(nk),hybrid%nbands(nk),hybrid%ne_eig(nk)
END DO
# ifdef CPP_MPI
#if defined(CPP_MPI)&&defined(CPP_NEVER)
! send results for occupied bands to all processes
sndreqd = 0 ; rcvreqd = 0
DO nk = 1,kpts%nkpt
......@@ -175,7 +183,7 @@ CONTAINS
CALL MPI_GET_ADDRESS( hybrid%nobd, addr, ierr(1) )
rcvreqd = 0
# endif
#endif
! spread hybrid%nobd from IBZ to whole BZ
DO nk = 1,kpts%nkptf
......@@ -202,10 +210,10 @@ CONTAINS
& hybdat%lmaxcd,hybdat%maxindxc,mpi,&
& hybdat%lmaxc,hybdat%nindxc,hybdat%core1,hybdat%core2,hybdat%eig_c)
# ifdef CPP_MPI
#if defined(CPP_MPI)&&defined(CPP_NEVER)
! wait until all files are written in gen_wavf
CALL MPI_BARRIER(mpi%mpi_comm,ierr)
# endif
#endif
!
! check olap between core-basis/core-valence/basis-basis
......
......@@ -59,7 +59,7 @@ CONTAINS
RETURN
ENDIF
!Check if we are converged well enough to calculate a new potential
#ifdef CPP_MPI
#if defined(CPP_MPI)&&defined(CPP_NEVER)
CALL judft_error("Hybrid functionals do not work in parallel version yet")
CALL MPI_BCAST(results%last_distance ....
#endif
......
......@@ -189,8 +189,7 @@ SUBROUTINE initParallelProcesses(atoms,vacuum,input,stars,sliceplot,banddos,&
ALLOCATE(hybrid%nindx(0:atoms%lmaxd,atoms%ntype))
ALLOCATE(hybrid%select1(4,atoms%ntype),hybrid%lcutm1(atoms%ntype))
ALLOCATE(hybrid%select2(4,atoms%ntype),hybrid%lcutm2(atoms%ntype),hybrid%lcutwf(atoms%ntype))
ALLOCATE(hybrid%ddist(dimension%jspd))
ALLOCATE(hybrid%lcutwf(atoms%ntype))
IF (xcpot%igrd.NE.0) THEN
ALLOCATE (stars%ft2_gfx(0:dimension%nn2d-1),stars%ft2_gfy(0:dimension%nn2d-1))
......@@ -222,7 +221,6 @@ SUBROUTINE initParallelProcesses(atoms,vacuum,input,stars,sliceplot,banddos,&
jij%nmagn=1
jij%mtypes=1
jij%phnd=1
hybrid%ddist = 1.0
stars%sk2(:) = 0.0
stars%phi2(:) = 0.0
END IF
......
......@@ -103,7 +103,7 @@ CONTAINS
! .. Local Scalars ..
INTEGER:: eig_id
INTEGER:: it,ithf,pc
INTEGER:: n,it,ithf,pc
LOGICAL:: stop80,reap,l_endit,l_opti,l_cont
!--- J<
INTEGER :: phn
......
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