Commit 7df27c5a authored by Matthias Redies's avatar Matthias Redies

bug-fix & more

parent e1c5a926
......@@ -17,9 +17,12 @@ c J.-P. Hanke, Dec. 2015 c
c*******************************************c
MODULE m_wann_uHu
USE m_juDFT
#ifdef CPP_MPI
use mpi
#endif
CONTAINS
SUBROUTINE wann_uHu(
> stars,vacuum,atoms,sphhar,input,kpts,sym,mpi,
> stars,vacuum,atoms,sphhar,input,kpts,sym,fmpi,
> banddos,oneD,noco,nococonv,cell,vTot,wann,enpara,
> eig_idList,l_real,l_dulo,l_noco,l_ss,lmaxd,ntypd,
> neigd,natd,nop,nvd,jspd,llod,nlod,ntype,
......@@ -64,7 +67,6 @@ c*******************************************c
IMPLICIT NONE
#include "cpp_double.h"
#ifdef CPP_MPI
include 'mpif.h'
integer ierr(3)
integer cpu_index
integer stt(MPI_STATUS_SIZE)
......@@ -78,7 +80,7 @@ c*******************************************c
TYPE(t_input),INTENT(IN) :: input
TYPE(t_kpts),INTENT(IN) :: kpts
TYPE(t_sym),INTENT(IN) :: sym
TYPE(t_mpi),INTENT(IN) :: mpi
TYPE(t_mpi),INTENT(IN) :: fmpi
TYPE(t_banddos),INTENT(IN) :: banddos
TYPE(t_oneD),INTENT(IN) :: oneD
TYPE(t_noco),INTENT(IN) :: noco
......@@ -309,7 +311,7 @@ c-----read the input file to determine what to do
if(.not.wann%l_fermi)efermi=0.0
#ifdef CPP_MPI
call MPI_BARRIER(MPI_COMM_WORLD,ierr)
call MPI_BARRIER(MPI_COMM_WORLD,ierr(1))
#endif
c**************************************************************
......@@ -671,12 +673,12 @@ c*****************************************************************c
innerEig_idList(iqpt_b) = eig_idList(bpt_q(iqpt_b,iqpt))
! WRITE(fending,'("_",i4.4)')bpt_q(iqpt_b,iqpt)
! innerEig_idList(iqpt_b)=open_eig(mpi%mpi_comm,
! innerEig_idList(iqpt_b)=open_eig(fmpi%mpi_comm,
! + lapw%dim_nbasfcn(),input%neig,
! + nkpts,wannierspin,atoms%lmaxd,
! + atoms%nlod,atoms%ntype,atoms%nlotot,
! + l_noco,.FALSE.,l_real,l_soc,.FALSE.,
! + mpi%n_size,filename=trim(fstart)//fending,
! + fmpi%n_size,filename=trim(fstart)//fending,
! + layers=vacuum%layers,nstars=vacuum%nstars,
! + ncored=29,nsld=atoms%nat,
! + nat=atoms%nat,l_dos=banddos%dos.OR.input%cdinf,
......@@ -687,11 +689,11 @@ c*****************************************************************c
eig_id = eig_idList(qptibz)
! WRITE(fending,'("_",i4.4)')qptibz
! eig_id=open_eig(mpi%mpi_comm,lapw%dim_nbasfcn(),input%neig,
! eig_id=open_eig(fmpi%mpi_comm,lapw%dim_nbasfcn(),input%neig,
! + nkpts,wannierspin,atoms%lmaxd,
! + atoms%nlod,atoms%ntype,atoms%nlotot,
! + l_noco,.FALSE.,l_real,l_soc,.FALSE.,
! + mpi%n_size,filename=trim(fstart)//fending,
! + fmpi%n_size,filename=trim(fstart)//fending,
! + layers=vacuum%layers,nstars=vacuum%nstars,
! + ncored=29,nsld=atoms%nat,
! + nat=atoms%nat,l_dos=banddos%dos.OR.input%cdinf,
......@@ -704,11 +706,11 @@ c*****************************************************************c
eig_id = eig_idList(qptibz)
! WRITE(fending,'("_",i4.4)')qptibz
! eig_id=open_eig(mpi%mpi_comm,lapw%dim_nbasfcn(),input%neig,
! eig_id=open_eig(fmpi%mpi_comm,lapw%dim_nbasfcn(),input%neig,
! + nkpts,wannierspin,atoms%lmaxd,
! + atoms%nlod,atoms%ntype,atoms%nlotot,
! + l_noco,.FALSE.,l_real,l_soc,.FALSE.,
! + mpi%n_size,filename=trim(fstart)//fending,
! + fmpi%n_size,filename=trim(fstart)//fending,
! + layers=vacuum%layers,nstars=vacuum%nstars,
! + ncored=29,nsld=atoms%nat,
! + nat=atoms%nat,l_dos=banddos%dos.OR.input%cdinf,
......@@ -784,7 +786,7 @@ cccccccccccc read in the eigenvalues and vectors cccccc
! call cdn_read0(eig_id,irank,isize,jspin5,wannierspin,l_noco,
! < ello,evac,epar,wk,n_bands,n_size)
CALL cdn_read0(eig_id,mpi%irank,mpi%isize,jspin5,
CALL cdn_read0(eig_id,fmpi%irank,fmpi%isize,jspin5,
& input%jspins, !wannierspin instead of DIMENSION%jspd?&
& noco%l_noco, n_bands,n_size)
......@@ -813,10 +815,11 @@ c.. now we want to define the maximum number of the bands by all kpts
#ifdef CPP_MPI
if(l_p0)then
do cpu_index=1,isize-1
call MPI_SEND(nbnd,1,MPI_INTEGER,cpu_index,1,MPI_COMM_WORLD,ierr)
call MPI_SEND(nbnd,1,MPI_INTEGER,cpu_index,1,MPI_COMM_WORLD,
& ierr(1))
enddo
else
call MPI_RECV(nbnd,1,MPI_INTEGER,0,1,MPI_COMM_WORLD,stt,ierr)
call MPI_RECV(nbnd,1,MPI_INTEGER,0,1,MPI_COMM_WORLD,stt,ierr(1))
endif
#endif
......@@ -863,7 +866,7 @@ c...and the local orbital radial functions
call radflo(
> atoms,n,jspin4,enpara%ello0(:,:,jspin3),vr(1,n,jspin3),
> ff(n,1:,1:,0:,jspin4),gg(n,1:,1:,0:,jspin4),mpi,
> ff(n,1:,1:,0:,jspin4),gg(n,1:,1:,0:,jspin4),fmpi,
< usdus,uuilon,duilon,ulouilopn,flo(n,:,:,:,jspin4))
enddo
......@@ -957,7 +960,7 @@ c if (mod(i_rec-1,isize).eq.irank) then
CALL lapw%init(input,noco,nococonv,kpts,atoms,sym,kptibz,cell,
& (sym%zrfs.AND.(SUM(ABS(kpts%bk(3,:kpts%nkpt))).LT.1e-9)
& .AND..NOT.noco%l_noco.and.mpi%n_size==1),mpi)
& .AND..NOT.noco%l_noco.and.fmpi%n_size==1),fmpi)
nbasfcn = MERGE(lapw%nv(1)+lapw%nv(2)+2*atoms%nlotot,
& lapw%nv(1)+atoms%nlotot,noco%l_noco)
......@@ -967,7 +970,7 @@ c if (mod(i_rec-1,isize).eq.irank) then
CALL cdn_read(
& eig_id,
& lapw%dim_nvd(),input%jspins,mpi%irank,mpi%isize, !wannierspin instead of DIMENSION%jspd?&
& lapw%dim_nvd(),input%jspins,fmpi%irank,fmpi%isize, !wannierspin instead of DIMENSION%jspd?&
& kptibz,jspin,lapw%dim_nbasfcn(),
& noco%l_ss,noco%l_noco,input%neig,
& n_start,n_end,
......@@ -1040,7 +1043,7 @@ c$$$ nslibd=0
call lapw_b%init(input,noco,nococonv,kpts,atoms,sym,kptibz_b,
& cell,
& (sym%zrfs.AND.(SUM(ABS(kpts%bk(3,:kpts%nkpt))).LT.1e-9)
& .AND..NOT.noco%l_noco.and.mpi%n_size==1),mpi)
& .AND..NOT.noco%l_noco.and.fmpi%n_size==1),fmpi)
nbasfcn_b = MERGE(lapw_b%nv(1)+lapw_b%nv(2)+2*atoms%nlotot,
......@@ -1051,7 +1054,7 @@ c$$$ nslibd=0
CALL cdn_read(
& eig_id,
& lapw%dim_nvd(),input%jspins,mpi%irank,mpi%isize, !wannierspin instead of DIMENSION%jspd?
& lapw%dim_nvd(),input%jspins,fmpi%irank,fmpi%isize, !wannierspin instead of DIMENSION%jspd?
& kptibz_b,jspin,lapw%dim_nbasfcn(),
& noco%l_ss,noco%l_noco,input%neig,n_start,n_end,
& nbands_b,eigg,zzMat)
......@@ -1187,7 +1190,7 @@ c***********************************************************
call lapw_b2%init(input,noco,nococonv,kpts,atoms,sym,kptibz_b2,
& cell,(sym%zrfs.AND.(SUM(ABS(kpts%bk(3,:kpts%nkpt))).LT.1e-9)
& .AND..NOT.noco%l_noco.and.mpi%n_size==1),mpi)
& .AND..NOT.noco%l_noco.and.fmpi%n_size==1),fmpi)
nbasfcn_b2 = MERGE(lapw_b2%nv(1)+lapw_b2%nv(2)+2*atoms%nlotot,
& lapw_b2%nv(1)+atoms%nlotot,noco%l_noco)
......@@ -1198,7 +1201,7 @@ c***********************************************************
CALL cdn_read(
& eig_id,
& lapw%dim_nvd(),input%jspins,mpi%irank,mpi%isize, !wannierspin instead of DIMENSION%jspd?&
& lapw%dim_nvd(),input%jspins,fmpi%irank,fmpi%isize, !wannierspin instead of DIMENSION%jspd?&
& kptibz_b2,jspin,lapw%dim_nbasfcn(),
& noco%l_ss,noco%l_noco,input%neig,n_start,n_end,
& nbands_b2,eigg,zzMat)
......@@ -1501,7 +1504,7 @@ c endif
10 continue ! end of cycle by the k-points
#ifdef CPP_MPI
call MPI_BARRIER(MPI_COMM_WORLD,ierr)
call MPI_BARRIER(MPI_COMM_WORLD,ierr(1))
#endif
5 continue
......@@ -1522,7 +1525,7 @@ c endif
110 continue ! end of cycle by spins
#ifdef CPP_MPI
call MPI_BARRIER(MPI_COMM_WORLD,ierr)
call MPI_BARRIER(MPI_COMM_WORLD,ierr(1))
#endif
! close eig files
......@@ -1594,7 +1597,7 @@ c************************************************c
if(allocated(gb_q)) deallocate(gb_q,bpt_q)
#ifdef CPP_MPI
call MPI_BARRIER(MPI_COMM_WORLD,ierr)
call MPI_BARRIER(MPI_COMM_WORLD,ierr(1))
#endif
call cpu_time(t1)
t_total = t1-t00
......
......@@ -8,6 +8,9 @@ c*****************************************c
c J.-P. Hanke, Dec. 2015 c
c*****************************************c
MODULE m_wann_uHu_soc
#if (defined(CPP_MPI) && !defined(CPP_T90))
use mpi
#endif
CONTAINS
SUBROUTINE wann_uHu_soc(
> input,atoms,
......@@ -110,7 +113,6 @@ C .. Local Arrays ..
DATA ispjsp/1,-1/
#if (defined(CPP_MPI) && !defined(CPP_T90))
INCLUDE 'mpif.h'
INTEGER ierr(3)
#endif
......@@ -437,7 +439,7 @@ c*********************************************************c
enddo !ikpt_b
#if (defined(CPP_MPI) && !defined(CPP_T90))
CALL MPI_BARRIER(MPI_COMM_WORLD,ierr)
CALL MPI_BARRIER(MPI_COMM_WORLD,ierr(1))
#endif
deallocate( dvd, dvu, uvd, uvu )
......
......@@ -504,7 +504,7 @@ c*********************************************************c
ENDDO!ltil1
#if (defined(CPP_MPI) && !defined(CPP_T90))
CALL MPI_BARRIER(MPI_COMM_WORLD,ierr)
CALL MPI_BARRIER(MPI_COMM_WORLD,ierr(1))
#endif
deallocate( ulovulo )
......
......@@ -816,7 +816,7 @@ c*********************************************************c
t_gggint = t_gggint + t0-t1
#if (defined(CPP_MPI) && !defined(CPP_T90))
CALL MPI_BARRIER(MPI_COMM_WORLD,ierr)
CALL MPI_BARRIER(MPI_COMM_WORLD,ierr(1))
#endif
deallocate( ulovulo_sph, ulovulo_non)
......
......@@ -54,7 +54,7 @@ c Collect contributions to the mmnk matrix from the
c various processors.
c******************************************************
length = nbnd*nbnd*nntot2*nntot
CALL MPI_BARRIER(MPI_COMM_WORLD,ierr)
CALL MPI_BARRIER(MPI_COMM_WORLD,ierr(1))
CALL MPI_GATHERV(
> uHu_in,length*nkpt_loc,MPI_DOUBLE_COMPLEX,
> uHu,length*counts,length*displs,MPI_DOUBLE_COMPLEX,
......@@ -164,7 +164,7 @@ c******************************************************
if(allocated(uHu)) deallocate( uHu )
#ifdef CPP_MPI
CALL MPI_BARRIER(MPI_COMM_WORLD,ierr)
CALL MPI_BARRIER(MPI_COMM_WORLD,ierr(1))
#endif
end subroutine wann_write_uHu
......
......@@ -14,9 +14,12 @@ c Frank Freimuth, November 2006
c******************************************************************
module m_wannier_to_lapw
use m_juDFT
#ifdef CPP_MPI
use mpi
#endif
contains
subroutine wannier_to_lapw(
> mpi_comm,eig_id,l_real,
> mpi_communicatior,eig_id,l_real,
> input,lapw,oneD,noco,nococonv,sym,cell,atoms,stars,vacuum,
> sphhar,
> vTot,
......@@ -62,13 +65,12 @@ c******************************************************************
TYPE(t_potden),INTENT(IN) :: vTot
#ifdef CPP_MPI
include 'mpif.h'
integer mpiierr(3)
integer cpu_index
integer stt(MPI_STATUS_SIZE)
#endif
logical,intent(in):: l_soc, l_real
integer,intent(in)::unigrid(4),mpi_comm,eig_id
integer,intent(in)::unigrid(4),mpi_communicatior,eig_id
integer,intent(in)::band_min(2),band_max(2)
logical, intent (in) :: invs,invs2,film,slice,symor
integer, intent (in) :: lmaxd,ntypd,neigd,nkptd,kk,nnne
......@@ -697,7 +699,7 @@ c****************************************************************
deallocate(u_matrix)
#ifdef CPP_MPI
call MPI_BARRIER(mpi_comm,mpiierr)
call MPI_BARRIER(mpi_communicatior,mpiierr(1))
#endif
nrec=nrec+nkpts
......@@ -708,7 +710,7 @@ c****************************************************************
deallocate ( ff,gg)
#ifdef CPP_MPI
call MPI_BARRIER(mpi_comm,mpiierr)
call MPI_BARRIER(mpi_communicatior,mpiierr(2))
#endif
end subroutine wannier_to_lapw
......
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