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

This commit is contained in:
sjplimp
2014-04-09 14:28:46 +00:00
parent 51f4c3b0cc
commit cd3dbc40fd
9 changed files with 24 additions and 26 deletions

View File

@ -95,6 +95,7 @@ void AngleCharmmOMP::eval(int nfrom, int nto, ThrData * const thr)
dbl3_t * _noalias const f = (dbl3_t *) thr->get_f()[0]; dbl3_t * _noalias const f = (dbl3_t *) thr->get_f()[0];
const int4_t * _noalias const anglelist = (int4_t *) neighbor->anglelist[0]; const int4_t * _noalias const anglelist = (int4_t *) neighbor->anglelist[0];
const int nlocal = atom->nlocal; const int nlocal = atom->nlocal;
eangle = 0.0;
for (n = nfrom; n < nto; n++) { for (n = nfrom; n < nto; n++) {
i1 = anglelist[n].a; i1 = anglelist[n].a;

View File

@ -94,6 +94,7 @@ void AngleFourierOMP::eval(int nfrom, int nto, ThrData * const thr)
dbl3_t * _noalias const f = (dbl3_t *) thr->get_f()[0]; dbl3_t * _noalias const f = (dbl3_t *) thr->get_f()[0];
const int4_t * _noalias const anglelist = (int4_t *) neighbor->anglelist[0]; const int4_t * _noalias const anglelist = (int4_t *) neighbor->anglelist[0];
const int nlocal = atom->nlocal; const int nlocal = atom->nlocal;
eangle = 0.0;
for (n = nfrom; n < nto; n++) { for (n = nfrom; n < nto; n++) {
i1 = anglelist[n].a; i1 = anglelist[n].a;

View File

@ -94,6 +94,7 @@ void AngleHarmonicOMP::eval(int nfrom, int nto, ThrData * const thr)
dbl3_t * _noalias const f = (dbl3_t *) thr->get_f()[0]; dbl3_t * _noalias const f = (dbl3_t *) thr->get_f()[0];
const int4_t * _noalias const anglelist = (int4_t *) neighbor->anglelist[0]; const int4_t * _noalias const anglelist = (int4_t *) neighbor->anglelist[0];
const int nlocal = atom->nlocal; const int nlocal = atom->nlocal;
eangle = 0.0;
for (n = nfrom; n < nto; n++) { for (n = nfrom; n < nto; n++) {
i1 = anglelist[n].a; i1 = anglelist[n].a;

View File

@ -87,6 +87,7 @@ void BondHarmonicOMP::eval(int nfrom, int nto, ThrData * const thr)
dbl3_t * _noalias const f = (dbl3_t *) thr->get_f()[0]; dbl3_t * _noalias const f = (dbl3_t *) thr->get_f()[0];
const int3_t * _noalias const bondlist = (int3_t *) neighbor->bondlist[0]; const int3_t * _noalias const bondlist = (int3_t *) neighbor->bondlist[0];
const int nlocal = atom->nlocal; const int nlocal = atom->nlocal;
ebond = 0.0;
for (n = nfrom; n < nto; n++) { for (n = nfrom; n < nto; n++) {
i1 = bondlist[n].a; i1 = bondlist[n].a;

View File

@ -87,6 +87,7 @@ void BondHarmonicShiftOMP::eval(int nfrom, int nto, ThrData * const thr)
dbl3_t * _noalias const f = (dbl3_t *) thr->get_f()[0]; dbl3_t * _noalias const f = (dbl3_t *) thr->get_f()[0];
const int3_t * _noalias const bondlist = (int3_t *) neighbor->bondlist[0]; const int3_t * _noalias const bondlist = (int3_t *) neighbor->bondlist[0];
const int nlocal = atom->nlocal; const int nlocal = atom->nlocal;
ebond = 0.0;
for (n = nfrom; n < nto; n++) { for (n = nfrom; n < nto; n++) {
i1 = bondlist[n].a; i1 = bondlist[n].a;

View File

@ -87,6 +87,7 @@ void BondNonlinearOMP::eval(int nfrom, int nto, ThrData * const thr)
dbl3_t * _noalias const f = (dbl3_t *) thr->get_f()[0]; dbl3_t * _noalias const f = (dbl3_t *) thr->get_f()[0];
const int3_t * _noalias const bondlist = (int3_t *) neighbor->bondlist[0]; const int3_t * _noalias const bondlist = (int3_t *) neighbor->bondlist[0];
const int nlocal = atom->nlocal; const int nlocal = atom->nlocal;
ebond = 0.0;
for (n = nfrom; n < nto; n++) { for (n = nfrom; n < nto; n++) {
i1 = bondlist[n].a; i1 = bondlist[n].a;

View File

@ -103,7 +103,7 @@ void DihedralCharmmOMP::eval(int nfrom, int nto, ThrData * const thr)
double delx,dely,delz,rsq,r2inv,r6inv; double delx,dely,delz,rsq,r2inv,r6inv;
double forcecoul,forcelj,fpair,ecoul,evdwl; double forcecoul,forcelj,fpair,ecoul,evdwl;
edihedral = 0.0; ecoul = evdwl = edihedral = 0.0;
const dbl3_t * _noalias const x = (dbl3_t *) atom->x[0]; const dbl3_t * _noalias const x = (dbl3_t *) atom->x[0];
dbl3_t * _noalias const f = (dbl3_t *) thr->get_f()[0]; dbl3_t * _noalias const f = (dbl3_t *) thr->get_f()[0];

View File

@ -65,8 +65,7 @@ void PairTIP4PCutOMP::compute(int eflag, int vflag)
if (eflag || vflag) ev_setup(eflag,vflag); if (eflag || vflag) ev_setup(eflag,vflag);
else evflag = vflag_fdotr = 0; else evflag = vflag_fdotr = 0;
const int nlocal = atom->nlocal; const int nall = atom->nlocal + atom->nghost;
const int nall = nlocal + atom->nghost;
// reallocate hneigh_thr & newsite_thr if necessary // reallocate hneigh_thr & newsite_thr if necessary
// initialize hneigh_thr[0] to -1 on steps when reneighboring occurred // initialize hneigh_thr[0] to -1 on steps when reneighboring occurred
@ -140,9 +139,7 @@ void PairTIP4PCutOMP::eval(int iifrom, int iito, ThrData * const thr)
dbl3_t * _noalias const f = (dbl3_t *) thr->get_f()[0]; dbl3_t * _noalias const f = (dbl3_t *) thr->get_f()[0];
const double * _noalias const q = atom->q; const double * _noalias const q = atom->q;
const int * _noalias const type = atom->type; const int * _noalias const type = atom->type;
const int nlocal = atom->nlocal;
const double * _noalias const special_coul = force->special_coul; const double * _noalias const special_coul = force->special_coul;
const double * _noalias const special_lj = force->special_lj;
const double qqrd2e = force->qqrd2e; const double qqrd2e = force->qqrd2e;
const double cut_coulsqplus = (cut_coul+2.0*qdist) * (cut_coul+2.0*qdist); const double cut_coulsqplus = (cut_coul+2.0*qdist) * (cut_coul+2.0*qdist);

View File

@ -58,9 +58,8 @@ void PPPMDispOMP::allocate()
{ {
PPPMDisp::allocate(); PPPMDisp::allocate();
const int nthreads = comm->nthreads;
#if defined(_OPENMP) #if defined(_OPENMP)
const int nthreads = comm->nthreads;
#pragma omp parallel default(none) #pragma omp parallel default(none)
#endif #endif
{ {
@ -133,12 +132,11 @@ void PPPMDispOMP::compute_gf()
double unitky = (2.0*MY_PI/yprd); double unitky = (2.0*MY_PI/yprd);
double unitkz = (2.0*MY_PI/zprd_slab); double unitkz = (2.0*MY_PI/zprd_slab);
int tid,nn,nnfrom,nnto,nx,ny,nz,k,l,m; int tid,nn,nnfrom,nnto,k,l,m;
int kper,lper,mper; int kper,lper,mper;
double snx,sny,snz,snx2,sny2,snz2; double snx,sny,snz,snx2,sny2,snz2;
double sqk; double sqk;
double argx,argy,argz,wx,wy,wz,sx,sy,sz,qx,qy,qz; double argx,argy,argz,wx,wy,wz,sx,sy,sz,qx,qy,qz;
double sum1,dot1,dot2;
double numerator,denominator; double numerator,denominator;
const int nnx = nxhi_fft-nxlo_fft+1; const int nnx = nxhi_fft-nxlo_fft+1;
@ -337,7 +335,6 @@ void PPPMDispOMP::particle_map(double dxinv, double dyinv,
int nxhi_o, int nyhi_o, int nxhi_o, int nyhi_o,
int nzhi_o) int nzhi_o)
{ {
const int * _noalias const type = atom->type;
const dbl3_t * _noalias const x = (dbl3_t *) atom->x[0]; const dbl3_t * _noalias const x = (dbl3_t *) atom->x[0];
int3_t * _noalias const p2g = (int3_t *) part2grid[0]; int3_t * _noalias const p2g = (int3_t *) part2grid[0];
const double boxlox = boxlo[0]; const double boxlox = boxlo[0];
@ -693,7 +690,6 @@ void PPPMDispOMP::make_rho_a()
void PPPMDispOMP::fieldforce_c_ik() void PPPMDispOMP::fieldforce_c_ik()
{ {
const int nthreads = comm->nthreads;
const int nlocal = atom->nlocal; const int nlocal = atom->nlocal;
// no local atoms => nothing to do // no local atoms => nothing to do
@ -711,6 +707,7 @@ void PPPMDispOMP::fieldforce_c_ik()
const double qqrd2e = force->qqrd2e; const double qqrd2e = force->qqrd2e;
#if defined(_OPENMP) #if defined(_OPENMP)
const int nthreads = comm->nthreads;
#pragma omp parallel default(none) #pragma omp parallel default(none)
#endif #endif
{ {
@ -781,7 +778,6 @@ void PPPMDispOMP::fieldforce_c_ik()
void PPPMDispOMP::fieldforce_c_ad() void PPPMDispOMP::fieldforce_c_ad()
{ {
const int nthreads = comm->nthreads;
const int nlocal = atom->nlocal; const int nlocal = atom->nlocal;
// no local atoms => nothing to do // no local atoms => nothing to do
@ -814,6 +810,7 @@ void PPPMDispOMP::fieldforce_c_ad()
const double hz_inv = nz_pppm/zprd_slab; const double hz_inv = nz_pppm/zprd_slab;
#if defined(_OPENMP) #if defined(_OPENMP)
const int nthreads = comm->nthreads;
#pragma omp parallel default(none) #pragma omp parallel default(none)
#endif #endif
{ {
@ -835,7 +832,7 @@ void PPPMDispOMP::fieldforce_c_ad()
FFT_SCALAR * const * const dr1d = static_cast<FFT_SCALAR **>(thr->get_drho1d()); FFT_SCALAR * const * const dr1d = static_cast<FFT_SCALAR **>(thr->get_drho1d());
int l,m,n,nx,ny,nz,mx,my,mz; int l,m,n,nx,ny,nz,mx,my,mz;
FFT_SCALAR dx,dy,dz,x0,y0,z0; FFT_SCALAR dx,dy,dz;
FFT_SCALAR ekx,eky,ekz; FFT_SCALAR ekx,eky,ekz;
double sf = 0.0; double sf = 0.0;
double s1,s2,s3; double s1,s2,s3;
@ -903,7 +900,6 @@ void PPPMDispOMP::fieldforce_c_ad()
void PPPMDispOMP::fieldforce_c_peratom() void PPPMDispOMP::fieldforce_c_peratom()
{ {
const int nthreads = comm->nthreads;
const int nlocal = atom->nlocal; const int nlocal = atom->nlocal;
// no local atoms => nothing to do // no local atoms => nothing to do
@ -919,6 +915,7 @@ void PPPMDispOMP::fieldforce_c_peratom()
const double * const * const x = atom->x; const double * const * const x = atom->x;
#if defined(_OPENMP) #if defined(_OPENMP)
const int nthreads = comm->nthreads;
#pragma omp parallel default(none) #pragma omp parallel default(none)
#endif #endif
{ {
@ -937,7 +934,7 @@ void PPPMDispOMP::fieldforce_c_peratom()
ThrData *thr = fix->get_thr(tid); ThrData *thr = fix->get_thr(tid);
FFT_SCALAR * const * const r1d = static_cast<FFT_SCALAR **>(thr->get_rho1d()); FFT_SCALAR * const * const r1d = static_cast<FFT_SCALAR **>(thr->get_rho1d());
int i,l,m,n,nx,ny,nz,mx,my,mz; int l,m,n,nx,ny,nz,mx,my,mz;
FFT_SCALAR dx,dy,dz,x0,y0,z0; FFT_SCALAR dx,dy,dz,x0,y0,z0;
FFT_SCALAR u,v0,v1,v2,v3,v4,v5; FFT_SCALAR u,v0,v1,v2,v3,v4,v5;
@ -1000,7 +997,6 @@ void PPPMDispOMP::fieldforce_c_peratom()
void PPPMDispOMP::fieldforce_g_ik() void PPPMDispOMP::fieldforce_g_ik()
{ {
const int nthreads = comm->nthreads;
const int nlocal = atom->nlocal; const int nlocal = atom->nlocal;
// no local atoms => nothing to do // no local atoms => nothing to do
@ -1014,9 +1010,9 @@ void PPPMDispOMP::fieldforce_g_ik()
// ek = 3 components of E-field on particle // ek = 3 components of E-field on particle
const double * const * const x = atom->x; const double * const * const x = atom->x;
const double qqrd2e = force->qqrd2e;
#if defined(_OPENMP) #if defined(_OPENMP)
const int nthreads = comm->nthreads;
#pragma omp parallel default(none) #pragma omp parallel default(none)
#endif #endif
{ {
@ -1090,7 +1086,6 @@ void PPPMDispOMP::fieldforce_g_ik()
void PPPMDispOMP::fieldforce_g_ad() void PPPMDispOMP::fieldforce_g_ad()
{ {
const int nthreads = comm->nthreads;
const int nlocal = atom->nlocal; const int nlocal = atom->nlocal;
// no local atoms => nothing to do // no local atoms => nothing to do
@ -1119,6 +1114,7 @@ void PPPMDispOMP::fieldforce_g_ad()
const double hz_inv = nz_pppm_6/zprd_slab; const double hz_inv = nz_pppm_6/zprd_slab;
#if defined(_OPENMP) #if defined(_OPENMP)
const int nthreads = comm->nthreads;
#pragma omp parallel default(none) #pragma omp parallel default(none)
#endif #endif
{ {
@ -1140,7 +1136,7 @@ void PPPMDispOMP::fieldforce_g_ad()
FFT_SCALAR * const * const dr1d = static_cast<FFT_SCALAR **>(thr->get_drho1d_6()); FFT_SCALAR * const * const dr1d = static_cast<FFT_SCALAR **>(thr->get_drho1d_6());
int l,m,n,nx,ny,nz,mx,my,mz; int l,m,n,nx,ny,nz,mx,my,mz;
FFT_SCALAR dx,dy,dz,x0,y0,z0; FFT_SCALAR dx,dy,dz;
FFT_SCALAR ekx,eky,ekz; FFT_SCALAR ekx,eky,ekz;
int type; int type;
double lj; double lj;
@ -1212,7 +1208,6 @@ void PPPMDispOMP::fieldforce_g_ad()
void PPPMDispOMP::fieldforce_g_peratom() void PPPMDispOMP::fieldforce_g_peratom()
{ {
const int nthreads = comm->nthreads;
const int nlocal = atom->nlocal; const int nlocal = atom->nlocal;
// no local atoms => nothing to do // no local atoms => nothing to do
@ -1227,6 +1222,7 @@ void PPPMDispOMP::fieldforce_g_peratom()
const double * const * const x = atom->x; const double * const * const x = atom->x;
#if defined(_OPENMP) #if defined(_OPENMP)
const int nthreads = comm->nthreads;
#pragma omp parallel default(none) #pragma omp parallel default(none)
#endif #endif
{ {
@ -1245,7 +1241,7 @@ void PPPMDispOMP::fieldforce_g_peratom()
ThrData *thr = fix->get_thr(tid); ThrData *thr = fix->get_thr(tid);
FFT_SCALAR * const * const r1d = static_cast<FFT_SCALAR **>(thr->get_rho1d_6()); FFT_SCALAR * const * const r1d = static_cast<FFT_SCALAR **>(thr->get_rho1d_6());
int i,l,m,n,nx,ny,nz,mx,my,mz; int l,m,n,nx,ny,nz,mx,my,mz;
FFT_SCALAR dx,dy,dz,x0,y0,z0; FFT_SCALAR dx,dy,dz,x0,y0,z0;
FFT_SCALAR u,v0,v1,v2,v3,v4,v5; FFT_SCALAR u,v0,v1,v2,v3,v4,v5;
int type; int type;
@ -1311,7 +1307,6 @@ void PPPMDispOMP::fieldforce_g_peratom()
void PPPMDispOMP::fieldforce_a_ik() void PPPMDispOMP::fieldforce_a_ik()
{ {
const int nthreads = comm->nthreads;
const int nlocal = atom->nlocal; const int nlocal = atom->nlocal;
// no local atoms => nothing to do // no local atoms => nothing to do
@ -1325,9 +1320,9 @@ void PPPMDispOMP::fieldforce_a_ik()
// ek = 3 components of E-field on particle // ek = 3 components of E-field on particle
const double * const * const x = atom->x; const double * const * const x = atom->x;
const double qqrd2e = force->qqrd2e;
#if defined(_OPENMP) #if defined(_OPENMP)
const int nthreads = comm->nthreads;
#pragma omp parallel default(none) #pragma omp parallel default(none)
#endif #endif
{ {
@ -1433,7 +1428,6 @@ void PPPMDispOMP::fieldforce_a_ik()
void PPPMDispOMP::fieldforce_a_ad() void PPPMDispOMP::fieldforce_a_ad()
{ {
const int nthreads = comm->nthreads;
const int nlocal = atom->nlocal; const int nlocal = atom->nlocal;
// no local atoms => nothing to do // no local atoms => nothing to do
@ -1462,6 +1456,7 @@ void PPPMDispOMP::fieldforce_a_ad()
const double hz_inv = nz_pppm_6/zprd_slab; const double hz_inv = nz_pppm_6/zprd_slab;
#if defined(_OPENMP) #if defined(_OPENMP)
const int nthreads = comm->nthreads;
#pragma omp parallel default(none) #pragma omp parallel default(none)
#endif #endif
{ {
@ -1622,7 +1617,6 @@ void PPPMDispOMP::fieldforce_a_ad()
void PPPMDispOMP::fieldforce_a_peratom() void PPPMDispOMP::fieldforce_a_peratom()
{ {
const int nthreads = comm->nthreads;
const int nlocal = atom->nlocal; const int nlocal = atom->nlocal;
// no local atoms => nothing to do // no local atoms => nothing to do
@ -1637,6 +1631,7 @@ void PPPMDispOMP::fieldforce_a_peratom()
const double * const * const x = atom->x; const double * const * const x = atom->x;
#if defined(_OPENMP) #if defined(_OPENMP)
const int nthreads = comm->nthreads;
#pragma omp parallel default(none) #pragma omp parallel default(none)
#endif #endif
{ {
@ -1655,7 +1650,7 @@ void PPPMDispOMP::fieldforce_a_peratom()
ThrData *thr = fix->get_thr(tid); ThrData *thr = fix->get_thr(tid);
FFT_SCALAR * const * const r1d = static_cast<FFT_SCALAR **>(thr->get_rho1d_6()); FFT_SCALAR * const * const r1d = static_cast<FFT_SCALAR **>(thr->get_rho1d_6());
int i,l,m,n,nx,ny,nz,mx,my,mz; int l,m,n,nx,ny,nz,mx,my,mz;
FFT_SCALAR dx,dy,dz,x0,y0,z0; FFT_SCALAR dx,dy,dz,x0,y0,z0;
FFT_SCALAR u0,v00,v10,v20,v30,v40,v50; FFT_SCALAR u0,v00,v10,v20,v30,v40,v50;
FFT_SCALAR u1,v01,v11,v21,v31,v41,v51; FFT_SCALAR u1,v01,v11,v21,v31,v41,v51;