git-svn-id: svn://svn.icms.temple.edu/lammps-ro/trunk@12253 f3b2605a-c512-4ea7-a41b-209d697bcdaa

This commit is contained in:
sjplimp 2014-08-06 16:07:54 +00:00
parent a9495cb7f0
commit 2cca373515
66 changed files with 310 additions and 272 deletions

View File

@ -752,8 +752,8 @@ void PairLubricate::read_restart_settings(FILE *fp)
/* ---------------------------------------------------------------------- */
int PairLubricate::pack_comm(int n, int *list, double *buf,
int pbc_flag, int *pbc)
int PairLubricate::pack_forward_comm(int n, int *list, double *buf,
int pbc_flag, int *pbc)
{
int i,j,m;
@ -771,12 +771,12 @@ int PairLubricate::pack_comm(int n, int *list, double *buf,
buf[m++] = omega[j][2];
}
return 6;
return m;
}
/* ---------------------------------------------------------------------- */
void PairLubricate::unpack_comm(int n, int first, double *buf)
void PairLubricate::unpack_forward_comm(int n, int first, double *buf)
{
int i,m,last;

View File

@ -40,8 +40,8 @@ class PairLubricate : public Pair {
int pre_adapt(char *, int, int, int, int);
void adapt(int, int, int, int, int, double);
int pack_comm(int, int *, double *, int, int *);
void unpack_comm(int, int, double *);
int pack_forward_comm(int, int *, double *, int, int *);
void unpack_forward_comm(int, int, double *);
protected:
double mu,cut_inner_global,cut_global;

View File

@ -2009,8 +2009,8 @@ void PairLubricateU::copy_uo_vec(int inum, double **f, double **torque,
/* ---------------------------------------------------------------------- */
int PairLubricateU::pack_comm(int n, int *list, double *buf,
int pbc_flag, int *pbc)
int PairLubricateU::pack_forward_comm(int n, int *list, double *buf,
int pbc_flag, int *pbc)
{
int i,j,m;
@ -2027,12 +2027,12 @@ int PairLubricateU::pack_comm(int n, int *list, double *buf,
buf[m++] = omega[j][1];
buf[m++] = omega[j][2];
}
return 6;
return m;
}
/* ---------------------------------------------------------------------- */
void PairLubricateU::unpack_comm(int n, int first, double *buf)
void PairLubricateU::unpack_forward_comm(int n, int first, double *buf)
{
int i,m,last;

View File

@ -37,8 +37,8 @@ class PairLubricateU : public Pair {
void read_restart(FILE *);
void write_restart_settings(FILE *);
void read_restart_settings(FILE *);
int pack_comm(int, int *, double *, int, int *);
void unpack_comm(int, int, double *);
int pack_forward_comm(int, int *, double *, int, int *);
void unpack_forward_comm(int, int, double *);
protected:
double cut_inner_global,cut_global;

View File

@ -237,8 +237,8 @@ double PairEAMGPU::single(int i, int j, int itype, int jtype,
/* ---------------------------------------------------------------------- */
int PairEAMGPU::pack_comm(int n, int *list, double *buf, int pbc_flag,
int *pbc)
int PairEAMGPU::pack_forward_comm(int n, int *list, double *buf,
int pbc_flag,int *pbc)
{
int i,j,m;
@ -258,12 +258,12 @@ int PairEAMGPU::pack_comm(int n, int *list, double *buf, int pbc_flag,
}
}
return 1;
return m;
}
/* ---------------------------------------------------------------------- */
void PairEAMGPU::unpack_comm(int n, int first, double *buf)
void PairEAMGPU::unpack_forward_comm(int n, int first, double *buf)
{
int i,m,last;

View File

@ -35,8 +35,8 @@ class PairEAMGPU : public PairEAM {
double single(int, int, int, int, double, double, double, double &);
double memory_usage();
int pack_comm(int, int *, double *, int, int *);
void unpack_comm(int, int, double *);
int pack_forward_comm(int, int *, double *, int, int *);
void unpack_forward_comm(int, int, double *);
enum { GPU_FORCE, GPU_NEIGH, GPU_HYB_NEIGH };

View File

@ -763,8 +763,8 @@ double PairGranHookeHistory::single(int i, int j, int itype, int jtype,
/* ---------------------------------------------------------------------- */
int PairGranHookeHistory::pack_comm(int n, int *list,
double *buf, int pbc_flag, int *pbc)
int PairGranHookeHistory::pack_forward_comm(int n, int *list, double *buf,
int pbc_flag, int *pbc)
{
int i,j,m;
@ -773,12 +773,12 @@ int PairGranHookeHistory::pack_comm(int n, int *list,
j = list[i];
buf[m++] = mass_rigid[j];
}
return 1;
return m;
}
/* ---------------------------------------------------------------------- */
void PairGranHookeHistory::unpack_comm(int n, int first, double *buf)
void PairGranHookeHistory::unpack_forward_comm(int n, int first, double *buf)
{
int i,m,last;

View File

@ -42,8 +42,8 @@ class PairGranHookeHistory : public Pair {
void read_restart_settings(FILE *);
void reset_dt();
virtual double single(int, int, int, int, double, double, double, double &);
int pack_comm(int, int *, double *, int, int *);
void unpack_comm(int, int, double *);
int pack_forward_comm(int, int *, double *, int, int *);
void unpack_forward_comm(int, int, double *);
void *extract(const char *, int &);
double memory_usage();

View File

@ -292,7 +292,8 @@ double FixQEQComb::memory_usage()
}
/* ---------------------------------------------------------------------- */
int FixQEQComb::pack_comm(int n, int *list, double *buf, int pbc_flag, int *pbc)
int FixQEQComb::pack_forward_comm(int n, int *list, double *buf,
int pbc_flag, int *pbc)
{
int i,j,m;
@ -301,12 +302,12 @@ int FixQEQComb::pack_comm(int n, int *list, double *buf, int pbc_flag, int *pbc)
j = list[i];
buf[m++] = atom->q[j];
}
return 1;
return m;
}
/* ---------------------------------------------------------------------- */
void FixQEQComb::unpack_comm(int n, int first, double *buf)
void FixQEQComb::unpack_forward_comm(int n, int first, double *buf)
{
int i,m,last;

View File

@ -35,8 +35,8 @@ class FixQEQComb : public Fix {
virtual void post_force(int);
void post_force_respa(int,int,int);
double memory_usage();
int pack_comm(int , int *, double *, int, int *);
void unpack_comm(int , int , double *);
int pack_forward_comm(int , int *, double *, int, int *);
void unpack_forward_comm(int , int , double *);
void min_post_force(int);

View File

@ -933,7 +933,8 @@ void PairADP::grab(FILE *fp, int n, double *list)
/* ---------------------------------------------------------------------- */
int PairADP::pack_comm(int n, int *list, double *buf, int pbc_flag, int *pbc)
int PairADP::pack_forward_comm(int n, int *list, double *buf,
int pbc_flag, int *pbc)
{
int i,j,m;
@ -951,12 +952,12 @@ int PairADP::pack_comm(int n, int *list, double *buf, int pbc_flag, int *pbc)
buf[m++] = lambda[j][4];
buf[m++] = lambda[j][5];
}
return 10;
return m;
}
/* ---------------------------------------------------------------------- */
void PairADP::unpack_comm(int n, int first, double *buf)
void PairADP::unpack_forward_comm(int n, int first, double *buf)
{
int i,m,last;
@ -996,7 +997,7 @@ int PairADP::pack_reverse_comm(int n, int first, double *buf)
buf[m++] = lambda[i][4];
buf[m++] = lambda[i][5];
}
return 10;
return m;
}
/* ---------------------------------------------------------------------- */

View File

@ -34,8 +34,8 @@ class PairADP : public Pair {
void init_style();
double init_one(int, int);
int pack_comm(int, int *, double *, int, int *);
void unpack_comm(int, int, double *);
int pack_forward_comm(int, int *, double *, int, int *);
void unpack_forward_comm(int, int, double *);
int pack_reverse_comm(int, int, double *);
void unpack_reverse_comm(int, int *, double *);
double memory_usage();

View File

@ -1991,7 +1991,8 @@ void PairComb::Over_cor(Param *param, double rsq1, int NCoi,
/* ---------------------------------------------------------------------- */
int PairComb::pack_comm(int n, int *list, double *buf, int pbc_flag, int *pbc)
int PairComb::pack_forward_comm(int n, int *list, double *buf,
int pbc_flag, int *pbc)
{
int i,j,m;
@ -2000,12 +2001,12 @@ int PairComb::pack_comm(int n, int *list, double *buf, int pbc_flag, int *pbc)
j = list[i];
buf[m++] = qf[j];
}
return 1;
return m;
}
/* ---------------------------------------------------------------------- */
void PairComb::unpack_comm(int n, int first, double *buf)
void PairComb::unpack_forward_comm(int n, int first, double *buf)
{
int i,m,last;
@ -2023,7 +2024,7 @@ int PairComb::pack_reverse_comm(int n, int first, double *buf)
m = 0;
last = first + n;
for (i = first; i < last; i++) buf[m++] = qf[i];
return 1;
return m;
}
/* ---------------------------------------------------------------------- */

View File

@ -149,8 +149,8 @@ class PairComb : public Pair {
void Over_cor(Param *, double, int, double &, double &);
int pack_reverse_comm(int, int, double *);
void unpack_reverse_comm(int, int *, double *);
int pack_comm(int , int *, double *, int, int *);
void unpack_comm(int , int , double *);
int pack_forward_comm(int , int *, double *, int, int *);
void unpack_forward_comm(int , int , double *);
void Short_neigh();

View File

@ -3853,7 +3853,8 @@ double PairComb3::switching_d(double rr)
/* ---------------------------------------------------------------------- */
int PairComb3::pack_comm(int n, int *list, double *buf, int pbc_flag, int *pbc)
int PairComb3::pack_forward_comm(int n, int *list, double *buf,
int pbc_flag, int *pbc)
{
int i,j,m;
@ -3869,12 +3870,12 @@ int PairComb3::pack_comm(int n, int *list, double *buf, int pbc_flag, int *pbc)
buf[m++] = NCo[j];
}
}
return 1;
return m;
}
/* ---------------------------------------------------------------------- */
void PairComb3::unpack_comm(int n, int first, double *buf)
void PairComb3::unpack_forward_comm(int n, int first, double *buf)
{
int i,m,last;
@ -3904,7 +3905,7 @@ int PairComb3::pack_reverse_comm(int n, int first, double *buf)
for (i = first; i < last; i++)
buf[m++] = NCo[i];
}
return 1;
return m;
}
/* ---------------------------------------------------------------------- */

View File

@ -246,8 +246,8 @@ class PairComb3 : public Pair {
// communication functions
int pack_reverse_comm(int, int, double *);
void unpack_reverse_comm(int, int *, double *);
int pack_comm(int , int *, double *, int, int *);
void unpack_comm(int , int , double *);
int pack_forward_comm(int , int *, double *, int, int *);
void unpack_forward_comm(int , int , double *);
// vector functions, inline for efficiency
inline double vec3_dot(double *x, double *y) {

View File

@ -806,7 +806,8 @@ double PairEAM::single(int i, int j, int itype, int jtype,
/* ---------------------------------------------------------------------- */
int PairEAM::pack_comm(int n, int *list, double *buf, int pbc_flag, int *pbc)
int PairEAM::pack_forward_comm(int n, int *list, double *buf,
int pbc_flag, int *pbc)
{
int i,j,m;
@ -815,12 +816,12 @@ int PairEAM::pack_comm(int n, int *list, double *buf, int pbc_flag, int *pbc)
j = list[i];
buf[m++] = fp[j];
}
return 1;
return m;
}
/* ---------------------------------------------------------------------- */
void PairEAM::unpack_comm(int n, int first, double *buf)
void PairEAM::unpack_forward_comm(int n, int first, double *buf)
{
int i,m,last;
@ -838,7 +839,7 @@ int PairEAM::pack_reverse_comm(int n, int first, double *buf)
m = 0;
last = first + n;
for (i = first; i < last; i++) buf[m++] = rho[i];
return 1;
return m;
}
/* ---------------------------------------------------------------------- */

View File

@ -53,8 +53,8 @@ class PairEAM : public Pair {
double init_one(int, int);
double single(int, int, int, int, double, double, double, double &);
virtual int pack_comm(int, int *, double *, int, int *);
virtual void unpack_comm(int, int, double *);
virtual int pack_forward_comm(int, int *, double *, int, int *);
virtual void unpack_forward_comm(int, int, double *);
int pack_reverse_comm(int, int, double *);
void unpack_reverse_comm(int, int *, double *);
double memory_usage();

View File

@ -1083,7 +1083,8 @@ double PairEIM::funccoul(int i, int j, double r)
/* ---------------------------------------------------------------------- */
int PairEIM::pack_comm(int n, int *list, double *buf, int pbc_flag, int *pbc)
int PairEIM::pack_forward_comm(int n, int *list, double *buf,
int pbc_flag, int *pbc)
{
int i,j,m;
@ -1100,12 +1101,12 @@ int PairEIM::pack_comm(int n, int *list, double *buf, int pbc_flag, int *pbc)
buf[m++] = fp[j];
}
}
return 1;
return m;
}
/* ---------------------------------------------------------------------- */
void PairEIM::unpack_comm(int n, int first, double *buf)
void PairEIM::unpack_forward_comm(int n, int first, double *buf)
{
int i,m,last;
@ -1133,7 +1134,7 @@ int PairEIM::pack_reverse_comm(int n, int first, double *buf)
if (rhofp == 2) {
for (i = first; i < last; i++) buf[m++] = fp[i];
}
return 1;
return m;
}
/* ---------------------------------------------------------------------- */

View File

@ -35,8 +35,8 @@ class PairEIM : public Pair {
void init_style();
double init_one(int, int);
int pack_comm(int, int *, double *, int, int *);
void unpack_comm(int, int, double *);
int pack_forward_comm(int, int *, double *, int, int *);
void unpack_forward_comm(int, int, double *);
int pack_reverse_comm(int, int, double *);
void unpack_reverse_comm(int, int *, double *);
double memory_usage();

View File

@ -702,8 +702,8 @@ void FixBondBreak::post_integrate_respa(int ilevel, int iloop)
/* ---------------------------------------------------------------------- */
int FixBondBreak::pack_comm(int n, int *list, double *buf,
int pbc_flag, int *pbc)
int FixBondBreak::pack_forward_comm(int n, int *list, double *buf,
int pbc_flag, int *pbc)
{
int i,j,k,m,ns;
@ -714,7 +714,7 @@ int FixBondBreak::pack_comm(int n, int *list, double *buf,
buf[m++] = ubuf(partner[j]).d;
buf[m++] = probability[j];
}
return 2;
return m;
}
int **nspecial = atom->nspecial;
@ -734,7 +734,7 @@ int FixBondBreak::pack_comm(int n, int *list, double *buf,
/* ---------------------------------------------------------------------- */
void FixBondBreak::unpack_comm(int n, int first, double *buf)
void FixBondBreak::unpack_forward_comm(int n, int first, double *buf)
{
int i,j,m,ns,last;
@ -775,7 +775,7 @@ int FixBondBreak::pack_reverse_comm(int n, int first, double *buf)
buf[m++] = ubuf(partner[i]).d;
buf[m++] = distsq[i];
}
return 2;
return m;
}
/* ---------------------------------------------------------------------- */

View File

@ -33,8 +33,8 @@ class FixBondBreak : public Fix {
void post_integrate();
void post_integrate_respa(int,int);
int pack_comm(int, int *, double *, int, int *);
void unpack_comm(int, int, double *);
int pack_forward_comm(int, int *, double *, int, int *);
void unpack_forward_comm(int, int, double *);
int pack_reverse_comm(int, int, double *);
void unpack_reverse_comm(int, int *, double *);
double compute_vector(int);

View File

@ -1211,8 +1211,8 @@ void FixBondCreate::post_integrate_respa(int ilevel, int iloop)
/* ---------------------------------------------------------------------- */
int FixBondCreate::pack_comm(int n, int *list, double *buf,
int pbc_flag, int *pbc)
int FixBondCreate::pack_forward_comm(int n, int *list, double *buf,
int pbc_flag, int *pbc)
{
int i,j,k,m,ns;
@ -1223,7 +1223,7 @@ int FixBondCreate::pack_comm(int n, int *list, double *buf,
j = list[i];
buf[m++] = ubuf(bondcount[j]).d;
}
return 1;
return m;
}
if (commflag == 2) {
@ -1232,7 +1232,7 @@ int FixBondCreate::pack_comm(int n, int *list, double *buf,
buf[m++] = ubuf(partner[j]).d;
buf[m++] = probability[j];
}
return 2;
return m;
}
int **nspecial = atom->nspecial;
@ -1252,7 +1252,7 @@ int FixBondCreate::pack_comm(int n, int *list, double *buf,
/* ---------------------------------------------------------------------- */
void FixBondCreate::unpack_comm(int n, int first, double *buf)
void FixBondCreate::unpack_forward_comm(int n, int first, double *buf)
{
int i,j,m,ns,last;
@ -1298,14 +1298,14 @@ int FixBondCreate::pack_reverse_comm(int n, int first, double *buf)
if (commflag == 1) {
for (i = first; i < last; i++)
buf[m++] = ubuf(bondcount[i]).d;
return 1;
return m;
}
for (i = first; i < last; i++) {
buf[m++] = ubuf(partner[i]).d;
buf[m++] = distsq[i];
}
return 2;
return m;
}
/* ---------------------------------------------------------------------- */

View File

@ -35,8 +35,8 @@ class FixBondCreate : public Fix {
void post_integrate();
void post_integrate_respa(int, int);
int pack_comm(int, int *, double *, int, int *);
void unpack_comm(int, int, double *);
int pack_forward_comm(int, int *, double *, int, int *);
void unpack_forward_comm(int, int, double *);
int pack_reverse_comm(int, int, double *);
void unpack_reverse_comm(int, int *, double *);
void grow_arrays(int);

View File

@ -730,7 +730,8 @@ void PairMEAM::read_files(char *globalfile, char *userfile)
/* ---------------------------------------------------------------------- */
int PairMEAM::pack_comm(int n, int *list, double *buf, int pbc_flag, int *pbc)
int PairMEAM::pack_forward_comm(int n, int *list, double *buf,
int pbc_flag, int *pbc)
{
int i,j,k,m;
@ -767,12 +768,13 @@ int PairMEAM::pack_comm(int n, int *list, double *buf, int pbc_flag, int *pbc)
buf[m++] = tsq_ave[j][1];
buf[m++] = tsq_ave[j][2];
}
return comm_forward;
return m;
}
/* ---------------------------------------------------------------------- */
void PairMEAM::unpack_comm(int n, int first, double *buf)
void PairMEAM::unpack_forward_comm(int n, int first, double *buf)
{
int i,k,m,last;
@ -843,7 +845,7 @@ int PairMEAM::pack_reverse_comm(int n, int first, double *buf)
buf[m++] = tsq_ave[i][2];
}
return comm_reverse;
return m;
}
/* ---------------------------------------------------------------------- */

View File

@ -69,8 +69,8 @@ class PairMEAM : public Pair {
void init_list(int, class NeighList *);
double init_one(int, int);
int pack_comm(int, int *, double *, int, int *);
void unpack_comm(int, int, double *);
int pack_forward_comm(int, int *, double *, int, int *);
void unpack_forward_comm(int, int, double *);
int pack_reverse_comm(int, int, double *);
void unpack_reverse_comm(int, int *, double *);
double memory_usage();

View File

@ -478,8 +478,8 @@ double FixOrientFCC::compute_scalar()
/* ---------------------------------------------------------------------- */
int FixOrientFCC::pack_comm(int n, int *list, double *buf,
int pbc_flag, int *pbc)
int FixOrientFCC::pack_forward_comm(int n, int *list, double *buf,
int pbc_flag, int *pbc)
{
int i,j,k,num;
tagint id;
@ -508,18 +508,14 @@ int FixOrientFCC::pack_comm(int n, int *list, double *buf,
if (k < nlocal) id = tag[id];
buf[m++] = id;
}
m += (12-num) * 3;
if (use_xismooth) m += 12-num;
}
if (use_xismooth) return 62;
return 50;
return m;
}
/* ---------------------------------------------------------------------- */
void FixOrientFCC::unpack_comm(int n, int first, double *buf)
void FixOrientFCC::unpack_forward_comm(int n, int first, double *buf)
{
int i,j,num;
int last = first + n;
@ -536,9 +532,6 @@ void FixOrientFCC::unpack_comm(int n, int first, double *buf)
nbr[i].dxi[j][2] = buf[m++];
nbr[i].id[j] = static_cast<tagint> (buf[m++]);
}
m += (12-num) * 3;
if (use_xismooth) m += 12-num;
}
}

View File

@ -52,8 +52,8 @@ class FixOrientFCC : public Fix {
void post_force(int);
void post_force_respa(int, int, int);
double compute_scalar();
int pack_comm(int, int *, double *, int, int *);
void unpack_comm(int, int, double *);
int pack_forward_comm(int, int *, double *, int, int *);
void unpack_forward_comm(int, int, double *);
double memory_usage();
private:

View File

@ -506,8 +506,8 @@ int FixPeriNeigh::unpack_exchange(int nlocal, double *buf)
/* ---------------------------------------------------------------------- */
int FixPeriNeigh::pack_comm(int n, int *list, double *buf,
int pbc_flag, int *pbc)
int FixPeriNeigh::pack_forward_comm(int n, int *list, double *buf,
int pbc_flag, int *pbc)
{
int i,j,m;
@ -516,12 +516,12 @@ int FixPeriNeigh::pack_comm(int n, int *list, double *buf,
j = list[i];
buf[m++] = wvolume[j];
}
return 1;
return m;
}
/* ---------------------------------------------------------------------- */
void FixPeriNeigh::unpack_comm(int n, int first, double *buf)
void FixPeriNeigh::unpack_forward_comm(int n, int first, double *buf)
{
int i,m,last;

View File

@ -54,8 +54,8 @@ class FixPeriNeigh : public Fix {
void unpack_restart(int, int);
int size_restart(int);
int maxsize_restart();
int pack_comm(int, int *, double *, int, int *);
void unpack_comm(int, int, double *);
int pack_forward_comm(int, int *, double *, int, int *);
void unpack_forward_comm(int, int, double *);
protected:

View File

@ -799,8 +799,8 @@ double PairPeriEPS::compute_DeviatoricForceStateNorm(int i)
communication routines
---------------------------------------------------------------------- */
int PairPeriEPS::pack_comm(int n, int *list, double *buf,
int pbc_flag, int *pbc)
int PairPeriEPS::pack_forward_comm(int n, int *list, double *buf,
int pbc_flag, int *pbc)
{
int i,j,m;
@ -809,12 +809,12 @@ int PairPeriEPS::pack_comm(int n, int *list, double *buf,
j = list[i];
buf[m++] = theta[j];
}
return 1;
return m;
}
/* ---------------------------------------------------------------------- */
void PairPeriEPS::unpack_comm(int n, int first, double *buf)
void PairPeriEPS::unpack_forward_comm(int n, int first, double *buf)
{
int i,m,last;

View File

@ -31,8 +31,8 @@ class PairPeriEPS : public Pair {
PairPeriEPS(class LAMMPS *);
virtual ~PairPeriEPS();
int pack_comm(int, int *, double *, int, int *);
void unpack_comm(int, int, double *);
int pack_forward_comm(int, int *, double *, int, int *);
void unpack_forward_comm(int, int, double *);
virtual void compute(int, int);
void settings(int, char **);

View File

@ -626,8 +626,8 @@ void PairPeriLPS::compute_dilatation()
communication routines
---------------------------------------------------------------------- */
int PairPeriLPS::pack_comm(int n, int *list, double *buf,
int pbc_flag, int *pbc)
int PairPeriLPS::pack_forward_comm(int n, int *list, double *buf,
int pbc_flag, int *pbc)
{
int i,j,m;
@ -636,12 +636,12 @@ int PairPeriLPS::pack_comm(int n, int *list, double *buf,
j = list[i];
buf[m++] = theta[j];
}
return 1;
return m;
}
/* ---------------------------------------------------------------------- */
void PairPeriLPS::unpack_comm(int n, int first, double *buf)
void PairPeriLPS::unpack_forward_comm(int n, int first, double *buf)
{
int i,m,last;

View File

@ -31,8 +31,8 @@ class PairPeriLPS : public Pair {
PairPeriLPS(class LAMMPS *);
virtual ~PairPeriLPS();
int pack_comm(int, int *, double *, int, int *);
void unpack_comm(int, int, double *);
int pack_forward_comm(int, int *, double *, int, int *);
void unpack_forward_comm(int, int, double *);
virtual void compute(int, int);
void settings(int, char **);

View File

@ -696,8 +696,8 @@ void PairPeriVES::compute_dilatation()
communication routines
---------------------------------------------------------------------- */
int PairPeriVES::pack_comm(int n, int *list, double *buf,
int pbc_flag, int *pbc)
int PairPeriVES::pack_forward_comm(int n, int *list, double *buf,
int pbc_flag, int *pbc)
{
int i,j,m;
@ -706,12 +706,12 @@ int PairPeriVES::pack_comm(int n, int *list, double *buf,
j = list[i];
buf[m++] = theta[j];
}
return 1;
return m;
}
/* ---------------------------------------------------------------------- */
void PairPeriVES::unpack_comm(int n, int first, double *buf)
void PairPeriVES::unpack_forward_comm(int n, int first, double *buf)
{
int i,m,last;

View File

@ -31,8 +31,8 @@ class PairPeriVES : public Pair {
PairPeriVES(class LAMMPS *);
virtual ~PairPeriVES();
int pack_comm(int, int *, double *, int, int *);
void unpack_comm(int, int, double *);
int pack_forward_comm(int, int *, double *, int, int *);
void unpack_forward_comm(int, int, double *);
virtual void compute(int, int);
void settings(int, char **);

View File

@ -621,7 +621,8 @@ double PairREAX::init_one(int i, int j)
/* ---------------------------------------------------------------------- */
int PairREAX::pack_comm(int n, int *list, double *buf, int pbc_flag, int *pbc)
int PairREAX::pack_forward_comm(int n, int *list, double *buf,
int pbc_flag, int *pbc)
{
int i,j,m;
@ -640,12 +641,12 @@ int PairREAX::pack_comm(int n, int *list, double *buf, int pbc_flag, int *pbc)
}
}
return 1;
return m;
}
/* ---------------------------------------------------------------------- */
void PairREAX::unpack_comm(int n, int first, double *buf)
void PairREAX::unpack_forward_comm(int n, int first, double *buf)
{
int i,m,last;
@ -673,7 +674,7 @@ int PairREAX::pack_reverse_comm(int n, int first, double *buf)
for (i = first; i < last; i++)
buf[m++] = wcg[i];
return 1;
return m;
}
/* ---------------------------------------------------------------------- */

View File

@ -36,8 +36,8 @@ class PairREAX : public Pair {
double init_one(int, int);
double memory_usage();
int pack_comm(int, int *, double *, int, int *);
void unpack_comm(int, int, double *);
int pack_forward_comm(int, int *, double *, int, int *);
void unpack_forward_comm(int, int, double *);
int pack_reverse_comm(int, int, double *);
void unpack_reverse_comm(int, int *, double *);

View File

@ -2762,8 +2762,8 @@ int FixRigidSmall::unpack_exchange(int nlocal, double *buf)
for FULL_BODY, send 0/1 flag with every atom
------------------------------------------------------------------------- */
int FixRigidSmall::pack_comm(int n, int *list, double *buf,
int pbc_flag, int *pbc)
int FixRigidSmall::pack_forward_comm(int n, int *list, double *buf,
int pbc_flag, int *pbc)
{
int i,j;
double *xcm,*vcm,*quat,*omega,*ex_space,*ey_space,*ez_space,*conjqm;
@ -2850,7 +2850,7 @@ int FixRigidSmall::pack_comm(int n, int *list, double *buf,
for other commflag values, only unpack body info if atom owns it
------------------------------------------------------------------------- */
void FixRigidSmall::unpack_comm(int n, int first, double *buf)
void FixRigidSmall::unpack_forward_comm(int n, int first, double *buf)
{
int i,j,last;
double *xcm,*vcm,*quat,*omega,*ex_space,*ey_space,*ez_space,*conjqm;

View File

@ -52,8 +52,8 @@ class FixRigidSmall : public Fix {
int pack_exchange(int, double *);
int unpack_exchange(int, double *);
int pack_comm(int, int *, double *, int, int *);
void unpack_comm(int, int, double *);
int pack_forward_comm(int, int *, double *, int, int *);
void unpack_forward_comm(int, int, double *);
int pack_reverse_comm(int, int, double *);
void unpack_reverse_comm(int, int *, double *);

View File

@ -2583,7 +2583,8 @@ int FixShake::unpack_exchange(int nlocal, double *buf)
/* ---------------------------------------------------------------------- */
int FixShake::pack_comm(int n, int *list, double *buf, int pbc_flag, int *pbc)
int FixShake::pack_forward_comm(int n, int *list, double *buf,
int pbc_flag, int *pbc)
{
int i,j,m;
double dx,dy,dz;
@ -2613,12 +2614,12 @@ int FixShake::pack_comm(int n, int *list, double *buf, int pbc_flag, int *pbc)
buf[m++] = xshake[j][2] + dz;
}
}
return 3;
return m;
}
/* ---------------------------------------------------------------------- */
void FixShake::unpack_comm(int n, int first, double *buf)
void FixShake::unpack_forward_comm(int n, int first, double *buf)
{
int i,m,last;

View File

@ -44,8 +44,8 @@ class FixShake : public Fix {
int pack_exchange(int, double *);
int unpack_exchange(int, double *);
int pack_comm(int, int *, double *, int, int *);
void unpack_comm(int, int, double *);
int pack_forward_comm(int, int *, double *, int, int *);
void unpack_forward_comm(int, int, double *);
int dof(int);
void reset_dt();

View File

@ -679,13 +679,13 @@ int FixATC::unpack_exchange(int nlocal, double * buf)
return num;
}
int FixATC::pack_comm(int n, int *list, double *buf, int pbc_flag, int *pbc)
int FixATC::pack_forward_comm(int n, int *list, double *buf, int pbc_flag, int *pbc)
{
int num = atc_->pack_comm(n, list, buf, pbc_flag, pbc);
return num;
}
void FixATC::unpack_comm(int n, int first, double *buf)
void FixATC::unpack_forward_comm(int n, int first, double *buf)
{
atc_->unpack_comm(n, first, buf);
}

View File

@ -69,15 +69,15 @@ namespace LAMMPS_NS {
atom received from another processor. */
int unpack_exchange(int, double *);
/** pack_comm called from comm->forward_comm_fix and
/** pack_forward_comm called from comm->forward_comm_fix and
packs fix-specific data for a given ghost atom
from exchange with another proc */
int pack_comm(int , int *, double *, int, int *);
int pack_forward_comm(int , int *, double *, int, int *);
/** unpack_comm called from comm->forward_comm_fix and
unpacks fix-specific data for a given ghost atom
from exchange with another proc */
void unpack_comm(int, int, double *);
void unpack_forward_comm(int, int, double *);
/** pre_neighbor is used to modify fix-specific data
and is called before neighbor list is built in

View File

@ -2793,7 +2793,8 @@ void FixShakeCuda::post_force_respa(int vflag, int ilevel, int iloop)
/* ---------------------------------------------------------------------- */
int FixShakeCuda::pack_comm(int n, int* list, double* buf, int pbc_flag, int* pbc)
int FixShakeCuda::pack_forward_comm(int n, int* list, double* buf,
int pbc_flag, int* pbc)
{
if(cuda->finished_setup) {
int iswap = *list;
@ -2805,7 +2806,7 @@ int FixShakeCuda::pack_comm(int n, int* list, double* buf, int pbc_flag, int* pb
} else
Cuda_FixShakeCuda_PackComm(&cuda->shared_data, n, iswap, (void*) buf, pbc, pbc_flag);
return 3;
return 3*n;
}
int i, j, m;
@ -2839,12 +2840,12 @@ int FixShakeCuda::pack_comm(int n, int* list, double* buf, int pbc_flag, int* pb
}
}
return 3;
return m;
}
/* ---------------------------------------------------------------------- */
void FixShakeCuda::unpack_comm(int n, int first, double* buf)
void FixShakeCuda::unpack_forward_comm(int n, int first, double* buf)
{
if(cuda->finished_setup) {
Cuda_FixShakeCuda_UnpackComm(&cuda->shared_data, n, first, (void*)buf);

View File

@ -43,8 +43,8 @@ class FixShakeCuda : public Fix {
void set_arrays(int);
int pack_exchange(int, double *);
int unpack_exchange(int, double *);
int pack_comm(int, int *, double *, int, int *);
void unpack_comm(int, int, double *);
int pack_forward_comm(int, int *, double *, int, int *);
void unpack_forward_comm(int, int, double *);
int dof(int);
void reset_dt();

View File

@ -231,17 +231,18 @@ void PairEAMCuda::array2spline()
/* ---------------------------------------------------------------------- */
int PairEAMCuda::pack_comm(int n, int* iswap, double* buf, int pbc_flag, int* pbc)
int PairEAMCuda::pack_forward_comm(int n, int* iswap, double* buf,
int pbc_flag, int* pbc)
{
Cuda_PairEAMCuda_PackComm(&cuda->shared_data, n, *iswap, buf);
if(sizeof(F_FLOAT) < sizeof(double)) return 1;
else return 1;
if(sizeof(F_FLOAT) < sizeof(double)) return n;
else return n;
}
/* ---------------------------------------------------------------------- */
void PairEAMCuda::unpack_comm(int n, int first, double* buf)
void PairEAMCuda::unpack_forward_comm(int n, int first, double* buf)
{
Cuda_PairEAMCuda_UnpackComm(&cuda->shared_data, n, first, buf, cu_fp->dev_data());
}

View File

@ -57,8 +57,9 @@ class PairEAMCuda : public PairEAM
void init_list(int, class NeighList *);
void init_style();
void array2spline();
int pack_comm(int n, int *iswap, double *buf, int pbc_flag, int *pbc);
void unpack_comm(int n, int first, double *buf);
int pack_forward_comm(int n, int *iswap, double *buf,
int pbc_flag, int *pbc);
void unpack_forward_comm(int n, int first, double *buf);
protected:
class Cuda *cuda;
void allocate();

View File

@ -494,7 +494,8 @@ void PairCDEAM::read_h_coeff(char *filename)
/* ---------------------------------------------------------------------- */
int PairCDEAM::pack_comm(int n, int *list, double *buf, int pbc_flag, int *pbc)
int PairCDEAM::pack_forward_comm(int n, int *list, double *buf,
int pbc_flag, int *pbc)
{
int i,j,m;
@ -508,7 +509,7 @@ int PairCDEAM::pack_comm(int n, int *list, double *buf, int pbc_flag, int *pbc)
buf[m++] = rhoB[j];
buf[m++] = D_values[j];
}
return 4;
return m;
}
else if(cdeamVersion == 2) {
for (i = 0; i < n; i++) {
@ -517,7 +518,7 @@ int PairCDEAM::pack_comm(int n, int *list, double *buf, int pbc_flag, int *pbc)
buf[m++] = rho[j];
buf[m++] = rhoB[j];
}
return 3;
return m;
}
else { ASSERT(false); return 0; }
}
@ -526,14 +527,14 @@ int PairCDEAM::pack_comm(int n, int *list, double *buf, int pbc_flag, int *pbc)
j = list[i];
buf[m++] = D_values[j];
}
return 1;
return m;
}
else return 0;
}
/* ---------------------------------------------------------------------- */
void PairCDEAM::unpack_comm(int n, int first, double *buf)
void PairCDEAM::unpack_forward_comm(int n, int first, double *buf)
{
int i,m,last;
@ -580,14 +581,14 @@ int PairCDEAM::pack_reverse_comm(int n, int first, double *buf)
buf[m++] = rhoB[i];
buf[m++] = D_values[i];
}
return 3;
return m;
}
else if(cdeamVersion == 2) {
for(i = first; i < last; i++) {
buf[m++] = rho[i];
buf[m++] = rhoB[i];
}
return 2;
return m;
}
else { ASSERT(false); return 0; }
}
@ -595,7 +596,7 @@ int PairCDEAM::pack_reverse_comm(int n, int first, double *buf)
for(i = first; i < last; i++) {
buf[m++] = D_values[i];
}
return 1;
return m;
}
else return 0;
}

View File

@ -41,8 +41,8 @@ public:
void coeff(int, char **);
/// This is for MPI communication with neighbor nodes.
int pack_comm(int, int *, double *, int, int *);
void unpack_comm(int, int, double *);
int pack_forward_comm(int, int *, double *, int, int *);
void unpack_forward_comm(int, int, double *);
int pack_reverse_comm(int, int, double *);
void unpack_reverse_comm(int, int *, double *);

View File

@ -526,18 +526,19 @@ double PairMEAMSpline::init_one(int i, int j)
/* ---------------------------------------------------------------------- */
int PairMEAMSpline::pack_comm(int n, int *list, double *buf, int pbc_flag, int *pbc)
int PairMEAMSpline::pack_forward_comm(int n, int *list, double *buf,
int pbc_flag, int *pbc)
{
int* list_iter = list;
int* list_iter_end = list + n;
while(list_iter != list_iter_end)
*buf++ = Uprime_values[*list_iter++];
return 1;
return n;
}
/* ---------------------------------------------------------------------- */
void PairMEAMSpline::unpack_comm(int n, int first, double *buf)
void PairMEAMSpline::unpack_forward_comm(int n, int first, double *buf)
{
memcpy(&Uprime_values[first], buf, n * sizeof(buf[0]));
}

View File

@ -47,8 +47,8 @@ public:
void init_list(int, class NeighList *);
double init_one(int, int);
int pack_comm(int, int *, double *, int, int *);
void unpack_comm(int, int, double *);
int pack_forward_comm(int, int *, double *, int, int *);
void unpack_forward_comm(int, int, double *);
int pack_reverse_comm(int, int, double *);
void unpack_reverse_comm(int, int *, double *);
double memory_usage();

View File

@ -562,18 +562,19 @@ double PairMEAMSWSpline::init_one(int i, int j)
/* ---------------------------------------------------------------------- */
int PairMEAMSWSpline::pack_comm(int n, int *list, double *buf, int pbc_flag, int *pbc)
int PairMEAMSWSpline::pack_forward_comm(int n, int *list, double *buf,
int pbc_flag, int *pbc)
{
int* list_iter = list;
int* list_iter_end = list + n;
while(list_iter != list_iter_end)
*buf++ = Uprime_values[*list_iter++];
return 1;
return n;
}
/* ---------------------------------------------------------------------- */
void PairMEAMSWSpline::unpack_comm(int n, int first, double *buf)
void PairMEAMSWSpline::unpack_forward_comm(int n, int first, double *buf)
{
memcpy(&Uprime_values[first], buf, n * sizeof(buf[0]));
}

View File

@ -47,8 +47,8 @@ public:
void init_list(int, class NeighList *);
double init_one(int, int);
int pack_comm(int, int *, double *, int, int *);
void unpack_comm(int, int, double *);
int pack_forward_comm(int, int *, double *, int, int *);
void unpack_forward_comm(int, int, double *);
int pack_reverse_comm(int, int, double *);
void unpack_reverse_comm(int, int *, double *);
double memory_usage();

View File

@ -802,8 +802,8 @@ void FixQEqReax::calculate_Q()
/* ---------------------------------------------------------------------- */
int FixQEqReax::pack_comm(int n, int *list, double *buf,
int pbc_flag, int *pbc)
int FixQEqReax::pack_forward_comm(int n, int *list, double *buf,
int pbc_flag, int *pbc)
{
int m;
@ -816,12 +816,12 @@ int FixQEqReax::pack_comm(int n, int *list, double *buf,
else if( pack_flag == 4 )
for(m = 0; m < n; m++) buf[m] = atom->q[list[m]];
return 1;
return n;
}
/* ---------------------------------------------------------------------- */
void FixQEqReax::unpack_comm(int n, int first, double *buf)
void FixQEqReax::unpack_forward_comm(int n, int first, double *buf)
{
int i, m;
@ -841,7 +841,7 @@ int FixQEqReax::pack_reverse_comm(int n, int first, double *buf)
{
int i, m;
for(m = 0, i = first; m < n; m++, i++) buf[m] = q[i];
return 1;
return n;
}
/* ---------------------------------------------------------------------- */

View File

@ -120,8 +120,8 @@ class FixQEqReax : public Fix {
//int GMRES(double*,double*);
void sparse_matvec(sparse_matrix*,double*,double*);
int pack_comm(int, int *, double *, int, int *);
void unpack_comm(int, int, double *);
int pack_forward_comm(int, int *, double *, int, int *);
void unpack_forward_comm(int, int, double *);
int pack_reverse_comm(int, int, double *);
void unpack_reverse_comm(int, int *, double *);
double memory_usage();

View File

@ -135,8 +135,8 @@ int FixReaxC::unpack_exchange(int nlocal, double *buf)
/* ---------------------------------------------------------------------- */
int FixReaxC::pack_comm(int n, int *list, double *buf,
int pbc_flag, int *pbc)
int FixReaxC::pack_forward_comm(int n, int *list, double *buf,
int pbc_flag, int *pbc)
{
int i,j,m;
@ -145,12 +145,12 @@ int FixReaxC::pack_comm(int n, int *list, double *buf,
j = list[i];
buf[m++] = num_bonds[j];
}
return 1;
return m;
}
/* ---------------------------------------------------------------------- */
void FixReaxC::unpack_comm(int n, int first, double *buf)
void FixReaxC::unpack_forward_comm(int n, int first, double *buf)
{
int i,m,last;

View File

@ -47,8 +47,8 @@ class FixReaxC : public Fix {
void copy_arrays(int, int, int);
int pack_exchange(int, double *);
int unpack_exchange(int, double *);
int pack_comm(int, int *, double *, int, int *);
void unpack_comm(int, int, double *);
int pack_forward_comm(int, int *, double *, int, int *);
void unpack_forward_comm(int, int, double *);
private:
int maxbonds; // max # of bonds for any atom

View File

@ -927,8 +927,8 @@ int FixReaxCSpecies::nint(const double &r)
/* ---------------------------------------------------------------------- */
int FixReaxCSpecies::pack_comm(int n, int *list, double *buf,
int pbc_flag, int *pbc)
int FixReaxCSpecies::pack_forward_comm(int n, int *list, double *buf,
int pbc_flag, int *pbc)
{
int i,j,m;
@ -942,12 +942,12 @@ int FixReaxCSpecies::pack_comm(int n, int *list, double *buf,
buf[m+4] = x0[j].z;
m += 5;
}
return 5;
return m;
}
/* ---------------------------------------------------------------------- */
void FixReaxCSpecies::unpack_comm(int n, int first, double *buf)
void FixReaxCSpecies::unpack_forward_comm(int n, int first, double *buf)
{
int i,m,last;

View File

@ -74,8 +74,8 @@ class FixReaxCSpecies : public Fix {
int CheckExistence(int, int);
int nint(const double &);
int pack_comm(int, int *, double *, int, int *);
void unpack_comm(int, int, double *);
int pack_forward_comm(int, int *, double *, int, int *);
void unpack_forward_comm(int, int, double *);
void OpenPos();
void WritePos(int, int);
double memory_usage();

View File

@ -287,8 +287,8 @@ double PairSPHRhoSum::single(int i, int j, int itype, int jtype, double rsq,
/* ---------------------------------------------------------------------- */
int PairSPHRhoSum::pack_comm(int n, int *list, double *buf, int pbc_flag,
int *pbc) {
int PairSPHRhoSum::pack_forward_comm(int n, int *list, double *buf,
int pbc_flag, int *pbc) {
int i, j, m;
double *rho = atom->rho;
@ -297,12 +297,12 @@ int PairSPHRhoSum::pack_comm(int n, int *list, double *buf, int pbc_flag,
j = list[i];
buf[m++] = rho[j];
}
return 1;
return m;
}
/* ---------------------------------------------------------------------- */
void PairSPHRhoSum::unpack_comm(int n, int first, double *buf) {
void PairSPHRhoSum::unpack_forward_comm(int n, int first, double *buf) {
int i, m, last;
double *rho = atom->rho;

View File

@ -34,8 +34,8 @@ class PairSPHRhoSum : public Pair {
void coeff(int, char **);
virtual double init_one(int, int);
virtual double single(int, int, int, int, double, double, double, double &);
int pack_comm(int, int *, double *, int, int *);
void unpack_comm(int, int, double *);
int pack_forward_comm(int, int *, double *, int, int *);
void unpack_forward_comm(int, int, double *);
protected:
double **cut;

View File

@ -911,7 +911,6 @@ void CommBrick::borders()
/* ----------------------------------------------------------------------
forward communication invoked by a Pair
n = constant number of datums per atom
------------------------------------------------------------------------- */
void CommBrick::forward_comm_pair(Pair *pair)
@ -921,29 +920,31 @@ void CommBrick::forward_comm_pair(Pair *pair)
MPI_Request request;
MPI_Status status;
int nsize = pair->comm_forward;
for (iswap = 0; iswap < nswap; iswap++) {
// pack buffer
n = pair->pack_comm(sendnum[iswap],sendlist[iswap],
buf_send,pbc_flag[iswap],pbc[iswap]);
n = pair->pack_forward_comm(sendnum[iswap],sendlist[iswap],
buf_send,pbc_flag[iswap],pbc[iswap]);
// exchange with another proc
// if self, set recv buffer to send buffer
if (sendproc[iswap] != me) {
if (recvnum[iswap])
MPI_Irecv(buf_recv,n*recvnum[iswap],MPI_DOUBLE,recvproc[iswap],0,
world,&request);
MPI_Irecv(buf_recv,nsize*recvnum[iswap],MPI_DOUBLE,
recvproc[iswap],0,world,&request);
if (sendnum[iswap])
MPI_Send(buf_send,n*sendnum[iswap],MPI_DOUBLE,sendproc[iswap],0,world);
MPI_Send(buf_send,n,MPI_DOUBLE,sendproc[iswap],0,world);
if (recvnum[iswap]) MPI_Wait(&request,&status);
buf = buf_recv;
} else buf = buf_send;
// unpack buffer
pair->unpack_comm(recvnum[iswap],firstrecv[iswap],buf);
pair->unpack_forward_comm(recvnum[iswap],firstrecv[iswap],buf);
}
}
@ -959,6 +960,8 @@ void CommBrick::reverse_comm_pair(Pair *pair)
MPI_Request request;
MPI_Status status;
int nsize = MAX(pair->comm_reverse,pair->comm_reverse_off);
for (iswap = nswap-1; iswap >= 0; iswap--) {
// pack buffer
@ -970,10 +973,10 @@ void CommBrick::reverse_comm_pair(Pair *pair)
if (sendproc[iswap] != me) {
if (sendnum[iswap])
MPI_Irecv(buf_recv,n*sendnum[iswap],MPI_DOUBLE,sendproc[iswap],0,
MPI_Irecv(buf_recv,nsize*sendnum[iswap],MPI_DOUBLE,sendproc[iswap],0,
world,&request);
if (recvnum[iswap])
MPI_Send(buf_send,n*recvnum[iswap],MPI_DOUBLE,recvproc[iswap],0,world);
MPI_Send(buf_send,n,MPI_DOUBLE,recvproc[iswap],0,world);
if (sendnum[iswap]) MPI_Wait(&request,&status);
buf = buf_recv;
} else buf = buf_send;
@ -996,29 +999,31 @@ void CommBrick::forward_comm_fix(Fix *fix)
MPI_Request request;
MPI_Status status;
int nsize = fix->comm_forward;
for (iswap = 0; iswap < nswap; iswap++) {
// pack buffer
n = fix->pack_comm(sendnum[iswap],sendlist[iswap],
buf_send,pbc_flag[iswap],pbc[iswap]);
n = fix->pack_forward_comm(sendnum[iswap],sendlist[iswap],
buf_send,pbc_flag[iswap],pbc[iswap]);
// exchange with another proc
// if self, set recv buffer to send buffer
if (sendproc[iswap] != me) {
if (recvnum[iswap])
MPI_Irecv(buf_recv,n*recvnum[iswap],MPI_DOUBLE,recvproc[iswap],0,
MPI_Irecv(buf_recv,nsize*recvnum[iswap],MPI_DOUBLE,recvproc[iswap],0,
world,&request);
if (sendnum[iswap])
MPI_Send(buf_send,n*sendnum[iswap],MPI_DOUBLE,sendproc[iswap],0,world);
MPI_Send(buf_send,n,MPI_DOUBLE,sendproc[iswap],0,world);
if (recvnum[iswap]) MPI_Wait(&request,&status);
buf = buf_recv;
} else buf = buf_send;
// unpack buffer
fix->unpack_comm(recvnum[iswap],firstrecv[iswap],buf);
fix->unpack_forward_comm(recvnum[iswap],firstrecv[iswap],buf);
}
}
@ -1034,6 +1039,8 @@ void CommBrick::reverse_comm_fix(Fix *fix)
MPI_Request request;
MPI_Status status;
int nsize = fix->comm_reverse;
for (iswap = nswap-1; iswap >= 0; iswap--) {
// pack buffer
@ -1045,14 +1052,14 @@ void CommBrick::reverse_comm_fix(Fix *fix)
if (sendproc[iswap] != me) {
if (sendnum[iswap])
MPI_Irecv(buf_recv,n*sendnum[iswap],MPI_DOUBLE,sendproc[iswap],0,
MPI_Irecv(buf_recv,nsize*sendnum[iswap],MPI_DOUBLE,sendproc[iswap],0,
world,&request);
if (recvnum[iswap])
MPI_Send(buf_send,n*recvnum[iswap],MPI_DOUBLE,recvproc[iswap],0,world);
MPI_Send(buf_send,n,MPI_DOUBLE,recvproc[iswap],0,world);
if (sendnum[iswap]) MPI_Wait(&request,&status);
buf = buf_recv;
} else buf = buf_send;
// unpack buffer
fix->unpack_reverse_comm(sendnum[iswap],sendlist[iswap],buf);
@ -1075,8 +1082,8 @@ void CommBrick::forward_comm_variable_fix(Fix *fix)
// pack buffer
n = fix->pack_comm(sendnum[iswap],sendlist[iswap],
buf_send,pbc_flag[iswap],pbc[iswap]);
n = fix->pack_forward_comm(sendnum[iswap],sendlist[iswap],
buf_send,pbc_flag[iswap],pbc[iswap]);
// exchange with another proc
// if self, set recv buffer to send buffer
@ -1093,7 +1100,7 @@ void CommBrick::forward_comm_variable_fix(Fix *fix)
// unpack buffer
fix->unpack_comm(recvnum[iswap],firstrecv[iswap],buf);
fix->unpack_forward_comm(recvnum[iswap],firstrecv[iswap],buf);
}
}

View File

@ -1273,7 +1273,6 @@ void CommTiled::borders()
/* ----------------------------------------------------------------------
forward communication invoked by a Pair
n = constant number of datums per atom
------------------------------------------------------------------------- */
void CommTiled::forward_comm_pair(Pair *pair)
@ -1281,8 +1280,7 @@ void CommTiled::forward_comm_pair(Pair *pair)
int i,irecv,n,nsend,nrecv;
MPI_Status status;
// NOTE: what to do about nsize ???
int nsize = 1;
int nsize = pair->comm_forward;
for (int iswap = 0; iswap < nswap; iswap++) {
nsend = nsendproc[iswap] - sendself[iswap];
@ -1296,22 +1294,24 @@ void CommTiled::forward_comm_pair(Pair *pair)
}
if (sendother[iswap]) {
for (i = 0; i < nsendproc[iswap]; i++) {
n = pair->pack_comm(sendnum[iswap][i],sendlist[iswap][i],
buf_send,pbc_flag[iswap][i],pbc[iswap][i]);
n = pair->pack_forward_comm(sendnum[iswap][i],sendlist[iswap][i],
buf_send,pbc_flag[iswap][i],pbc[iswap][i]);
MPI_Send(buf_send,n,MPI_DOUBLE,sendproc[iswap][i],0,world);
}
}
if (sendself[iswap]) {
pair->pack_comm(sendnum[iswap][nsend],sendlist[iswap][nsend],
buf_send,pbc_flag[iswap][nsend],pbc[iswap][nsend]);
pair->unpack_comm(recvnum[iswap][nrecv],firstrecv[iswap][nrecv],
buf_send);
pair->pack_forward_comm(sendnum[iswap][nsend],sendlist[iswap][nsend],
buf_send,pbc_flag[iswap][nsend],
pbc[iswap][nsend]);
pair->unpack_forward_comm(recvnum[iswap][nrecv],firstrecv[iswap][nrecv],
buf_send);
}
if (recvother[iswap]) {
for (i = 0; i < nrecv; i++) {
MPI_Waitany(nrecv,requests,&irecv,&status);
pair->unpack_comm(recvnum[iswap][irecv],firstrecv[iswap][irecv],
&buf_recv[nsize*forward_recv_offset[iswap][irecv]]);
pair->unpack_forward_comm(recvnum[iswap][irecv],firstrecv[iswap][irecv],
&buf_recv[nsize*
forward_recv_offset[iswap][irecv]]);
}
}
}
@ -1327,8 +1327,7 @@ void CommTiled::reverse_comm_pair(Pair *pair)
int i,irecv,n,nsend,nrecv;
MPI_Status status;
// NOTE: what to do about nsize ???
int nsize = 1;
int nsize = MAX(pair->comm_reverse,pair->comm_reverse_off);
for (int iswap = nswap-1; iswap >= 0; iswap--) {
nsend = nsendproc[iswap] - sendself[iswap];
@ -1371,31 +1370,42 @@ void CommTiled::reverse_comm_pair(Pair *pair)
void CommTiled::forward_comm_fix(Fix *fix)
{
int i,irecv,n;
int i,irecv,n,nsend,nrecv;
MPI_Status status;
for (int iswap = 0; iswap < nswap; iswap++) {
if (sendproc[iswap][0] != me) {
for (i = 0; i < nrecvproc[iswap]; i++)
MPI_Irecv(&buf_recv[forward_recv_offset[iswap][i]],
size_forward_recv[iswap][i],
MPI_DOUBLE,recvproc[iswap][i],0,world,&requests[i]);
for (i = 0; i < nsendproc[iswap]; i++) {
n = fix->pack_comm(sendnum[iswap][i],sendlist[iswap][i],
buf_send,pbc_flag[iswap][i],pbc[iswap][i]);
MPI_Send(buf_send,n*sendnum[iswap][i],MPI_DOUBLE,
sendproc[iswap][i],0,world);
}
for (i = 0; i < nrecvproc[iswap]; i++) {
MPI_Waitany(nrecvproc[iswap],requests,&irecv,&status);
fix->unpack_comm(recvnum[iswap][irecv],firstrecv[iswap][irecv],
&buf_recv[forward_recv_offset[iswap][irecv]]);
}
int nsize = fix->comm_forward;
} else {
n = fix->pack_comm(sendnum[iswap][0],sendlist[iswap][0],
buf_send,pbc_flag[iswap][0],pbc[iswap][0]);
fix->unpack_comm(recvnum[iswap][0],firstrecv[iswap][0],buf_send);
for (int iswap = 0; iswap < nswap; iswap++) {
nsend = nsendproc[iswap] - sendself[iswap];
nrecv = nrecvproc[iswap] - sendself[iswap];
if (recvother[iswap]) {
for (i = 0; i < nrecv; i++)
MPI_Irecv(&buf_recv[nsize*forward_recv_offset[iswap][i]],
nsize*recvnum[iswap][i],
MPI_DOUBLE,recvproc[iswap][i],0,world,&requests[i]);
}
if (sendother[iswap]) {
for (i = 0; i < nsendproc[iswap]; i++) {
n = fix->pack_forward_comm(sendnum[iswap][i],sendlist[iswap][i],
buf_send,pbc_flag[iswap][i],pbc[iswap][i]);
MPI_Send(buf_send,n,MPI_DOUBLE,sendproc[iswap][i],0,world);
}
}
if (sendself[iswap]) {
fix->pack_forward_comm(sendnum[iswap][nsend],sendlist[iswap][nsend],
buf_send,pbc_flag[iswap][nsend],
pbc[iswap][nsend]);
fix->unpack_forward_comm(recvnum[iswap][nrecv],firstrecv[iswap][nrecv],
buf_send);
}
if (recvother[iswap]) {
for (i = 0; i < nrecv; i++) {
MPI_Waitany(nrecv,requests,&irecv,&status);
fix->unpack_forward_comm(recvnum[iswap][irecv],firstrecv[iswap][irecv],
&buf_recv[nsize*
forward_recv_offset[iswap][irecv]]);
}
}
}
}
@ -1407,31 +1417,41 @@ void CommTiled::forward_comm_fix(Fix *fix)
void CommTiled::reverse_comm_fix(Fix *fix)
{
int i,irecv,n;
int i,irecv,n,nsend,nrecv;
MPI_Status status;
int nsize = fix->comm_reverse;
for (int iswap = nswap-1; iswap >= 0; iswap--) {
if (sendproc[iswap][0] != me) {
for (i = 0; i < nsendproc[iswap]; i++)
MPI_Irecv(&buf_recv[reverse_recv_offset[iswap][i]],
size_reverse_recv[iswap][i],MPI_DOUBLE,
nsend = nsendproc[iswap] - sendself[iswap];
nrecv = nrecvproc[iswap] - sendself[iswap];
if (sendother[iswap]) {
for (i = 0; i < nsend; i++)
MPI_Irecv(&buf_recv[nsize*reverse_recv_offset[iswap][i]],
nsize*sendnum[iswap][i],MPI_DOUBLE,
sendproc[iswap][i],0,world,&requests[i]);
for (i = 0; i < nrecvproc[iswap]; i++) {
}
if (recvother[iswap]) {
for (i = 0; i < nrecv; i++) {
n = fix->pack_reverse_comm(recvnum[iswap][i],firstrecv[iswap][i],
buf_send);
MPI_Send(buf_send,n*recvnum[iswap][i],MPI_DOUBLE,
recvproc[iswap][i],0,world);
MPI_Send(buf_send,n,MPI_DOUBLE,recvproc[iswap][i],0,world);
}
for (i = 0; i < nsendproc[iswap]; i++) {
MPI_Waitany(nsendproc[iswap],requests,&irecv,&status);
}
if (sendself[iswap]) {
fix->pack_reverse_comm(recvnum[iswap][nrecv],firstrecv[iswap][nrecv],
buf_send);
fix->unpack_reverse_comm(sendnum[iswap][nsend],sendlist[iswap][nsend],
buf_send);
}
if (sendother[iswap]) {
for (i = 0; i < nsend; i++) {
MPI_Waitany(nsend,requests,&irecv,&status);
fix->unpack_reverse_comm(sendnum[iswap][irecv],sendlist[iswap][irecv],
&buf_recv[reverse_recv_offset[iswap][irecv]]);
&buf_recv[nsize*
reverse_recv_offset[iswap][irecv]]);
}
} else {
n = fix->pack_reverse_comm(recvnum[iswap][0],firstrecv[iswap][0],
buf_send);
fix->unpack_reverse_comm(sendnum[iswap][0],sendlist[iswap][0],buf_send);
}
}
}
@ -1616,6 +1636,8 @@ void CommTiled::forward_comm_array(int nsize, double **array)
nsend = nsendproc[iswap] - sendself[iswap];
nrecv = nrecvproc[iswap] - sendself[iswap];
MPI_Barrier(world);
if (recvother[iswap]) {
for (i = 0; i < nrecv; i++)
MPI_Irecv(&buf_recv[nsize*forward_recv_offset[iswap][i]],
@ -1651,7 +1673,7 @@ void CommTiled::forward_comm_array(int nsize, double **array)
if (recvother[iswap]) {
for (i = 0; i < nrecv; i++) {
MPI_Waitany(nrecv,requests,&irecv,&status);
m = 0;
m = nsize*forward_recv_offset[iswap][irecv];
last = firstrecv[iswap][irecv] + recvnum[iswap][irecv];
for (iatom = firstrecv[iswap][irecv]; iatom < last; iatom++)
for (k = 0; k < nsize; k++)

View File

@ -162,8 +162,8 @@ class Fix : protected Pointers {
virtual double max_alpha(double *) {return 0.0;}
virtual int min_dof() {return 0;}
virtual int pack_comm(int, int *, double *, int, int *) {return 0;}
virtual void unpack_comm(int, int, double *) {}
virtual int pack_forward_comm(int, int *, double *, int, int *) {return 0;}
virtual void unpack_forward_comm(int, int, double *) {}
virtual int pack_reverse_comm(int, int, double *) {return 0;}
virtual void unpack_reverse_comm(int, int *, double *) {}

View File

@ -163,8 +163,8 @@ class Pair : protected Pointers {
virtual void write_data(FILE *) {}
virtual void write_data_all(FILE *) {}
virtual int pack_comm(int, int *, double *, int, int *) {return 0;}
virtual void unpack_comm(int, int, double *) {}
virtual int pack_forward_comm(int, int *, double *, int, int *) {return 0;}
virtual void unpack_forward_comm(int, int, double *) {}
virtual int pack_reverse_comm(int, int, double *) {return 0;}
virtual void unpack_reverse_comm(int, int *, double *) {}
virtual double memory_usage();