From 53b04e19ddc25c08d8bf22c1fa29f9b50825c3e9 Mon Sep 17 00:00:00 2001
From: Matthieu Schaller <matthieu.schaller@durham.ac.uk>
Date: Tue, 14 Feb 2017 14:06:32 +0000
Subject: [PATCH] Flip the cells in the PAIR_NOSORT tasks *before* extracting
 values.

---
 src/runner_doiact_nosort.h | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/src/runner_doiact_nosort.h b/src/runner_doiact_nosort.h
index 057dd756b4..d38f01c695 100644
--- a/src/runner_doiact_nosort.h
+++ b/src/runner_doiact_nosort.h
@@ -18,15 +18,15 @@ void DOPAIR1_NOSORT(struct runner *r, struct cell *ci, struct cell *cj) {
   if (!cell_is_drifted(ci, e)) cell_drift(ci, e);
   if (!cell_is_drifted(cj, e)) cell_drift(cj, e);
 
+  /* Get the relative distance between the pairs, wrapping. */
+  double shift[3] = {0.0, 0.0, 0.0};
+  space_getsid(e->s, &ci, &cj, shift);
+
   const int count_i = ci->count;
   const int count_j = cj->count;
   struct part *restrict parts_i = ci->parts;
   struct part *restrict parts_j = cj->parts;
 
-  /* Get the relative distance between the pairs, wrapping. */
-  double shift[3] = {0.0, 0.0, 0.0};
-  space_getsid(e->s, &ci, &cj, shift);
-
   /* Loop over the parts in ci. */
   for (int pid = 0; pid < count_i; pid++) {
 
@@ -135,15 +135,15 @@ void DOPAIR2_NOSORT(struct runner *r, struct cell *ci, struct cell *cj) {
   if (!cell_is_drifted(ci, e)) cell_drift(ci, e);
   if (!cell_is_drifted(cj, e)) cell_drift(cj, e);
 
+  /* Get the relative distance between the pairs, wrapping. */
+  double shift[3] = {0.0, 0.0, 0.0};
+  space_getsid(e->s, &ci, &cj, shift);
+
   const int count_i = ci->count;
   const int count_j = cj->count;
   struct part *restrict parts_i = ci->parts;
   struct part *restrict parts_j = cj->parts;
 
-  /* Get the relative distance between the pairs, wrapping. */
-  double shift[3] = {0.0, 0.0, 0.0};
-  space_getsid(e->s, &ci, &cj, shift);
-
   /* Loop over the parts in ci. */
   for (int pid = 0; pid < count_i; pid++) {
 
-- 
GitLab