more bookkeeping changes

This commit is contained in:
Steve Plimpton
2022-11-30 10:56:54 -07:00
parent d32da83eb6
commit cc18528ea1
20 changed files with 277 additions and 285 deletions

View File

@ -291,7 +291,7 @@ FFT_SCALAR *AmoebaConvolution::pre_convolution_3d()
debug_scalar(GRIDBRICK_OUT,"PRE Convo / PRE Grid3d"); debug_scalar(GRIDBRICK_OUT,"PRE Convo / PRE Grid3d");
#endif #endif
gc->reverse_comm(Grid3d::PAIR,amoeba,1,sizeof(FFT_SCALAR),which, gc->reverse_comm(Grid3d::PAIR,amoeba,which,1,sizeof(FFT_SCALAR),
gc_buf1,gc_buf2,MPI_FFT_SCALAR); gc_buf1,gc_buf2,MPI_FFT_SCALAR);
#if DEBUG_AMOEBA #if DEBUG_AMOEBA
@ -354,7 +354,7 @@ FFT_SCALAR *AmoebaConvolution::pre_convolution_4d()
debug_scalar(GRIDBRICK_OUT,"PRE Convo / PRE Grid3d"); debug_scalar(GRIDBRICK_OUT,"PRE Convo / PRE Grid3d");
#endif #endif
gc->reverse_comm(Grid3d::PAIR,amoeba,2,sizeof(FFT_SCALAR),which, gc->reverse_comm(Grid3d::PAIR,amoeba,which,2,sizeof(FFT_SCALAR),
gc_buf1,gc_buf2,MPI_FFT_SCALAR); gc_buf1,gc_buf2,MPI_FFT_SCALAR);
#if DEBUG_AMOEBA #if DEBUG_AMOEBA
@ -443,7 +443,7 @@ void *AmoebaConvolution::post_convolution_3d()
debug_scalar(GRIDBRICK_IN,"POST Convo / PRE grid3d"); debug_scalar(GRIDBRICK_IN,"POST Convo / PRE grid3d");
debug_file(GRIDBRICK_IN,"post.convo.pre.grid3d"); debug_file(GRIDBRICK_IN,"post.convo.pre.grid3d");
#endif #endif
gc->forward_comm(Grid3d::PAIR,amoeba,1,sizeof(FFT_SCALAR),which, gc->forward_comm(Grid3d::PAIR,amoeba,which,1,sizeof(FFT_SCALAR),
gc_buf1,gc_buf2,MPI_FFT_SCALAR); gc_buf1,gc_buf2,MPI_FFT_SCALAR);
return (void *) grid_brick; return (void *) grid_brick;
@ -485,7 +485,7 @@ void *AmoebaConvolution::post_convolution_4d()
debug_scalar(GRIDBRICK_IN,"POST Convo / PRE grid3d"); debug_scalar(GRIDBRICK_IN,"POST Convo / PRE grid3d");
debug_file(GRIDBRICK_IN,"post.convo.pre.grid3d"); debug_file(GRIDBRICK_IN,"post.convo.pre.grid3d");
#endif #endif
gc->forward_comm(Grid3d::PAIR,amoeba,2,sizeof(FFT_SCALAR),which, gc->forward_comm(Grid3d::PAIR,amoeba,which,2,sizeof(FFT_SCALAR),
gc_buf1,gc_buf2,MPI_FFT_SCALAR); gc_buf1,gc_buf2,MPI_FFT_SCALAR);
return (void *) cgrid_brick; return (void *) cgrid_brick;

View File

@ -130,7 +130,7 @@ void MSMDielectric::compute(int eflag, int vflag)
// to fully sum contribution in their 3d grid // to fully sum contribution in their 3d grid
current_level = 0; current_level = 0;
gcall->reverse_comm(Grid3d::KSPACE,this,1,sizeof(double),REVERSE_RHO, gcall->reverse_comm(Grid3d::KSPACE,this,REVERSE_RHO,1,sizeof(double),
gcall_buf1,gcall_buf2,MPI_DOUBLE); gcall_buf1,gcall_buf2,MPI_DOUBLE);
// forward communicate charge density values to fill ghost grid points // forward communicate charge density values to fill ghost grid points
@ -139,7 +139,7 @@ void MSMDielectric::compute(int eflag, int vflag)
for (int n=0; n<=levels-2; n++) { for (int n=0; n<=levels-2; n++) {
if (!active_flag[n]) continue; if (!active_flag[n]) continue;
current_level = n; current_level = n;
gc[n]->forward_comm(Grid3d::KSPACE,this,1,sizeof(double),FORWARD_RHO, gc[n]->forward_comm(Grid3d::KSPACE,this,FORWARD_RHO,1,sizeof(double),
gc_buf1[n],gc_buf2[n],MPI_DOUBLE); gc_buf1[n],gc_buf2[n],MPI_DOUBLE);
direct(n); direct(n);
restriction(n); restriction(n);
@ -152,15 +152,15 @@ void MSMDielectric::compute(int eflag, int vflag)
if (domain->nonperiodic) { if (domain->nonperiodic) {
current_level = levels-1; current_level = levels-1;
gc[levels-1]-> gc[levels-1]->
forward_comm(Grid3d::KSPACE,this,1,sizeof(double),FORWARD_RHO, forward_comm(Grid3d::KSPACE,this,FORWARD_RHO,1,sizeof(double),
gc_buf1[levels-1],gc_buf2[levels-1],MPI_DOUBLE); gc_buf1[levels-1],gc_buf2[levels-1],MPI_DOUBLE);
direct_top(levels-1); direct_top(levels-1);
gc[levels-1]-> gc[levels-1]->
reverse_comm(Grid3d::KSPACE,this,1,sizeof(double),REVERSE_AD, reverse_comm(Grid3d::KSPACE,this,REVERSE_AD,1,sizeof(double),
gc_buf1[levels-1],gc_buf2[levels-1],MPI_DOUBLE); gc_buf1[levels-1],gc_buf2[levels-1],MPI_DOUBLE);
if (vflag_atom) if (vflag_atom)
gc[levels-1]-> gc[levels-1]->
reverse_comm(Grid3d::KSPACE,this,6,sizeof(double),REVERSE_AD_PERATOM, reverse_comm(Grid3d::KSPACE,this,REVERSE_AD_PERATOM,6,sizeof(double),
gc_buf1[levels-1],gc_buf2[levels-1],MPI_DOUBLE); gc_buf1[levels-1],gc_buf2[levels-1],MPI_DOUBLE);
} else { } else {
@ -171,7 +171,7 @@ void MSMDielectric::compute(int eflag, int vflag)
current_level = levels-1; current_level = levels-1;
if (vflag_atom) if (vflag_atom)
gc[levels-1]-> gc[levels-1]->
reverse_comm(Grid3d::KSPACE,this,6,sizeof(double),REVERSE_AD_PERATOM, reverse_comm(Grid3d::KSPACE,this,REVERSE_AD_PERATOM,6,sizeof(double),
gc_buf1[levels-1],gc_buf2[levels-1],MPI_DOUBLE); gc_buf1[levels-1],gc_buf2[levels-1],MPI_DOUBLE);
} }
} }
@ -184,27 +184,27 @@ void MSMDielectric::compute(int eflag, int vflag)
prolongation(n); prolongation(n);
current_level = n; current_level = n;
gc[n]->reverse_comm(Grid3d::KSPACE,this,1,sizeof(double),REVERSE_AD, gc[n]->reverse_comm(Grid3d::KSPACE,this,REVERSE_AD,1,sizeof(double),
gc_buf1[n],gc_buf2[n],MPI_DOUBLE); gc_buf1[n],gc_buf2[n],MPI_DOUBLE);
// extra per-atom virial communication // extra per-atom virial communication
if (vflag_atom) if (vflag_atom)
gc[n]->reverse_comm(Grid3d::KSPACE,this,6,sizeof(double), gc[n]->reverse_comm(Grid3d::KSPACE,this,REVERSE_AD_PERATOM,6,sizeof(double),
REVERSE_AD_PERATOM,gc_buf1[n],gc_buf2[n],MPI_DOUBLE); gc_buf1[n],gc_buf2[n],MPI_DOUBLE);
} }
// all procs communicate E-field values // all procs communicate E-field values
// to fill ghost cells surrounding their 3d bricks // to fill ghost cells surrounding their 3d bricks
current_level = 0; current_level = 0;
gcall->forward_comm(Grid3d::KSPACE,this,1,sizeof(double),FORWARD_AD, gcall->forward_comm(Grid3d::KSPACE,this,FORWARD_AD,1,sizeof(double),
gcall_buf1,gcall_buf2,MPI_DOUBLE); gcall_buf1,gcall_buf2,MPI_DOUBLE);
// extra per-atom energy/virial communication // extra per-atom energy/virial communication
if (vflag_atom) if (vflag_atom)
gcall->forward_comm(Grid3d::KSPACE,this,6,sizeof(double),FORWARD_AD_PERATOM, gcall->forward_comm(Grid3d::KSPACE,this,FORWARD_AD_PERATOM,6,sizeof(double),
gcall_buf1,gcall_buf2,MPI_DOUBLE); gcall_buf1,gcall_buf2,MPI_DOUBLE);
// calculate the force on my particles (interpolation) // calculate the force on my particles (interpolation)

View File

@ -129,8 +129,8 @@ void PPPMDielectric::compute(int eflag, int vflag)
// to fully sum contribution in their 3d bricks // to fully sum contribution in their 3d bricks
// remap from 3d decomposition to FFT decomposition // remap from 3d decomposition to FFT decomposition
gc->reverse_comm(Grid3d::KSPACE,this,1,sizeof(FFT_SCALAR), gc->reverse_comm(Grid3d::KSPACE,this,REVERSE_RHO,1,sizeof(FFT_SCALAR),
REVERSE_RHO,gc_buf1,gc_buf2,MPI_FFT_SCALAR); gc_buf1,gc_buf2,MPI_FFT_SCALAR);
brick2fft(); brick2fft();
// compute potential gradient on my FFT grid and // compute potential gradient on my FFT grid and
@ -144,21 +144,21 @@ void PPPMDielectric::compute(int eflag, int vflag)
// to fill ghost cells surrounding their 3d bricks // to fill ghost cells surrounding their 3d bricks
if (differentiation_flag == 1) if (differentiation_flag == 1)
gc->forward_comm(Grid3d::KSPACE,this,1,sizeof(FFT_SCALAR), gc->forward_comm(Grid3d::KSPACE,this,FORWARD_AD,1,sizeof(FFT_SCALAR),
FORWARD_AD,gc_buf1,gc_buf2,MPI_FFT_SCALAR); gc_buf1,gc_buf2,MPI_FFT_SCALAR);
else else
gc->forward_comm(Grid3d::KSPACE,this,3,sizeof(FFT_SCALAR), gc->forward_comm(Grid3d::KSPACE,this,FORWARD_IK,3,sizeof(FFT_SCALAR),
FORWARD_IK,gc_buf1,gc_buf2,MPI_FFT_SCALAR); gc_buf1,gc_buf2,MPI_FFT_SCALAR);
// extra per-atom energy/virial communication // extra per-atom energy/virial communication
if (evflag_atom) { if (evflag_atom) {
if (differentiation_flag == 1 && vflag_atom) if (differentiation_flag == 1 && vflag_atom)
gc->forward_comm(Grid3d::KSPACE,this,6,sizeof(FFT_SCALAR), gc->forward_comm(Grid3d::KSPACE,this,FORWARD_AD_PERATOM,6,sizeof(FFT_SCALAR),
FORWARD_AD_PERATOM,gc_buf1,gc_buf2,MPI_FFT_SCALAR); gc_buf1,gc_buf2,MPI_FFT_SCALAR);
else if (differentiation_flag == 0) else if (differentiation_flag == 0)
gc->forward_comm(Grid3d::KSPACE,this,7,sizeof(FFT_SCALAR), gc->forward_comm(Grid3d::KSPACE,this,FORWARD_IK_PERATOM,7,sizeof(FFT_SCALAR),
FORWARD_IK_PERATOM,gc_buf1,gc_buf2,MPI_FFT_SCALAR); gc_buf1,gc_buf2,MPI_FFT_SCALAR);
} }
// calculate the force on my particles // calculate the force on my particles

View File

