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

This commit is contained in:
sjplimp 2012-02-16 16:13:15 +00:00
parent fa7b92e430
commit f55b74a85f
96 changed files with 326 additions and 136 deletions

View File

@ -118,8 +118,6 @@ void PairLJSDKCoulLong::eval()
double r,rsq,r2inv,forcecoul,forcelj,factor_coul,factor_lj;
double grij,expm2,prefactor,t,erfc;
evdwl = ecoul = 0.0;
const double * const * const x = atom->x;
double * const * const f = atom->f;
const double * const q = atom->q;
@ -151,6 +149,8 @@ void PairLJSDKCoulLong::eval()
const int jnum = numneigh[i];
for (jj = 0; jj < jnum; jj++) {
forcecoul = forcelj = evdwl = ecoul = 0.0;
j = jlist[jj];
factor_lj = special_lj[sbmask(j)];
factor_coul = special_coul[sbmask(j)];
@ -175,7 +175,13 @@ void PairLJSDKCoulLong::eval()
erfc = t * (A1+t*(A2+t*(A3+t*(A4+t*A5)))) * expm2;
prefactor = qqrd2e * qtmp*q[j]/r;
forcecoul = prefactor * (erfc + EWALD_F*grij*expm2);
if (factor_coul < 1.0) forcecoul -= (1.0-factor_coul)*prefactor;
if (EFLAG)
ecoul = prefactor*erfc;
if (factor_coul < 1.0) {
forcecoul -= (1.0-factor_coul)*prefactor;
if (EFLAG)
ecoul -= (1.0-factor_coul)*prefactor;
}
} else {
union_int_float_t rsq_lookup;
rsq_lookup.f = rsq;
@ -184,15 +190,16 @@ void PairLJSDKCoulLong::eval()
fraction = (rsq_lookup.f - rtable[itable]) * drtable[itable];
table = ftable[itable] + fraction*dftable[itable];
forcecoul = qtmp*q[j] * table;
if (EFLAG)
ecoul = qtmp*q[j] * table;
if (factor_coul < 1.0) {
table = ctable[itable] + fraction*dctable[itable];
prefactor = qtmp*q[j] * table;
forcecoul -= (1.0-factor_coul)*prefactor;
if (EFLAG)
ecoul -= (1.0-factor_coul)*prefactor;
}
}
} else {
forcecoul = 0.0;
ecoul = 0.0;
}
if (rsq < cut_ljsq[itype][jtype]) {
@ -205,7 +212,7 @@ void PairLJSDKCoulLong::eval()
if (EFLAG)
evdwl = r4inv*(lj3[itype][jtype]*r4inv*r4inv
- lj4[itype][jtype]) - offset[itype][jtype];
} else if (ljt == LJ9_6) {
const double r3inv = r2inv*sqrt(r2inv);
const double r6inv = r3inv*r3inv;
@ -223,12 +230,12 @@ void PairLJSDKCoulLong::eval()
evdwl = r6inv*(lj3[itype][jtype]*r6inv
- lj4[itype][jtype]) - offset[itype][jtype];
}
} else {
forcelj=0.0;
evdwl = 0.0;
forcelj *= factor_lj;
if (EFLAG)
evdwl *= factor_lj;
}
fpair = (forcecoul + factor_lj*forcelj) * r2inv;
fpair = (forcecoul + forcelj) * r2inv;
fxtmp += delx*fpair;
fytmp += dely*fpair;
@ -239,24 +246,9 @@ void PairLJSDKCoulLong::eval()
f[j][2] -= delz*fpair;
}
if (EFLAG) {
if (rsq < cut_coulsq) {
if (!ncoultablebits || rsq <= tabinnersq)
ecoul = prefactor*erfc;
else {
table = etable[itable] + fraction*detable[itable];
ecoul = qtmp*q[j] * table;
}
if (factor_coul < 1.0) ecoul -= (1.0-factor_coul)*prefactor;
} else ecoul = 0.0;
if (rsq < cut_ljsq[itype][jtype]) {
evdwl *= factor_lj;
} else evdwl = 0.0;
}
if (EVFLAG) ev_tally(i,j,nlocal,NEWTON_PAIR,
evdwl,ecoul,fpair,delx,dely,delz);
evdwl,ecoul,fpair,delx,dely,delz);
}
}
f[i][0] += fxtmp;
@ -662,6 +654,8 @@ double PairLJSDKCoulLong::single(int i, int j, int itype, int jtype,
double fraction,table,forcecoul,forcelj,phicoul,philj;
int itable;
forcecoul = forcelj = phicoul = philj = 0.0;
r2inv = 1.0/rsq;
if (rsq < cut_coulsq) {
if (!ncoultablebits || rsq <= tabinnersq) {
@ -672,7 +666,11 @@ double PairLJSDKCoulLong::single(int i, int j, int itype, int jtype,
erfc = t * (A1+t*(A2+t*(A3+t*(A4+t*A5)))) * expm2;
prefactor = force->qqrd2e * atom->q[i]*atom->q[j]/r;
forcecoul = prefactor * (erfc + EWALD_F*grij*expm2);
if (factor_coul < 1.0) forcecoul -= (1.0-factor_coul)*prefactor;
phicoul = prefactor*erfc;
if (factor_coul < 1.0) {
forcecoul -= (1.0-factor_coul)*prefactor;
phicoul -= (1.0-factor_coul)*prefactor;
}
} else {
union_int_float_t rsq_lookup_single;
rsq_lookup_single.f = rsq;
@ -681,13 +679,16 @@ double PairLJSDKCoulLong::single(int i, int j, int itype, int jtype,
fraction = (rsq_lookup_single.f - rtable[itable]) * drtable[itable];
table = ftable[itable] + fraction*dftable[itable];
forcecoul = atom->q[i]*atom->q[j] * table;
table = etable[itable] + fraction*detable[itable];
phicoul = atom->q[i]*atom->q[j] * table;
if (factor_coul < 1.0) {
table = ctable[itable] + fraction*dctable[itable];
prefactor = atom->q[i]*atom->q[j] * table;
forcecoul -= (1.0-factor_coul)*prefactor;
phicoul -= (1.0-factor_coul)*prefactor;
}
}
} else forcecoul = 0.0;
}
if (rsq < cut_ljsq[itype][jtype]) {
const int ljt = lj_type[itype][jtype];
@ -698,30 +699,15 @@ double PairLJSDKCoulLong::single(int i, int j, int itype, int jtype,
const double ratio = sigma[itype][jtype]/sqrt(rsq);
const double eps = epsilon[itype][jtype];
fforce = factor_lj * ljpref*eps * (ljpow1*pow(ratio,ljpow1)
forcelj = factor_lj * ljpref*eps * (ljpow1*pow(ratio,ljpow1)
- ljpow2*pow(ratio,ljpow2))/rsq;
philj = factor_lj * (ljpref*eps * (pow(ratio,ljpow1) - pow(ratio,ljpow2))
- offset[itype][jtype]);
} else fforce=0.0;
fforce = (forcecoul + factor_lj*forcelj) * r2inv;
double eng = 0.0;
if (rsq < cut_coulsq) {
if (!ncoultablebits || rsq <= tabinnersq)
phicoul = prefactor*erfc;
else {
table = etable[itable] + fraction*detable[itable];
phicoul = atom->q[i]*atom->q[j] * table;
}
if (factor_coul < 1.0) phicoul -= (1.0-factor_coul)*prefactor;
eng += phicoul;
}
if (rsq < cut_ljsq[itype][jtype])
eng += philj;
fforce = (forcecoul + forcelj) * r2inv;
return eng;
return phicoul + philj;
}
/* ---------------------------------------------------------------------- */

View File

@ -21,10 +21,6 @@
using namespace LAMMPS_NS;
using namespace FixConst;
using namespace FixConstCuda;
using namespace FixConst;
using namespace FixConstCuda;
using namespace FixConstCuda;
using namespace FixConstCuda;
/* ---------------------------------------------------------------------- */

View File

@ -22,10 +22,6 @@
using namespace LAMMPS_NS;
using namespace FixConst;
using namespace FixConstCuda;
using namespace FixConst;
using namespace FixConstCuda;
using namespace FixConstCuda;
using namespace FixConstCuda;
/* ---------------------------------------------------------------------- */

View File

@ -2450,7 +2450,7 @@ int FixShakeCuda::unpack_exchange(int nlocal, double *buf)
prediction portion is different than Verlet
rRESPA updating of atom coords is done with full v, but only portions of f
------------------------------------------------------------------------- */
/*
#if 0
void FixShakeCuda::post_force_respa(int vflag, int ilevel, int iloop)
{
// call stats only on outermost level
@ -2529,6 +2529,7 @@ void FixShakeCuda::post_force_respa(int vflag, int ilevel, int iloop)
else shake3angle(m);
}
}
#endif
/* ---------------------------------------------------------------------- */

View File

@ -154,7 +154,7 @@ void PairBornCoulLongCuda::init_style()
cuda->shared_data.pppm.qqrd2e=force->qqrd2e;
if(ncoultablebits) error->warning(FLERR,"# CUDA: You asked for the useage of Coulomb Tables. This is not supported in CUDA Pair forces. Setting is ignored.\n");
if(ncoultablebits) error->warning(FLERR,"# CUDA: You asked for the usage of Coulomb Tables. This is not supported in CUDA Pair forces. Setting is ignored.\n");
}
void PairBornCoulLongCuda::init_list(int id, NeighList *ptr)

View File

@ -141,7 +141,7 @@ void PairBuckCoulCutCuda::init_style()
cuda->shared_data.pair.cut_coulsq_global=cut_coul_global * cut_coul_global;
if(ncoultablebits) error->warning(FLERR,"# CUDA: You asked for the useage of Coulomb Tables. This is not supported in CUDA Pair forces. Setting is ignored.\n");
if(ncoultablebits) error->warning(FLERR,"# CUDA: You asked for the usage of Coulomb Tables. This is not supported in CUDA Pair forces. Setting is ignored.\n");
}
void PairBuckCoulCutCuda::init_list(int id, NeighList *ptr)

View File

@ -152,7 +152,7 @@ void PairBuckCoulLongCuda::init_style()
cuda->shared_data.pppm.qqrd2e=force->qqrd2e;
if(ncoultablebits) error->warning(FLERR,"# CUDA: You asked for the useage of Coulomb Tables. This is not supported in CUDA Pair forces. Setting is ignored.\n");
if(ncoultablebits) error->warning(FLERR,"# CUDA: You asked for the usage of Coulomb Tables. This is not supported in CUDA Pair forces. Setting is ignored.\n");
}
void PairBuckCoulLongCuda::init_list(int id, NeighList *ptr)

