diff --git a/src/cell.c b/src/cell.c index aa067e21370e6f92de018828ecf8dc3263c0ec6f..f6eb88b53bd51c801be35f405627c2c3f9e0497b 100644 --- a/src/cell.c +++ b/src/cell.c @@ -4569,7 +4569,7 @@ void cell_drift_bpart(struct cell *c, const struct engine *e, int force) { float cell_h_max = 0.f; /* Drift irrespective of cell flags? */ - force |= c->black_holes.do_drift; + force |= cell_get_flag(c, cell_flag_do_bh_drift); #ifdef SWIFT_DEBUG_CHECKS /* Check that we only drift local cells. */ @@ -4583,8 +4583,7 @@ void cell_drift_bpart(struct cell *c, const struct engine *e, int force) { if (c->black_holes.count == 0) { /* Clear the drift flags. */ - c->black_holes.do_drift = 0; - c->black_holes.do_sub_drift = 0; + cell_clear_flag(c, cell_flag_do_bh_drift & cell_flag_do_bh_sub_drift); /* Update the time of the last drift */ c->black_holes.ti_old_part = ti_current; @@ -4595,7 +4594,7 @@ void cell_drift_bpart(struct cell *c, const struct engine *e, int force) { /* Ok, we have some particles somewhere in the hierarchy to drift */ /* Are we not in a leaf ? */ - if (c->split && (force || c->black_holes.do_sub_drift)) { + if (c->split && (force || cell_get_flag(c, cell_flag_do_bh_sub_drift))) { /* Loop over the progeny and collect their data. */ for (int k = 0; k < 8; k++) { @@ -4701,8 +4700,7 @@ void cell_drift_bpart(struct cell *c, const struct engine *e, int force) { } /* Clear the drift flags. */ - c->black_holes.do_drift = 0; - c->black_holes.do_sub_drift = 0; + cell_clear_flag(c, cell_flag_do_bh_drift & cell_flag_do_bh_sub_drift); } /** diff --git a/src/cell.h b/src/cell.h index 8d13a2257c2a86d3845e90cebdf6edb262247b0a..8e3f460b3908175a0ddbf0d12d90cf9d2f849a06 100644 --- a/src/cell.h +++ b/src/cell.h @@ -633,12 +633,6 @@ struct cell { /*! Is the #bpart data of this cell being used in a sub-cell? */ int hold; - /*! Does this cell need to be drifted (black holes)? */ - char do_drift; - - /*! Do any of this cell's sub-cells need to be drifted (black holes)? */ - char do_sub_drift; - } black_holes; #ifdef WITH_MPI @@ -1297,11 +1291,6 @@ __attribute__((always_inline)) INLINE static void cell_set_flag( c->flags |= flag; } -__attribute__((always_inline)) INLINE static void cell_set_flag_threadsafe( - struct cell *c, enum cell_flags flag) { - atomic_or(&c->flags, flag); -} - /** Clear the given flag for the given cell. */ __attribute__((always_inline)) INLINE static void cell_clear_flag( struct cell *c, enum cell_flags flag) { diff --git a/src/space.c b/src/space.c index 166c8b42660e5f38bd194ab671175a1346930a77..ae3fdcb1e19e9ab0750599a656f5dbcac54dfc95 100644 --- a/src/space.c +++ b/src/space.c @@ -258,7 +258,6 @@ void space_rebuild_recycle_mapper(void *map_data, int num_elements, c->stars.parts = NULL; c->black_holes.parts = NULL; c->flags = 0; - c->black_holes.do_sub_drift = 0; c->hydro.ti_end_min = -1; c->hydro.ti_end_max = -1; c->grav.ti_end_min = -1; @@ -3318,7 +3317,6 @@ void space_split_recursive(struct space *s, struct cell *c, cp->hydro.super = NULL; cp->grav.super = NULL; cp->flags = 0; - cp->black_holes.do_sub_drift = 0; #ifdef WITH_MPI cp->mpi.tag = -1; #endif // WITH_MPI