From e5d24a2e23141db144e2e89817ba1fdac34b141a Mon Sep 17 00:00:00 2001
From: "Peter W. Draper" <p.w.draper@durham.ac.uk>
Date: Mon, 10 Jul 2017 10:49:25 +0100
Subject: [PATCH] Add check to make sure that foreign cells do not have xparts

This would have revealed the last MPI bug a but quicker
---
 src/runner.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/src/runner.c b/src/runner.c
index 00303081ec..f2e962da3b 100644
--- a/src/runner.c
+++ b/src/runner.c
@@ -462,6 +462,10 @@ void runner_do_sort(struct runner *r, struct cell *c, int flags, int cleanup,
 
     /* Reset the sort distance */
     if (c->sorted == 0) {
+#ifdef SWIFT_DEBUG_CHECKS
+      if (xparts != NULL && c->nodeID != engine_rank)
+         error("Have non-NULL xparts in foreign cell");
+#endif
 
       /* And the individual sort distances if we are a local cell */
       if (xparts != NULL) {
-- 
GitLab