diff --git a/src/GPU/fix_gpu.h b/src/GPU/fix_gpu.h index 30b53ac879..fb38f7c7c5 100644 --- a/src/GPU/fix_gpu.h +++ b/src/GPU/fix_gpu.h @@ -13,7 +13,7 @@ #ifdef FIX_CLASS -FixStyle(gpu,FixGPU) +FixStyle(GPU,FixGPU) #else diff --git a/src/comm.cpp b/src/comm.cpp index 17123c4b58..87e7a47ab0 100644 --- a/src/comm.cpp +++ b/src/comm.cpp @@ -68,6 +68,8 @@ Comm::Comm(LAMMPS *lmp) : Pointers(lmp) cutghostuser = 0.0; ghost_velocity = 0; + nthreads = 1; + // initialize comm buffers & exchange memory maxsend = BUFMIN; diff --git a/src/comm.h b/src/comm.h index f093fb74b6..049e1ae85f 100644 --- a/src/comm.h +++ b/src/comm.h @@ -29,6 +29,7 @@ class Comm : protected Pointers { double cutghost[3]; // cutoffs used for acquiring ghost atoms double cutghostuser; // user-specified ghost cutoff int ***grid2proc; // which proc owns i,j,k loc in 3d grid + int nthreads; // OpenMP threads per MPI process Comm(class LAMMPS *); virtual ~Comm(); diff --git a/src/input.cpp b/src/input.cpp index c002917d4a..ff0c227381 100644 --- a/src/input.cpp +++ b/src/input.cpp @@ -1123,6 +1123,23 @@ void Input::package() if (!lmp->cuda) error->all("Package cuda command without USER-CUDA installed"); lmp->cuda->accelerator(narg-1,&arg[1]); + + } else if (strcmp(arg[0],"gpu") == 0) { + char **fixarg = new char*[2+narg]; + fixarg[0] = "package_gpu"; + fixarg[1] = "all"; + fixarg[2] = "GPU"; + 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 if (strcmp(arg[0],"omp") == 0) { + if (narg != 2) error->all("Illegal package command"); + comm->nthreads = atoi(arg[1]); + if (comm->nthreads < 1) error->all("Illegal package command"); + } else error->all("Illegal package command"); } diff --git a/src/memory.h b/src/memory.h index 45bf996a55..9ee0898e37 100644 --- a/src/memory.h +++ b/src/memory.h @@ -46,7 +46,7 @@ class Memory : protected Pointers { array = (TYPE *) smalloc(nbytes,name); return array; } - + template TYPE **create(TYPE **&array, int n, const char *name) {fail(name);} diff --git a/src/modify.cpp b/src/modify.cpp index 56b147f0b5..054b582208 100644 --- a/src/modify.cpp +++ b/src/modify.cpp @@ -94,6 +94,8 @@ Modify::Modify(LAMMPS *lmp) : Pointers(lmp) id_restart_peratom = style_restart_peratom = NULL; index_restart_peratom = NULL; + allow_early_fix = 0; + ncompute = maxcompute = 0; compute = NULL; } diff --git a/src/modify.h b/src/modify.h index 0175cc06a0..637ca702ee 100644 --- a/src/modify.h +++ b/src/modify.h @@ -33,6 +33,8 @@ class Modify : protected Pointers { int nfix_restart_global; // stored fix global info from restart file int nfix_restart_peratom; // stored fix peratom info from restart file + int allow_early_fix; // 1 if allow fix creation at start of script + class Fix **fix; // list of fixes int *fmask; // bit mask for when each fix is applied