From 174e8e0c71a97f1ac9e80d9d841fb7da7c06e32f Mon Sep 17 00:00:00 2001
From: James Willis <james.s.willis@durham.ac.uk>
Date: Fri, 27 Oct 2017 11:50:14 +0100
Subject: [PATCH] Call doself_subset_density when macro defined.

---
 tests/test27cells.c | 25 ++++++++++++++++++-------
 1 file changed, 18 insertions(+), 7 deletions(-)

diff --git a/tests/test27cells.c b/tests/test27cells.c
index 5d705ad729..390791266a 100644
--- a/tests/test27cells.c
+++ b/tests/test27cells.c
@@ -34,15 +34,23 @@
 #define DOSELF1 runner_doself1_density_vec
 #define DOSELF1_SUBSET runner_doself_subset_density_vec
 #define DOPAIR1 runner_dopair1_branch_density
-#define DOSELF1_NAME "runner_doself1_density_vec"
+#ifdef DOSELF_SUBSET
+#define DOSELF1_NAME "runner_doself_subset_density_vec"
+#else
+#define DOSELF1_NAME "runner_doself_density_vec"
+#endif
 #define DOPAIR1_NAME "runner_dopair1_density_vec"
 #endif
 
 #ifndef DOSELF1
 #define DOSELF1 runner_doself1_density
 #define DOSELF1_SUBSET runner_doself_subset_density
+#ifdef DOSELF_SUBSET
+#define DOSELF1_NAME "runner_doself1_subset_density"
+#else
 #define DOSELF1_NAME "runner_doself1_density"
 #endif
+#endif
 
 #ifndef DOPAIR1
 #define DOPAIR1 runner_dopair1_branch_density
@@ -470,11 +478,11 @@ int main(int argc, char *argv[]) {
 
         DOPAIR1(&runner, main_cell, cells[j]);
 
-        const ticks sub_toc = getticks();
-        timings[j] += sub_toc - sub_tic;
+        timings[j] += getticks() - sub_tic;
       }
     }
 
+#ifdef DOSELF_SUBSET
     int *pid = NULL;
     int count = 0;
     if ((pid = malloc(sizeof(int) * main_cell->count)) == NULL)
@@ -484,15 +492,18 @@ int main(int argc, char *argv[]) {
         pid[count] = k;
         ++count;
       }
+#endif
 
     /* And now the self-interaction */
     const ticks self_tic = getticks();
 
-    DOSELF1_SUBSET(&runner, main_cell, main_cell->parts,pid,count);
-
-    const ticks self_toc = getticks();
+#ifdef DOSELF_SUBSET
+    DOSELF1_SUBSET(&runner, main_cell, main_cell->parts, pid, count);
+#else
+    DOSELF1(&runner, main_cell);
+#endif
 
-    timings[13] += self_toc - self_tic;
+    timings[13] += getticks() - self_tic;
 
 #endif
 
-- 
GitLab