Commit 33c9cc37 authored by Matthieu Schaller's avatar Matthieu Schaller
Browse files

Collect the number of inhibited particles in each space in engine_collect_end_of_step()

parent f4daa0f3
......@@ -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,
......
......@@ -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 */
......
......@@ -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,
......
......@@ -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;
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment