From 61e2cd3f61fc18850e26326eecb86b03576a841c Mon Sep 17 00:00:00 2001
From: Axel Kohlmeyer <akohlmey@gmail.com>
Date: Fri, 5 Oct 2018 16:03:11 +0200
Subject: [PATCH] avoid requesting threaded neighbor lists that are both
 threaded via USER-OMP and USER-INTEL

---
 src/USER-INTEL/fix_intel.cpp | 7 ++++++-
 src/USER-OMP/fix_omp.cpp     | 5 ++++-
 2 files changed, 10 insertions(+), 2 deletions(-)

diff --git a/src/USER-INTEL/fix_intel.cpp b/src/USER-INTEL/fix_intel.cpp
index 3a67b60632..37212928df 100644
--- a/src/USER-INTEL/fix_intel.cpp
+++ b/src/USER-INTEL/fix_intel.cpp
@@ -532,8 +532,13 @@ void FixIntel::check_neighbor_intel()
       _offload_noghost = 0;
     }
     #endif
+
+    // avoid flagging a neighbor list as both USER-INTEL and USER-OMP
+    if (neighbor->requests[i]->intel)
+      neighbor->requests[i]->omp = 0;
+
     if (neighbor->requests[i]->skip)
-      error->all(FLERR, "Cannot yet use hybrid styles with Intel package.");
+      error->all(FLERR, "Hybrid styles with Intel package are unsupported.");
   }
 }
 
diff --git a/src/USER-OMP/fix_omp.cpp b/src/USER-OMP/fix_omp.cpp
index 8d54d5b451..8be54caada 100644
--- a/src/USER-OMP/fix_omp.cpp
+++ b/src/USER-OMP/fix_omp.cpp
@@ -318,8 +318,11 @@ void FixOMP::set_neighbor_omp()
   const int neigh_omp = _neighbor ? 1 : 0;
   const int nrequest = neighbor->nrequest;
 
+  // flag *all* neighbor list requests as USER-OMP threaded,
+  // but skip lists already flagged as USER-INTEL threaded
   for (int i = 0; i < nrequest; ++i)
-    neighbor->requests[i]->omp = neigh_omp;
+    if (! neighbor->requests[i]->intel)
+      neighbor->requests[i]->omp = neigh_omp;
 }
 
 /* ---------------------------------------------------------------------- */
-- 
GitLab