Skip to content

Commit

Permalink
Fix for MPI and cuda-MPI for dl-find
Browse files Browse the repository at this point in the history
  • Loading branch information
akhilshajan committed Jul 9, 2024
1 parent 46ee0c1 commit c7e8767
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 0 deletions.
12 changes: 12 additions & 0 deletions src/dlfind/dl_find.f90
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down
5 changes: 5 additions & 0 deletions src/dlfind/dlfind_main_driver.f90
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit c7e8767

Please sign in to comment.