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

This commit is contained in:
sjplimp 2011-05-20 22:59:15 +00:00
parent 91b6d45b53
commit 3ae193256b
8 changed files with 16 additions and 7 deletions

View File

@ -17,7 +17,7 @@ PACKAGE = asphere class2 colloid dipole dsmc gpu granular \
kspace manybody meam molecule opt peri poems reax replica \
shock srd xtc
PACKUSER = user-ackland user-atc user-cd-eam user-cg-cmm user-cuda user-eff \
PACKUSER = user-ackland user-atc user-cd-eam user-cg-cmm user-eff \
user-ewaldn user-imd user-reaxc user-smd
PACKALL = $(PACKAGE) $(PACKUSER)

View File

@ -289,7 +289,7 @@ void Atom::create_avec(const char *style, int narg, char **arg, char *suffix)
AtomVec *Atom::new_avec(const char *style, int narg, char **arg,
char *suffix, int &sflag)
{
if (suffix) {
if (suffix && lmp->offaccel == 0) {
sflag = 1;
char estyle[256];
sprintf(estyle,"%s/%s",style,suffix);

View File

@ -144,7 +144,7 @@ void Force::create_pair(const char *style, char *suffix)
Pair *Force::new_pair(const char *style, char *suffix, int &sflag)
{
if (suffix) {
if (suffix && lmp->offaccel == 0) {
sflag = 1;
char estyle[256];
sprintf(estyle,"%s/%s",style,suffix);

View File

@ -811,6 +811,13 @@ void Input::accelerator()
if (strcmp(lmp->asuffix,arg[0]) != 0)
error->all("Accelerator command requires matching command-line -a switch");
if (strcmp(arg[0],"off") == 0) {
if (narg != 1) error->all("Illegal accelerator command");
lmp->offaccel = 1;
return;
}
lmp->offaccel = 0;
if (strcmp(arg[0],"cuda") == 0) lmp->cuda->accelerator(narg-1,&arg[1]);
else error->all("Illegal accelerator command");
}

View File

@ -58,8 +58,9 @@ LAMMPS::LAMMPS(int narg, char **arg, MPI_Comm communicator)
int screenflag = 0;
int logflag = 0;
accelerator = NOACCEL;
cuda = NULL;
asuffix = NULL;
offaccel = 0;
cuda = NULL;
int iarg = 1;

View File

@ -44,6 +44,7 @@ class LAMMPS {
int accelerator; // accelerator flag
char *asuffix; // accelerator suffix
int offaccel; // 1 if accelerator flag currently disabled
class Cuda *cuda; // CUDA accelerator class
LAMMPS(int, char **, MPI_Comm);

View File

@ -640,7 +640,7 @@ void Modify::add_fix(int narg, char **arg, char *suffix)
int success = 0;
if (suffix) {
if (suffix && lmp->offaccel == 0) {
char estyle[256];
sprintf(estyle,"%s/%s",arg[2],suffix);
success = 1;
@ -784,7 +784,7 @@ void Modify::add_compute(int narg, char **arg, char *suffix)
int success = 0;
if (suffix) {
if (suffix && lmp->offaccel == 0) {
char estyle[256];
sprintf(estyle,"%s/%s",arg[2],suffix);
success = 1;

View File

@ -221,7 +221,7 @@ void Update::create_integrate(int narg, char **arg, char *suffix)
void Update::new_integrate(char *style, int narg, char **arg,
char *suffix, int &sflag)
{
if (suffix) {
if (suffix && lmp->offaccel == 0) {
sflag = 1;
char estyle[256];
sprintf(estyle,"%s/%s",style,suffix);