View File

@ -137,7 +137,7 @@ void PairBuckCuda::init_style()
cuda->shared_data.pppm.qqrd2e=force->qqrd2e;
if(ncoultablebits) error->warning(FLERR,"# CUDA: You asked for the useage of Coulomb Tables. This is not supported in CUDA Pair forces. Setting is ignored.\n");
if(ncoultablebits) error->warning(FLERR,"# CUDA: You asked for the usage of Coulomb Tables. This is not supported in CUDA Pair forces. Setting is ignored.\n");
}
void PairBuckCuda::init_list(int id, NeighList *ptr)

View File

@ -168,7 +168,7 @@ void PairLJCharmmCoulLongCuda::init_style()
cuda->shared_data.pppm.qqrd2e=force->qqrd2e;
if(ncoultablebits) error->warning(FLERR,"# CUDA: You asked for the useage of Coulomb Tables. This is not supported in CUDA Pair forces. Setting is ignored.\n");
if(ncoultablebits) error->warning(FLERR,"# CUDA: You asked for the usage of Coulomb Tables. This is not supported in CUDA Pair forces. Setting is ignored.\n");
}
void PairLJCharmmCoulLongCuda::init_list(int id, NeighList *ptr)

View File

@ -149,7 +149,7 @@ void PairLJClass2CoulLongCuda::init_style()
cuda->shared_data.pppm.qqrd2e=force->qqrd2e;
if(ncoultablebits) error->warning(FLERR,"# CUDA: You asked for the useage of Coulomb Tables. This is not supported in CUDA Pair forces. Setting is ignored.\n");
if(ncoultablebits) error->warning(FLERR,"# CUDA: You asked for the usage of Coulomb Tables. This is not supported in CUDA Pair forces. Setting is ignored.\n");
}
void PairLJClass2CoulLongCuda::init_list(int id, NeighList *ptr)

View File

@ -187,7 +187,7 @@ void PairLJCutCoulLongCuda::init_style()
cuda->shared_data.pppm.qqrd2e=force->qqrd2e;
if(ncoultablebits) error->warning(FLERR,"# CUDA: You asked for the useage of Coulomb Tables. This is not supported in CUDA Pair forces. Setting is ignored.\n");
if(ncoultablebits) error->warning(FLERR,"# CUDA: You asked for the usage of Coulomb Tables. This is not supported in CUDA Pair forces. Setting is ignored.\n");
}
void PairLJCutCoulLongCuda::init_list(int id, NeighList *ptr)

View File

