Skip to content

Commit

Permalink
BUGFIX:
Browse files Browse the repository at this point in the history
case Real-space DMFT and mpi_lanc=F:

in ed_solve_single, check_MPI() is T but fmpi_=mpi_lanc=F. So the
MPI communicator is not set (as it should be). However the following
condition if(MpiMaster) is true for every core, and every core writes on
the used.input file, rendering it unreadable if not dangerous. Cases in
which binary blobs - probably coming from cores writing at the same
time- are present have been reported. If one uses this file as input for
a new run, the program either doesn't run or behaves erratically.

Fix for now:
if fmpi_ is F, don't print to used.input in ed_solve_single.
Only the master (not the same master of ed_solve_single's MpiComm) in
ed_solve_lattice will print, before ed_solve_single is called.

Fix for the future:
Enable in the lattice case the possibility of having different input
files for different atoms; this could expose the case where ULOC is
different per atom, which is now not accessible without specific coding
in the driver.
  • Loading branch information
lcrippa committed Jun 13, 2024
1 parent 3e3e55c commit e854781
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src/ED_MAIN.f90
Original file line number Diff line number Diff line change
Expand Up @@ -203,8 +203,8 @@ subroutine ed_solve_single(bath,sflag,fmpi)
!
check = check_bath_dimension(bath)
if(.not.check)stop "ED_SOLVE_SINGLE Error: wrong bath dimensions"
!
if(MpiMaster)call save_input_file(str(ed_input_file))
!
if(MpiMaster.and.fmpi_)call save_input_file(str(ed_input_file))
!
call allocate_dmft_bath(dmft_bath)
call set_dmft_bath(bath,dmft_bath)
Expand Down Expand Up @@ -345,6 +345,9 @@ subroutine ed_solve_lattice(bath,mpi_lanc,Uloc_ii,Ust_ii,Jh_ii,Jp_ii,Jx_ii,iflag
lanc_nstates_total = neigen_total_ineq(ilat)
!
call ed_set_Hloc(Hloc_ineq(ilat,:,:,:,:))
!
if(MPI_MASTER)call save_input_file(str(ed_input_file))
!
call ed_solve_single(bath(ilat,:),sflag=iflag_,fmpi=mpi_lanc_)
!
neigen_sectortmp(ilat,:) = neigen_sector(:)
Expand Down

0 comments on commit e854781

Please sign in to comment.