git-svn-id: svn://svn.icms.temple.edu/lammps-ro/trunk@6287 f3b2605a-c512-4ea7-a41b-209d697bcdaa
This commit is contained in:
@ -1249,24 +1249,20 @@ void Input::special_bonds()
|
||||
|
||||
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;
|
||||
else if (strcmp(arg[0],"on") == 0) lmp->suffix_enable = 1;
|
||||
else if (strcmp(arg[0],"opt") == 0 || strcmp(arg[0],"gpu") == 0 ||
|
||||
strcmp(arg[0],"cuda") == 0) {
|
||||
else {
|
||||
delete [] lmp->suffix;
|
||||
int n = strlen(arg[0]) + 1;
|
||||
lmp->suffix = new char[n];
|
||||
strcpy(lmp->suffix,arg[0]);
|
||||
lmp->suffix_enable = 1;
|
||||
|
||||
|
||||
if (!lmp->cuda && strcmp(lmp->suffix,"cuda") == 0)
|
||||
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");
|
||||
}
|
||||
}
|
||||
|
||||
/* ---------------------------------------------------------------------- */
|
||||
|
||||
@ -104,15 +104,11 @@ LAMMPS::LAMMPS(int narg, char **arg, MPI_Comm communicator)
|
||||
} else if (strcmp(arg[iarg],"-suffix") == 0 ||
|
||||
strcmp(arg[iarg],"-sf") == 0) {
|
||||
if (iarg+2 > narg) error->universe_all("Invalid command-line argument");
|
||||
if (strcmp(arg[iarg+1],"opt") == 0 ||
|
||||
strcmp(arg[iarg+1],"gpu") == 0 ||
|
||||
strcmp(arg[iarg+1],"cuda") == 0) {
|
||||
delete [] suffix;
|
||||
int n = strlen(arg[iarg+1]) + 1;
|
||||
suffix = new char[n];
|
||||
strcpy(suffix,arg[iarg+1]);
|
||||
suffix_enable = 1;
|
||||
}
|
||||
delete [] suffix;
|
||||
int n = strlen(arg[iarg+1]) + 1;
|
||||
suffix = new char[n];
|
||||
strcpy(suffix,arg[iarg+1]);
|
||||
suffix_enable = 1;
|
||||
iarg += 2;
|
||||
} else error->universe_all("Invalid command-line argument");
|
||||
}
|
||||
@ -305,8 +301,6 @@ LAMMPS::LAMMPS(int narg, char **arg, MPI_Comm communicator)
|
||||
int me;
|
||||
MPI_Comm_rank(world,&me);
|
||||
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
|
||||
|
||||
|
||||
Reference in New Issue
Block a user