From 7a5587d65ecb58999eefed4aee2bb5451a87b5b6 Mon Sep 17 00:00:00 2001
From: stamoor <stamoor@f3b2605a-c512-4ea7-a41b-209d697bcdaa>
Date: Thu, 11 Feb 2016 15:43:25 +0000
Subject: [PATCH] Adding Kokkos error check

git-svn-id: svn://svn.icms.temple.edu/lammps-ro/trunk@14586 f3b2605a-c512-4ea7-a41b-209d697bcdaa
---
 src/KOKKOS/kokkos.cpp |  4 +++-
 src/KOKKOS/kokkos.h   | 10 +++++++---
 2 files changed, 10 insertions(+), 4 deletions(-)

diff --git a/src/KOKKOS/kokkos.cpp b/src/KOKKOS/kokkos.cpp
index 0d17ca4d5d..0dbb1754a0 100644
--- a/src/KOKKOS/kokkos.cpp
+++ b/src/KOKKOS/kokkos.cpp
@@ -37,7 +37,7 @@ KokkosLMP::KokkosLMP(LAMMPS *lmp, int narg, char **arg) : Pointers(lmp)
 
   // process any command-line args that invoke Kokkos settings
 
-  int ngpu = 0;
+  ngpu = 0;
   int device = 0;
   num_threads = 1;
   numa = 1;
@@ -159,6 +159,8 @@ void KokkosLMP::accelerator(int narg, char **arg)
       else if (strcmp(arg[iarg+1],"n2") == 0) neighflag = N2;
       else if (strcmp(arg[iarg+1],"full/cluster") == 0) neighflag = FULLCLUSTER;
       else error->all(FLERR,"Illegal package kokkos command");
+      if (neighflag = HALF && num_threads == 0 || ngpu == 0)
+        error->all(FLERR,"Must use Kokkos half/thread or full neighbor list with threads or GPU");
       iarg += 2;
     } else if (strcmp(arg[iarg],"binsize") == 0) {
       if (iarg+2 > narg) error->all(FLERR,"Illegal package kokkos command");
diff --git a/src/KOKKOS/kokkos.h b/src/KOKKOS/kokkos.h
index 3f86a7bac6..4db638803e 100644
--- a/src/KOKKOS/kokkos.h
+++ b/src/KOKKOS/kokkos.h
@@ -27,7 +27,7 @@ class KokkosLMP : protected Pointers {
   int forward_comm_classic;
   int exchange_comm_on_host;
   int forward_comm_on_host;
-  int num_threads;
+  int num_threads,ngpu;
   int numa;
 
   KokkosLMP(class LAMMPS *, int, char **);
@@ -49,11 +49,15 @@ Self-explanatory.  See Section 2.7 of the manual for details.
 
 E: GPUs are requested but Kokkos has not been compiled for CUDA
 
-UNDOCUMENTED
+Recompile Kokkos with CUDA support to use GPUs.
 
 E: Kokkos has been compiled for CUDA but no GPUs are requested
 
-UNDOCUMENTED
+One or more GPUs must be used when Kokkos is compiled for CUDA.
+
+E: Must use Kokkos half/thread or full neighbor list with threads or GPU
+
+Using Kokkos half neighbor list with threading is not allowed.
 
 E: Illegal ... command
 
-- 
GitLab