diff --git a/src/runner_doiact_grav.h b/src/runner_doiact_grav.h index ebd08a662cee9595f8a82cbd5e4091d8325e1380..56bb4ca348504aaefbefcf17ff5f4afd8d17adf6 100644 --- a/src/runner_doiact_grav.h +++ b/src/runner_doiact_grav.h @@ -1718,7 +1718,8 @@ static INLINE void runner_do_grav_long_range(struct runner *r, struct cell *ci, /* Recover the list of top-level cells */ struct cell *cells = e->s->cells_top; - const int nr_cells = e->s->nr_cells; + int *cells_with_gparts = e->s->cells_with_gparts_top; + const int nr_cells_with_gparts = e->s->nr_cells_with_gparts; /* Anything to do here? */ if (!cell_is_active_gravity(ci, e)) return; @@ -1744,10 +1745,10 @@ static INLINE void runner_do_grav_long_range(struct runner *r, struct cell *ci, /* Loop over all the top-level cells and go for a M-M interaction if * well-separated */ - for (int n = 0; n < nr_cells; ++n) { + for (int n = 0; n < nr_cells_with_gparts; ++n) { /* Handle on the top-level cell and it's gravity business*/ - struct cell *cj = &cells[n]; + const struct cell *cj = &cells[cells_with_gparts[n]]; const struct gravity_tensors *const multi_j = cj->grav.multipole; /* Avoid self contributions */ diff --git a/src/space.c b/src/space.c index 073cf44aaee5b3bd932e2f993e616146dd26184a..ddb4c2af6fdf056b9686825d2d06715ea1178a8d 100644 --- a/src/space.c +++ b/src/space.c @@ -2590,7 +2590,7 @@ void space_list_cells_with_gparts(struct space *s) { } if (s->e->verbose) - message("Have %d top-level cells with tasks (total=%d)", + message("Have %d top-level cells with gparts (total=%d)", s->nr_cells_with_gparts, s->nr_cells); if (s->e->verbose)