From e9ad6ab488aefa3b568738e827f66feb37bcee1b Mon Sep 17 00:00:00 2001
From: James Willis <james.s.willis@durham.ac.uk>
Date: Thu, 15 Nov 2018 17:00:27 +0000
Subject: [PATCH] Added criteria to split FOF tasks.

---
 src/cell.h | 16 +++++++++++++---
 1 file changed, 13 insertions(+), 3 deletions(-)

diff --git a/src/cell.h b/src/cell.h
index e8e5a9fbc3..26ffbfd121 100644
--- a/src/cell.h
+++ b/src/cell.h
@@ -428,9 +428,6 @@ struct cell {
     /*! Task propagating the multipole to the particles */
     struct task *down;
 
-    /*! Tasks for FOF */
-    struct task *fof_self, *fof_pair;
-    
     /*! Number of M-M tasks that are associated with this cell. */
     short int nr_mm_tasks;
 
@@ -828,6 +825,19 @@ cell_can_split_self_gravity_task(const struct cell *c) {
   return c->split && c->depth < space_subdepth_grav;
 }
 
+/**
+ * @brief Can a self FOF task associated with a cell be split into smaller
+ * sub-tasks.
+ *
+ * @param c The #cell.
+ */
+__attribute__((always_inline)) INLINE static int cell_can_split_self_fof_task(
+    const struct cell *c) {
+
+  /* Is the cell split ? */
+  return c->split && c->grav.count > 400 && c->depth < 4;
+}
+
 /**
  * @brief Have particles in a pair of cells moved too much and require a rebuild
  * ?
-- 
GitLab