From aa863a08b699fb7030ea6375b529962d8a95c1d9 Mon Sep 17 00:00:00 2001
From: Pedro Gonnet <gonnet@google.com>
Date: Tue, 18 Apr 2017 22:54:17 +0200
Subject: [PATCH] force re-sort of cells whenever we receive particles.

---
 src/runner.c        | 3 +++
 src/runner_doiact.h | 7 -------
 2 files changed, 3 insertions(+), 7 deletions(-)

diff --git a/src/runner.c b/src/runner.c
index 7e9886873e..d7edfe615a 100644
--- a/src/runner.c
+++ b/src/runner.c
@@ -1405,6 +1405,9 @@ void runner_do_recv_part(struct runner *r, struct cell *c, int timer) {
   timebin_t time_bin_min = num_time_bins;
   timebin_t time_bin_max = 0;
   float h_max = 0.f;
+  
+  /* Clear this cell's sorted mask. */
+  c->sorted = 0;
 
   /* If this cell is a leaf, collect the particle data. */
   if (!c->split) {
diff --git a/src/runner_doiact.h b/src/runner_doiact.h
index d41470f68d..bf8b1d6bdf 100644
--- a/src/runner_doiact.h
+++ b/src/runner_doiact.h
@@ -865,13 +865,6 @@ void DOPAIR1(struct runner *r, struct cell *ci, struct cell *cj) {
 
   const struct engine *restrict e = r->e;
 
-#ifdef WITH_MPI
-  if (ci->nodeID != cj->nodeID) {
-    DOPAIR1_NOSORT(r, ci, cj);
-    return;
-  }
-#endif
-
 #ifdef WITH_OLD_VECTORIZATION
   int icount = 0;
   float r2q[VEC_SIZE] __attribute__((aligned(16)));
-- 
GitLab