Commit aeb74acf authored by Uliana Alekseeva's avatar Uliana Alekseeva

An (ugly) RMA synchronization in fermi.

Helps when lots of k-points need to be calculated.
parent 8515629c
......@@ -228,9 +228,6 @@ CONTAINS
IF (mpi%n_rank == 0) THEN
! Only process 0 writes out the value of ne_all and the
! eigenvalues.
! Trying to use MPI_PUT for the very same slot by all processes
! causes problems with IntelMPI/2019
! Mai 2019 U. Alekseeva
CALL write_eig(eig_id, nk,jsp,ne_found,ne_all,&
eig(:ne_all),n_start=mpi%n_size,n_end=mpi%n_rank,zMat=zMat)
eigBuffer(:ne_all,nk,jsp) = eig(:ne_all)
......
......@@ -72,6 +72,7 @@ CONTAINS
INCLUDE 'mpif.h'
INTEGER, PARAMETER :: comm = MPI_COMM_SELF
INTEGER*4 :: nv_mpi(2),idum1d(0),idum2d(0,0)
INTEGER ierr
#endif
! ..
......@@ -121,8 +122,8 @@ CONTAINS
IF (mpi%irank == 0) CALL openXMLElementNoAttributes('eigenvalues')
DO jsp = 1,nspins
DO k = 1,kpts%nkpt
CALL read_eig(eig_id,k,jsp,neig=ne(k,jsp),eig=eig(:,k,jsp))
IF (mpi%irank == 0) THEN
CALL read_eig(eig_id,k,jsp,neig=ne(k,jsp),eig=eig(:,k,jsp))
WRITE (6,'(a2,3f10.5,f12.6)') 'at',kpts%bk(:,k),kpts%wtkpt(k)
WRITE (6,'(i5,a14)') ne(k,jsp),' eigenvalues :'
WRITE (6,'(8f12.6)') (eig(i,k,jsp),i=1,ne(k,jsp))
......@@ -136,10 +137,14 @@ CONTAINS
CALL writeXMLElementPoly('eigenvaluesAt',(/'spin','ikpt','k_x ','k_y ','k_z '/),attributes,eig(1:ne(k,jsp),k,jsp))
END IF
END IF
#ifdef CPP_MPI
CALL MPI_BARRIER(mpi%mpi_comm,ierr)
#endif
END DO
ENDDO
!finished reading of eigenvalues
IF (mpi%irank == 0) CALL closeXMLElement('eigenvalues')
IF (mpi%irank == 0) THEN
IF (ABS(input%fixed_moment)<1E-6) THEN
!this is a standard calculation
......@@ -257,15 +262,17 @@ CONTAINS
WRITE(attributes(1),'(f20.10)') results%ef
WRITE(attributes(2),'(a)') 'Htr'
IF (mpi%irank.EQ.0) CALL writeXMLElement('FermiEnergy',(/'value','units'/),attributes(1:2))
ENDIF
!Put w_iks into eig-file
IF (mpi%n_rank == 0) THEN
DO jsp = 1,nspins
DO k = 1,kpts%nkpt
CALL write_eig(eig_id,k,jsp,w_iks=results%w_iks(:,k,jsp))
ENDDO
DO jsp = 1,nspins
DO k = 1,kpts%nkpt
IF (mpi%irank == 0) CALL write_eig(eig_id,k,jsp,w_iks=results%w_iks(:,k,jsp))
#ifdef CPP_MPI
CALL MPI_BARRIER(mpi%mpi_comm,ierr)
#endif
ENDDO
ENDIF
ENDDO
RETURN
8020 FORMAT (/,'FERMIE:',/,&
......
......@@ -288,7 +288,7 @@ CONTAINS
! fermi level and occupancies
IF (noco%l_soc.AND.(.NOT.noco%l_noco)) DIMENSION%neigd = 2*DIMENSION%neigd
IF ((mpi%irank.EQ.0)) THEN
!IF ((mpi%irank.EQ.0)) THEN
CALL timestart("determination of fermi energy")
IF (noco%l_soc.AND.(.NOT.noco%l_noco)) THEN
......@@ -322,7 +322,7 @@ CONTAINS
!!$ END IF
!!$ !-Wannier
ENDIF
!ENDIF
#ifdef CPP_MPI
CALL MPI_BCAST(results%ef,1,MPI_DOUBLE_PRECISION,0,mpi%mpi_comm,ierr)
CALL MPI_BCAST(results%w_iks,SIZE(results%w_iks),MPI_DOUBLE_PRECISION,0,mpi%mpi_comm,ierr)
......
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