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

This commit is contained in:
sjplimp
2011-06-01 17:34:26 +00:00
parent c8fcafa2fb
commit 1f19be90b8
2 changed files with 10 additions and 20 deletions

View File

@ -1249,12 +1249,11 @@ void Input::special_bonds()
void Input::suffix() void Input::suffix()
{ {
if (narg != 1) error->all("Illegal package command"); if (narg != 1) error->all("Illegal suffix command");
if (strcmp(arg[0],"off") == 0) lmp->suffix_enable = 0; if (strcmp(arg[0],"off") == 0) lmp->suffix_enable = 0;
else if (strcmp(arg[0],"on") == 0) lmp->suffix_enable = 1; else if (strcmp(arg[0],"on") == 0) lmp->suffix_enable = 1;
else if (strcmp(arg[0],"opt") == 0 || strcmp(arg[0],"gpu") == 0 || else {
strcmp(arg[0],"cuda") == 0) {
delete [] lmp->suffix; delete [] lmp->suffix;
int n = strlen(arg[0]) + 1; int n = strlen(arg[0]) + 1;
lmp->suffix = new char[n]; lmp->suffix = new char[n];
@ -1263,10 +1262,7 @@ void Input::suffix()
if (!lmp->cuda && strcmp(lmp->suffix,"cuda") == 0) if (!lmp->cuda && strcmp(lmp->suffix,"cuda") == 0)
error->all("Cannot use suffix cuda without USER-CUDA installed"); error->all("Cannot use suffix cuda without USER-CUDA installed");
if (lmp->cuda && strcmp(lmp->suffix,"cuda") != 0 && me == 0) }
error->warning("Non-cuda suffix used with USER-CUDA mode enabled");
} else error->all("Illegal suffix command");
} }
/* ---------------------------------------------------------------------- */ /* ---------------------------------------------------------------------- */

View File

@ -104,15 +104,11 @@ LAMMPS::LAMMPS(int narg, char **arg, MPI_Comm communicator)
} else if (strcmp(arg[iarg],"-suffix") == 0 || } else if (strcmp(arg[iarg],"-suffix") == 0 ||
strcmp(arg[iarg],"-sf") == 0) { strcmp(arg[iarg],"-sf") == 0) {
if (iarg+2 > narg) error->universe_all("Invalid command-line argument"); if (iarg+2 > narg) error->universe_all("Invalid command-line argument");
if (strcmp(arg[iarg+1],"opt") == 0 || delete [] suffix;
strcmp(arg[iarg+1],"gpu") == 0 || int n = strlen(arg[iarg+1]) + 1;
strcmp(arg[iarg+1],"cuda") == 0) { suffix = new char[n];
delete [] suffix; strcpy(suffix,arg[iarg+1]);
int n = strlen(arg[iarg+1]) + 1; suffix_enable = 1;
suffix = new char[n];
strcpy(suffix,arg[iarg+1]);
suffix_enable = 1;
}
iarg += 2; iarg += 2;
} else error->universe_all("Invalid command-line argument"); } else error->universe_all("Invalid command-line argument");
} }
@ -305,8 +301,6 @@ LAMMPS::LAMMPS(int narg, char **arg, MPI_Comm communicator)
int me; int me;
MPI_Comm_rank(world,&me); MPI_Comm_rank(world,&me);
if (cuda && me == 0) error->message("USER-CUDA mode is enabled"); if (cuda && me == 0) error->message("USER-CUDA mode is enabled");
if (cuda && suffix && strcmp(suffix,"cuda") != 0 && me == 0)
error->warning("Non-cuda suffix used with USER-CUDA mode enabled");
// allocate input class now that MPI is fully setup // allocate input class now that MPI is fully setup