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

This commit is contained in:
sjplimp
2014-08-14 20:07:39 +00:00
parent 18a1c57b56
commit 10dfed77c9
3 changed files with 33 additions and 2 deletions

View File

@ -594,15 +594,32 @@ void LAMMPS::create()
}
/* ----------------------------------------------------------------------
check suffix consistency with installed packages
do this for GPU, USER-INTEL, USER-OMP
already done in constructor for USER-CUDA, KOKKOS
turn off suffix2 = omp if USER-OMP is not installed
invoke package-specific setup commands
only invoke if suffix is set and enabled
also check if suffix2 is set
called from LAMMPS constructor and after clear() command
only invoke if suffix is set and enabled
also check if suffix2 is set
------------------------------------------------------------------------- */
void LAMMPS::post_create()
{
if (!suffix_enable) return;
if (strcmp(suffix,"gpu") == 0 && !modify->check_package("GPU"))
error->all(FLERR,"Using suffix gpu without GPU package installed");
if (strcmp(suffix,"intel") == 0 && !modify->check_package("Intel"))
error->all(FLERR,"Using suffix intel without USER-INTEL package installed");
if (strcmp(suffix,"omp") == 0 && !modify->check_package("OMP"))
error->all(FLERR,"Using suffix omp without USER-OMP package installed");
if (strcmp(suffix2,"omp") == 0 && !modify->check_package("OMP")) {
delete [] suffix2;
suffix2 = NULL;
}
if (suffix) {
if (strcmp(suffix,"gpu") == 0) input->one("package gpu force/neigh 0 0 1");
if (strcmp(suffix,"omp") == 0) input->one("package omp *");

View File

@ -860,6 +860,19 @@ int Modify::find_fix(const char *id)
return ifix;
}
/* ----------------------------------------------------------------------
check for fix associated with package name
return 1 if found else 0
used to determine whether LAMMPS was built with
GPU, USER-INTEL, USER-OMP packages
------------------------------------------------------------------------- */
int Modify::check_package(const char *package_fix_name)
{
if (fix_map->find(package_fix_name) == fix_map->end()) return 0;
return 1;
}
/* ----------------------------------------------------------------------
add a new compute
------------------------------------------------------------------------- */

View File

@ -86,6 +86,7 @@ class Modify : protected Pointers {
void modify_fix(int, char **);
void delete_fix(const char *);
int find_fix(const char *);
int check_package(const char *);
void add_compute(int, char **, int trysuffix=0);
void modify_compute(int, char **);