Skip to content

Commit

Permalink
support lammps 20210831 (deepmodeling#1129)
Browse files Browse the repository at this point in the history
* support lammps 20210831

* fix typo

Co-authored-by: Han Wang <[email protected]>

Co-authored-by: Han Wang <[email protected]>
  • Loading branch information
njzjz and amcadmus authored Sep 12, 2021
1 parent 90d71ca commit 298b12a
Showing 1 changed file with 25 additions and 0 deletions.
25 changes: 25 additions & 0 deletions source/lmp/pppm_dplr.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -109,8 +109,13 @@ void PPPMDPLR::compute(int eflag, int vflag)
// to fully sum contribution in their 3d bricks
// remap from 3d decomposition to FFT decomposition

#if LAMMPS_VERSION_NUMBER>=20210831
gc->reverse_comm(GridComm::KSPACE,this,1,sizeof(FFT_SCALAR),REVERSE_RHO,
gc_buf1,gc_buf2,MPI_FFT_SCALAR);
#else
gc->reverse_comm_kspace(this,1,sizeof(FFT_SCALAR),REVERSE_RHO,
gc_buf1,gc_buf2,MPI_FFT_SCALAR);
#endif
brick2fft();

// compute potential gradient on my FFT grid and
Expand All @@ -124,21 +129,41 @@ void PPPMDPLR::compute(int eflag, int vflag)
// to fill ghost cells surrounding their 3d bricks

if (differentiation_flag == 1)
#if LAMMPS_VERSION_NUMBER>=20210831
gc->forward_comm(GridComm::KSPACE,this,1,sizeof(FFT_SCALAR),FORWARD_AD,
gc_buf1,gc_buf2,MPI_FFT_SCALAR);
#else
gc->forward_comm_kspace(this,1,sizeof(FFT_SCALAR),FORWARD_AD,
gc_buf1,gc_buf2,MPI_FFT_SCALAR);
#endif
else
#if LAMMPS_VERSION_NUMBER>=20210831
gc->forward_comm(GridComm::KSPACE,this,1,sizeof(FFT_SCALAR),FORWARD_IK,
gc_buf1,gc_buf2,MPI_FFT_SCALAR);
#else
gc->forward_comm_kspace(this,3,sizeof(FFT_SCALAR),FORWARD_IK,
gc_buf1,gc_buf2,MPI_FFT_SCALAR);
#endif

// extra per-atom energy/virial communication

if (evflag_atom) {
if (differentiation_flag == 1 && vflag_atom)
#if LAMMPS_VERSION_NUMBER>=20210831
gc->forward_comm(GridComm::KSPACE,this,6,sizeof(FFT_SCALAR),FORWARD_AD_PERATOM,
gc_buf1,gc_buf2,MPI_FFT_SCALAR);
#else
gc->forward_comm_kspace(this,6,sizeof(FFT_SCALAR),FORWARD_AD_PERATOM,
gc_buf1,gc_buf2,MPI_FFT_SCALAR);
#endif
else if (differentiation_flag == 0)
#if LAMMPS_VERSION_NUMBER>=20210831
gc->forward_comm(GridComm::KSPACE,this,7,sizeof(FFT_SCALAR),FORWARD_IK_PERATOM,
gc_buf1,gc_buf2,MPI_FFT_SCALAR);
#else
gc->forward_comm_kspace(this,7,sizeof(FFT_SCALAR),FORWARD_IK_PERATOM,
gc_buf1,gc_buf2,MPI_FFT_SCALAR);
#endif
}

// calculate the force on my particles
Expand Down

0 comments on commit 298b12a

Please sign in to comment.