@ -77,8 +77,8 @@ class PairMEAMSpline : public Pair
{
public:
PairMEAMSpline(class LAMMPS *);
~PairMEAMSpline();
void compute(int, int);
virtual ~PairMEAMSpline();
virtual void compute(int, int);
void settings(int, char **);
void coeff(int, char **);
void init_style();
@ -91,7 +91,7 @@ public:
void unpack_reverse_comm(int, int *, double *);
double memory_usage();
private:
protected:
char **elements; // names of unique elements
int *map; // mapping from atom types to elements
int nelements; // # of unique elements
@ -100,7 +100,7 @@ private:
public:
/// Default constructor.
SplineFunction() : N(0), X(NULL), Xs(NULL), Y(NULL), Y2(NULL), Ydelta(NULL) {}
SplineFunction() : X(NULL), Xs(NULL), Y(NULL), Y2(NULL), Ydelta(NULL), N(0) {}
/// Destructor.
~SplineFunction() {

View File

@ -24,7 +24,8 @@ done
if (test $1 = 1) then
if (test -e ../Makefile.package) then
sed -i -e 's|^PKG_INC =[ \t]*|&-DLMP_USER_OMP |' ../Makefile.package
sed -i -e 's/[ \t]*[^ \t=]*OMP[^ \t]*[ \t]*//g' \
-e 's|^PKG_INC =[ \t]*|&-DLMP_USER_OMP |' ../Makefile.package
fi
# force rebuild of files with LMP_USER_OMP switch
@ -37,7 +38,7 @@ if (test $1 = 1) then
elif (test $1 = 0) then
if (test -e ../Makefile.package) then
sed -i -e 's/[^ \t]*OMP[^ \t]* //g' ../Makefile.package
sed -i -e 's/[ \t=]*[^ \t]*OMP[^ \t]*[ \t]*//g' ../Makefile.package
fi
# force rebuild of files with LMP_USER_OMP switch

View File

@ -40,13 +40,14 @@
#include <stdlib.h>
#include <stdio.h>
#include "suffix.h"
#if defined(LMP_USER_CUDA)
#include "cuda_modify_flags.h"
#endif
using namespace LAMMPS_NS;
using namespace FixConst;
using namespace FixConst;
#if defined(LMP_USER_CUDA)
using namespace FixConstCuda;
#endif
@ -63,7 +64,8 @@ static int get_tid()
/* ---------------------------------------------------------------------- */
FixOMP::FixOMP(LAMMPS *lmp, int narg, char **arg) : Fix(lmp, narg, arg),
thr(NULL), last_omp_style(NULL), _nthr(-1), _neighbor(true), _newton(false)
thr(NULL), last_omp_style(NULL), last_pair_hybrid(NULL),
_nthr(-1), _neighbor(true), _newton(false)
{
if ((narg < 4) || (narg > 6)) error->all(FLERR,"Illegal fix OMP command");
if (strcmp(arg[1],"all") != 0) error->all(FLERR,"Illegal fix OMP command");
@ -192,8 +194,10 @@ void FixOMP::init()
error->all(FLERR,"Cannot use r-RESPA with /omp styles");
int check_hybrid;
last_pair_hybrid = NULL;
last_omp_style = NULL;
char *last_omp_name = NULL;
char *last_hybrid_name = NULL;
// determine which is the last force style with OpenMP
// support as this is the one that has to reduce the forces
@ -220,13 +224,21 @@ void FixOMP::init()
char *suffix = style->keywords[i] + len - 4; \
if (strcmp(suffix,"/omp") == 0) { \
last_omp_name = force->name ## _style; \
last_omp_style = (void *) force->name; \
last_omp_style = style->styles[i]; \
} \
} \
}
CheckStyleForOMP(pair);
CheckHybridForOMP(pair,Pair);
if (check_hybrid) {
PairHybrid *style = (PairHybrid *) force->pair;
for (int i=0; i < style->nstyles; i++) {
if (style->styles[i]->suffix_flag & Suffix::OMP) {
last_pair_hybrid = style->styles[i];
last_omp_name = style->keywords[i];
}
}
}
CheckStyleForOMP(bond);
CheckHybridForOMP(bond,Bond);

View File

@ -50,8 +50,10 @@ class FixOMP : public Fix {
protected:
ThrData **thr;
void *last_omp_style; // pointer to the style that needs
// to do the force reduction
void *last_omp_style; // pointer to the style that needs
// to do the general force reduction
void *last_pair_hybrid; // pointer to the pair style that needs
// to call virial_fdot_compute()
public:
bool get_neighbor() const {return _neighbor;};

View File

@ -56,14 +56,14 @@ void Neighbor::half_from_full_no_newton_omp(NeighList *list)
for (ii = ifrom; ii < ito; ii++) {
#if defined(_OPENMP)
#pragma omp critical
#endif
if (pgsize - npnt < oneatom) {
npnt = 0;
npage += nthreads;
// only one thread at a time may check whether we
// need new neighbor list pages and then add to them.
#if defined(_OPENMP)
#pragma omp critical
#endif
if (npage >= list->maxpage) list->add_pages(nthreads);
}
@ -132,14 +132,14 @@ void Neighbor::half_from_full_newton_omp(NeighList *list)
for (ii = ifrom; ii < ito; ii++) {
#if defined(_OPENMP)
#pragma omp critical
#endif
if (pgsize - npnt < oneatom) {
npnt = 0;
npage += nthreads;
// only one thread at a time may check whether we
// need new neighbor list pages and then add to them.
#if defined(_OPENMP)
#pragma omp critical
#endif
if (npage >= list->maxpage) list->add_pages(nthreads);
}

View File

@ -23,6 +23,7 @@
#include "neighbor.h"
#include "neigh_list.h"
#include "suffix.h"
using namespace LAMMPS_NS;
/* ---------------------------------------------------------------------- */
@ -30,6 +31,7 @@ using namespace LAMMPS_NS;
PairADPOMP::PairADPOMP(LAMMPS *lmp) :
PairADP(lmp), ThrOMP(lmp, THR_PAIR)
{
suffix_flag |= Suffix::OMP;
respa_enable = 0;
}

View File

@ -26,6 +26,7 @@
#include <omp.h>
#endif
#include "suffix.h"
using namespace LAMMPS_NS;
#define TOL 1.0e-9
@ -35,6 +36,7 @@ using namespace LAMMPS_NS;
PairAIREBOOMP::PairAIREBOOMP(LAMMPS *lmp) :
PairAIREBO(lmp), ThrOMP(lmp, THR_PAIR)
{
suffix_flag |= Suffix::OMP;
respa_enable = 0;
}

View File

@ -20,6 +20,7 @@
#include "neighbor.h"
#include "neigh_list.h"
#include "suffix.h"
using namespace LAMMPS_NS;
#define EWALD_F 1.12837917
@ -35,6 +36,7 @@ using namespace LAMMPS_NS;
PairBornCoulLongOMP::PairBornCoulLongOMP(LAMMPS *lmp) :
PairBornCoulLong(lmp), ThrOMP(lmp, THR_PAIR)
{
suffix_flag |= Suffix::OMP;
respa_enable = 0;
}

View File

@ -21,6 +21,7 @@
#include "neigh_list.h"
#include "math_const.h"
#include "suffix.h"
using namespace LAMMPS_NS;
using namespace MathConst;
@ -29,6 +30,7 @@ using namespace MathConst;
PairBornCoulWolfOMP::PairBornCoulWolfOMP(LAMMPS *lmp) :
PairBornCoulWolf(lmp), ThrOMP(lmp, THR_PAIR)
{
suffix_flag |= Suffix::OMP;
respa_enable = 0;
}

View File

@ -20,6 +20,7 @@
#include "neighbor.h"
#include "neigh_list.h"
#include "suffix.h"
using namespace LAMMPS_NS;
/* ---------------------------------------------------------------------- */
@ -27,6 +28,7 @@ using namespace LAMMPS_NS;
PairBornOMP::PairBornOMP(LAMMPS *lmp) :
PairBorn(lmp), ThrOMP(lmp, THR_PAIR)
{
suffix_flag |= Suffix::OMP;
respa_enable = 0;
}

View File

@ -23,6 +23,7 @@
#include "random_mars.h"
#include "math_const.h"
#include "suffix.h"
using namespace LAMMPS_NS;
using namespace MathConst;
@ -33,6 +34,7 @@ using namespace MathConst;
PairBrownianOMP::PairBrownianOMP(LAMMPS *lmp) :
PairBrownian(lmp), ThrOMP(lmp, THR_PAIR)
{
suffix_flag |= Suffix::OMP;
respa_enable = 0;
random_thr = NULL;
}

View File

@ -23,6 +23,7 @@
#include "random_mars.h"
#include "math_const.h"
#include "suffix.h"
using namespace LAMMPS_NS;
using namespace MathConst;
@ -33,6 +34,7 @@ using namespace MathConst;
PairBrownianPolyOMP::PairBrownianPolyOMP(LAMMPS *lmp) :
PairBrownianPoly(lmp), ThrOMP(lmp, THR_PAIR)
{
suffix_flag |= Suffix::OMP;
respa_enable = 0;
random_thr = NULL;
}

View File

@ -20,6 +20,7 @@
#include "neighbor.h"
#include "neigh_list.h"
#include "suffix.h"
using namespace LAMMPS_NS;
/* ---------------------------------------------------------------------- */
@ -27,6 +28,7 @@ using namespace LAMMPS_NS;
PairBuckCoulCutOMP::PairBuckCoulCutOMP(LAMMPS *lmp) :
PairBuckCoulCut(lmp), ThrOMP(lmp, THR_PAIR)
{
suffix_flag |= Suffix::OMP;
respa_enable = 0;
}

View File

@ -20,6 +20,7 @@
#include "neighbor.h"
#include "neigh_list.h"
#include "suffix.h"
using namespace LAMMPS_NS;
#define EWALD_F 1.12837917
@ -35,6 +36,7 @@ using namespace LAMMPS_NS;
PairBuckCoulLongOMP::PairBuckCoulLongOMP(LAMMPS *lmp) :
PairBuckCoulLong(lmp), ThrOMP(lmp, THR_PAIR)
{
suffix_flag |= Suffix::OMP;
respa_enable = 0;
}

View File

@ -21,6 +21,7 @@
#include "neighbor.h"
#include "neigh_list.h"
#include "suffix.h"
using namespace LAMMPS_NS;
#define EWALD_F 1.12837917
@ -36,6 +37,7 @@ using namespace LAMMPS_NS;
PairBuckCoulOMP::PairBuckCoulOMP(LAMMPS *lmp) :
PairBuckCoul(lmp), ThrOMP(lmp, THR_PAIR)
{
suffix_flag |= Suffix::OMP;
respa_enable = 0;
}

View File

@ -20,6 +20,7 @@
#include "neighbor.h"
#include "neigh_list.h"
#include "suffix.h"
using namespace LAMMPS_NS;
/* ---------------------------------------------------------------------- */
@ -27,6 +28,7 @@ using namespace LAMMPS_NS;
PairBuckOMP::PairBuckOMP(LAMMPS *lmp) :
PairBuck(lmp), ThrOMP(lmp, THR_PAIR)
{
suffix_flag |= Suffix::OMP;
respa_enable = 0;
}

View File

@ -24,6 +24,7 @@
#include "neighbor.h"
#include "neigh_list.h"
#include "suffix.h"
using namespace LAMMPS_NS;
// This is for debugging purposes. The ASSERT() macro is used in the code to check
@ -46,6 +47,7 @@ using namespace LAMMPS_NS;
PairCDEAMOMP::PairCDEAMOMP(LAMMPS *lmp, int _cdeamVersion) :
PairEAM(lmp), PairCDEAM(lmp,_cdeamVersion), ThrOMP(lmp, THR_PAIR)
{
suffix_flag |= Suffix::OMP;
respa_enable = 0;
}

View File

@ -21,6 +21,7 @@
#include "neighbor.h"
#include "neigh_list.h"
#include "suffix.h"
using namespace LAMMPS_NS;
/* ---------------------------------------------------------------------- */
@ -28,6 +29,7 @@ using namespace LAMMPS_NS;
PairColloidOMP::PairColloidOMP(LAMMPS *lmp) :
PairColloid(lmp), ThrOMP(lmp, THR_PAIR)
{
suffix_flag |= Suffix::OMP;
respa_enable = 0;
}

View File

@ -22,6 +22,7 @@
#include "neighbor.h"
#include "neigh_list.h"
#include "suffix.h"
using namespace LAMMPS_NS;
#define MAXNEIGH 24
@ -31,6 +32,7 @@ using namespace LAMMPS_NS;
PairCombOMP::PairCombOMP(LAMMPS *lmp) :
PairComb(lmp), ThrOMP(lmp, THR_PAIR)
{
suffix_flag |= Suffix::OMP;
respa_enable = 0;
}

View File

@ -20,6 +20,7 @@
#include "neighbor.h"
#include "neigh_list.h"
#include "suffix.h"
using namespace LAMMPS_NS;
/* ---------------------------------------------------------------------- */
@ -27,6 +28,7 @@ using namespace LAMMPS_NS;
PairCoulCutOMP::PairCoulCutOMP(LAMMPS *lmp) :
PairCoulCut(lmp), ThrOMP(lmp, THR_PAIR)
{
suffix_flag |= Suffix::OMP;
respa_enable = 0;
}

View File

@ -20,6 +20,7 @@
#include "neighbor.h"
#include "neigh_list.h"
#include "suffix.h"
using namespace LAMMPS_NS;
/* ---------------------------------------------------------------------- */
@ -27,6 +28,7 @@ using namespace LAMMPS_NS;
PairCoulDebyeOMP::PairCoulDebyeOMP(LAMMPS *lmp) :
PairCoulDebye(lmp), ThrOMP(lmp, THR_PAIR)
{
suffix_flag |= Suffix::OMP;
respa_enable = 0;
}

View File

@ -20,6 +20,7 @@
#include "neighbor.h"
#include "neigh_list.h"
#include "suffix.h"
using namespace LAMMPS_NS;
/* ---------------------------------------------------------------------- */
@ -27,6 +28,7 @@ using namespace LAMMPS_NS;
PairCoulDielOMP::PairCoulDielOMP(LAMMPS *lmp) :
PairCoulDiel(lmp), ThrOMP(lmp, THR_PAIR)
{
suffix_flag |= Suffix::OMP;
respa_enable = 0;
}

View File

@ -20,6 +20,7 @@
#include "neighbor.h"
#include "neigh_list.h"
#include "suffix.h"
using namespace LAMMPS_NS;
#define EWALD_F 1.12837917
@ -35,6 +36,7 @@ using namespace LAMMPS_NS;
PairCoulLongOMP::PairCoulLongOMP(LAMMPS *lmp) :
PairCoulLong(lmp), ThrOMP(lmp, THR_PAIR)
{
suffix_flag |= Suffix::OMP;
respa_enable = 0;
}

View File

@ -21,6 +21,7 @@
#include "neigh_list.h"
#include "math_const.h"
#include "suffix.h"
using namespace LAMMPS_NS;
using namespace MathConst;
@ -29,6 +30,7 @@ using namespace MathConst;
PairCoulWolfOMP::PairCoulWolfOMP(LAMMPS *lmp) :
PairCoulWolf(lmp), ThrOMP(lmp, THR_PAIR)
{
suffix_flag |= Suffix::OMP;
respa_enable = 0;
}

View File

@ -20,6 +20,7 @@
#include "neighbor.h"
#include "neigh_list.h"
#include "suffix.h"
using namespace LAMMPS_NS;
/* ---------------------------------------------------------------------- */
@ -27,6 +28,7 @@ using namespace LAMMPS_NS;
PairDipoleCutOMP::PairDipoleCutOMP(LAMMPS *lmp) :
PairDipoleCut(lmp), ThrOMP(lmp, THR_PAIR)
{
suffix_flag |= Suffix::OMP;
respa_enable = 0;
}

View File

@ -20,6 +20,7 @@
#include "neighbor.h"
#include "neigh_list.h"
#include "suffix.h"
using namespace LAMMPS_NS;
/* ---------------------------------------------------------------------- */
@ -27,6 +28,7 @@ using namespace LAMMPS_NS;
PairDipoleSFOMP::PairDipoleSFOMP(LAMMPS *lmp) :
PairDipoleSF(lmp), ThrOMP(lmp, THR_PAIR)
{
suffix_flag |= Suffix::OMP;
respa_enable = 0;
}

View File

@ -22,6 +22,7 @@
#include "update.h"
#include "random_mars.h"
#include "suffix.h"
using namespace LAMMPS_NS;
#define EPSILON 1.0e-10
@ -31,6 +32,7 @@ using namespace LAMMPS_NS;
PairDPDOMP::PairDPDOMP(LAMMPS *lmp) :
PairDPD(lmp), ThrOMP(lmp, THR_PAIR)
{
suffix_flag |= Suffix::OMP;
respa_enable = 0;
random_thr = NULL;
}

View File

@ -22,6 +22,7 @@
#include "update.h"
#include "random_mars.h"
#include "suffix.h"
using namespace LAMMPS_NS;
#define EPSILON 1.0e-10
@ -31,6 +32,7 @@ using namespace LAMMPS_NS;
PairDPDTstatOMP::PairDPDTstatOMP(LAMMPS *lmp) :
PairDPDTstat(lmp), ThrOMP(lmp, THR_PAIR)
{
suffix_flag |= Suffix::OMP;
respa_enable = 0;
random_thr = NULL;
}

View File

@ -23,6 +23,7 @@
#include "neighbor.h"
#include "neigh_list.h"
#include "suffix.h"
using namespace LAMMPS_NS;
/* ---------------------------------------------------------------------- */
@ -30,6 +31,7 @@ using namespace LAMMPS_NS;
PairEAMOMP::PairEAMOMP(LAMMPS *lmp) :
PairEAM(lmp), ThrOMP(lmp, THR_PAIR)
{
suffix_flag |= Suffix::OMP;
respa_enable = 0;
}

View File

@ -20,6 +20,7 @@
#include "neighbor.h"
#include "neigh_list.h"
#include "suffix.h"
using namespace LAMMPS_NS;
/* ---------------------------------------------------------------------- */
@ -27,6 +28,7 @@ using namespace LAMMPS_NS;
PairEDIPOMP::PairEDIPOMP(LAMMPS *lmp) :
PairEDIP(lmp), ThrOMP(lmp, THR_PAIR)
{
suffix_flag |= Suffix::OMP;
respa_enable = 0;
}

View File

@ -23,6 +23,7 @@
#include "neighbor.h"
#include "neigh_list.h"
#include "suffix.h"
using namespace LAMMPS_NS;
/* ---------------------------------------------------------------------- */
@ -30,6 +31,7 @@ using namespace LAMMPS_NS;
PairEIMOMP::PairEIMOMP(LAMMPS *lmp) :
PairEIM(lmp), ThrOMP(lmp, THR_PAIR)
{
suffix_flag |= Suffix::OMP;
respa_enable = 0;
}

View File

@ -20,6 +20,7 @@
#include "neighbor.h"
#include "neigh_list.h"
#include "suffix.h"
using namespace LAMMPS_NS;
/* ---------------------------------------------------------------------- */
@ -27,6 +28,7 @@ using namespace LAMMPS_NS;
PairGaussCutOMP::PairGaussCutOMP(LAMMPS *lmp) :
PairGaussCut(lmp), ThrOMP(lmp, THR_PAIR)
{
suffix_flag |= Suffix::OMP;
respa_enable = 0;
}

View File

@ -20,6 +20,7 @@
#include "neighbor.h"
#include "neigh_list.h"
#include "suffix.h"
using namespace LAMMPS_NS;
#define EPSILON 1.0e-10
@ -28,6 +29,7 @@ using namespace LAMMPS_NS;
PairGaussOMP::PairGaussOMP(LAMMPS *lmp) :
PairGauss(lmp), ThrOMP(lmp, THR_PAIR)
{
suffix_flag |= Suffix::OMP;
respa_enable = 0;
}

View File

@ -22,6 +22,7 @@
#include "neighbor.h"
#include "neigh_list.h"
#include "suffix.h"
using namespace LAMMPS_NS;
/* ---------------------------------------------------------------------- */
@ -29,6 +30,7 @@ using namespace LAMMPS_NS;
PairGayBerneOMP::PairGayBerneOMP(LAMMPS *lmp) :
PairGayBerne(lmp), ThrOMP(lmp, THR_PAIR)
{
suffix_flag |= Suffix::OMP;
respa_enable = 0;
}

View File

@ -21,6 +21,7 @@
#include "neigh_list.h"
#include "update.h"
#include "suffix.h"
using namespace LAMMPS_NS;
/* ---------------------------------------------------------------------- */
@ -28,6 +29,7 @@ using namespace LAMMPS_NS;
PairGranHertzHistoryOMP::PairGranHertzHistoryOMP(LAMMPS *lmp) :
PairGranHertzHistory(lmp), ThrOMP(lmp, THR_PAIR)
{
suffix_flag |= Suffix::OMP;
respa_enable = 0;
}

View File

@ -23,6 +23,7 @@
#include "string.h"
#include "suffix.h"
using namespace LAMMPS_NS;
/* ---------------------------------------------------------------------- */
@ -30,6 +31,7 @@ using namespace LAMMPS_NS;
PairGranHookeHistoryOMP::PairGranHookeHistoryOMP(LAMMPS *lmp) :
PairGranHookeHistory(lmp), ThrOMP(lmp, THR_PAIR)
{
suffix_flag |= Suffix::OMP;
respa_enable = 0;
// trigger use of OpenMP version of FixShearHistory
suffix = new char[4];

View File

@ -20,6 +20,7 @@
#include "neighbor.h"
#include "neigh_list.h"
#include "suffix.h"
using namespace LAMMPS_NS;
/* ---------------------------------------------------------------------- */
@ -27,6 +28,7 @@ using namespace LAMMPS_NS;
PairGranHookeOMP::PairGranHookeOMP(LAMMPS *lmp) :
PairGranHooke(lmp), ThrOMP(lmp, THR_PAIR)
{
suffix_flag |= Suffix::OMP;
respa_enable = 0;
}

View File

@ -23,6 +23,7 @@
#include "math_const.h"
#include "suffix.h"
using namespace LAMMPS_NS;
using namespace MathConst;
@ -33,6 +34,7 @@ using namespace MathConst;
PairHbondDreidingLJOMP::PairHbondDreidingLJOMP(LAMMPS *lmp) :
PairHbondDreidingLJ(lmp), ThrOMP(lmp, THR_PAIR)
{
suffix_flag |= Suffix::OMP;
respa_enable = 0;
hbcount_thr = hbeng_thr = NULL;
}
@ -41,7 +43,6 @@ PairHbondDreidingLJOMP::PairHbondDreidingLJOMP(LAMMPS *lmp) :
PairHbondDreidingLJOMP::~PairHbondDreidingLJOMP()
{
respa_enable = 0;
if (hbcount_thr) {
delete[] hbcount_thr;
delete[] hbeng_thr;

View File

@ -23,6 +23,7 @@
#include "math_const.h"
#include "suffix.h"
using namespace LAMMPS_NS;
using namespace MathConst;
@ -33,6 +34,7 @@ using namespace MathConst;
PairHbondDreidingMorseOMP::PairHbondDreidingMorseOMP(LAMMPS *lmp) :
PairHbondDreidingMorse(lmp), ThrOMP(lmp, THR_PAIR)
{
suffix_flag |= Suffix::OMP;
respa_enable = 0;
hbcount_thr = hbeng_thr = NULL;
}
@ -41,7 +43,6 @@ PairHbondDreidingMorseOMP::PairHbondDreidingMorseOMP(LAMMPS *lmp) :
PairHbondDreidingMorseOMP::~PairHbondDreidingMorseOMP()
{
respa_enable = 0;
if (hbcount_thr) {
delete[] hbcount_thr;
delete[] hbeng_thr;

View File

@ -26,6 +26,7 @@
#include <string.h>
#include "suffix.h"
using namespace LAMMPS_NS;
/* ---------------------------------------------------------------------- */
@ -33,6 +34,7 @@ using namespace LAMMPS_NS;
PairLineLJOMP::PairLineLJOMP(LAMMPS *lmp) :
PairLineLJ(lmp), ThrOMP(lmp, THR_PAIR)
{
suffix_flag |= Suffix::OMP;
respa_enable = 0;
}

View File

@ -20,6 +20,7 @@
#include "neighbor.h"
#include "neigh_list.h"
#include "suffix.h"
using namespace LAMMPS_NS;
/* ---------------------------------------------------------------------- */
@ -27,6 +28,7 @@ using namespace LAMMPS_NS;
PairLJ96CutOMP::PairLJ96CutOMP(LAMMPS *lmp) :
PairLJ96Cut(lmp), ThrOMP(lmp, THR_PAIR)
{
suffix_flag |= Suffix::OMP;
respa_enable = 0;
}

View File

@ -20,6 +20,7 @@
#include "neighbor.h"
#include "neigh_list.h"
#include "suffix.h"
using namespace LAMMPS_NS;
/* ---------------------------------------------------------------------- */
@ -27,6 +28,7 @@ using namespace LAMMPS_NS;
PairLJCharmmCoulCharmmImplicitOMP::PairLJCharmmCoulCharmmImplicitOMP(LAMMPS *lmp) :
PairLJCharmmCoulCharmmImplicit(lmp), ThrOMP(lmp, THR_PAIR)
{
suffix_flag |= Suffix::OMP;
respa_enable = 0;
}

View File

@ -20,6 +20,7 @@
#include "neighbor.h"
#include "neigh_list.h"
#include "suffix.h"
using namespace LAMMPS_NS;
/* ---------------------------------------------------------------------- */
@ -27,6 +28,7 @@ using namespace LAMMPS_NS;
PairLJCharmmCoulCharmmOMP::PairLJCharmmCoulCharmmOMP(LAMMPS *lmp) :
PairLJCharmmCoulCharmm(lmp), ThrOMP(lmp, THR_PAIR)
{
suffix_flag |= Suffix::OMP;
respa_enable = 0;
}

View File

@ -20,6 +20,7 @@
#include "neighbor.h"
#include "neigh_list.h"
#include "suffix.h"
using namespace LAMMPS_NS;
#define EWALD_F 1.12837917
@ -35,6 +36,7 @@ using namespace LAMMPS_NS;
PairLJCharmmCoulLongOMP::PairLJCharmmCoulLongOMP(LAMMPS *lmp) :
PairLJCharmmCoulLong(lmp), ThrOMP(lmp, THR_PAIR)
{
suffix_flag |= Suffix::OMP;
respa_enable = 0;
}

View File

@ -25,6 +25,7 @@
#include <string.h>
#include "suffix.h"
using namespace LAMMPS_NS;
#define EWALD_F 1.12837917
@ -40,9 +41,10 @@ using namespace LAMMPS_NS;
PairLJCharmmCoulPPPMOMP::PairLJCharmmCoulPPPMOMP(LAMMPS *lmp) :
PairLJCharmmCoulLong(lmp), ThrOMP(lmp, THR_PAIR|THR_PROXY)
{
suffix_flag |= Suffix::OMP;
respa_enable = 0;
nproxy=1;
kspace = NULL;
}

View File

@ -20,6 +20,7 @@
#include "neighbor.h"
#include "neigh_list.h"
#include "suffix.h"
using namespace LAMMPS_NS;
/* ---------------------------------------------------------------------- */
@ -27,6 +28,7 @@ using namespace LAMMPS_NS;
PairLJClass2CoulCutOMP::PairLJClass2CoulCutOMP(LAMMPS *lmp) :
PairLJClass2CoulCut(lmp), ThrOMP(lmp, THR_PAIR)
{
suffix_flag |= Suffix::OMP;
respa_enable = 0;
}

View File

@ -20,6 +20,7 @@
#include "neighbor.h"
#include "neigh_list.h"
#include "suffix.h"
using namespace LAMMPS_NS;
#define EWALD_F 1.12837917
@ -35,6 +36,7 @@ using namespace LAMMPS_NS;
PairLJClass2CoulLongOMP::PairLJClass2CoulLongOMP(LAMMPS *lmp) :
PairLJClass2CoulLong(lmp), ThrOMP(lmp, THR_PAIR)
{
suffix_flag |= Suffix::OMP;
respa_enable = 0;
}

View File

@ -25,6 +25,7 @@
#include <string.h>
#include "suffix.h"
using namespace LAMMPS_NS;
#define EWALD_F 1.12837917
@ -40,9 +41,10 @@ using namespace LAMMPS_NS;
PairLJClass2CoulPPPMOMP::PairLJClass2CoulPPPMOMP(LAMMPS *lmp) :
PairLJClass2CoulLong(lmp), ThrOMP(lmp, THR_PAIR|THR_PROXY)
{
suffix_flag |= Suffix::OMP;
respa_enable = 0;
nproxy=1;
kspace = NULL;
}

View File

@ -20,6 +20,7 @@
#include "neighbor.h"
#include "neigh_list.h"
#include "suffix.h"
using namespace LAMMPS_NS;
/* ---------------------------------------------------------------------- */
@ -27,6 +28,7 @@ using namespace LAMMPS_NS;
PairLJClass2OMP::PairLJClass2OMP(LAMMPS *lmp) :
PairLJClass2(lmp), ThrOMP(lmp, THR_PAIR)
{
suffix_flag |= Suffix::OMP;
respa_enable = 0;
}

View File

@ -21,6 +21,7 @@
#include "neighbor.h"
#include "neigh_list.h"
#include "suffix.h"
using namespace LAMMPS_NS;
#define EWALD_F 1.12837917
@ -36,6 +37,7 @@ using namespace LAMMPS_NS;
PairLJCoulOMP::PairLJCoulOMP(LAMMPS *lmp) :
PairLJCoul(lmp), ThrOMP(lmp, THR_PAIR)
{
suffix_flag |= Suffix::OMP;
respa_enable = 0;
}

View File

@ -20,6 +20,7 @@
#include "neighbor.h"
#include "neigh_list.h"
#include "suffix.h"
using namespace LAMMPS_NS;
using namespace PairLJCubicConstants;
@ -28,6 +29,7 @@ using namespace PairLJCubicConstants;
PairLJCubicOMP::PairLJCubicOMP(LAMMPS *lmp) :
PairLJCubic(lmp), ThrOMP(lmp, THR_PAIR)
{
suffix_flag |= Suffix::OMP;
respa_enable = 0;
}

View File

@ -20,6 +20,7 @@
#include "neighbor.h"
#include "neigh_list.h"
#include "suffix.h"
using namespace LAMMPS_NS;
/* ---------------------------------------------------------------------- */
@ -27,6 +28,7 @@ using namespace LAMMPS_NS;
PairLJCutCoulCutOMP::PairLJCutCoulCutOMP(LAMMPS *lmp) :
PairLJCutCoulCut(lmp), ThrOMP(lmp, THR_PAIR)
{
suffix_flag |= Suffix::OMP;
respa_enable = 0;
}

View File

@ -20,6 +20,7 @@
#include "neighbor.h"
#include "neigh_list.h"
#include "suffix.h"
using namespace LAMMPS_NS;
/* ---------------------------------------------------------------------- */
@ -27,6 +28,7 @@ using namespace LAMMPS_NS;
PairLJCutCoulDebyeOMP::PairLJCutCoulDebyeOMP(LAMMPS *lmp) :
PairLJCutCoulDebye(lmp), ThrOMP(lmp, THR_PAIR)
{
suffix_flag |= Suffix::OMP;
respa_enable = 0;
}

View File

@ -20,6 +20,7 @@
#include "neighbor.h"
#include "neigh_list.h"
#include "suffix.h"
using namespace LAMMPS_NS;
#define EWALD_F 1.12837917
@ -35,6 +36,7 @@ using namespace LAMMPS_NS;
PairLJCutCoulLongOMP::PairLJCutCoulLongOMP(LAMMPS *lmp) :
PairLJCutCoulLong(lmp), ThrOMP(lmp, THR_PAIR)
{
suffix_flag |= Suffix::OMP;
respa_enable = 0;
}

View File

@ -23,6 +23,7 @@
#include "memory.h"
#include "neigh_list.h"
#include "suffix.h"
using namespace LAMMPS_NS;
#define EWALD_F 1.12837917
@ -38,6 +39,7 @@ using namespace LAMMPS_NS;
PairLJCutCoulLongTIP4POMP::PairLJCutCoulLongTIP4POMP(LAMMPS *lmp) :
PairLJCutCoulLongTIP4P(lmp), ThrOMP(lmp, THR_PAIR)
{
suffix_flag |= Suffix::OMP;
respa_enable = 0;
// for caching m-shift corrected positions

View File

@ -25,6 +25,7 @@
#include <string.h>
#include "suffix.h"
using namespace LAMMPS_NS;
#define EWALD_F 1.12837917
@ -40,9 +41,10 @@ using namespace LAMMPS_NS;
PairLJCutCoulPPPMOMP::PairLJCutCoulPPPMOMP(LAMMPS *lmp) :
PairLJCutCoulLong(lmp), ThrOMP(lmp, THR_PAIR|THR_PROXY)
{
suffix_flag |= Suffix::OMP;
respa_enable = 0;
nproxy=1;
kspace = NULL;
}

View File

@ -27,6 +27,7 @@
#include <string.h>
#include "suffix.h"
using namespace LAMMPS_NS;
#define EWALD_F 1.12837917
@ -42,6 +43,7 @@ using namespace LAMMPS_NS;
PairLJCutCoulPPPMTIP4POMP::PairLJCutCoulPPPMTIP4POMP(LAMMPS *lmp) :
PairLJCutCoulLongTIP4P(lmp), ThrOMP(lmp, THR_PAIR|THR_PROXY)
{
suffix_flag |= Suffix::OMP;
respa_enable = 0;
nproxy=1;

View File

@ -20,6 +20,7 @@
#include "neighbor.h"
#include "neigh_list.h"
#include "suffix.h"
using namespace LAMMPS_NS;
/* ---------------------------------------------------------------------- */
@ -27,6 +28,7 @@ using namespace LAMMPS_NS;
PairLJCutOMP::PairLJCutOMP(LAMMPS *lmp) :
PairLJCut(lmp), ThrOMP(lmp, THR_PAIR)
{
suffix_flag |= Suffix::OMP;
respa_enable = 0;
}

View File

@ -20,6 +20,7 @@
#include "neighbor.h"
#include "neigh_list.h"
#include "suffix.h"
using namespace LAMMPS_NS;
/* ---------------------------------------------------------------------- */
@ -27,6 +28,7 @@ using namespace LAMMPS_NS;
PairLJExpandOMP::PairLJExpandOMP(LAMMPS *lmp) :
PairLJExpand(lmp), ThrOMP(lmp, THR_PAIR)
{
suffix_flag |= Suffix::OMP;
respa_enable = 0;
}

View File

@ -20,6 +20,7 @@
#include "neighbor.h"
#include "neigh_list.h"
#include "suffix.h"
using namespace LAMMPS_NS;
/* ---------------------------------------------------------------------- */
@ -27,6 +28,7 @@ using namespace LAMMPS_NS;
PairLJGromacsCoulGromacsOMP::PairLJGromacsCoulGromacsOMP(LAMMPS *lmp) :
PairLJGromacsCoulGromacs(lmp), ThrOMP(lmp, THR_PAIR)
{
suffix_flag |= Suffix::OMP;
respa_enable = 0;
}

View File

@ -20,6 +20,7 @@
#include "neighbor.h"
#include "neigh_list.h"
#include "suffix.h"
using namespace LAMMPS_NS;
/* ---------------------------------------------------------------------- */
@ -27,6 +28,7 @@ using namespace LAMMPS_NS;
PairLJGromacsOMP::PairLJGromacsOMP(LAMMPS *lmp) :
PairLJGromacs(lmp), ThrOMP(lmp, THR_PAIR)
{
suffix_flag |= Suffix::OMP;
respa_enable = 0;
}

View File

@ -22,6 +22,7 @@
#include "lj_sdk_common.h"
#include "suffix.h"
using namespace LAMMPS_NS;
using namespace LJSDKParms;
@ -38,6 +39,7 @@ using namespace LJSDKParms;
PairLJSDKCoulLongOMP::PairLJSDKCoulLongOMP(LAMMPS *lmp) :
PairLJSDKCoulLong(lmp), ThrOMP(lmp, THR_PAIR)
{
suffix_flag |= Suffix::OMP;
respa_enable = 0;
}
@ -91,8 +93,6 @@ void PairLJSDKCoulLongOMP::eval_thr(int iifrom, int iito, ThrData * const thr)
double r,rsq,r2inv,forcecoul,forcelj,factor_coul,factor_lj;
double grij,expm2,prefactor,t,erfc;
evdwl = ecoul = 0.0;
const double * const * const x = atom->x;
double * const * const f = thr->get_f();
const double * const q = atom->q;
@ -123,6 +123,8 @@ void PairLJSDKCoulLongOMP::eval_thr(int iifrom, int iito, ThrData * const thr)
const int jnum = numneigh[i];
for (jj = 0; jj < jnum; jj++) {
forcecoul = forcelj = evdwl = ecoul = 0.0;
j = jlist[jj];
factor_lj = special_lj[sbmask(j)];
factor_coul = special_coul[sbmask(j)];
@ -147,7 +149,13 @@ void PairLJSDKCoulLongOMP::eval_thr(int iifrom, int iito, ThrData * const thr)
erfc = t * (A1+t*(A2+t*(A3+t*(A4+t*A5)))) * expm2;
prefactor = qqrd2e * qtmp*q[j]/r;
forcecoul = prefactor * (erfc + EWALD_F*grij*expm2);
if (factor_coul < 1.0) forcecoul -= (1.0-factor_coul)*prefactor;
if (EFLAG)
ecoul = prefactor*erfc;
if (factor_coul < 1.0) {
forcecoul -= (1.0-factor_coul)*prefactor;
if (EFLAG)
ecoul -= (1.0-factor_coul)*prefactor;
}
} else {
union_int_float_t rsq_lookup;
rsq_lookup.f = rsq;
@ -156,15 +164,16 @@ void PairLJSDKCoulLongOMP::eval_thr(int iifrom, int iito, ThrData * const thr)
fraction = (rsq_lookup.f - rtable[itable]) * drtable[itable];
table = ftable[itable] + fraction*dftable[itable];
forcecoul = qtmp*q[j] * table;
if (EFLAG)
ecoul = qtmp*q[j] * table;
if (factor_coul < 1.0) {
table = ctable[itable] + fraction*dctable[itable];
prefactor = qtmp*q[j] * table;
forcecoul -= (1.0-factor_coul)*prefactor;
if (EFLAG)
ecoul -= (1.0-factor_coul)*prefactor;
}
}
} else {
forcecoul = 0.0;
ecoul = 0.0;
}
if (rsq < cut_ljsq[itype][jtype]) {
@ -177,7 +186,7 @@ void PairLJSDKCoulLongOMP::eval_thr(int iifrom, int iito, ThrData * const thr)
if (EFLAG)
evdwl = r4inv*(lj3[itype][jtype]*r4inv*r4inv
- lj4[itype][jtype]) - offset[itype][jtype];
} else if (ljt == LJ9_6) {
const double r3inv = r2inv*sqrt(r2inv);
const double r6inv = r3inv*r3inv;
@ -195,12 +204,12 @@ void PairLJSDKCoulLongOMP::eval_thr(int iifrom, int iito, ThrData * const thr)
evdwl = r6inv*(lj3[itype][jtype]*r6inv
- lj4[itype][jtype]) - offset[itype][jtype];
}
} else {
forcelj=0.0;
evdwl = 0.0;
forcelj *= factor_lj;
if (EFLAG)
evdwl *= factor_lj;
}
fpair = (forcecoul + factor_lj*forcelj) * r2inv;
fpair = (forcecoul + forcelj) * r2inv;
fxtmp += delx*fpair;
fytmp += dely*fpair;
@ -211,24 +220,9 @@ void PairLJSDKCoulLongOMP::eval_thr(int iifrom, int iito, ThrData * const thr)
f[j][2] -= delz*fpair;
}
if (EFLAG) {
if (rsq < cut_coulsq) {
if (!ncoultablebits || rsq <= tabinnersq)
ecoul = prefactor*erfc;
else {
table = etable[itable] + fraction*detable[itable];
ecoul = qtmp*q[j] * table;
}
if (factor_coul < 1.0) ecoul -= (1.0-factor_coul)*prefactor;
} else ecoul = 0.0;
if (rsq < cut_ljsq[itype][jtype]) {
evdwl *= factor_lj;
} else evdwl = 0.0;
}
if (EVFLAG) ev_tally_thr(this, i,j,nlocal,NEWTON_PAIR,
if (EVFLAG) ev_tally_thr(this,i,j,nlocal,NEWTON_PAIR,
evdwl,ecoul,fpair,delx,dely,delz,thr);
}
}
f[i][0] += fxtmp;

View File

@ -23,6 +23,7 @@
#include "lj_sdk_common.h"
#include "suffix.h"
using namespace LAMMPS_NS;
using namespace LJSDKParms;
@ -31,6 +32,7 @@ using namespace LJSDKParms;
PairLJSDKOMP::PairLJSDKOMP(LAMMPS *lmp) :
PairLJSDK(lmp), ThrOMP(lmp, THR_PAIR)
{
suffix_flag |= Suffix::OMP;
respa_enable = 0;
}

View File

@ -20,6 +20,7 @@
#include "neighbor.h"
#include "neigh_list.h"
#include "suffix.h"
using namespace LAMMPS_NS;
/* ---------------------------------------------------------------------- */
@ -27,6 +28,7 @@ using namespace LAMMPS_NS;
PairLJShiftedForceOMP::PairLJShiftedForceOMP(LAMMPS *lmp) :
PairLJShiftedForce(lmp), ThrOMP(lmp, THR_PAIR)
{
suffix_flag |= Suffix::OMP;
respa_enable = 0;
}

View File

@ -20,6 +20,7 @@
#include "neighbor.h"
#include "neigh_list.h"
#include "suffix.h"
using namespace LAMMPS_NS;
/* ---------------------------------------------------------------------- */
@ -27,6 +28,7 @@ using namespace LAMMPS_NS;
PairLJSmoothLinearOMP::PairLJSmoothLinearOMP(LAMMPS *lmp) :
PairLJSmoothLinear(lmp), ThrOMP(lmp, THR_PAIR)
{
suffix_flag |= Suffix::OMP;
respa_enable = 0;
}

View File

@ -20,6 +20,7 @@
#include "neighbor.h"
#include "neigh_list.h"
#include "suffix.h"
using namespace LAMMPS_NS;
/* ---------------------------------------------------------------------- */
@ -27,6 +28,7 @@ using namespace LAMMPS_NS;
PairLJSmoothOMP::PairLJSmoothOMP(LAMMPS *lmp) :
PairLJSmooth(lmp), ThrOMP(lmp, THR_PAIR)
{
suffix_flag |= Suffix::OMP;
respa_enable = 0;
}

View File

@ -24,6 +24,7 @@
#include "random_mars.h"
#include "math_const.h"
#include "suffix.h"
using namespace LAMMPS_NS;
using namespace MathConst;
@ -32,6 +33,7 @@ using namespace MathConst;
PairLubricateOMP::PairLubricateOMP(LAMMPS *lmp) :
PairLubricate(lmp), ThrOMP(lmp, THR_PAIR)
{
suffix_flag |= Suffix::OMP;
respa_enable = 0;
}

View File

@ -24,6 +24,7 @@
#include "random_mars.h"
#include "math_const.h"
#include "suffix.h"
using namespace LAMMPS_NS;
using namespace MathConst;
@ -32,6 +33,7 @@ using namespace MathConst;
PairLubricatePolyOMP::PairLubricatePolyOMP(LAMMPS *lmp) :
PairLubricatePoly(lmp), ThrOMP(lmp, THR_PAIR)
{
suffix_flag |= Suffix::OMP;
respa_enable = 0;
}

View File

@ -20,6 +20,7 @@
#include "neighbor.h"
#include "neigh_list.h"
#include "suffix.h"
using namespace LAMMPS_NS;
/* ---------------------------------------------------------------------- */
@ -27,6 +28,7 @@ using namespace LAMMPS_NS;
PairMorseOMP::PairMorseOMP(LAMMPS *lmp) :
PairMorse(lmp), ThrOMP(lmp, THR_PAIR)
{
suffix_flag |= Suffix::OMP;
respa_enable = 0;
}

View File

@ -28,6 +28,7 @@
#include "neigh_list.h"
#include "math_const.h"
#include "suffix.h"
using namespace LAMMPS_NS;
using namespace MathConst;
@ -36,6 +37,7 @@ using namespace MathConst;
PairPeriLPSOMP::PairPeriLPSOMP(LAMMPS *lmp) :
PairPeriLPS(lmp), ThrOMP(lmp, THR_PAIR)
{
suffix_flag |= Suffix::OMP;
respa_enable = 0;
}

View File

@ -27,6 +27,7 @@
#include "neighbor.h"
#include "neigh_list.h"
#include "suffix.h"
using namespace LAMMPS_NS;
/* ---------------------------------------------------------------------- */
@ -34,6 +35,7 @@ using namespace LAMMPS_NS;
PairPeriPMBOMP::PairPeriPMBOMP(LAMMPS *lmp) :
PairPeriPMB(lmp), ThrOMP(lmp, THR_PAIR)
{
suffix_flag |= Suffix::OMP;
respa_enable = 0;
}

View File

@ -22,6 +22,7 @@
#include "neighbor.h"
#include "neigh_list.h"
#include "suffix.h"
using namespace LAMMPS_NS;
/* ---------------------------------------------------------------------- */
@ -29,6 +30,7 @@ using namespace LAMMPS_NS;
PairRESquaredOMP::PairRESquaredOMP(LAMMPS *lmp) :
PairRESquared(lmp), ThrOMP(lmp, THR_PAIR)
{
suffix_flag |= Suffix::OMP;
respa_enable = 0;
}

View File

@ -21,6 +21,7 @@
#include "neigh_list.h"
#include "math_const.h"
#include "suffix.h"
using namespace LAMMPS_NS;
using namespace MathConst;
@ -31,6 +32,7 @@ using namespace MathConst;
PairSoftOMP::PairSoftOMP(LAMMPS *lmp) :
PairSoft(lmp), ThrOMP(lmp, THR_PAIR)
{
suffix_flag |= Suffix::OMP;
respa_enable = 0;
}

View File

@ -20,6 +20,7 @@
#include "neighbor.h"
#include "neigh_list.h"
#include "suffix.h"
using namespace LAMMPS_NS;
/* ---------------------------------------------------------------------- */
@ -27,6 +28,7 @@ using namespace LAMMPS_NS;
PairSWOMP::PairSWOMP(LAMMPS *lmp) :
PairSW(lmp), ThrOMP(lmp, THR_PAIR)
{
suffix_flag |= Suffix::OMP;
respa_enable = 0;
}

View File

@ -21,6 +21,7 @@
#include "neighbor.h"
#include "neigh_list.h"
#include "suffix.h"
using namespace LAMMPS_NS;
/* ---------------------------------------------------------------------- */
@ -28,6 +29,7 @@ using namespace LAMMPS_NS;
PairTableOMP::PairTableOMP(LAMMPS *lmp) :
PairTable(lmp), ThrOMP(lmp, THR_PAIR)
{
suffix_flag |= Suffix::OMP;
respa_enable = 0;
}

View File

@ -20,6 +20,7 @@
#include "neighbor.h"
#include "neigh_list.h"
#include "suffix.h"
using namespace LAMMPS_NS;
/* ---------------------------------------------------------------------- */
@ -27,6 +28,7 @@ using namespace LAMMPS_NS;
PairTersoffOMP::PairTersoffOMP(LAMMPS *lmp) :
PairTersoff(lmp), ThrOMP(lmp, THR_PAIR)
{
suffix_flag |= Suffix::OMP;
respa_enable = 0;
}

View File

@ -21,6 +21,7 @@
#include "neighbor.h"
#include "neigh_list.h"
#include "suffix.h"
using namespace LAMMPS_NS;
/* ---------------------------------------------------------------------- */
@ -28,6 +29,7 @@ using namespace LAMMPS_NS;
PairTersoffTableOMP::PairTersoffTableOMP(LAMMPS *lmp) :
PairTersoffTable(lmp), ThrOMP(lmp, THR_PAIR)
{
suffix_flag |= Suffix::OMP;
respa_enable = 0;
}

View File

@ -28,6 +28,7 @@
#include <string.h>
#include "suffix.h"
using namespace LAMMPS_NS;
/* ---------------------------------------------------------------------- */
@ -35,6 +36,7 @@ using namespace LAMMPS_NS;
PairTriLJOMP::PairTriLJOMP(LAMMPS *lmp) :
PairTriLJ(lmp), ThrOMP(lmp, THR_PAIR)
{
suffix_flag |= Suffix::OMP;
respa_enable = 0;
}

View File

@ -20,6 +20,7 @@
#include "neighbor.h"
#include "neigh_list.h"
#include "suffix.h"
using namespace LAMMPS_NS;
/* ---------------------------------------------------------------------- */
@ -27,6 +28,7 @@ using namespace LAMMPS_NS;
PairYukawaColloidOMP::PairYukawaColloidOMP(LAMMPS *lmp) :
PairYukawaColloid(lmp), ThrOMP(lmp, THR_PAIR)
{
suffix_flag |= Suffix::OMP;
respa_enable = 0;
}

View File

@ -20,6 +20,7 @@
#include "neighbor.h"
#include "neigh_list.h"
#include "suffix.h"
using namespace LAMMPS_NS;
/* ---------------------------------------------------------------------- */
@ -27,6 +28,7 @@ using namespace LAMMPS_NS;
PairYukawaOMP::PairYukawaOMP(LAMMPS *lmp) :
PairYukawa(lmp), ThrOMP(lmp, THR_PAIR)
{
suffix_flag |= Suffix::OMP;
respa_enable = 0;
}

View File

@ -173,6 +173,8 @@ void ThrOMP::reduce_thr(void *style, const int eflag, const int vflag,
double **f = lmp->atom->f;
double **x = lmp->atom->x;
int need_force_reduce = 1;
if (evflag)
sync_threads();
@ -180,12 +182,23 @@ void ThrOMP::reduce_thr(void *style, const int eflag, const int vflag,
case THR_PAIR: {
Pair * const pair = lmp->force->pair;
if (pair->vflag_fdotr) {
if (lmp->neighbor->includegroup == 0)
thr->virial_fdotr_compute(x, nlocal, nghost, -1);
else
thr->virial_fdotr_compute(x, nlocal, nghost, nfirst);
if (style == fix->last_pair_hybrid) {
// pair_style hybrid will compute fdotr for us
// but we first need to reduce the forces
data_reduce_thr(&(f[0][0]), nall, nthreads, 3, tid);
need_force_reduce = 0;
}
// this is a non-hybrid pair style. compute per thread fdotr
if (fix->last_pair_hybrid == NULL) {
if (lmp->neighbor->includegroup == 0)
thr->virial_fdotr_compute(x, nlocal, nghost, -1);
else
thr->virial_fdotr_compute(x, nlocal, nghost, nfirst);
}
}
if (evflag) {
@ -217,12 +230,23 @@ void ThrOMP::reduce_thr(void *style, const int eflag, const int vflag,
case THR_PAIR|THR_PROXY: {
Pair * const pair = lmp->force->pair;
if (tid >= nproxy && pair->vflag_fdotr) {
if (lmp->neighbor->includegroup == 0)
thr->virial_fdotr_compute(x, nlocal, nghost, -1);
else
thr->virial_fdotr_compute(x, nlocal, nghost, nfirst);
if (fix->last_pair_hybrid) {
if (tid == nproxy)
lmp->error->all(FLERR,
"Cannot use hybrid pair style with kspace proxy");
else return;
}
// this is a non-hybrid pair style. compute per thread fdotr
if (fix->last_pair_hybrid == NULL) {
if (lmp->neighbor->includegroup == 0)
thr->virial_fdotr_compute(x, nlocal, nghost, -1);
else
thr->virial_fdotr_compute(x, nlocal, nghost, nfirst);
}
}
if (evflag) {
@ -406,8 +430,10 @@ void ThrOMP::reduce_thr(void *style, const int eflag, const int vflag,
break;
}
if (style == fix->last_omp_style) {
data_reduce_thr(&(f[0][0]), nall, nthreads, 3, tid);
if (style == fix->last_omp_style) {
if (need_force_reduce)
data_reduce_thr(&(f[0][0]), nall, nthreads, 3, tid);
if (lmp->atom->torque)
data_reduce_thr(&(lmp->atom->torque[0][0]), nall, nthreads, 3, tid);
}

View File

@ -33,6 +33,7 @@
#include "accelerator_cuda.h"
#include "memory.h"
#include "error.h"
#include "suffix.h"
using namespace LAMMPS_NS;
@ -71,6 +72,7 @@ Pair::Pair(LAMMPS *lmp) : Pointers(lmp)
tabinner = sqrt(2.0);
allocated = 0;
suffix_flag = Suffix::NONE;
maxeatom = maxvatom = 0;
eatom = NULL;

View File

@ -1,4 +1,4 @@
/* ----------------------------------------------------------------------
/* -*- c++ -*- ----------------------------------------------------------
LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator
http://lammps.sandia.gov, Sandia National Laboratories
Steve Plimpton, sjplimp@sandia.gov
@ -26,6 +26,7 @@ class Pair : protected Pointers {
friend class DihedralCharmm;
friend class DihedralCharmmOMP;
friend class FixGPU;
friend class FixOMP;
friend class ThrOMP;
public:
@ -133,7 +134,8 @@ class Pair : protected Pointers {
virtual void min_x_set(int) {}
protected:
int allocated; // 0/1 = whether arrays are allocated
int allocated; // 0/1 = whether arrays are allocated
int suffix_flag; // suffix compatibility flag
// pair_modify settings
int offset_flag,mix_flag; // flags for offset and mixing

View File

@ -28,7 +28,7 @@ class PairBeck : public Pair {
public:
PairBeck(class LAMMPS *);
virtual ~PairBeck();
void compute(int, int);
virtual void compute(int, int);
void settings(int, char **);
void coeff(int, char **);
double init_one(int, int);
@ -56,17 +56,14 @@ class PairBeck : public Pair {
E: Illegal ... command
Self-explanatory. Check the input script syntax and compare to the
documentation for the command. You can use -echo screen as a
command-line option when running LAMMPS to see the offending line.
UNDOCUMENTED
E: Incorrect args for pair coefficients
Self-explanatory. Check the input script or data file.
UNDOCUMENTED
E: All pair coeffs are not set
All pair coefficients must be set in the data file or by the
pair_coeff command before running a simulation.
UNDOCUMENTED
*/

29
src/suffix.h Normal file
View File

@ -0,0 +1,29 @@
/* ----------------------------------------------------------------------
LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator
http://lammps.sandia.gov, Sandia National Laboratories
Steve Plimpton, sjplimp@sandia.gov
Copyright (2003) Sandia Corporation. Under the terms of Contract
DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
certain rights in this software. This software is distributed under
the GNU General Public License.
See the README file in the top-level LAMMPS directory.
------------------------------------------------------------------------- */
#ifndef LMP_SUFFIX_H
#define LMP_SUFFIX_H
namespace LAMMPS_NS {
namespace Suffix {
static const int NONE = 0;
static const int OPT = 1<<0;
static const int GPU = 1<<1;
static const int CUDA = 1<<2;
static const int OMP = 1<<3;
}
}
#endif