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

This commit is contained in:
sjplimp
2012-06-06 22:47:51 +00:00
parent f46eb9dedb
commit ef9e700545
1408 changed files with 58053 additions and 57983 deletions

View File

@ -5,7 +5,7 @@
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
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.
@ -40,25 +40,25 @@
// External functions from cuda library for atom decomposition
int re_gpu_init(const int ntypes, double **shape, double **well,
double **cutsq, double **sigma, double **epsilon,
int **form, double **host_lj1,
double **host_lj2, double **host_lj3, double **host_lj4,
double **offset, double *special_lj, const int nlocal,
const int nall, const int max_nbors, const int maxspecial,
const double cell_size, int &gpu_mode, FILE *screen);
double **cutsq, double **sigma, double **epsilon,
int **form, double **host_lj1,
double **host_lj2, double **host_lj3, double **host_lj4,
double **offset, double *special_lj, const int nlocal,
const int nall, const int max_nbors, const int maxspecial,
const double cell_size, int &gpu_mode, FILE *screen);
void re_gpu_clear();
int ** re_gpu_compute_n(const int ago, const int inum, const int nall,
double **host_x, int *host_type, double *sublo,
double *subhi, int *tag, int **nspecial, int **special,
const bool eflag, const bool vflag,
const bool eatom, const bool vatom, int &host_start,
int **ilist, int **jnum, const double cpu_time,
bool &success, double **host_quat);
double **host_x, int *host_type, double *sublo,
double *subhi, int *tag, int **nspecial, int **special,
const bool eflag, const bool vflag,
const bool eatom, const bool vatom, int &host_start,
int **ilist, int **jnum, const double cpu_time,
bool &success, double **host_quat);
int * re_gpu_compute(const int ago, const int inum, const int nall,
double **host_x, int *host_type, int *ilist, int *numj,
int **firstneigh, const bool eflag, const bool vflag,
const bool eatom, const bool vatom, int &host_start,
const double cpu_time, bool &success, double **host_quat);
double **host_x, int *host_type, int *ilist, int *numj,
int **firstneigh, const bool eflag, const bool vflag,
const bool eatom, const bool vatom, int &host_start,
const double cpu_time, bool &success, double **host_quat);
double re_gpu_bytes();
using namespace LAMMPS_NS;
@ -71,11 +71,11 @@ PairRESquaredGPU::PairRESquaredGPU(LAMMPS *lmp) : PairRESquared(lmp),
gpu_mode(GPU_FORCE)
{
avec = (AtomVecEllipsoid *) atom->style_match("ellipsoid");
if (!avec)
if (!avec)
error->all(FLERR,"Pair resquared/gpu requires atom style ellipsoid");
quat_nmax = 0;
quat = NULL;
GPU_EXTRA::gpu_ready(lmp->modify, lmp->error);
GPU_EXTRA::gpu_ready(lmp->modify, lmp->error);
}
/* ----------------------------------------------------------------------
@ -100,7 +100,7 @@ void PairRESquaredGPU::compute(int eflag, int vflag)
int inum, host_start;
bool success = true;
int *ilist, *numneigh, **firstneigh;
int *ilist, *numneigh, **firstneigh;
if (nall > quat_nmax) {
quat_nmax = static_cast<int>(1.1 * nall);
@ -121,19 +121,19 @@ void PairRESquaredGPU::compute(int eflag, int vflag)
if (gpu_mode != GPU_FORCE) {
inum = atom->nlocal;
firstneigh = re_gpu_compute_n(neighbor->ago, inum, nall, atom->x,
atom->type, domain->sublo, domain->subhi,
atom->tag, atom->nspecial, atom->special,
eflag, vflag, eflag_atom, vflag_atom,
host_start, &ilist, &numneigh, cpu_time,
success, quat);
atom->type, domain->sublo, domain->subhi,
atom->tag, atom->nspecial, atom->special,
eflag, vflag, eflag_atom, vflag_atom,
host_start, &ilist, &numneigh, cpu_time,
success, quat);
} else {
inum = list->inum;
numneigh = list->numneigh;
firstneigh = list->firstneigh;
ilist = re_gpu_compute(neighbor->ago, inum, nall, atom->x, atom->type,
list->ilist, numneigh, firstneigh, eflag, vflag,
eflag_atom, vflag_atom, host_start,
cpu_time, success, quat);
list->ilist, numneigh, firstneigh, eflag, vflag,
eflag_atom, vflag_atom, host_start,
cpu_time, success, quat);
}
if (!success)
error->one(FLERR,"Insufficient memory on accelerator");
@ -151,7 +151,7 @@ void PairRESquaredGPU::compute(int eflag, int vflag)
void PairRESquaredGPU::init_style()
{
if (force->newton_pair)
if (force->newton_pair)
error->all(FLERR,"Cannot use newton pair with resquared/gpu pair style");
if (!atom->ellipsoid_flag)
error->all(FLERR,"Pair resquared/gpu requires atom style ellipsoid");
@ -193,10 +193,10 @@ void PairRESquaredGPU::init_style()
if (atom->molecular)
maxspecial=atom->maxspecial;
int success = re_gpu_init(atom->ntypes+1, shape1, well, cutsq, sigma,
epsilon, form, lj1, lj2, lj3, lj4, offset,
force->special_lj, atom->nlocal,
atom->nlocal+atom->nghost, 300, maxspecial,
cell_size, gpu_mode, screen);
epsilon, form, lj1, lj2, lj3, lj4, offset,
force->special_lj, atom->nlocal,
atom->nlocal+atom->nghost, 300, maxspecial,
cell_size, gpu_mode, screen);
GPU_EXTRA::check_flag(success,error,world);
if (gpu_mode == GPU_FORCE) {
@ -219,7 +219,7 @@ double PairRESquaredGPU::memory_usage()
/* ---------------------------------------------------------------------- */
void PairRESquaredGPU::cpu_compute(int start, int inum, int eflag, int vflag,
int *ilist, int *numneigh, int **firstneigh)
int *ilist, int *numneigh, int **firstneigh)
{
int i,j,ii,jj,jnum,itype,jtype;
double evdwl,one_eng,rsq,r2inv,r6inv,forcelj,factor_lj;
@ -308,8 +308,8 @@ void PairRESquaredGPU::cpu_compute(int start, int inum, int eflag, int vflag,
if (eflag) evdwl = factor_lj*one_eng;
if (evflag) ev_tally_xyz_full(i,evdwl,0.0,fforce[0],fforce[1],
fforce[2],-r12[0],-r12[1],-r12[2]);
if (evflag) ev_tally_xyz_full(i,evdwl,0.0,fforce[0],fforce[1],
fforce[2],-r12[0],-r12[1],-r12[2]);
}
}
}