git-svn-id: svn://svn.icms.temple.edu/lammps-ro/trunk@12474 f3b2605a-c512-4ea7-a41b-209d697bcdaa
This commit is contained in:
@ -108,17 +108,17 @@ FixGPU::FixGPU(LAMMPS *lmp, int narg, char **arg) :
|
|||||||
else if (strcmp(arg[iarg]+1,"hybrid") == 0) _gpu_mode = GPU_HYB_NEIGH;
|
else if (strcmp(arg[iarg]+1,"hybrid") == 0) _gpu_mode = GPU_HYB_NEIGH;
|
||||||
else error->all(FLERR,"Illegal package gpu command");
|
else error->all(FLERR,"Illegal package gpu command");
|
||||||
iarg += 2;
|
iarg += 2;
|
||||||
|
} else if (strcmp(arg[iarg],"newton") == 0) {
|
||||||
|
if (iarg+2 > narg) error->all(FLERR,"Illegal package gpu command");
|
||||||
|
if (strcmp(arg[iarg]+1,"off") == 0) newtonflag = 0;
|
||||||
|
else if (strcmp(arg[iarg]+1,"on") == 0) newtonflag = 1;
|
||||||
|
else error->all(FLERR,"Illegal package gpu command");
|
||||||
} else if (strcmp(arg[iarg],"split") == 0) {
|
} else if (strcmp(arg[iarg],"split") == 0) {
|
||||||
if (iarg+2 > narg) error->all(FLERR,"Illegal package gpu command");
|
if (iarg+2 > narg) error->all(FLERR,"Illegal package gpu command");
|
||||||
_particle_split = force->numeric(FLERR,arg[iarg+1]);
|
_particle_split = force->numeric(FLERR,arg[iarg+1]);
|
||||||
if (_particle_split == 0.0 || _particle_split > 1.0)
|
if (_particle_split == 0.0 || _particle_split > 1.0)
|
||||||
error->all(FLERR,"Illegal package GPU command");
|
error->all(FLERR,"Illegal package GPU command");
|
||||||
iarg += 2;
|
iarg += 2;
|
||||||
} else if (strcmp(arg[iarg],"newton") == 0) {
|
|
||||||
if (iarg+2 > narg) error->all(FLERR,"Illegal package gpu command");
|
|
||||||
if (strcmp(arg[iarg]+1,"off") == 0) newtonflag = 0;
|
|
||||||
else if (strcmp(arg[iarg]+1,"on") == 0) newtonflag = 1;
|
|
||||||
else error->all(FLERR,"Illegal package gpu command");
|
|
||||||
} else if (strcmp(arg[iarg],"gpuID") == 0) {
|
} else if (strcmp(arg[iarg],"gpuID") == 0) {
|
||||||
if (iarg+3 > narg) error->all(FLERR,"Illegal package gpu command");
|
if (iarg+3 > narg) error->all(FLERR,"Illegal package gpu command");
|
||||||
first_gpu = force->inumeric(FLERR,arg[iarg+1]);
|
first_gpu = force->inumeric(FLERR,arg[iarg+1]);
|
||||||
|
|||||||
@ -642,7 +642,7 @@ void Input::clear()
|
|||||||
if (narg > 0) error->all(FLERR,"Illegal clear command");
|
if (narg > 0) error->all(FLERR,"Illegal clear command");
|
||||||
lmp->destroy();
|
lmp->destroy();
|
||||||
lmp->create();
|
lmp->create();
|
||||||
lmp->post_create();
|
lmp->post_create(0,NULL,NULL,NULL);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* ---------------------------------------------------------------------- */
|
/* ---------------------------------------------------------------------- */
|
||||||
|
|||||||
@ -92,6 +92,10 @@ LAMMPS::LAMMPS(int narg, char **arg, MPI_Comm communicator)
|
|||||||
int wdfirst,wdlast;
|
int wdfirst,wdlast;
|
||||||
int kkfirst,kklast;
|
int kkfirst,kklast;
|
||||||
|
|
||||||
|
int npack = 0;
|
||||||
|
int *pfirst = NULL;
|
||||||
|
int *plast = NULL;
|
||||||
|
|
||||||
int iarg = 1;
|
int iarg = 1;
|
||||||
while (iarg < narg) {
|
while (iarg < narg) {
|
||||||
if (strcmp(arg[iarg],"-partition") == 0 ||
|
if (strcmp(arg[iarg],"-partition") == 0 ||
|
||||||
@ -165,6 +169,22 @@ LAMMPS::LAMMPS(int narg, char **arg, MPI_Comm communicator)
|
|||||||
kkfirst = iarg;
|
kkfirst = iarg;
|
||||||
while (iarg < narg && arg[iarg][0] != '-') iarg++;
|
while (iarg < narg && arg[iarg][0] != '-') iarg++;
|
||||||
kklast = iarg;
|
kklast = iarg;
|
||||||
|
} else if (strcmp(arg[iarg],"-package") == 0 ||
|
||||||
|
strcmp(arg[iarg],"-pk") == 0) {
|
||||||
|
if (iarg+2 > narg)
|
||||||
|
error->universe_all(FLERR,"Invalid command-line argument");
|
||||||
|
memory->grow(pfirst,npack+1,"lammps:pfirst");
|
||||||
|
memory->grow(plast,npack+1,"lammps:plast");
|
||||||
|
// delimit args for package command invocation
|
||||||
|
// any package arg with leading "-" will be followed by numeric digit
|
||||||
|
iarg++;
|
||||||
|
pfirst[npack] = iarg;
|
||||||
|
while (iarg < narg) {
|
||||||
|
if (arg[iarg][0] != '-') iarg++;
|
||||||
|
else if (isdigit(arg[iarg][1])) iarg++;
|
||||||
|
else break;
|
||||||
|
}
|
||||||
|
plast[npack++] = iarg;
|
||||||
} 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)
|
if (iarg+2 > narg)
|
||||||
@ -480,7 +500,9 @@ LAMMPS::LAMMPS(int narg, char **arg, MPI_Comm communicator)
|
|||||||
// allocate top-level classes
|
// allocate top-level classes
|
||||||
|
|
||||||
create();
|
create();
|
||||||
post_create();
|
post_create(npack,pfirst,plast,arg);
|
||||||
|
memory->destroy(pfirst);
|
||||||
|
memory->destroy(plast);
|
||||||
|
|
||||||
// if helpflag set, print help and quit
|
// if helpflag set, print help and quit
|
||||||
|
|
||||||
@ -603,7 +625,7 @@ void LAMMPS::create()
|
|||||||
so that package-specific core classes have been instantiated
|
so that package-specific core classes have been instantiated
|
||||||
------------------------------------------------------------------------- */
|
------------------------------------------------------------------------- */
|
||||||
|
|
||||||
void LAMMPS::post_create()
|
void LAMMPS::post_create(int npack, int *pfirst, int *plast, char **arg)
|
||||||
{
|
{
|
||||||
// default package commands triggered by "-c on" and "-k on"
|
// default package commands triggered by "-c on" and "-k on"
|
||||||
|
|
||||||
@ -644,6 +666,22 @@ void LAMMPS::post_create()
|
|||||||
if (suffix2) {
|
if (suffix2) {
|
||||||
if (strcmp(suffix,"omp") == 0) input->one("package omp 0");
|
if (strcmp(suffix,"omp") == 0) input->one("package omp 0");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// invoke any command-line package commands
|
||||||
|
|
||||||
|
if (npack) {
|
||||||
|
char str[128];
|
||||||
|
for (int i = 0; i < npack; i++) {
|
||||||
|
strcpy(str,"package");
|
||||||
|
for (int j = pfirst[i]; j < plast[i]; j++) {
|
||||||
|
if (strlen(str) + strlen(arg[j]) + 2 > 128)
|
||||||
|
error->all(FLERR,"Too many -pk arguments in command line");
|
||||||
|
strcat(str," ");
|
||||||
|
strcpy(str,arg[j]);
|
||||||
|
}
|
||||||
|
input->one(str);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/* ----------------------------------------------------------------------
|
/* ----------------------------------------------------------------------
|
||||||
@ -705,14 +743,16 @@ void LAMMPS::help()
|
|||||||
"\nCommand line options:\n\n"
|
"\nCommand line options:\n\n"
|
||||||
"-cuda on/off : turn CUDA mode on or off (-c)\n"
|
"-cuda on/off : turn CUDA mode on or off (-c)\n"
|
||||||
"-echo none/screen/log/both : echoing of input script (-e)\n"
|
"-echo none/screen/log/both : echoing of input script (-e)\n"
|
||||||
"-in filename : read input from file, not stdin (-i)\n"
|
|
||||||
"-help : print this help message (-h)\n"
|
"-help : print this help message (-h)\n"
|
||||||
|
"-in filename : read input from file, not stdin (-i)\n"
|
||||||
"-kokkos on/off ... : turn KOKKOS mode on or off (-k)\n"
|
"-kokkos on/off ... : turn KOKKOS mode on or off (-k)\n"
|
||||||
"-log none/filename : where to send log output (-l)\n"
|
"-log none/filename : where to send log output (-l)\n"
|
||||||
"-nocite : disable writing log.cite file (-nc)\n"
|
"-nocite : disable writing log.cite file (-nc)\n"
|
||||||
|
"-package style ... : invoke package command (-pk)\n"
|
||||||
"-partition size1 size2 ... : assign partition sizes (-p)\n"
|
"-partition size1 size2 ... : assign partition sizes (-p)\n"
|
||||||
"-plog basename : basename for partition logs (-pl)\n"
|
"-plog basename : basename for partition logs (-pl)\n"
|
||||||
"-pscreen basename : basename for partition screens (-ps)\n"
|
"-pscreen basename : basename for partition screens (-ps)\n"
|
||||||
|
"-restart rfile dfile ... : convert restart to data file (-r)\n"
|
||||||
"-reorder topology-specs : processor reordering (-r)\n"
|
"-reorder topology-specs : processor reordering (-r)\n"
|
||||||
"-screen none/filename : where to send screen output (-sc)\n"
|
"-screen none/filename : where to send screen output (-sc)\n"
|
||||||
"-suffix cuda/gpu/opt/omp : style suffix to apply (-sf)\n"
|
"-suffix cuda/gpu/opt/omp : style suffix to apply (-sf)\n"
|
||||||
|
|||||||
@ -54,7 +54,7 @@ class LAMMPS {
|
|||||||
LAMMPS(int, char **, MPI_Comm);
|
LAMMPS(int, char **, MPI_Comm);
|
||||||
~LAMMPS();
|
~LAMMPS();
|
||||||
void create();
|
void create();
|
||||||
void post_create();
|
void post_create(int, int *, int *, char **);
|
||||||
void init();
|
void init();
|
||||||
void destroy();
|
void destroy();
|
||||||
|
|
||||||
|
|||||||
@ -661,7 +661,7 @@ void Modify::add_fix(int narg, char **arg, int trysuffix)
|
|||||||
// MUST change NEXCEPT above when add new fix to this list
|
// MUST change NEXCEPT above when add new fix to this list
|
||||||
|
|
||||||
const char *exceptions[NEXCEPT] =
|
const char *exceptions[NEXCEPT] =
|
||||||
{"GPU","OMP","Intel","property/atom","cmap"};
|
{"GPU","OMP","INTEL","property/atom","cmap"};
|
||||||
|
|
||||||
if (domain->box_exist == 0) {
|
if (domain->box_exist == 0) {
|
||||||
int m;
|
int m;
|
||||||
|
|||||||
Reference in New Issue
Block a user