From be3ef045f91c46711253e7e8b57db4a4ed220d55 Mon Sep 17 00:00:00 2001
From: James Willis <james.s.willis@durham.ac.uk>
Date: Tue, 16 May 2017 15:33:14 +0100
Subject: [PATCH] Added debugging check.

---
 src/runner_doiact_vec.c | 10 ++++++++++
 1 file changed, 10 insertions(+)

diff --git a/src/runner_doiact_vec.c b/src/runner_doiact_vec.c
index 6353959876..974fd43f6a 100644
--- a/src/runner_doiact_vec.c
+++ b/src/runner_doiact_vec.c
@@ -887,6 +887,16 @@ __attribute__((always_inline)) INLINE void runner_doself2_force_vec(
   /* Read the particles from the cell and store them locally in the cache. */
   cache_read_particles(c, cell_cache);
 
+#ifdef SWIFT_DEBUG_CHECKS
+  for(int i=0; i<count; i++) {
+    pi = &c->parts[i];
+    /* Check that particles have been drifted to the current time */
+    if (pi->ti_drift != e->ti_current)
+      error("Particle pi not drifted to current time");
+    }
+  }
+#endif
+
   /* Create secondary cache to store particle interactions. */
   struct c2_cache int_cache;
   int icount = 0, icount_align = 0;
-- 
GitLab