@ -148,8 +148,8 @@ void PPPMDispDielectric::compute(int eflag, int vflag)
make_rho_c(); make_rho_c();
gc->reverse_comm(Grid3d::KSPACE,this,1,sizeof(FFT_SCALAR), gc->reverse_comm(Grid3d::KSPACE,this,REVERSE_RHO,1,sizeof(FFT_SCALAR),
REVERSE_RHO,gc_buf1,gc_buf2,MPI_FFT_SCALAR); gc_buf1,gc_buf2,MPI_FFT_SCALAR);
brick2fft(nxlo_in,nylo_in,nzlo_in,nxhi_in,nyhi_in,nzhi_in, brick2fft(nxlo_in,nylo_in,nzlo_in,nxhi_in,nyhi_in,nzhi_in,
density_brick,density_fft,work1,remap); density_brick,density_fft,work1,remap);
@ -163,14 +163,14 @@ void PPPMDispDielectric::compute(int eflag, int vflag)
virial_1,vg,vg2, virial_1,vg,vg2,
u_brick,v0_brick,v1_brick,v2_brick,v3_brick,v4_brick,v5_brick); u_brick,v0_brick,v1_brick,v2_brick,v3_brick,v4_brick,v5_brick);
gc->forward_comm(Grid3d::KSPACE,this,1,sizeof(FFT_SCALAR),FORWARD_AD, gc->forward_comm(Grid3d::KSPACE,this,FORWARD_AD,1,sizeof(FFT_SCALAR),
gc_buf1,gc_buf2,MPI_FFT_SCALAR); gc_buf1,gc_buf2,MPI_FFT_SCALAR);
fieldforce_c_ad(); fieldforce_c_ad();
if (vflag_atom) if (vflag_atom)
gc->forward_comm(Grid3d::KSPACE,this,6,sizeof(FFT_SCALAR), gc->forward_comm(Grid3d::KSPACE,this,FORWARD_AD_PERATOM,6,sizeof(FFT_SCALAR),
FORWARD_AD_PERATOM,gc_buf1,gc_buf2,MPI_FFT_SCALAR); gc_buf1,gc_buf2,MPI_FFT_SCALAR);
} else { } else {
poisson_ik(work1,work2,density_fft,fft1,fft2, poisson_ik(work1,work2,density_fft,fft1,fft2,
@ -182,14 +182,14 @@ void PPPMDispDielectric::compute(int eflag, int vflag)
vdx_brick,vdy_brick,vdz_brick,virial_1,vg,vg2, vdx_brick,vdy_brick,vdz_brick,virial_1,vg,vg2,
u_brick,v0_brick,v1_brick,v2_brick,v3_brick,v4_brick,v5_brick); u_brick,v0_brick,v1_brick,v2_brick,v3_brick,v4_brick,v5_brick);
gc->forward_comm(Grid3d::KSPACE,this,3,sizeof(FFT_SCALAR),FORWARD_IK, gc->forward_comm(Grid3d::KSPACE,this,FORWARD_IK,3,sizeof(FFT_SCALAR),
gc_buf1,gc_buf2,MPI_FFT_SCALAR); gc_buf1,gc_buf2,MPI_FFT_SCALAR);
fieldforce_c_ik(); fieldforce_c_ik();
if (evflag_atom) if (evflag_atom)
gc->forward_comm(Grid3d::KSPACE,this,7,sizeof(FFT_SCALAR), gc->forward_comm(Grid3d::KSPACE,this,FORWARD_IK_PERATOM,7,sizeof(FFT_SCALAR),
FORWARD_IK_PERATOM,gc_buf1,gc_buf2,MPI_FFT_SCALAR); gc_buf1,gc_buf2,MPI_FFT_SCALAR);
} }
if (evflag_atom) fieldforce_c_peratom(); if (evflag_atom) fieldforce_c_peratom();
@ -206,8 +206,8 @@ void PPPMDispDielectric::compute(int eflag, int vflag)
make_rho_g(); make_rho_g();
gc6->reverse_comm(Grid3d::KSPACE,this,1,sizeof(FFT_SCALAR), gc6->reverse_comm(Grid3d::KSPACE,this,REVERSE_RHO_GEOM,1,sizeof(FFT_SCALAR),
REVERSE_RHO_GEOM,gc6_buf1,gc6_buf2,MPI_FFT_SCALAR); gc6_buf1,gc6_buf2,MPI_FFT_SCALAR);
brick2fft(nxlo_in_6,nylo_in_6,nzlo_in_6,nxhi_in_6,nyhi_in_6,nzhi_in_6, brick2fft(nxlo_in_6,nylo_in_6,nzlo_in_6,nxhi_in_6,nyhi_in_6,nzhi_in_6,
density_brick_g,density_fft_g,work1_6,remap_6); density_brick_g,density_fft_g,work1_6,remap_6);
@ -222,14 +222,13 @@ void PPPMDispDielectric::compute(int eflag, int vflag)
u_brick_g,v0_brick_g,v1_brick_g,v2_brick_g, u_brick_g,v0_brick_g,v1_brick_g,v2_brick_g,
v3_brick_g,v4_brick_g,v5_brick_g); v3_brick_g,v4_brick_g,v5_brick_g);
gc6->forward_comm(Grid3d::KSPACE,this,1,sizeof(FFT_SCALAR), gc6->forward_comm(Grid3d::KSPACE,this,FORWARD_AD_GEOM,1,sizeof(FFT_SCALAR),
FORWARD_AD_GEOM,gc6_buf1,gc6_buf2,MPI_FFT_SCALAR); gc6_buf1,gc6_buf2,MPI_FFT_SCALAR);
fieldforce_g_ad(); fieldforce_g_ad();
if (vflag_atom) if (vflag_atom)
gc6->forward_comm(Grid3d::KSPACE,this,6,sizeof(FFT_SCALAR), gc6->forward_comm(Grid3d::KSPACE,this,FORWARD_AD_PERATOM_GEOM,6,sizeof(FFT_SCALAR),
FORWARD_AD_PERATOM_GEOM,
gc6_buf1,gc6_buf2,MPI_FFT_SCALAR); gc6_buf1,gc6_buf2,MPI_FFT_SCALAR);
} else { } else {
@ -243,14 +242,13 @@ void PPPMDispDielectric::compute(int eflag, int vflag)
u_brick_g,v0_brick_g,v1_brick_g,v2_brick_g, u_brick_g,v0_brick_g,v1_brick_g,v2_brick_g,
v3_brick_g,v4_brick_g,v5_brick_g); v3_brick_g,v4_brick_g,v5_brick_g);
gc6->forward_comm(Grid3d::KSPACE,this,3,sizeof(FFT_SCALAR), gc6->forward_comm(Grid3d::KSPACE,this,FORWARD_IK_GEOM,3,sizeof(FFT_SCALAR),
FORWARD_IK_GEOM,gc6_buf1,gc6_buf2,MPI_FFT_SCALAR); gc6_buf1,gc6_buf2,MPI_FFT_SCALAR);
fieldforce_g_ik(); fieldforce_g_ik();
if (evflag_atom) if (evflag_atom)
gc6->forward_comm(Grid3d::KSPACE,this,7,sizeof(FFT_SCALAR), gc6->forward_comm(Grid3d::KSPACE,this,FORWARD_IK_PERATOM_GEOM,7,sizeof(FFT_SCALAR),
FORWARD_IK_PERATOM_GEOM,
gc6_buf1,gc6_buf2,MPI_FFT_SCALAR); gc6_buf1,gc6_buf2,MPI_FFT_SCALAR);
} }
@ -268,8 +266,8 @@ void PPPMDispDielectric::compute(int eflag, int vflag)
make_rho_a(); make_rho_a();
gc6->reverse_comm(Grid3d::KSPACE,this,7,sizeof(FFT_SCALAR), gc6->reverse_comm(Grid3d::KSPACE,this,REVERSE_RHO_ARITH,7,sizeof(FFT_SCALAR),
REVERSE_RHO_ARITH,gc6_buf1,gc6_buf2,MPI_FFT_SCALAR); gc6_buf1,gc6_buf2,MPI_FFT_SCALAR);
brick2fft_a(); brick2fft_a();
@ -298,14 +296,13 @@ void PPPMDispDielectric::compute(int eflag, int vflag)
u_brick_a4,v0_brick_a4,v1_brick_a4,v2_brick_a4, u_brick_a4,v0_brick_a4,v1_brick_a4,v2_brick_a4,
v3_brick_a4,v4_brick_a4,v5_brick_a4); v3_brick_a4,v4_brick_a4,v5_brick_a4);
gc6->forward_comm(Grid3d::KSPACE,this,7,sizeof(FFT_SCALAR), gc6->forward_comm(Grid3d::KSPACE,this,FORWARD_AD_ARITH,7,sizeof(FFT_SCALAR),
FORWARD_AD_ARITH,gc6_buf1,gc6_buf2,MPI_FFT_SCALAR); gc6_buf1,gc6_buf2,MPI_FFT_SCALAR);
fieldforce_a_ad(); fieldforce_a_ad();
if (evflag_atom) if (evflag_atom)
gc6->forward_comm(Grid3d::KSPACE,this,42,sizeof(FFT_SCALAR), gc6->forward_comm(Grid3d::KSPACE,this,FORWARD_AD_PERATOM_ARITH,42,sizeof(FFT_SCALAR),
FORWARD_AD_PERATOM_ARITH,
gc6_buf1,gc6_buf2,MPI_FFT_SCALAR); gc6_buf1,gc6_buf2,MPI_FFT_SCALAR);
} else { } else {
@ -340,14 +337,13 @@ void PPPMDispDielectric::compute(int eflag, int vflag)
u_brick_a4,v0_brick_a4,v1_brick_a4,v2_brick_a4, u_brick_a4,v0_brick_a4,v1_brick_a4,v2_brick_a4,
v3_brick_a4,v4_brick_a4,v5_brick_a4); v3_brick_a4,v4_brick_a4,v5_brick_a4);
gc6->forward_comm(Grid3d::KSPACE,this,21,sizeof(FFT_SCALAR), gc6->forward_comm(Grid3d::KSPACE,this,FORWARD_IK_ARITH,21,sizeof(FFT_SCALAR),
FORWARD_IK_ARITH,gc6_buf1,gc6_buf2,MPI_FFT_SCALAR); gc6_buf1,gc6_buf2,MPI_FFT_SCALAR);
fieldforce_a_ik(); fieldforce_a_ik();
if (evflag_atom) if (evflag_atom)
gc6->forward_comm(Grid3d::KSPACE,this,49,sizeof(FFT_SCALAR), gc6->forward_comm(Grid3d::KSPACE,this,FORWARD_IK_PERATOM_ARITH,49,sizeof(FFT_SCALAR),
FORWARD_IK_PERATOM_ARITH,
gc6_buf1,gc6_buf2,MPI_FFT_SCALAR); gc6_buf1,gc6_buf2,MPI_FFT_SCALAR);
} }
@ -365,8 +361,8 @@ void PPPMDispDielectric::compute(int eflag, int vflag)
make_rho_none(); make_rho_none();
gc6->reverse_comm(Grid3d::KSPACE,this,nsplit_alloc,sizeof(FFT_SCALAR), gc6->reverse_comm(Grid3d::KSPACE,this,REVERSE_RHO_NONE,nsplit_alloc,sizeof(FFT_SCALAR),
REVERSE_RHO_NONE,gc6_buf1,gc6_buf2,MPI_FFT_SCALAR); gc6_buf1,gc6_buf2,MPI_FFT_SCALAR);
brick2fft_none(); brick2fft_none();
@ -380,14 +376,13 @@ void PPPMDispDielectric::compute(int eflag, int vflag)
n += 2; n += 2;
} }
gc6->forward_comm(Grid3d::KSPACE,this,1*nsplit_alloc,sizeof(FFT_SCALAR), gc6->forward_comm(Grid3d::KSPACE,this,FORWARD_AD_NONE,1*nsplit_alloc,sizeof(FFT_SCALAR),
FORWARD_AD_NONE,gc6_buf1,gc6_buf2,MPI_FFT_SCALAR); gc6_buf1,gc6_buf2,MPI_FFT_SCALAR);
fieldforce_none_ad(); fieldforce_none_ad();
if (vflag_atom) if (vflag_atom)
gc6->forward_comm(Grid3d::KSPACE,this,6*nsplit_alloc,sizeof(FFT_SCALAR), gc6->forward_comm(Grid3d::KSPACE,this,FORWARD_AD_PERATOM_NONE,6*nsplit_alloc,sizeof(FFT_SCALAR),
FORWARD_AD_PERATOM_NONE,
gc6_buf1,gc6_buf2,MPI_FFT_SCALAR); gc6_buf1,gc6_buf2,MPI_FFT_SCALAR);
} else { } else {
@ -401,14 +396,13 @@ void PPPMDispDielectric::compute(int eflag, int vflag)
n += 2; n += 2;
} }
gc6->forward_comm(Grid3d::KSPACE,this,3*nsplit_alloc,sizeof(FFT_SCALAR), gc6->forward_comm(Grid3d::KSPACE,this,FORWARD_IK_NONE,3*nsplit_alloc,sizeof(FFT_SCALAR),
FORWARD_IK_NONE,gc6_buf1,gc6_buf2,MPI_FFT_SCALAR); gc6_buf1,gc6_buf2,MPI_FFT_SCALAR);
fieldforce_none_ik(); fieldforce_none_ik();
if (evflag_atom) if (evflag_atom)
gc6->forward_comm(Grid3d::KSPACE,this,7*nsplit_alloc,sizeof(FFT_SCALAR), gc6->forward_comm(Grid3d::KSPACE,this,FORWARD_IK_PERATOM_NONE,7*nsplit_alloc,sizeof(FFT_SCALAR),
FORWARD_IK_PERATOM_NONE,
gc6_buf1,gc6_buf2,MPI_FFT_SCALAR); gc6_buf1,gc6_buf2,MPI_FFT_SCALAR);
} }

View File

@ -441,7 +441,7 @@ void PPPMElectrode::compute(int eflag, int vflag)
// TODO: this is dangerous now that compute_vector's interface has been // TODO: this is dangerous now that compute_vector's interface has been
// changed since a compute could call an arbitrary source, needs tightening // changed since a compute could call an arbitrary source, needs tightening
make_rho_in_brick(last_source_grpbit, density_brick, !last_invert_source); make_rho_in_brick(last_source_grpbit, density_brick, !last_invert_source);
gc->reverse_comm(Grid3d::KSPACE, this, 1, sizeof(FFT_SCALAR), REVERSE_RHO, gc_buf1, gc_buf2, gc->reverse_comm(Grid3d::KSPACE, this, REVERSE_RHO, 1, sizeof(FFT_SCALAR), gc_buf1, gc_buf2,
MPI_FFT_SCALAR); MPI_FFT_SCALAR);
for (int nz = nzlo_out; nz <= nzhi_out; nz++) for (int nz = nzlo_out; nz <= nzhi_out; nz++)
for (int ny = nylo_out; ny <= nyhi_out; ny++) for (int ny = nylo_out; ny <= nyhi_out; ny++)
@ -455,7 +455,7 @@ void PPPMElectrode::compute(int eflag, int vflag)
// to fully sum contribution in their 3d bricks // to fully sum contribution in their 3d bricks
// remap from 3d decomposition to FFT decomposition // remap from 3d decomposition to FFT decomposition
gc->reverse_comm(Grid3d::KSPACE, this, 1, sizeof(FFT_SCALAR), REVERSE_RHO, gc_buf1, gc_buf2, gc->reverse_comm(Grid3d::KSPACE, this, REVERSE_RHO, 1, sizeof(FFT_SCALAR), gc_buf1, gc_buf2,
MPI_FFT_SCALAR); MPI_FFT_SCALAR);
} }
@ -475,20 +475,20 @@ void PPPMElectrode::compute(int eflag, int vflag)
// to fill ghost cells surrounding their 3d bricks // to fill ghost cells surrounding their 3d bricks
if (differentiation_flag == 1) if (differentiation_flag == 1)
gc->forward_comm(Grid3d::KSPACE, this, 1, sizeof(FFT_SCALAR), FORWARD_AD, gc_buf1, gc_buf2, gc->forward_comm(Grid3d::KSPACE, this, FORWARD_AD, 1, sizeof(FFT_SCALAR), gc_buf1, gc_buf2,
MPI_FFT_SCALAR); MPI_FFT_SCALAR);
else else
gc->forward_comm(Grid3d::KSPACE, this, 3, sizeof(FFT_SCALAR), FORWARD_IK, gc_buf1, gc_buf2, gc->forward_comm(Grid3d::KSPACE, this, FORWARD_IK, 3, sizeof(FFT_SCALAR), gc_buf1, gc_buf2,
MPI_FFT_SCALAR); MPI_FFT_SCALAR);
// extra per-atom energy/virial communication // extra per-atom energy/virial communication
if (evflag_atom) { if (evflag_atom) {
if (differentiation_flag == 1 && vflag_atom) if (differentiation_flag == 1 && vflag_atom)
gc->forward_comm(Grid3d::KSPACE, this, 6, sizeof(FFT_SCALAR), FORWARD_AD_PERATOM, gc_buf1, gc->forward_comm(Grid3d::KSPACE, this, FORWARD_AD_PERATOM, 6, sizeof(FFT_SCALAR), gc_buf1,
gc_buf2, MPI_FFT_SCALAR); gc_buf2, MPI_FFT_SCALAR);
else if (differentiation_flag == 0) else if (differentiation_flag == 0)
gc->forward_comm(Grid3d::KSPACE, this, 7, sizeof(FFT_SCALAR), FORWARD_IK_PERATOM, gc_buf1, gc->forward_comm(Grid3d::KSPACE, this, FORWARD_IK_PERATOM, 7, sizeof(FFT_SCALAR), gc_buf1,
gc_buf2, MPI_FFT_SCALAR); gc_buf2, MPI_FFT_SCALAR);
} }
@ -586,7 +586,7 @@ void PPPMElectrode::compute_vector(double *vec, int sensor_grpbit, int source_gr
make_rho_in_brick(source_grpbit, electrolyte_density_brick, invert_source); make_rho_in_brick(source_grpbit, electrolyte_density_brick, invert_source);
density_brick = electrolyte_density_brick; density_brick = electrolyte_density_brick;
density_fft = electrolyte_density_fft; density_fft = electrolyte_density_fft;
gc->reverse_comm(Grid3d::KSPACE, this, 1, sizeof(FFT_SCALAR), REVERSE_RHO, gc_buf1, gc_buf2, gc->reverse_comm(Grid3d::KSPACE, this, REVERSE_RHO, 1, sizeof(FFT_SCALAR), gc_buf1, gc_buf2,
MPI_FFT_SCALAR); MPI_FFT_SCALAR);
brick2fft(); brick2fft();
// switch back pointers // switch back pointers
@ -614,7 +614,7 @@ void PPPMElectrode::compute_vector(double *vec, int sensor_grpbit, int source_gr
u_brick[k][j][i] = work2[n]; u_brick[k][j][i] = work2[n];
n += 2; n += 2;
} }
gc->forward_comm(Grid3d::KSPACE, this, 1, sizeof(FFT_SCALAR), FORWARD_AD, gc_buf1, gc_buf2, gc->forward_comm(Grid3d::KSPACE, this, FORWARD_AD, 1, sizeof(FFT_SCALAR), gc_buf1, gc_buf2,
MPI_FFT_SCALAR); MPI_FFT_SCALAR);
project_psi(vec, sensor_grpbit); project_psi(vec, sensor_grpbit);
compute_vector_called = true; compute_vector_called = true;

