diff --git a/src/dlfind/dl_find.f90 b/src/dlfind/dl_find.f90 index 3b5b074d..6b9e4fa0 100644 --- a/src/dlfind/dl_find.f90 +++ b/src/dlfind/dl_find.f90 @@ -354,6 +354,9 @@ subroutine dlf_run(ierr2 & use quick_method_module,only: quick_method use quick_files_module, only: write_molden use quick_molden_module, only: quick_molden +#ifdef MPIV + use quick_mpi_module +#endif implicit none #ifdef GAMESS real(rk) :: core(*) ! GAMESS memory, not used in DL-FIND @@ -892,7 +895,16 @@ subroutine dlf_run(ierr2 & if(.not.testconv) then if (glob%imicroiter < 2) then ! Standard convergence test +#ifdef MPIV + call MPI_BARRIER(MPI_COMM_WORLD,mpierror) + call flush() +#endif call convergence_test(stat%ccycle,.true.,tconv) +#ifdef MPIV + call MPI_BARRIER(MPI_COMM_WORLD,mpierror) + call flush() + if (bMPI)call MPI_BCAST(tconv,1,mpi_logical,0,MPI_COMM_WORLD,mpierror) +#endif if (tconv) then if (printl > 0) then write(stdout,'(/" GEOMETRY OPTIMIZED AFTER",i5," CYCLES")') stat%ccycle diff --git a/src/dlfind/dlfind_main_driver.f90 b/src/dlfind/dlfind_main_driver.f90 index 7bceabd2..b597a359 100644 --- a/src/dlfind/dlfind_main_driver.f90 +++ b/src/dlfind/dlfind_main_driver.f90 @@ -341,6 +341,11 @@ subroutine dlf_get_gradient(nvar,coords,energy,gradient,iimage,kiter,status,ierr ! call test_update status=1 +#ifdef MPIV + ! we now have new geometry, and let other nodes know the new geometry + if (bMPI)call MPI_BCAST(xyz,natom*3,mpi_double_precision,0,MPI_COMM_WORLD,mpierror) +#endif + #if defined CUDA || defined CUDA_MPIV || defined HIP || defined HIP_MPIV call gpu_setup(natom,nbasis, quick_molspec%nElec, quick_molspec%imult, & quick_molspec%molchg, quick_molspec%iAtomType)