Commit 6f12fe19 authored by Matthieu Schaller's avatar Matthieu Schaller
Browse files

Also update the counter of gravity self/pair tasks when linking them.

parent 7f64ed3b
......@@ -763,6 +763,9 @@ void cell_clean_links(struct cell *c, void *data) {
c->force = NULL;
c->nr_force = 0;
c->grav = NULL;
c->nr_grav = 0;
}
/**
......
......@@ -1409,6 +1409,7 @@ static inline void engine_make_gravity_dependencies(struct engine *e,
/* link to cell. */
engine_addlink(e, &c->grav, gravity);
atomic_inc(&c->nr_grav);
}
/**
......@@ -1420,11 +1421,9 @@ static inline void engine_make_gravity_dependencies(struct engine *e,
* @param gravity The gravity task to link.
* @param c The cell.
*/
static inline void engine_make_external_gravity_dependencies(struct engine *e,
struct scheduler
*sched, struct
task *gravity,
struct cell *c) {
static inline void engine_make_external_gravity_dependencies(
struct engine *e, struct scheduler *sched, struct task *gravity,
struct cell *c) {
/* init --> external gravity --> kick */
scheduler_addunlock(sched, c->super->init, gravity);
......@@ -1432,6 +1431,7 @@ static inline void engine_make_external_gravity_dependencies(struct engine *e,
/* link to cell. */
engine_addlink(e, &c->grav, gravity);
atomic_inc(&c->nr_grav);
}
/**
......
......@@ -395,6 +395,7 @@ void space_regrid(struct space *s, double cell_max, int verbose) {
s->cells_top[k].nr_density = 0;
s->cells_top[k].nr_gradient = 0;
s->cells_top[k].nr_force = 0;
s->cells_top[k].nr_grav = 0;
s->cells_top[k].density = NULL;
s->cells_top[k].gradient = NULL;
s->cells_top[k].force = NULL;
......@@ -587,8 +588,7 @@ void space_rebuild(struct space *s, double cell_max, int verbose) {
for (size_t k = 1; k < nr_parts; k++) {
if (ind[k - 1] > ind[k]) {
error("Sort failed!");
} else if (ind[k] != cell_getid(s->cdim,
s->parts[k].x[0] * s->iwidth[0],
} else if (ind[k] != cell_getid(s->cdim, s->parts[k].x[0] * s->iwidth[0],
s->parts[k].x[1] * s->iwidth[1],
s->parts[k].x[2] * s->iwidth[2])) {
error("Incorrect indices!");
......
Markdown is supported
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