View File

@ -1,3 +1,4 @@
// clang-format off // clang-format off
/* ---------------------------------------------------------------------- /* ----------------------------------------------------------------------
LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator
@ -252,12 +253,12 @@ void PPPMGPU::compute(int eflag, int vflag)
// remap from 3d decomposition to FFT decomposition // remap from 3d decomposition to FFT decomposition
if (triclinic == 0) { if (triclinic == 0) {
gc->reverse_comm(Grid3d::KSPACE,this,1,sizeof(FFT_SCALAR), gc->reverse_comm(Grid3d::KSPACE,this,REVERSE_RHO_GPU,1,sizeof(FFT_SCALAR),
REVERSE_RHO_GPU,gc_buf1,gc_buf2,MPI_FFT_SCALAR); gc_buf1,gc_buf2,MPI_FFT_SCALAR);
brick2fft_gpu(); brick2fft_gpu();
} else { } else {
gc->reverse_comm(Grid3d::KSPACE,this,1,sizeof(FFT_SCALAR), gc->reverse_comm(Grid3d::KSPACE,this,REVERSE_RHO,1,sizeof(FFT_SCALAR),
REVERSE_RHO,gc_buf1,gc_buf2,MPI_FFT_SCALAR); gc_buf1,gc_buf2,MPI_FFT_SCALAR);
PPPM::brick2fft(); PPPM::brick2fft();
} }
@ -271,21 +272,21 @@ void PPPMGPU::compute(int eflag, int vflag)
// to fill ghost cells surrounding their 3d bricks // to fill ghost cells surrounding their 3d bricks
if (differentiation_flag == 1) if (differentiation_flag == 1)
gc->forward_comm(Grid3d::KSPACE,this,1,sizeof(FFT_SCALAR), gc->forward_comm(Grid3d::KSPACE,this,FORWARD_AD,1,sizeof(FFT_SCALAR),
FORWARD_AD,gc_buf1,gc_buf2,MPI_FFT_SCALAR); gc_buf1,gc_buf2,MPI_FFT_SCALAR);
else else
gc->forward_comm(Grid3d::KSPACE,this,3,sizeof(FFT_SCALAR), gc->forward_comm(Grid3d::KSPACE,this,FORWARD_IK,3,sizeof(FFT_SCALAR),
FORWARD_IK,gc_buf1,gc_buf2,MPI_FFT_SCALAR); gc_buf1,gc_buf2,MPI_FFT_SCALAR);
// extra per-atom energy/virial communication // extra per-atom energy/virial communication
if (evflag_atom) { if (evflag_atom) {
if (differentiation_flag == 1 && vflag_atom) if (differentiation_flag == 1 && vflag_atom)
gc->forward_comm(Grid3d::KSPACE,this,6,sizeof(FFT_SCALAR), gc->forward_comm(Grid3d::KSPACE,this,FORWARD_AD_PERATOM,6,sizeof(FFT_SCALAR),
FORWARD_AD_PERATOM,gc_buf1,gc_buf2,MPI_FFT_SCALAR); gc_buf1,gc_buf2,MPI_FFT_SCALAR);
else if (differentiation_flag == 0) else if (differentiation_flag == 0)
gc->forward_comm(Grid3d::KSPACE,this,7,sizeof(FFT_SCALAR), gc->forward_comm(Grid3d::KSPACE,this,FORWARD_IK_PERATOM,7,sizeof(FFT_SCALAR),
FORWARD_IK_PERATOM,gc_buf1,gc_buf2,MPI_FFT_SCALAR); gc_buf1,gc_buf2,MPI_FFT_SCALAR);
} }
poisson_time += platform::walltime()-t3; poisson_time += platform::walltime()-t3;
@ -828,8 +829,8 @@ void PPPMGPU::compute_group_group(int groupbit_A, int groupbit_B, int AA_flag)
density_brick = density_A_brick; density_brick = density_A_brick;
density_fft = density_A_fft; density_fft = density_A_fft;
gc->reverse_comm(Grid3d::KSPACE,this,1,sizeof(FFT_SCALAR), gc->reverse_comm(Grid3d::KSPACE,this,REVERSE_RHO,1,sizeof(FFT_SCALAR),
REVERSE_RHO,gc_buf1,gc_buf2,MPI_FFT_SCALAR); gc_buf1,gc_buf2,MPI_FFT_SCALAR);
brick2fft(); brick2fft();
// group B // group B
@ -837,8 +838,8 @@ void PPPMGPU::compute_group_group(int groupbit_A, int groupbit_B, int AA_flag)
density_brick = density_B_brick; density_brick = density_B_brick;
density_fft = density_B_fft; density_fft = density_B_fft;
gc->reverse_comm(Grid3d::KSPACE,this,1,sizeof(FFT_SCALAR), gc->reverse_comm(Grid3d::KSPACE,this,REVERSE_RHO,1,sizeof(FFT_SCALAR),
REVERSE_RHO,gc_buf1,gc_buf2,MPI_FFT_SCALAR); gc_buf1,gc_buf2,MPI_FFT_SCALAR);
brick2fft(); brick2fft();
// switch back pointers // switch back pointers

View File

@ -292,7 +292,7 @@ void PPPMDispIntel::compute(int eflag, int vflag)
make_rho_c<float,float>(fix->get_single_buffers()); make_rho_c<float,float>(fix->get_single_buffers());
} }
gc->reverse_comm(Grid3d::KSPACE,this,1,sizeof(FFT_SCALAR),REVERSE_RHO, gc->reverse_comm(Grid3d::KSPACE,this,REVERSE_RHO,1,sizeof(FFT_SCALAR),
gc_buf1,gc_buf2,MPI_FFT_SCALAR); gc_buf1,gc_buf2,MPI_FFT_SCALAR);
brick2fft(nxlo_in, nylo_in, nzlo_in, nxhi_in, nyhi_in, nzhi_in, brick2fft(nxlo_in, nylo_in, nzlo_in, nxhi_in, nyhi_in, nzhi_in,
@ -306,7 +306,7 @@ void PPPMDispIntel::compute(int eflag, int vflag)
energy_1, greensfn, virial_1, vg,vg2, u_brick, v0_brick, energy_1, greensfn, virial_1, vg,vg2, u_brick, v0_brick,
v1_brick, v2_brick, v3_brick, v4_brick, v5_brick); v1_brick, v2_brick, v3_brick, v4_brick, v5_brick);
gc->forward_comm(Grid3d::KSPACE,this,1,sizeof(FFT_SCALAR),FORWARD_AD, gc->forward_comm(Grid3d::KSPACE,this,FORWARD_AD,1,sizeof(FFT_SCALAR),
gc_buf1,gc_buf2,MPI_FFT_SCALAR); gc_buf1,gc_buf2,MPI_FFT_SCALAR);
if (fix->precision() == FixIntel::PREC_MODE_MIXED) { if (fix->precision() == FixIntel::PREC_MODE_MIXED) {
@ -318,8 +318,8 @@ void PPPMDispIntel::compute(int eflag, int vflag)
} }
if (vflag_atom) if (vflag_atom)
gc->forward_comm(Grid3d::KSPACE,this,6,sizeof(FFT_SCALAR), gc->forward_comm(Grid3d::KSPACE,this,FORWARD_AD_PERATOM,6,sizeof(FFT_SCALAR),
FORWARD_AD_PERATOM,gc_buf1,gc_buf2,MPI_FFT_SCALAR); gc_buf1,gc_buf2,MPI_FFT_SCALAR);
} else { } else {
poisson_ik(work1, work2, density_fft, fft1, fft2, poisson_ik(work1, work2, density_fft, fft1, fft2,
@ -331,7 +331,7 @@ void PPPMDispIntel::compute(int eflag, int vflag)
u_brick, v0_brick, v1_brick, v2_brick, v3_brick, v4_brick, u_brick, v0_brick, v1_brick, v2_brick, v3_brick, v4_brick,
v5_brick); v5_brick);
gc->forward_comm(Grid3d::KSPACE,this,3,sizeof(FFT_SCALAR),FORWARD_IK, gc->forward_comm(Grid3d::KSPACE,this,FORWARD_IK,3,sizeof(FFT_SCALAR),
gc_buf1,gc_buf2,MPI_FFT_SCALAR); gc_buf1,gc_buf2,MPI_FFT_SCALAR);
if (fix->precision() == FixIntel::PREC_MODE_MIXED) { if (fix->precision() == FixIntel::PREC_MODE_MIXED) {
@ -343,8 +343,8 @@ void PPPMDispIntel::compute(int eflag, int vflag)
} }
if (evflag_atom) if (evflag_atom)
gc->forward_comm(Grid3d::KSPACE,this,7,sizeof(FFT_SCALAR), gc->forward_comm(Grid3d::KSPACE,this,FORWARD_IK_PERATOM,7,sizeof(FFT_SCALAR),
FORWARD_IK_PERATOM,gc_buf1,gc_buf2,MPI_FFT_SCALAR); gc_buf1,gc_buf2,MPI_FFT_SCALAR);
} }
if (evflag_atom) fieldforce_c_peratom(); if (evflag_atom) fieldforce_c_peratom();
} }
@ -376,7 +376,7 @@ void PPPMDispIntel::compute(int eflag, int vflag)
make_rho_g<float,float>(fix->get_single_buffers()); make_rho_g<float,float>(fix->get_single_buffers());
} }
gc6->reverse_comm(Grid3d::KSPACE,this,1,sizeof(FFT_SCALAR),REVERSE_RHO_G, gc6->reverse_comm(Grid3d::KSPACE,this,REVERSE_RHO_G,1,sizeof(FFT_SCALAR),
gc6_buf1,gc6_buf2,MPI_FFT_SCALAR); gc6_buf1,gc6_buf2,MPI_FFT_SCALAR);
brick2fft(nxlo_in_6, nylo_in_6, nzlo_in_6, nxhi_in_6, nyhi_in_6, nzhi_in_6, brick2fft(nxlo_in_6, nylo_in_6, nzlo_in_6, nxhi_in_6, nyhi_in_6, nzhi_in_6,
@ -391,7 +391,7 @@ void PPPMDispIntel::compute(int eflag, int vflag)
virial_6, vg_6, vg2_6, u_brick_g, v0_brick_g, v1_brick_g, virial_6, vg_6, vg2_6, u_brick_g, v0_brick_g, v1_brick_g,
v2_brick_g, v3_brick_g, v4_brick_g, v5_brick_g); v2_brick_g, v3_brick_g, v4_brick_g, v5_brick_g);
gc6->forward_comm(Grid3d::KSPACE,this,1,sizeof(FFT_SCALAR),FORWARD_AD_G, gc6->forward_comm(Grid3d::KSPACE,this,FORWARD_AD_G,1,sizeof(FFT_SCALAR),
gc6_buf1,gc6_buf2,MPI_FFT_SCALAR); gc6_buf1,gc6_buf2,MPI_FFT_SCALAR);
if (fix->precision() == FixIntel::PREC_MODE_MIXED) { if (fix->precision() == FixIntel::PREC_MODE_MIXED) {
@ -403,8 +403,8 @@ void PPPMDispIntel::compute(int eflag, int vflag)
} }
if (vflag_atom) if (vflag_atom)
gc6->forward_comm(Grid3d::KSPACE,this,7,sizeof(FFT_SCALAR), gc6->forward_comm(Grid3d::KSPACE,this,FORWARD_AD_PERATOM_G,7,sizeof(FFT_SCALAR),
FORWARD_AD_PERATOM_G,gc6_buf1,gc6_buf2,MPI_FFT_SCALAR); gc6_buf1,gc6_buf2,MPI_FFT_SCALAR);
} else { } else {
poisson_ik(work1_6, work2_6, density_fft_g, fft1_6, fft2_6, poisson_ik(work1_6, work2_6, density_fft_g, fft1_6, fft2_6,
@ -416,7 +416,7 @@ void PPPMDispIntel::compute(int eflag, int vflag)
vdz_brick_g, virial_6, vg_6, vg2_6, u_brick_g, v0_brick_g, vdz_brick_g, virial_6, vg_6, vg2_6, u_brick_g, v0_brick_g,
v1_brick_g, v2_brick_g, v3_brick_g, v4_brick_g, v5_brick_g); v1_brick_g, v2_brick_g, v3_brick_g, v4_brick_g, v5_brick_g);
gc6->forward_comm(Grid3d::KSPACE,this,3,sizeof(FFT_SCALAR),FORWARD_IK_G, gc6->forward_comm(Grid3d::KSPACE,this,FORWARD_IK_G,3,sizeof(FFT_SCALAR),
gc6_buf1,gc6_buf2,MPI_FFT_SCALAR); gc6_buf1,gc6_buf2,MPI_FFT_SCALAR);
if (fix->precision() == FixIntel::PREC_MODE_MIXED) { if (fix->precision() == FixIntel::PREC_MODE_MIXED) {
@ -428,8 +428,8 @@ void PPPMDispIntel::compute(int eflag, int vflag)
} }
if (evflag_atom) if (evflag_atom)
gc6->forward_comm(Grid3d::KSPACE,this,6,sizeof(FFT_SCALAR), gc6->forward_comm(Grid3d::KSPACE,this,FORWARD_IK_PERATOM_G,6,sizeof(FFT_SCALAR),
FORWARD_IK_PERATOM_G,gc6_buf1,gc6_buf2,MPI_FFT_SCALAR); gc6_buf1,gc6_buf2,MPI_FFT_SCALAR);
} }
if (evflag_atom) fieldforce_g_peratom(); if (evflag_atom) fieldforce_g_peratom();
@ -461,7 +461,7 @@ void PPPMDispIntel::compute(int eflag, int vflag)
make_rho_a<float,float>(fix->get_single_buffers()); make_rho_a<float,float>(fix->get_single_buffers());
} }
gc->reverse_comm(Grid3d::KSPACE,this,7,sizeof(FFT_SCALAR),REVERSE_RHO_A, gc->reverse_comm(Grid3d::KSPACE,this,REVERSE_RHO_A,7,sizeof(FFT_SCALAR),
gc_buf1,gc_buf2,MPI_FFT_SCALAR); gc_buf1,gc_buf2,MPI_FFT_SCALAR);
brick2fft_a(); brick2fft_a();
@ -487,7 +487,7 @@ void PPPMDispIntel::compute(int eflag, int vflag)
v5_brick_a2, u_brick_a4, v0_brick_a4, v1_brick_a4, v5_brick_a2, u_brick_a4, v0_brick_a4, v1_brick_a4,
v2_brick_a4, v3_brick_a4, v4_brick_a4, v5_brick_a4); v2_brick_a4, v3_brick_a4, v4_brick_a4, v5_brick_a4);
gc6->forward_comm(Grid3d::KSPACE,this,7,sizeof(FFT_SCALAR),FORWARD_AD_A, gc6->forward_comm(Grid3d::KSPACE,this,FORWARD_AD_A,7,sizeof(FFT_SCALAR),
gc6_buf1,gc6_buf2,MPI_FFT_SCALAR); gc6_buf1,gc6_buf2,MPI_FFT_SCALAR);
if (fix->precision() == FixIntel::PREC_MODE_MIXED) { if (fix->precision() == FixIntel::PREC_MODE_MIXED) {
@ -499,8 +499,8 @@ void PPPMDispIntel::compute(int eflag, int vflag)
} }
if (evflag_atom) if (evflag_atom)
gc6->forward_comm(Grid3d::KSPACE,this,42,sizeof(FFT_SCALAR), gc6->forward_comm(Grid3d::KSPACE,this,FORWARD_AD_PERATOM_A,42,sizeof(FFT_SCALAR),
FORWARD_AD_PERATOM_A,gc6_buf1,gc6_buf2,MPI_FFT_SCALAR); gc6_buf1,gc6_buf2,MPI_FFT_SCALAR);
} else { } else {
poisson_ik(work1_6, work2_6, density_fft_a3, fft1_6, fft2_6, poisson_ik(work1_6, work2_6, density_fft_a3, fft1_6, fft2_6,
@ -530,7 +530,7 @@ void PPPMDispIntel::compute(int eflag, int vflag)
u_brick_a4, v0_brick_a4, v1_brick_a4, v2_brick_a4, u_brick_a4, v0_brick_a4, v1_brick_a4, v2_brick_a4,
v3_brick_a4, v4_brick_a4, v5_brick_a4); v3_brick_a4, v4_brick_a4, v5_brick_a4);
gc6->forward_comm(Grid3d::KSPACE,this,18,sizeof(FFT_SCALAR),FORWARD_IK_A, gc6->forward_comm(Grid3d::KSPACE,this,FORWARD_IK_A,18,sizeof(FFT_SCALAR),
gc6_buf1,gc6_buf2,MPI_FFT_SCALAR); gc6_buf1,gc6_buf2,MPI_FFT_SCALAR);
if (fix->precision() == FixIntel::PREC_MODE_MIXED) { if (fix->precision() == FixIntel::PREC_MODE_MIXED) {
@ -542,8 +542,8 @@ void PPPMDispIntel::compute(int eflag, int vflag)
} }
if (evflag_atom) if (evflag_atom)
gc6->forward_comm(Grid3d::KSPACE,this,49,sizeof(FFT_SCALAR), gc6->forward_comm(Grid3d::KSPACE,this,FORWARD_IK_PERATOM_A,49,sizeof(FFT_SCALAR),
FORWARD_IK_PERATOM_A,gc6_buf1,gc6_buf2,MPI_FFT_SCALAR); gc6_buf1,gc6_buf2,MPI_FFT_SCALAR);
} }
if (evflag_atom) fieldforce_a_peratom(); if (evflag_atom) fieldforce_a_peratom();
@ -576,7 +576,7 @@ void PPPMDispIntel::compute(int eflag, int vflag)
make_rho_none<float,float>(fix->get_single_buffers()); make_rho_none<float,float>(fix->get_single_buffers());
} }
gc->reverse_comm(Grid3d::KSPACE,this,1,sizeof(FFT_SCALAR),REVERSE_RHO_NONE, gc->reverse_comm(Grid3d::KSPACE,this,REVERSE_RHO_NONE,1,sizeof(FFT_SCALAR),
gc_buf1,gc_buf2,MPI_FFT_SCALAR); gc_buf1,gc_buf2,MPI_FFT_SCALAR);
brick2fft_none(); brick2fft_none();
@ -592,8 +592,8 @@ void PPPMDispIntel::compute(int eflag, int vflag)
n += 2; n += 2;
} }
gc6->forward_comm(Grid3d::KSPACE,this,1,sizeof(FFT_SCALAR), gc6->forward_comm(Grid3d::KSPACE,this,FORWARD_AD_NONE,1,sizeof(FFT_SCALAR),
FORWARD_AD_NONE,gc6_buf1,gc6_buf2,MPI_FFT_SCALAR); gc6_buf1,gc6_buf2,MPI_FFT_SCALAR);
if (fix->precision() == FixIntel::PREC_MODE_MIXED) { if (fix->precision() == FixIntel::PREC_MODE_MIXED) {
fieldforce_none_ad<float,double>(fix->get_mixed_buffers()); fieldforce_none_ad<float,double>(fix->get_mixed_buffers());
@ -604,8 +604,7 @@ void PPPMDispIntel::compute(int eflag, int vflag)
} }
if (vflag_atom) if (vflag_atom)
gc6->forward_comm(Grid3d::KSPACE,this,6,sizeof(FFT_SCALAR), gc6->forward_comm(Grid3d::KSPACE,this,FORWARD_AD_PERATOM_NONE,6,sizeof(FFT_SCALAR),
FORWARD_AD_PERATOM_NONE,
gc6_buf1,gc6_buf2,MPI_FFT_SCALAR); gc6_buf1,gc6_buf2,MPI_FFT_SCALAR);
} else { } else {
@ -622,8 +621,7 @@ void PPPMDispIntel::compute(int eflag, int vflag)
n += 2; n += 2;
} }
gc6->forward_comm(Grid3d::KSPACE,this,3,sizeof(FFT_SCALAR), gc6->forward_comm(Grid3d::KSPACE,this,FORWARD_IK_NONE,3,sizeof(FFT_SCALAR),
FORWARD_IK_NONE,
gc6_buf1,gc6_buf2,MPI_FFT_SCALAR); gc6_buf1,gc6_buf2,MPI_FFT_SCALAR);
if (fix->precision() == FixIntel::PREC_MODE_MIXED) { if (fix->precision() == FixIntel::PREC_MODE_MIXED) {
@ -635,8 +633,7 @@ void PPPMDispIntel::compute(int eflag, int vflag)
} }
if (evflag_atom) if (evflag_atom)
gc6->forward_comm(Grid3d::KSPACE,this,7,sizeof(FFT_SCALAR), gc6->forward_comm(Grid3d::KSPACE,this,FORWARD_IK_PERATOM_NONE,7,sizeof(FFT_SCALAR),
FORWARD_IK_PERATOM_NONE,
gc6_buf1,gc6_buf2,MPI_FFT_SCALAR); gc6_buf1,gc6_buf2,MPI_FFT_SCALAR);
} }

View File

@ -210,7 +210,7 @@ void PPPMElectrodeIntel::compute(int eflag, int vflag)
make_rho_in_brick<float, float>(fix->get_single_buffers(), last_source_grpbit, make_rho_in_brick<float, float>(fix->get_single_buffers(), last_source_grpbit,
density_brick, !last_invert_source); density_brick, !last_invert_source);
} }
gc->reverse_comm(Grid3d::KSPACE, this, 1, sizeof(FFT_SCALAR), REVERSE_RHO, gc_buf1, gc_buf2, gc->reverse_comm(Grid3d::KSPACE, this, REVERSE_RHO, 1, sizeof(FFT_SCALAR), gc_buf1, gc_buf2,
MPI_FFT_SCALAR); MPI_FFT_SCALAR);
for (int nz = nzlo_out; nz <= nzhi_out; nz++) for (int nz = nzlo_out; nz <= nzhi_out; nz++)
for (int ny = nylo_out; ny <= nyhi_out; ny++) for (int ny = nylo_out; ny <= nyhi_out; ny++)
@ -232,7 +232,7 @@ void PPPMElectrodeIntel::compute(int eflag, int vflag)
// to fully sum contribution in their 3d bricks // to fully sum contribution in their 3d bricks
// remap from 3d decomposition to FFT decomposition // remap from 3d decomposition to FFT decomposition
gc->reverse_comm(Grid3d::KSPACE, this, 1, sizeof(FFT_SCALAR), REVERSE_RHO, gc_buf1, gc_buf2, gc->reverse_comm(Grid3d::KSPACE, this, REVERSE_RHO, 1, sizeof(FFT_SCALAR), gc_buf1, gc_buf2,
MPI_FFT_SCALAR); MPI_FFT_SCALAR);
} }
@ -252,20 +252,20 @@ void PPPMElectrodeIntel::compute(int eflag, int vflag)
// to fill ghost cells surrounding their 3d bricks // to fill ghost cells surrounding their 3d bricks
if (differentiation_flag == 1) if (differentiation_flag == 1)
gc->forward_comm(Grid3d::KSPACE, this, 1, sizeof(FFT_SCALAR), FORWARD_AD, gc_buf1, gc_buf2, gc->forward_comm(Grid3d::KSPACE, this, FORWARD_AD, 1, sizeof(FFT_SCALAR), gc_buf1, gc_buf2,
MPI_FFT_SCALAR); MPI_FFT_SCALAR);
else else
gc->forward_comm(Grid3d::KSPACE, this, 3, sizeof(FFT_SCALAR), FORWARD_IK, gc_buf1, gc_buf2, gc->forward_comm(Grid3d::KSPACE, this, FORWARD_IK, 3, sizeof(FFT_SCALAR), gc_buf1, gc_buf2,
MPI_FFT_SCALAR); MPI_FFT_SCALAR);
// extra per-atom energy/virial communication // extra per-atom energy/virial communication
if (evflag_atom) { if (evflag_atom) {
if (differentiation_flag == 1 && vflag_atom) if (differentiation_flag == 1 && vflag_atom)
gc->forward_comm(Grid3d::KSPACE, this, 6, sizeof(FFT_SCALAR), FORWARD_AD_PERATOM, gc_buf1, gc->forward_comm(Grid3d::KSPACE, this, FORWARD_AD_PERATOM, 6, sizeof(FFT_SCALAR), gc_buf1,
gc_buf2, MPI_FFT_SCALAR); gc_buf2, MPI_FFT_SCALAR);
else if (differentiation_flag == 0) else if (differentiation_flag == 0)
gc->forward_comm(Grid3d::KSPACE, this, 7, sizeof(FFT_SCALAR), FORWARD_IK_PERATOM, gc_buf1, gc->forward_comm(Grid3d::KSPACE, this, FORWARD_IK_PERATOM, 7, sizeof(FFT_SCALAR), gc_buf1,
gc_buf2, MPI_FFT_SCALAR); gc_buf2, MPI_FFT_SCALAR);
} }
int tempslabflag = slabflag; int tempslabflag = slabflag;
@ -340,7 +340,7 @@ void PPPMElectrodeIntel::compute_vector(double *vec, int sensor_grpbit, int sour
} }
density_brick = electrolyte_density_brick; density_brick = electrolyte_density_brick;
density_fft = electrolyte_density_fft; density_fft = electrolyte_density_fft;
gc->reverse_comm(Grid3d::KSPACE, this, 1, sizeof(FFT_SCALAR), REVERSE_RHO, gc_buf1, gc_buf2, gc->reverse_comm(Grid3d::KSPACE, this, REVERSE_RHO, 1, sizeof(FFT_SCALAR), gc_buf1, gc_buf2,
MPI_FFT_SCALAR); MPI_FFT_SCALAR);
brick2fft(); brick2fft();
// switch back pointers // switch back pointers
@ -370,7 +370,7 @@ void PPPMElectrodeIntel::compute_vector(double *vec, int sensor_grpbit, int sour
n += 2; n += 2;
} }
gc->forward_comm(Grid3d::KSPACE, this, 1, sizeof(FFT_SCALAR), FORWARD_AD, gc_buf1, gc_buf2, gc->forward_comm(Grid3d::KSPACE, this, FORWARD_AD, 1, sizeof(FFT_SCALAR), gc_buf1, gc_buf2,
MPI_FFT_SCALAR); MPI_FFT_SCALAR);
switch (fix->precision()) { switch (fix->precision()) {

View File

@ -227,7 +227,7 @@ void PPPMIntel::compute_first(int eflag, int vflag)
// to fully sum contribution in their 3d bricks // to fully sum contribution in their 3d bricks
// remap from 3d decomposition to FFT decomposition // remap from 3d decomposition to FFT decomposition
gc->reverse_comm(Grid3d::KSPACE,this,1,sizeof(FFT_SCALAR),REVERSE_RHO, gc->reverse_comm(Grid3d::KSPACE,this,REVERSE_RHO,1,sizeof(FFT_SCALAR),
gc_buf1,gc_buf2,MPI_FFT_SCALAR); gc_buf1,gc_buf2,MPI_FFT_SCALAR);
brick2fft(); brick2fft();
@ -243,21 +243,21 @@ void PPPMIntel::compute_first(int eflag, int vflag)
// to fill ghost cells surrounding their 3d bricks // to fill ghost cells surrounding their 3d bricks
if (differentiation_flag == 1) if (differentiation_flag == 1)
gc->forward_comm(Grid3d::KSPACE,this,1,sizeof(FFT_SCALAR),FORWARD_AD, gc->forward_comm(Grid3d::KSPACE,this,FORWARD_AD,1,sizeof(FFT_SCALAR),
gc_buf1,gc_buf2,MPI_FFT_SCALAR); gc_buf1,gc_buf2,MPI_FFT_SCALAR);
else else
gc->forward_comm(Grid3d::KSPACE,this,3,sizeof(FFT_SCALAR),FORWARD_IK, gc->forward_comm(Grid3d::KSPACE,this,FORWARD_IK,3,sizeof(FFT_SCALAR),
gc_buf1,gc_buf2,MPI_FFT_SCALAR); gc_buf1,gc_buf2,MPI_FFT_SCALAR);
// extra per-atom energy/virial communication // extra per-atom energy/virial communication
if (evflag_atom) { if (evflag_atom) {
if (differentiation_flag == 1 && vflag_atom) if (differentiation_flag == 1 && vflag_atom)
gc->forward_comm(Grid3d::KSPACE,this,6,sizeof(FFT_SCALAR), gc->forward_comm(Grid3d::KSPACE,this,FORWARD_AD_PERATOM,6,sizeof(FFT_SCALAR),
FORWARD_AD_PERATOM,gc_buf1,gc_buf2,MPI_FFT_SCALAR); gc_buf1,gc_buf2,MPI_FFT_SCALAR);
else if (differentiation_flag == 0) else if (differentiation_flag == 0)
gc->forward_comm(Grid3d::KSPACE,this,7,sizeof(FFT_SCALAR), gc->forward_comm(Grid3d::KSPACE,this,FORWARD_IK_PERATOM,7,sizeof(FFT_SCALAR),
FORWARD_IK_PERATOM,gc_buf1,gc_buf2,MPI_FFT_SCALAR); gc_buf1,gc_buf2,MPI_FFT_SCALAR);
} }
} }

View File

@ -655,13 +655,13 @@ void Grid3dKokkos<DeviceType>::setup_tiled(int &nbuf1, int &nbuf2)
------------------------------------------------------------------------- */ ------------------------------------------------------------------------- */
template<class DeviceType> template<class DeviceType>
void Grid3dKokkos<DeviceType>::forward_comm_kspace(KSpace *kspace, int nper, int which, void Grid3dKokkos<DeviceType>::forward_comm_kspace(KSpace *kspace, int which, int nper,
FFT_DAT::tdual_FFT_SCALAR_1d &k_buf1, FFT_DAT::tdual_FFT_SCALAR_1d &k_buf2, MPI_Datatype datatype) FFT_DAT::tdual_FFT_SCALAR_1d &k_buf1, FFT_DAT::tdual_FFT_SCALAR_1d &k_buf2, MPI_Datatype datatype)
{ {
if (layout == REGULAR) if (layout == REGULAR)
forward_comm_kspace_regular(kspace,nper,which,k_buf1,k_buf2,datatype); forward_comm_kspace_regular(kspace,which,nper,k_buf1,k_buf2,datatype);
else else
forward_comm_kspace_tiled(kspace,nper,which,k_buf1,k_buf2,datatype); forward_comm_kspace_tiled(kspace,which,nper,k_buf1,k_buf2,datatype);
} }
/* ---------------------------------------------------------------------- /* ----------------------------------------------------------------------
@ -670,7 +670,7 @@ void Grid3dKokkos<DeviceType>::forward_comm_kspace(KSpace *kspace, int nper, int
template<class DeviceType> template<class DeviceType>
void Grid3dKokkos<DeviceType>:: void Grid3dKokkos<DeviceType>::
forward_comm_kspace_regular(KSpace *kspace, int nper, int which, forward_comm_kspace_regular(KSpace *kspace, int which, int nper,
FFT_DAT::tdual_FFT_SCALAR_1d &k_buf1, FFT_DAT::tdual_FFT_SCALAR_1d &k_buf2, MPI_Datatype datatype) FFT_DAT::tdual_FFT_SCALAR_1d &k_buf1, FFT_DAT::tdual_FFT_SCALAR_1d &k_buf2, MPI_Datatype datatype)
{ {
int m; int m;
@ -724,7 +724,7 @@ forward_comm_kspace_regular(KSpace *kspace, int nper, int which,
template<class DeviceType> template<class DeviceType>
void Grid3dKokkos<DeviceType>:: void Grid3dKokkos<DeviceType>::
forward_comm_kspace_tiled(KSpace *kspace, int nper, int which, forward_comm_kspace_tiled(KSpace *kspace, int which, int nper,
FFT_DAT::tdual_FFT_SCALAR_1d &k_buf1, FFT_DAT::tdual_FFT_SCALAR_1d &k_buf2, MPI_Datatype datatype) FFT_DAT::tdual_FFT_SCALAR_1d &k_buf1, FFT_DAT::tdual_FFT_SCALAR_1d &k_buf2, MPI_Datatype datatype)
{ {
int i,m,offset; int i,m,offset;
@ -791,13 +791,13 @@ forward_comm_kspace_tiled(KSpace *kspace, int nper, int which,
------------------------------------------------------------------------- */ ------------------------------------------------------------------------- */
template<class DeviceType> template<class DeviceType>
void Grid3dKokkos<DeviceType>::reverse_comm_kspace(KSpace *kspace, int nper, int which, void Grid3dKokkos<DeviceType>::reverse_comm_kspace(KSpace *kspace, int which, int nper,
FFT_DAT::tdual_FFT_SCALAR_1d &k_buf1, FFT_DAT::tdual_FFT_SCALAR_1d &k_buf2, MPI_Datatype datatype) FFT_DAT::tdual_FFT_SCALAR_1d &k_buf1, FFT_DAT::tdual_FFT_SCALAR_1d &k_buf2, MPI_Datatype datatype)
{ {
if (layout == REGULAR) if (layout == REGULAR)
reverse_comm_kspace_regular(kspace,nper,which,k_buf1,k_buf2,datatype); reverse_comm_kspace_regular(kspace,which,nper,k_buf1,k_buf2,datatype);
else else
reverse_comm_kspace_tiled(kspace,nper,which,k_buf1,k_buf2,datatype); reverse_comm_kspace_tiled(kspace,which,nper,k_buf1,k_buf2,datatype);
} }
/* ---------------------------------------------------------------------- /* ----------------------------------------------------------------------
@ -806,7 +806,7 @@ void Grid3dKokkos<DeviceType>::reverse_comm_kspace(KSpace *kspace, int nper, int
template<class DeviceType> template<class DeviceType>
void Grid3dKokkos<DeviceType>:: void Grid3dKokkos<DeviceType>::
reverse_comm_kspace_regular(KSpace *kspace, int nper, int which, reverse_comm_kspace_regular(KSpace *kspace, int which, int nper,
FFT_DAT::tdual_FFT_SCALAR_1d &k_buf1, FFT_DAT::tdual_FFT_SCALAR_1d &k_buf2, MPI_Datatype datatype) FFT_DAT::tdual_FFT_SCALAR_1d &k_buf1, FFT_DAT::tdual_FFT_SCALAR_1d &k_buf2, MPI_Datatype datatype)
{ {
int m; int m;
@ -861,7 +861,7 @@ reverse_comm_kspace_regular(KSpace *kspace, int nper, int which,
template<class DeviceType> template<class DeviceType>
void Grid3dKokkos<DeviceType>:: void Grid3dKokkos<DeviceType>::
reverse_comm_kspace_tiled(KSpace *kspace, int nper, int which, reverse_comm_kspace_tiled(KSpace *kspace, int which, int nper,
FFT_DAT::tdual_FFT_SCALAR_1d &k_buf1, FFT_DAT::tdual_FFT_SCALAR_1d &k_buf2, MPI_Datatype datatype) FFT_DAT::tdual_FFT_SCALAR_1d &k_buf1, FFT_DAT::tdual_FFT_SCALAR_1d &k_buf2, MPI_Datatype datatype)
{ {
int i,m,offset; int i,m,offset;

View File

@ -444,8 +444,8 @@ void MSM::compute(int eflag, int vflag)
// to fully sum contribution in their 3d grid // to fully sum contribution in their 3d grid
current_level = 0; current_level = 0;
gcall->reverse_comm(Grid3d::KSPACE,this,1,sizeof(double), gcall->reverse_comm(Grid3d::KSPACE,this,REVERSE_RHO,1,sizeof(double),
REVERSE_RHO,gcall_buf1,gcall_buf2,MPI_DOUBLE); gcall_buf1,gcall_buf2,MPI_DOUBLE);
// forward communicate charge density values to fill ghost grid points // forward communicate charge density values to fill ghost grid points
// compute direct sum interaction and then restrict to coarser grid // compute direct sum interaction and then restrict to coarser grid
@ -453,8 +453,8 @@ void MSM::compute(int eflag, int vflag)
for (int n=0; n<=levels-2; n++) { for (int n=0; n<=levels-2; n++) {
if (!active_flag[n]) continue; if (!active_flag[n]) continue;
current_level = n; current_level = n;
gc[n]->forward_comm(Grid3d::KSPACE,this,1,sizeof(double), gc[n]->forward_comm(Grid3d::KSPACE,this,FORWARD_RHO,1,sizeof(double),
FORWARD_RHO,gc_buf1[n],gc_buf2[n],MPI_DOUBLE); gc_buf1[n],gc_buf2[n],MPI_DOUBLE);
direct(n); direct(n);
restriction(n); restriction(n);
} }
@ -466,16 +466,16 @@ void MSM::compute(int eflag, int vflag)
if (domain->nonperiodic) { if (domain->nonperiodic) {
current_level = levels-1; current_level = levels-1;
gc[levels-1]-> gc[levels-1]->
forward_comm(Grid3d::KSPACE,this,1,sizeof(double), forward_comm(Grid3d::KSPACE,this,FORWARD_RHO,1,sizeof(double),
FORWARD_RHO,gc_buf1[levels-1],gc_buf2[levels-1],MPI_DOUBLE); gc_buf1[levels-1],gc_buf2[levels-1],MPI_DOUBLE);
direct_top(levels-1); direct_top(levels-1);
gc[levels-1]-> gc[levels-1]->
reverse_comm(Grid3d::KSPACE,this,1,sizeof(double), reverse_comm(Grid3d::KSPACE,this,REVERSE_AD,1,sizeof(double),
REVERSE_AD,gc_buf1[levels-1],gc_buf2[levels-1],MPI_DOUBLE); gc_buf1[levels-1],gc_buf2[levels-1],MPI_DOUBLE);
if (vflag_atom) if (vflag_atom)
gc[levels-1]-> gc[levels-1]->
reverse_comm(Grid3d::KSPACE,this,6,sizeof(double), reverse_comm(Grid3d::KSPACE,this,REVERSE_AD_PERATOM,6,sizeof(double),
REVERSE_AD_PERATOM,gc_buf1[levels-1],gc_buf2[levels-1],MPI_DOUBLE); gc_buf1[levels-1],gc_buf2[levels-1],MPI_DOUBLE);
} else { } else {
// Here using MPI_Allreduce is cheaper than using commgrid // Here using MPI_Allreduce is cheaper than using commgrid
@ -485,8 +485,8 @@ void MSM::compute(int eflag, int vflag)
current_level = levels-1; current_level = levels-1;
if (vflag_atom) if (vflag_atom)
gc[levels-1]-> gc[levels-1]->
reverse_comm(Grid3d::KSPACE,this,6,sizeof(double), reverse_comm(Grid3d::KSPACE,this,REVERSE_AD_PERATOM,6,sizeof(double),
REVERSE_AD_PERATOM,gc_buf1[levels-1],gc_buf2[levels-1],MPI_DOUBLE); gc_buf1[levels-1],gc_buf2[levels-1],MPI_DOUBLE);
} }
} }
@ -498,28 +498,28 @@ void MSM::compute(int eflag, int vflag)
prolongation(n); prolongation(n);
current_level = n; current_level = n;
gc[n]->reverse_comm(Grid3d::KSPACE,this,1,sizeof(double), gc[n]->reverse_comm(Grid3d::KSPACE,this,REVERSE_AD,1,sizeof(double),
REVERSE_AD,gc_buf1[n],gc_buf2[n],MPI_DOUBLE); gc_buf1[n],gc_buf2[n],MPI_DOUBLE);
// extra per-atom virial communication // extra per-atom virial communication
if (vflag_atom) if (vflag_atom)
gc[n]->reverse_comm(Grid3d::KSPACE,this,6,sizeof(double), gc[n]->reverse_comm(Grid3d::KSPACE,this,REVERSE_AD_PERATOM,6,sizeof(double),
REVERSE_AD_PERATOM,gc_buf1[n],gc_buf2[n],MPI_DOUBLE); gc_buf1[n],gc_buf2[n],MPI_DOUBLE);
} }
// all procs communicate E-field values // all procs communicate E-field values
// to fill ghost cells surrounding their 3d bricks // to fill ghost cells surrounding their 3d bricks
current_level = 0; current_level = 0;
gcall->forward_comm(Grid3d::KSPACE,this,1,sizeof(double), gcall->forward_comm(Grid3d::KSPACE,this,FORWARD_AD,1,sizeof(double),
FORWARD_AD,gcall_buf1,gcall_buf2,MPI_DOUBLE); gcall_buf1,gcall_buf2,MPI_DOUBLE);
// extra per-atom energy/virial communication // extra per-atom energy/virial communication
if (vflag_atom) if (vflag_atom)
gcall->forward_comm(Grid3d::KSPACE,this,6,sizeof(double), gcall->forward_comm(Grid3d::KSPACE,this,FORWARD_AD_PERATOM,6,sizeof(double),
FORWARD_AD_PERATOM,gcall_buf1,gcall_buf2,MPI_DOUBLE); gcall_buf1,gcall_buf2,MPI_DOUBLE);
// calculate the force on my particles (interpolation) // calculate the force on my particles (interpolation)

View File

@ -160,8 +160,8 @@ void MSMCG::compute(int eflag, int vflag)
// to fully sum contribution in their 3d grid // to fully sum contribution in their 3d grid
current_level = 0; current_level = 0;
gcall->reverse_comm(Grid3d::KSPACE,this,1,sizeof(double), gcall->reverse_comm(Grid3d::KSPACE,this,REVERSE_RHO,1,sizeof(double),
REVERSE_RHO,gcall_buf1,gcall_buf2,MPI_DOUBLE); gcall_buf1,gcall_buf2,MPI_DOUBLE);
// forward communicate charge density values to fill ghost grid points // forward communicate charge density values to fill ghost grid points
// compute direct sum interaction and then restrict to coarser grid // compute direct sum interaction and then restrict to coarser grid
@ -169,8 +169,8 @@ void MSMCG::compute(int eflag, int vflag)
for (n=0; n<=levels-2; n++) { for (n=0; n<=levels-2; n++) {
if (!active_flag[n]) continue; if (!active_flag[n]) continue;
current_level = n; current_level = n;
gc[n]->forward_comm(Grid3d::KSPACE,this,1,sizeof(double), gc[n]->forward_comm(Grid3d::KSPACE,this,FORWARD_RHO,1,sizeof(double),
FORWARD_RHO,gc_buf1[n],gc_buf2[n],MPI_DOUBLE); gc_buf1[n],gc_buf2[n],MPI_DOUBLE);
direct(n); direct(n);
restriction(n); restriction(n);
} }
@ -182,16 +182,16 @@ void MSMCG::compute(int eflag, int vflag)
if (domain->nonperiodic) { if (domain->nonperiodic) {
current_level = levels-1; current_level = levels-1;
gc[levels-1]-> gc[levels-1]->
forward_comm(Grid3d::KSPACE,this,1,sizeof(double), forward_comm(Grid3d::KSPACE,this,FORWARD_RHO,1,sizeof(double),
FORWARD_RHO,gc_buf1[levels-1],gc_buf2[levels-1],MPI_DOUBLE); gc_buf1[levels-1],gc_buf2[levels-1],MPI_DOUBLE);
direct_top(levels-1); direct_top(levels-1);
gc[levels-1]-> gc[levels-1]->
reverse_comm(Grid3d::KSPACE,this,1,sizeof(double), reverse_comm(Grid3d::KSPACE,this,REVERSE_AD,1,sizeof(double),
REVERSE_AD,gc_buf1[levels-1],gc_buf2[levels-1],MPI_DOUBLE); gc_buf1[levels-1],gc_buf2[levels-1],MPI_DOUBLE);
if (vflag_atom) if (vflag_atom)
gc[levels-1]-> gc[levels-1]->
reverse_comm(Grid3d::KSPACE,this,6,sizeof(double), reverse_comm(Grid3d::KSPACE,this,REVERSE_AD_PERATOM,6,sizeof(double),
REVERSE_AD_PERATOM,gc_buf1[levels-1],gc_buf2[levels-1],MPI_DOUBLE); gc_buf1[levels-1],gc_buf2[levels-1],MPI_DOUBLE);
} else { } else {
// Here using MPI_Allreduce is cheaper than using commgrid // Here using MPI_Allreduce is cheaper than using commgrid
@ -201,8 +201,8 @@ void MSMCG::compute(int eflag, int vflag)
current_level = levels-1; current_level = levels-1;
if (vflag_atom) if (vflag_atom)
gc[levels-1]-> gc[levels-1]->
reverse_comm(Grid3d::KSPACE,this,6,sizeof(double), reverse_comm(Grid3d::KSPACE,this,REVERSE_AD_PERATOM,6,sizeof(double),
REVERSE_AD_PERATOM,gc_buf1[levels-1],gc_buf2[levels-1],MPI_DOUBLE); gc_buf1[levels-1],gc_buf2[levels-1],MPI_DOUBLE);
} }
} }
@ -214,28 +214,28 @@ void MSMCG::compute(int eflag, int vflag)
prolongation(n); prolongation(n);
current_level = n; current_level = n;
gc[n]->reverse_comm(Grid3d::KSPACE,this,1,sizeof(double), gc[n]->reverse_comm(Grid3d::KSPACE,this,REVERSE_AD,1,sizeof(double),
REVERSE_AD,gc_buf1[n],gc_buf2[n],MPI_DOUBLE); gc_buf1[n],gc_buf2[n],MPI_DOUBLE);
// extra per-atom virial communication // extra per-atom virial communication
if (vflag_atom) if (vflag_atom)
gc[n]->reverse_comm(Grid3d::KSPACE,this,6,sizeof(double), gc[n]->reverse_comm(Grid3d::KSPACE,this,REVERSE_AD_PERATOM,6,sizeof(double),
REVERSE_AD_PERATOM,gc_buf1[n],gc_buf2[n],MPI_DOUBLE); gc_buf1[n],gc_buf2[n],MPI_DOUBLE);
} }
// all procs communicate E-field values // all procs communicate E-field values
// to fill ghost cells surrounding their 3d bricks // to fill ghost cells surrounding their 3d bricks
current_level = 0; current_level = 0;
gcall->forward_comm(Grid3d::KSPACE,this,1,sizeof(double), gcall->forward_comm(Grid3d::KSPACE,this,FORWARD_AD,1,sizeof(double),
FORWARD_AD,gcall_buf1,gcall_buf2,MPI_DOUBLE); gcall_buf1,gcall_buf2,MPI_DOUBLE);
// extra per-atom energy/virial communication // extra per-atom energy/virial communication
if (vflag_atom) if (vflag_atom)
gcall->forward_comm(Grid3d::KSPACE,this,6,sizeof(double), gcall->forward_comm(Grid3d::KSPACE,this,FORWARD_AD_PERATOM,6,sizeof(double),
FORWARD_AD_PERATOM,gcall_buf1,gcall_buf2,MPI_DOUBLE); gcall_buf1,gcall_buf2,MPI_DOUBLE);
// calculate the force on my particles (interpolation) // calculate the force on my particles (interpolation)

View File

@ -640,8 +640,8 @@ void PPPM::compute(int eflag, int vflag)
// to fully sum contribution in their 3d bricks // to fully sum contribution in their 3d bricks
// remap from 3d decomposition to FFT decomposition // remap from 3d decomposition to FFT decomposition
gc->reverse_comm(Grid3d::KSPACE,this,1,sizeof(FFT_SCALAR), gc->reverse_comm(Grid3d::KSPACE,this,REVERSE_RHO,1,sizeof(FFT_SCALAR),
REVERSE_RHO,gc_buf1,gc_buf2,MPI_FFT_SCALAR); gc_buf1,gc_buf2,MPI_FFT_SCALAR);
brick2fft(); brick2fft();
// compute potential gradient on my FFT grid and // compute potential gradient on my FFT grid and
@ -655,21 +655,21 @@ void PPPM::compute(int eflag, int vflag)
// to fill ghost cells surrounding their 3d bricks // to fill ghost cells surrounding their 3d bricks
if (differentiation_flag == 1) if (differentiation_flag == 1)
gc->forward_comm(Grid3d::KSPACE,this,1,sizeof(FFT_SCALAR), gc->forward_comm(Grid3d::KSPACE,this,FORWARD_AD,1,sizeof(FFT_SCALAR),
FORWARD_AD,gc_buf1,gc_buf2,MPI_FFT_SCALAR); gc_buf1,gc_buf2,MPI_FFT_SCALAR);
else else
gc->forward_comm(Grid3d::KSPACE,this,3,sizeof(FFT_SCALAR), gc->forward_comm(Grid3d::KSPACE,this,FORWARD_IK,3,sizeof(FFT_SCALAR),
FORWARD_IK,gc_buf1,gc_buf2,MPI_FFT_SCALAR); gc_buf1,gc_buf2,MPI_FFT_SCALAR);
// extra per-atom energy/virial communication // extra per-atom energy/virial communication
if (evflag_atom) { if (evflag_atom) {
if (differentiation_flag == 1 && vflag_atom) if (differentiation_flag == 1 && vflag_atom)
gc->forward_comm(Grid3d::KSPACE,this,6,sizeof(FFT_SCALAR), gc->forward_comm(Grid3d::KSPACE,this,FORWARD_AD_PERATOM,6,sizeof(FFT_SCALAR),
FORWARD_AD_PERATOM,gc_buf1,gc_buf2,MPI_FFT_SCALAR); gc_buf1,gc_buf2,MPI_FFT_SCALAR);
else if (differentiation_flag == 0) else if (differentiation_flag == 0)
gc->forward_comm(Grid3d::KSPACE,this,7,sizeof(FFT_SCALAR), gc->forward_comm(Grid3d::KSPACE,this,FORWARD_IK_PERATOM,7,sizeof(FFT_SCALAR),
FORWARD_IK_PERATOM,gc_buf1,gc_buf2,MPI_FFT_SCALAR); gc_buf1,gc_buf2,MPI_FFT_SCALAR);
} }
// calculate the force on my particles // calculate the force on my particles
@ -3063,8 +3063,8 @@ void PPPM::compute_group_group(int groupbit_A, int groupbit_B, int AA_flag)
density_brick = density_A_brick; density_brick = density_A_brick;
density_fft = density_A_fft; density_fft = density_A_fft;
gc->reverse_comm(Grid3d::KSPACE,this,1,sizeof(FFT_SCALAR), gc->reverse_comm(Grid3d::KSPACE,this,REVERSE_RHO,1,sizeof(FFT_SCALAR),
REVERSE_RHO,gc_buf1,gc_buf2,MPI_FFT_SCALAR); gc_buf1,gc_buf2,MPI_FFT_SCALAR);
brick2fft(); brick2fft();
// group B // group B
@ -3072,8 +3072,8 @@ void PPPM::compute_group_group(int groupbit_A, int groupbit_B, int AA_flag)
density_brick = density_B_brick; density_brick = density_B_brick;
density_fft = density_B_fft; density_fft = density_B_fft;
gc->reverse_comm(Grid3d::KSPACE,this,1,sizeof(FFT_SCALAR), gc->reverse_comm(Grid3d::KSPACE,this,REVERSE_RHO,1,sizeof(FFT_SCALAR),
REVERSE_RHO,gc_buf1,gc_buf2,MPI_FFT_SCALAR); gc_buf1,gc_buf2,MPI_FFT_SCALAR);
brick2fft(); brick2fft();
// switch back pointers // switch back pointers

View File

@ -177,8 +177,8 @@ void PPPMCG::compute(int eflag, int vflag)
// to fully sum contribution in their 3d bricks // to fully sum contribution in their 3d bricks
// remap from 3d decomposition to FFT decomposition // remap from 3d decomposition to FFT decomposition
gc->reverse_comm(Grid3d::KSPACE,this,1,sizeof(FFT_SCALAR), gc->reverse_comm(Grid3d::KSPACE,this,REVERSE_RHO,1,sizeof(FFT_SCALAR),
REVERSE_RHO,gc_buf1,gc_buf2,MPI_FFT_SCALAR); gc_buf1,gc_buf2,MPI_FFT_SCALAR);
brick2fft(); brick2fft();
// compute potential gradient on my FFT grid and // compute potential gradient on my FFT grid and
@ -192,21 +192,21 @@ void PPPMCG::compute(int eflag, int vflag)
// to fill ghost cells surrounding their 3d bricks // to fill ghost cells surrounding their 3d bricks
if (differentiation_flag == 1) if (differentiation_flag == 1)
gc->forward_comm(Grid3d::KSPACE,this,1,sizeof(FFT_SCALAR), gc->forward_comm(Grid3d::KSPACE,this,FORWARD_AD,1,sizeof(FFT_SCALAR),
FORWARD_AD,gc_buf1,gc_buf2,MPI_FFT_SCALAR); gc_buf1,gc_buf2,MPI_FFT_SCALAR);
else else
gc->forward_comm(Grid3d::KSPACE,this,3,sizeof(FFT_SCALAR), gc->forward_comm(Grid3d::KSPACE,this,FORWARD_IK,3,sizeof(FFT_SCALAR),
FORWARD_IK,gc_buf1,gc_buf2,MPI_FFT_SCALAR); gc_buf1,gc_buf2,MPI_FFT_SCALAR);
// extra per-atom energy/virial communication // extra per-atom energy/virial communication
if (evflag_atom) { if (evflag_atom) {
if (differentiation_flag == 1 && vflag_atom) if (differentiation_flag == 1 && vflag_atom)
gc->forward_comm(Grid3d::KSPACE,this,6,sizeof(FFT_SCALAR), gc->forward_comm(Grid3d::KSPACE,this,FORWARD_AD_PERATOM,6,sizeof(FFT_SCALAR),
FORWARD_AD_PERATOM,gc_buf1,gc_buf2,MPI_FFT_SCALAR); gc_buf1,gc_buf2,MPI_FFT_SCALAR);
else if (differentiation_flag == 0) else if (differentiation_flag == 0)
gc->forward_comm(Grid3d::KSPACE,this,7,sizeof(FFT_SCALAR), gc->forward_comm(Grid3d::KSPACE,this,FORWARD_IK_PERATOM,7,sizeof(FFT_SCALAR),
FORWARD_IK_PERATOM,gc_buf1,gc_buf2,MPI_FFT_SCALAR); gc_buf1,gc_buf2,MPI_FFT_SCALAR);
} }
// calculate the force on my particles // calculate the force on my particles

View File

@ -445,8 +445,8 @@ void PPPMDipole::compute(int eflag, int vflag)
// to fully sum contribution in their 3d bricks // to fully sum contribution in their 3d bricks
// remap from 3d decomposition to FFT decomposition // remap from 3d decomposition to FFT decomposition
gc_dipole->reverse_comm(Grid3d::KSPACE,this,3,sizeof(FFT_SCALAR), gc_dipole->reverse_comm(Grid3d::KSPACE,this,REVERSE_MU,3,sizeof(FFT_SCALAR),
REVERSE_MU,gc_buf1,gc_buf2,MPI_FFT_SCALAR); gc_buf1,gc_buf2,MPI_FFT_SCALAR);
brick2fft_dipole(); brick2fft_dipole();
// compute potential gradient on my FFT grid and // compute potential gradient on my FFT grid and
@ -459,14 +459,14 @@ void PPPMDipole::compute(int eflag, int vflag)
// all procs communicate E-field values // all procs communicate E-field values
// to fill ghost cells surrounding their 3d bricks // to fill ghost cells surrounding their 3d bricks
gc_dipole->forward_comm(Grid3d::KSPACE,this,9,sizeof(FFT_SCALAR), gc_dipole->forward_comm(Grid3d::KSPACE,this,FORWARD_MU,9,sizeof(FFT_SCALAR),
FORWARD_MU,gc_buf1,gc_buf2,MPI_FFT_SCALAR); gc_buf1,gc_buf2,MPI_FFT_SCALAR);
// extra per-atom energy/virial communication // extra per-atom energy/virial communication
if (evflag_atom) if (evflag_atom)
gc_dipole->forward_comm(Grid3d::KSPACE,this,18,sizeof(FFT_SCALAR), gc_dipole->forward_comm(Grid3d::KSPACE,this,FORWARD_MU_PERATOM,18,sizeof(FFT_SCALAR),
FORWARD_MU_PERATOM,gc_buf1,gc_buf2,MPI_FFT_SCALAR); gc_buf1,gc_buf2,MPI_FFT_SCALAR);
// calculate the force on my particles // calculate the force on my particles

View File

@ -302,8 +302,8 @@ void PPPMDipoleSpin::compute(int eflag, int vflag)
// to fully sum contribution in their 3d bricks // to fully sum contribution in their 3d bricks
// remap from 3d decomposition to FFT decomposition // remap from 3d decomposition to FFT decomposition
gc_dipole->reverse_comm(Grid3d::KSPACE,this,3,sizeof(FFT_SCALAR), gc_dipole->reverse_comm(Grid3d::KSPACE,this,REVERSE_MU,3,sizeof(FFT_SCALAR),
REVERSE_MU,gc_buf1,gc_buf2,MPI_FFT_SCALAR); gc_buf1,gc_buf2,MPI_FFT_SCALAR);
brick2fft_dipole(); brick2fft_dipole();
// compute potential gradient on my FFT grid and // compute potential gradient on my FFT grid and
@ -316,14 +316,14 @@ void PPPMDipoleSpin::compute(int eflag, int vflag)
// all procs communicate E-field values // all procs communicate E-field values
// to fill ghost cells surrounding their 3d bricks // to fill ghost cells surrounding their 3d bricks
gc_dipole->forward_comm(Grid3d::KSPACE,this,9,sizeof(FFT_SCALAR), gc_dipole->forward_comm(Grid3d::KSPACE,this,FORWARD_MU,9,sizeof(FFT_SCALAR),
FORWARD_MU,gc_buf1,gc_buf2,MPI_FFT_SCALAR); gc_buf1,gc_buf2,MPI_FFT_SCALAR);
// extra per-atom energy/virial communication // extra per-atom energy/virial communication
if (evflag_atom) if (evflag_atom)
gc->forward_comm(Grid3d::KSPACE,this,18,sizeof(FFT_SCALAR), gc->forward_comm(Grid3d::KSPACE,this,FORWARD_MU_PERATOM,18,sizeof(FFT_SCALAR),
FORWARD_MU_PERATOM,gc_buf1,gc_buf2,MPI_FFT_SCALAR); gc_buf1,gc_buf2,MPI_FFT_SCALAR);
// calculate the force on my particles // calculate the force on my particles

View File

@ -916,8 +916,8 @@ void PPPMDisp::compute(int eflag, int vflag)
make_rho_c(); make_rho_c();
gc->reverse_comm(Grid3d::KSPACE,this,1,sizeof(FFT_SCALAR), gc->reverse_comm(Grid3d::KSPACE,this,REVERSE_RHO,1,sizeof(FFT_SCALAR),
REVERSE_RHO,gc_buf1,gc_buf2,MPI_FFT_SCALAR); gc_buf1,gc_buf2,MPI_FFT_SCALAR);
brick2fft(nxlo_in,nylo_in,nzlo_in,nxhi_in,nyhi_in,nzhi_in, brick2fft(nxlo_in,nylo_in,nzlo_in,nxhi_in,nyhi_in,nzhi_in,
density_brick,density_fft,work1,remap); density_brick,density_fft,work1,remap);
@ -931,14 +931,14 @@ void PPPMDisp::compute(int eflag, int vflag)
virial_1,vg,vg2, virial_1,vg,vg2,
u_brick,v0_brick,v1_brick,v2_brick,v3_brick,v4_brick,v5_brick); u_brick,v0_brick,v1_brick,v2_brick,v3_brick,v4_brick,v5_brick);
gc->forward_comm(Grid3d::KSPACE,this,1,sizeof(FFT_SCALAR), gc->forward_comm(Grid3d::KSPACE,this,FORWARD_AD,1,sizeof(FFT_SCALAR),
FORWARD_AD,gc_buf1,gc_buf2,MPI_FFT_SCALAR); gc_buf1,gc_buf2,MPI_FFT_SCALAR);
fieldforce_c_ad(); fieldforce_c_ad();
if (vflag_atom) if (vflag_atom)
gc->forward_comm(Grid3d::KSPACE,this,6,sizeof(FFT_SCALAR), gc->forward_comm(Grid3d::KSPACE,this,FORWARD_AD_PERATOM,6,sizeof(FFT_SCALAR),
FORWARD_AD_PERATOM,gc_buf1,gc_buf2,MPI_FFT_SCALAR); gc_buf1,gc_buf2,MPI_FFT_SCALAR);
} else { } else {
poisson_ik(work1,work2,density_fft,fft1,fft2, poisson_ik(work1,work2,density_fft,fft1,fft2,
@ -950,14 +950,14 @@ void PPPMDisp::compute(int eflag, int vflag)
vdx_brick,vdy_brick,vdz_brick,virial_1,vg,vg2, vdx_brick,vdy_brick,vdz_brick,virial_1,vg,vg2,
u_brick,v0_brick,v1_brick,v2_brick,v3_brick,v4_brick,v5_brick); u_brick,v0_brick,v1_brick,v2_brick,v3_brick,v4_brick,v5_brick);
gc->forward_comm(Grid3d::KSPACE,this,3,sizeof(FFT_SCALAR), gc->forward_comm(Grid3d::KSPACE,this,FORWARD_IK,3,sizeof(FFT_SCALAR),
FORWARD_IK,gc_buf1,gc_buf2,MPI_FFT_SCALAR); gc_buf1,gc_buf2,MPI_FFT_SCALAR);
fieldforce_c_ik(); fieldforce_c_ik();
if (evflag_atom) if (evflag_atom)
gc->forward_comm(Grid3d::KSPACE,this,7,sizeof(FFT_SCALAR), gc->forward_comm(Grid3d::KSPACE,this,FORWARD_IK_PERATOM,7,sizeof(FFT_SCALAR),
FORWARD_IK_PERATOM,gc_buf1,gc_buf2,MPI_FFT_SCALAR); gc_buf1,gc_buf2,MPI_FFT_SCALAR);
} }
if (evflag_atom) fieldforce_c_peratom(); if (evflag_atom) fieldforce_c_peratom();
@ -974,8 +974,8 @@ void PPPMDisp::compute(int eflag, int vflag)
make_rho_g(); make_rho_g();
gc6->reverse_comm(Grid3d::KSPACE,this,1,sizeof(FFT_SCALAR), gc6->reverse_comm(Grid3d::KSPACE,this,REVERSE_RHO_GEOM,1,sizeof(FFT_SCALAR),
REVERSE_RHO_GEOM,gc6_buf1,gc6_buf2,MPI_FFT_SCALAR); gc6_buf1,gc6_buf2,MPI_FFT_SCALAR);
brick2fft(nxlo_in_6,nylo_in_6,nzlo_in_6,nxhi_in_6,nyhi_in_6,nzhi_in_6, brick2fft(nxlo_in_6,nylo_in_6,nzlo_in_6,nxhi_in_6,nyhi_in_6,nzhi_in_6,
density_brick_g,density_fft_g,work1_6,remap_6); density_brick_g,density_fft_g,work1_6,remap_6);
@ -990,14 +990,14 @@ void PPPMDisp::compute(int eflag, int vflag)
u_brick_g,v0_brick_g,v1_brick_g,v2_brick_g, u_brick_g,v0_brick_g,v1_brick_g,v2_brick_g,
v3_brick_g,v4_brick_g,v5_brick_g); v3_brick_g,v4_brick_g,v5_brick_g);
gc6->forward_comm(Grid3d::KSPACE,this,1,sizeof(FFT_SCALAR), gc6->forward_comm(Grid3d::KSPACE,this,FORWARD_AD_GEOM,1,sizeof(FFT_SCALAR),
FORWARD_AD_GEOM,gc6_buf1,gc6_buf2,MPI_FFT_SCALAR); gc6_buf1,gc6_buf2,MPI_FFT_SCALAR);
fieldforce_g_ad(); fieldforce_g_ad();
if (vflag_atom) if (vflag_atom)
gc6->forward_comm(Grid3d::KSPACE,this,6,sizeof(FFT_SCALAR), gc6->forward_comm(Grid3d::KSPACE,this,FORWARD_AD_PERATOM_GEOM,6,sizeof(FFT_SCALAR),
FORWARD_AD_PERATOM_GEOM,gc6_buf1,gc6_buf2,MPI_FFT_SCALAR); gc6_buf1,gc6_buf2,MPI_FFT_SCALAR);
} else { } else {
poisson_ik(work1_6,work2_6,density_fft_g,fft1_6,fft2_6, poisson_ik(work1_6,work2_6,density_fft_g,fft1_6,fft2_6,
@ -1010,14 +1010,14 @@ void PPPMDisp::compute(int eflag, int vflag)
u_brick_g,v0_brick_g,v1_brick_g,v2_brick_g, u_brick_g,v0_brick_g,v1_brick_g,v2_brick_g,
v3_brick_g,v4_brick_g,v5_brick_g); v3_brick_g,v4_brick_g,v5_brick_g);
gc6->forward_comm(Grid3d::KSPACE,this,3,sizeof(FFT_SCALAR), gc6->forward_comm(Grid3d::KSPACE,this,FORWARD_IK_GEOM,3,sizeof(FFT_SCALAR),
FORWARD_IK_GEOM,gc6_buf1,gc6_buf2,MPI_FFT_SCALAR); gc6_buf1,gc6_buf2,MPI_FFT_SCALAR);
fieldforce_g_ik(); fieldforce_g_ik();
if (evflag_atom) if (evflag_atom)
gc6->forward_comm(Grid3d::KSPACE,this,7,sizeof(FFT_SCALAR), gc6->forward_comm(Grid3d::KSPACE,this,FORWARD_IK_PERATOM_GEOM,7,sizeof(FFT_SCALAR),
FORWARD_IK_PERATOM_GEOM,gc6_buf1,gc6_buf2,MPI_FFT_SCALAR); gc6_buf1,gc6_buf2,MPI_FFT_SCALAR);
} }
if (evflag_atom) fieldforce_g_peratom(); if (evflag_atom) fieldforce_g_peratom();
@ -1034,8 +1034,8 @@ void PPPMDisp::compute(int eflag, int vflag)
make_rho_a(); make_rho_a();
gc6->reverse_comm(Grid3d::KSPACE,this,7,sizeof(FFT_SCALAR), gc6->reverse_comm(Grid3d::KSPACE,this,REVERSE_RHO_ARITH,7,sizeof(FFT_SCALAR),
REVERSE_RHO_ARITH,gc6_buf1,gc6_buf2,MPI_FFT_SCALAR); gc6_buf1,gc6_buf2,MPI_FFT_SCALAR);
brick2fft_a(); brick2fft_a();
@ -1064,14 +1064,14 @@ void PPPMDisp::compute(int eflag, int vflag)
u_brick_a4,v0_brick_a4,v1_brick_a4,v2_brick_a4, u_brick_a4,v0_brick_a4,v1_brick_a4,v2_brick_a4,
v3_brick_a4,v4_brick_a4,v5_brick_a4); v3_brick_a4,v4_brick_a4,v5_brick_a4);
gc6->forward_comm(Grid3d::KSPACE,this,7,sizeof(FFT_SCALAR), gc6->forward_comm(Grid3d::KSPACE,this,FORWARD_AD_ARITH,7,sizeof(FFT_SCALAR),
FORWARD_AD_ARITH,gc6_buf1,gc6_buf2,MPI_FFT_SCALAR); gc6_buf1,gc6_buf2,MPI_FFT_SCALAR);
fieldforce_a_ad(); fieldforce_a_ad();
if (evflag_atom) if (evflag_atom)
gc6->forward_comm(Grid3d::KSPACE,this,42,sizeof(FFT_SCALAR), gc6->forward_comm(Grid3d::KSPACE,this,FORWARD_AD_PERATOM_ARITH,42,sizeof(FFT_SCALAR),
FORWARD_AD_PERATOM_ARITH,gc6_buf1,gc6_buf2,MPI_FFT_SCALAR); gc6_buf1,gc6_buf2,MPI_FFT_SCALAR);
} else { } else {
poisson_ik(work1_6,work2_6,density_fft_a3,fft1_6,fft2_6, poisson_ik(work1_6,work2_6,density_fft_a3,fft1_6,fft2_6,
@ -1105,14 +1105,14 @@ void PPPMDisp::compute(int eflag, int vflag)
u_brick_a4,v0_brick_a4,v1_brick_a4,v2_brick_a4, u_brick_a4,v0_brick_a4,v1_brick_a4,v2_brick_a4,
v3_brick_a4,v4_brick_a4,v5_brick_a4); v3_brick_a4,v4_brick_a4,v5_brick_a4);
gc6->forward_comm(Grid3d::KSPACE,this,21,sizeof(FFT_SCALAR), gc6->forward_comm(Grid3d::KSPACE,this,FORWARD_IK_ARITH,21,sizeof(FFT_SCALAR),
FORWARD_IK_ARITH,gc6_buf1,gc6_buf2,MPI_FFT_SCALAR); gc6_buf1,gc6_buf2,MPI_FFT_SCALAR);
fieldforce_a_ik(); fieldforce_a_ik();
if (evflag_atom) if (evflag_atom)
gc6->forward_comm(Grid3d::KSPACE,this,49,sizeof(FFT_SCALAR), gc6->forward_comm(Grid3d::KSPACE,this,FORWARD_IK_PERATOM_ARITH,49,sizeof(FFT_SCALAR),
FORWARD_IK_PERATOM_ARITH,gc6_buf1,gc6_buf2,MPI_FFT_SCALAR); gc6_buf1,gc6_buf2,MPI_FFT_SCALAR);
} }
if (evflag_atom) fieldforce_a_peratom(); if (evflag_atom) fieldforce_a_peratom();
@ -1129,8 +1129,8 @@ void PPPMDisp::compute(int eflag, int vflag)
make_rho_none(); make_rho_none();
gc6->reverse_comm(Grid3d::KSPACE,this,nsplit_alloc,sizeof(FFT_SCALAR), gc6->reverse_comm(Grid3d::KSPACE,this,REVERSE_RHO_NONE,nsplit_alloc,sizeof(FFT_SCALAR),
REVERSE_RHO_NONE,gc6_buf1,gc6_buf2,MPI_FFT_SCALAR); gc6_buf1,gc6_buf2,MPI_FFT_SCALAR);
brick2fft_none(); brick2fft_none();
@ -1144,14 +1144,14 @@ void PPPMDisp::compute(int eflag, int vflag)
n += 2; n += 2;
} }
gc6->forward_comm(Grid3d::KSPACE,this,1*nsplit_alloc,sizeof(FFT_SCALAR), gc6->forward_comm(Grid3d::KSPACE,this,FORWARD_AD_NONE,1*nsplit_alloc,sizeof(FFT_SCALAR),
FORWARD_AD_NONE,gc6_buf1,gc6_buf2,MPI_FFT_SCALAR); gc6_buf1,gc6_buf2,MPI_FFT_SCALAR);
fieldforce_none_ad(); fieldforce_none_ad();
if (vflag_atom) if (vflag_atom)
gc6->forward_comm(Grid3d::KSPACE,this,6*nsplit_alloc,sizeof(FFT_SCALAR), gc6->forward_comm(Grid3d::KSPACE,this,FORWARD_AD_PERATOM_NONE,6*nsplit_alloc,sizeof(FFT_SCALAR),
FORWARD_AD_PERATOM_NONE,gc6_buf1,gc6_buf2,MPI_FFT_SCALAR); gc6_buf1,gc6_buf2,MPI_FFT_SCALAR);
} else { } else {
int n = 0; int n = 0;
@ -1164,14 +1164,14 @@ void PPPMDisp::compute(int eflag, int vflag)
n += 2; n += 2;
} }
gc6->forward_comm(Grid3d::KSPACE,this,3*nsplit_alloc,sizeof(FFT_SCALAR), gc6->forward_comm(Grid3d::KSPACE,this,FORWARD_IK_NONE,3*nsplit_alloc,sizeof(FFT_SCALAR),
FORWARD_IK_NONE,gc6_buf1,gc6_buf2,MPI_FFT_SCALAR); gc6_buf1,gc6_buf2,MPI_FFT_SCALAR);
fieldforce_none_ik(); fieldforce_none_ik();
if (evflag_atom) if (evflag_atom)
gc6->forward_comm(Grid3d::KSPACE,this,7*nsplit_alloc,sizeof(FFT_SCALAR), gc6->forward_comm(Grid3d::KSPACE,this,FORWARD_IK_PERATOM_NONE,7*nsplit_alloc,sizeof(FFT_SCALAR),
FORWARD_IK_PERATOM_NONE,gc6_buf1,gc6_buf2,MPI_FFT_SCALAR); gc6_buf1,gc6_buf2,MPI_FFT_SCALAR);
} }
if (evflag_atom) fieldforce_none_peratom(); if (evflag_atom) fieldforce_none_peratom();

View File

@ -157,8 +157,8 @@ void PPPMStagger::compute(int eflag, int vflag)
// to fully sum contribution in their 3d bricks // to fully sum contribution in their 3d bricks
// remap from 3d decomposition to FFT decomposition // remap from 3d decomposition to FFT decomposition
gc->reverse_comm(Grid3d::KSPACE,this,1,sizeof(FFT_SCALAR), gc->reverse_comm(Grid3d::KSPACE,this,REVERSE_RHO,1,sizeof(FFT_SCALAR),
REVERSE_RHO,gc_buf1,gc_buf2,MPI_FFT_SCALAR); gc_buf1,gc_buf2,MPI_FFT_SCALAR);
brick2fft(); brick2fft();
// compute potential gradient on my FFT grid and // compute potential gradient on my FFT grid and
@ -172,21 +172,21 @@ void PPPMStagger::compute(int eflag, int vflag)
// to fill ghost cells surrounding their 3d bricks // to fill ghost cells surrounding their 3d bricks
if (differentiation_flag == 1) if (differentiation_flag == 1)
gc->forward_comm(Grid3d::KSPACE,this,1,sizeof(FFT_SCALAR), gc->forward_comm(Grid3d::KSPACE,this,FORWARD_AD,1,sizeof(FFT_SCALAR),
FORWARD_AD,gc_buf1,gc_buf2,MPI_FFT_SCALAR); gc_buf1,gc_buf2,MPI_FFT_SCALAR);
else else
gc->forward_comm(Grid3d::KSPACE,this,3,sizeof(FFT_SCALAR), gc->forward_comm(Grid3d::KSPACE,this,FORWARD_IK,3,sizeof(FFT_SCALAR),
FORWARD_IK,gc_buf1,gc_buf2,MPI_FFT_SCALAR); gc_buf1,gc_buf2,MPI_FFT_SCALAR);
// extra per-atom energy/virial communication // extra per-atom energy/virial communication
if (evflag_atom) { if (evflag_atom) {
if (differentiation_flag == 1 && vflag_atom) if (differentiation_flag == 1 && vflag_atom)
gc->forward_comm(Grid3d::KSPACE,this,6,sizeof(FFT_SCALAR), gc->forward_comm(Grid3d::KSPACE,this,FORWARD_AD_PERATOM,6,sizeof(FFT_SCALAR),
FORWARD_AD_PERATOM,gc_buf1,gc_buf2,MPI_FFT_SCALAR); gc_buf1,gc_buf2,MPI_FFT_SCALAR);
else if (differentiation_flag == 0) else if (differentiation_flag == 0)
gc->forward_comm(Grid3d::KSPACE,this,7,sizeof(FFT_SCALAR), gc->forward_comm(Grid3d::KSPACE,this,FORWARD_IK_PERATOM,7,sizeof(FFT_SCALAR),
FORWARD_IK_PERATOM,gc_buf1,gc_buf2,MPI_FFT_SCALAR); gc_buf1,gc_buf2,MPI_FFT_SCALAR);
} }
// calculate the force on my particles // calculate the force on my particles

View File

@ -166,7 +166,7 @@ void MSMCGOMP::compute(int eflag, int vflag)
// to fully sum contribution in their 3d grid // to fully sum contribution in their 3d grid
current_level = 0; current_level = 0;
gcall->reverse_comm(Grid3d::KSPACE,this,1,sizeof(double),REVERSE_RHO, gcall->reverse_comm(Grid3d::KSPACE,this,REVERSE_RHO,1,sizeof(double),
gcall_buf1,gcall_buf2,MPI_DOUBLE); gcall_buf1,gcall_buf2,MPI_DOUBLE);
// forward communicate charge density values to fill ghost grid points // forward communicate charge density values to fill ghost grid points
@ -175,7 +175,7 @@ void MSMCGOMP::compute(int eflag, int vflag)
for (int n=0; n<=levels-2; n++) { for (int n=0; n<=levels-2; n++) {
if (!active_flag[n]) continue; if (!active_flag[n]) continue;
current_level = n; current_level = n;
gc[n]->forward_comm(Grid3d::KSPACE,this,1,sizeof(double),FORWARD_RHO, gc[n]->forward_comm(Grid3d::KSPACE,this,FORWARD_RHO,1,sizeof(double),
gc_buf1[n],gc_buf2[n],MPI_DOUBLE); gc_buf1[n],gc_buf2[n],MPI_DOUBLE);
direct(n); direct(n);
restriction(n); restriction(n);
@ -188,15 +188,15 @@ void MSMCGOMP::compute(int eflag, int vflag)
if (domain->nonperiodic) { if (domain->nonperiodic) {
current_level = levels-1; current_level = levels-1;
gc[levels-1]-> gc[levels-1]->
forward_comm(Grid3d::KSPACE,this,1,sizeof(double),FORWARD_RHO, forward_comm(Grid3d::KSPACE,this,FORWARD_RHO,1,sizeof(double),
gc_buf1[levels-1],gc_buf2[levels-1],MPI_DOUBLE); gc_buf1[levels-1],gc_buf2[levels-1],MPI_DOUBLE);
direct_top(levels-1); direct_top(levels-1);
gc[levels-1]-> gc[levels-1]->
reverse_comm(Grid3d::KSPACE,this,1,sizeof(double),REVERSE_AD, reverse_comm(Grid3d::KSPACE,this,REVERSE_AD,1,sizeof(double),
gc_buf1[levels-1],gc_buf2[levels-1],MPI_DOUBLE); gc_buf1[levels-1],gc_buf2[levels-1],MPI_DOUBLE);
if (vflag_atom) if (vflag_atom)
gc[levels-1]-> gc[levels-1]->
reverse_comm(Grid3d::KSPACE,this,6,sizeof(double),REVERSE_AD_PERATOM, reverse_comm(Grid3d::KSPACE,this,REVERSE_AD_PERATOM,6,sizeof(double),
gc_buf1[levels-1],gc_buf2[levels-1],MPI_DOUBLE); gc_buf1[levels-1],gc_buf2[levels-1],MPI_DOUBLE);
} else { } else {
@ -207,7 +207,7 @@ void MSMCGOMP::compute(int eflag, int vflag)
current_level = levels-1; current_level = levels-1;
if (vflag_atom) if (vflag_atom)
gc[levels-1]-> gc[levels-1]->
reverse_comm(Grid3d::KSPACE,this,6,sizeof(double),REVERSE_AD_PERATOM, reverse_comm(Grid3d::KSPACE,this,REVERSE_AD_PERATOM,6,sizeof(double),
gc_buf1[levels-1],gc_buf2[levels-1],MPI_DOUBLE); gc_buf1[levels-1],gc_buf2[levels-1],MPI_DOUBLE);
} }
} }
@ -220,27 +220,27 @@ void MSMCGOMP::compute(int eflag, int vflag)
prolongation(n); prolongation(n);
current_level = n; current_level = n;
gc[n]->reverse_comm(Grid3d::KSPACE,this,1,sizeof(double),REVERSE_AD, gc[n]->reverse_comm(Grid3d::KSPACE,this,REVERSE_AD,1,sizeof(double),
gc_buf1[n],gc_buf2[n],MPI_DOUBLE); gc_buf1[n],gc_buf2[n],MPI_DOUBLE);
// extra per-atom virial communication // extra per-atom virial communication
if (vflag_atom) if (vflag_atom)
gc[n]->reverse_comm(Grid3d::KSPACE,this,6,sizeof(double), gc[n]->reverse_comm(Grid3d::KSPACE,this,REVERSE_AD_PERATOM,6,sizeof(double),
REVERSE_AD_PERATOM,gc_buf1[n],gc_buf2[n],MPI_DOUBLE); gc_buf1[n],gc_buf2[n],MPI_DOUBLE);
} }
// all procs communicate E-field values // all procs communicate E-field values
// to fill ghost cells surrounding their 3d bricks // to fill ghost cells surrounding their 3d bricks
current_level = 0; current_level = 0;
gcall->forward_comm(Grid3d::KSPACE,this,1,sizeof(double),FORWARD_AD, gcall->forward_comm(Grid3d::KSPACE,this,FORWARD_AD,1,sizeof(double),
gcall_buf1,gcall_buf2,MPI_DOUBLE); gcall_buf1,gcall_buf2,MPI_DOUBLE);
// extra per-atom energy/virial communication // extra per-atom energy/virial communication
if (vflag_atom) if (vflag_atom)
gcall->forward_comm(Grid3d::KSPACE,this,6,sizeof(double),FORWARD_AD_PERATOM, gcall->forward_comm(Grid3d::KSPACE,this,FORWARD_AD_PERATOM,6,sizeof(double),
gcall_buf1,gcall_buf2,MPI_DOUBLE); gcall_buf1,gcall_buf2,MPI_DOUBLE);
// calculate the force on my particles (interpolation) // calculate the force on my particles (interpolation)

View File

@ -560,10 +560,10 @@ void FixAveGrid::end_of_step()
if (modeatom) { if (modeatom) {
if (dimension == 2) if (dimension == 2)
grid2d->reverse_comm(Grid2d::FIX,this,nvalues+1,sizeof(double),0, grid2d->reverse_comm(Grid2d::FIX,this,0,nvalues+1,sizeof(double),
grid_buf1,grid_buf2,MPI_DOUBLE); grid_buf1,grid_buf2,MPI_DOUBLE);
else else
grid3d->reverse_comm(Grid3d::FIX,this,nvalues+1,sizeof(double),0, grid3d->reverse_comm(Grid3d::FIX,this,0,nvalues+1,sizeof(double),
grid_buf1,grid_buf2,MPI_DOUBLE); grid_buf1,grid_buf2,MPI_DOUBLE);
} }
@ -1788,7 +1788,7 @@ void FixAveGrid::output_grid(GridData *src)
only invoked for ATOM mode only invoked for ATOM mode
------------------------------------------------------------------------ */ ------------------------------------------------------------------------ */
void FixAveGrid::pack_reverse_grid(int /*flag*/, void *vbuf, int nlist, int *list) void FixAveGrid::pack_reverse_grid(int /*which*/, void *vbuf, int nlist, int *list)
{ {
int i,j,m; int i,j,m;
@ -1827,7 +1827,7 @@ void FixAveGrid::pack_reverse_grid(int /*flag*/, void *vbuf, int nlist, int *lis
only invoked for ATOM mode only invoked for ATOM mode
------------------------------------------------------------------------- */ ------------------------------------------------------------------------- */
void FixAveGrid::unpack_reverse_grid(int /*flag*/, void *vbuf, int nlist, int *list) void FixAveGrid::unpack_reverse_grid(int /*which*/, void *vbuf, int nlist, int *list)
{ {
int i,j,m; int i,j,m;
@ -2020,10 +2020,10 @@ void FixAveGrid::reset_grid()
if (modeatom) { if (modeatom) {
if (dimension == 2) if (dimension == 2)
grid2d->reverse_comm(Grid2d::FIX,this,nvalues+1,sizeof(double),0, grid2d->reverse_comm(Grid2d::FIX,this,0,nvalues+1,sizeof(double),
grid_buf1,grid_buf2,MPI_DOUBLE); grid_buf1,grid_buf2,MPI_DOUBLE);
else else
grid3d->reverse_comm(Grid3d::FIX,this,nvalues+1,sizeof(double),0, grid3d->reverse_comm(Grid3d::FIX,this,0,nvalues+1,sizeof(double),
grid_buf1,grid_buf2,MPI_DOUBLE); grid_buf1,grid_buf2,MPI_DOUBLE);
} }