From ab5592e67b34410a4a19bcbdde118fa54780c4ae Mon Sep 17 00:00:00 2001 From: sjplimp Date: Thu, 26 May 2011 22:45:42 +0000 Subject: [PATCH] git-svn-id: svn://svn.icms.temple.edu/lammps-ro/trunk@6221 f3b2605a-c512-4ea7-a41b-209d697bcdaa --- src/input.cpp | 15 ++++++--------- src/lammps.cpp | 3 +-- 2 files changed, 7 insertions(+), 11 deletions(-) diff --git a/src/input.cpp b/src/input.cpp index 835b8ae5c9..ca440d2e28 100644 --- a/src/input.cpp +++ b/src/input.cpp @@ -808,23 +808,20 @@ void Input::accelerator() if (domain->box_exist) error->all("Accelerator command after simulation box is defined"); if (narg < 1) error->all("Illegal accelerator command"); - if (!lmp->asuffix || (strcmp(lmp->asuffix,arg[0]) != 0)) - error->all("Accelerator command requires matching command-line -a switch"); if (strcmp(arg[0],"off") == 0) { if (narg != 1) error->all("Illegal accelerator command"); lmp->accelerator = 0; return; - } - - if (strcmp(arg[0],"on") == 0) { + } else if (strcmp(arg[0],"on") == 0) { if (narg != 1) error->all("Illegal accelerator command"); lmp->accelerator = 1; return; - } - - if (strcmp(arg[0],"cuda") == 0) lmp->cuda->accelerator(narg-1,&arg[1]); - else error->all("Illegal accelerator command"); + } else if (strcmp(arg[0],"cuda") == 0) { + if (!lmp->cuda) error->all("Accelerator cuda command without " + "USER-CUDA package installed"); + lmp->cuda->accelerator(narg-1,&arg[1]); + } else error->all("Illegal accelerator command"); } /* ---------------------------------------------------------------------- */ diff --git a/src/lammps.cpp b/src/lammps.cpp index dfef210734..bc3134d5d0 100644 --- a/src/lammps.cpp +++ b/src/lammps.cpp @@ -50,8 +50,7 @@ LAMMPS::LAMMPS(int narg, char **arg, MPI_Comm communicator) screen = NULL; logfile = NULL; - // create CUDA class - // cuda = true version if USER-CUDA installed, else dummy + // create CUDA class if USER-CUDA installed, else dummy cuda = new Cuda(this); if (!cuda->cuda_exists) {