git-svn-id: svn://svn.icms.temple.edu/lammps-ro/trunk@7266 f3b2605a-c512-4ea7-a41b-209d697bcdaa
This commit is contained in:
@ -509,6 +509,14 @@ void Input::clear()
|
||||
if (narg > 0) error->all(FLERR,"Illegal clear command");
|
||||
lmp->destroy();
|
||||
lmp->create();
|
||||
|
||||
// use of "omp" suffix implies using "package omp"
|
||||
// re-create the effect of that package command which creates a fix
|
||||
|
||||
if (lmp->suffix && lmp->suffix_enable) {
|
||||
if (strcmp(lmp->suffix,"omp") == 0)
|
||||
lmp->input->one("package omp *");
|
||||
}
|
||||
}
|
||||
|
||||
/* ---------------------------------------------------------------------- */
|
||||
@ -1141,25 +1149,15 @@ void Input::package()
|
||||
delete [] fixarg;
|
||||
|
||||
} else if (strcmp(arg[0],"omp") == 0) {
|
||||
|
||||
#ifdef _OPENMP
|
||||
if (narg != 2) error->all(FLERR,"Illegal package command");
|
||||
comm->nthreads = atoi(arg[1]);
|
||||
if (comm->nthreads < 1) error->all(FLERR,"Illegal package command");
|
||||
|
||||
omp_set_num_threads(comm->nthreads);
|
||||
if (me == 0) {
|
||||
if (screen)
|
||||
fprintf(screen," reset %d OpenMP thread(s) per MPI task\n",
|
||||
comm->nthreads);
|
||||
if (logfile)
|
||||
fprintf(logfile," reset %d OpenMP thread(s) per MPI task\n",
|
||||
comm->nthreads);
|
||||
}
|
||||
#else
|
||||
error->all(FLERR,"Cannot use package omp command with no OpenMP support");
|
||||
#endif
|
||||
|
||||
char **fixarg = new char*[2+narg];
|
||||
fixarg[0] = "package_omp";
|
||||
fixarg[1] = "all";
|
||||
fixarg[2] = "OMP";
|
||||
for (int i = 1; i < narg; i++) fixarg[i+2] = arg[i];
|
||||
modify->allow_early_fix = 1;
|
||||
modify->add_fix(2+narg,fixarg,NULL);
|
||||
modify->allow_early_fix = 0;
|
||||
delete [] fixarg;
|
||||
} else error->all(FLERR,"Illegal package command");
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user