diff --git a/src/engine.c b/src/engine.c index 88d59f25eed675f924ebe357e55a9d5318816088..6d32ce43620821b2847546be73727ad2dfedf22d 100644 --- a/src/engine.c +++ b/src/engine.c @@ -4868,7 +4868,7 @@ void engine_collect_end_of_step_mapper(void *map_data, int num_elements, void engine_collect_end_of_step(struct engine *e, int apply) { const ticks tic = getticks(); - const struct space *s = e->s; + struct space *s = e->s; struct end_of_step_data data; data.updated = 0, data.g_updated = 0, data.s_updated = 0; data.inhibited = 0, data.g_inhibited = 0, data.s_inhibited = 0; @@ -4883,6 +4883,11 @@ void engine_collect_end_of_step(struct engine *e, int apply) { s->local_cells_with_tasks_top, s->nr_local_cells_with_tasks, sizeof(int), 0, &data); + /* Store the local number of inhibited particles */ + s->nr_inhibited_parts = data.inhibited; + s->nr_inhibited_gparts = data.g_inhibited; + s->nr_inhibited_sparts = data.s_inhibited; + /* Store these in the temporary collection group. */ collectgroup1_init( &e->collect_group1, data.updated, data.g_updated, data.s_updated, diff --git a/src/engine.h b/src/engine.h index 7505a643cc6e911457192d734abb5db7f08512b3..d81346d3231fb9adc0aa08ec5f7aab0526050cd0 100644 --- a/src/engine.h +++ b/src/engine.h @@ -206,7 +206,7 @@ struct engine { long long total_nr_parts, total_nr_gparts, total_nr_sparts; /* The total number of inhibted particles in the system. */ - size_t nr_inhibited_parts, nr_inhibited_gparts, nr_inhibited_sparts; + long long nr_inhibited_parts, nr_inhibited_gparts, nr_inhibited_sparts; #ifdef SWIFT_DEBUG_CHECKS /* Total number of particles removed from the system since the last rebuild */ diff --git a/src/space.c b/src/space.c index 323dfdd7228c524ad446a64f9b3967c59d6f4552..9d405fbf83a5753869c23d933f679cee0ef236be 100644 --- a/src/space.c +++ b/src/space.c @@ -1005,6 +1005,11 @@ void space_rebuild(struct space *s, int repartitioned, int verbose) { #endif /* WITH_MPI */ + /* Mark that there are no inhibited particles left */ + s->nr_inhibited_parts = 0; + s->nr_inhibited_gparts = 0; + s->nr_inhibited_sparts = 0; + /* Sort the gparts according to their cells. */ if (nr_gparts > 0) space_gparts_sort(s->gparts, s->parts, s->sparts, gind, cell_gpart_counts, diff --git a/src/space.h b/src/space.h index 7fb9cf164095d8618bf8b42d950f41a02f82858d..a39f59ffa45ba85978927d42ee563f880ee1ac15 100644 --- a/src/space.h +++ b/src/space.h @@ -146,6 +146,15 @@ struct space { /*! The total number of g-parts in the space. */ size_t nr_sparts, size_sparts; + /*! Number of inhibted gas particles in the space */ + size_t nr_inhibited_parts; + + /*! Number of inhibted gravity particles in the space */ + size_t nr_inhibited_gparts; + + /*! Number of inhibted star particles in the space */ + size_t nr_inhibited_sparts; + /*! The particle data (cells have pointers to this). */ struct part *parts;