Commit a5f1bc2f authored by Matthieu Schaller's avatar Matthieu Schaller
Browse files

Only activate the FFT task if there is at least one active task on that rank.

parent 670f8b6e
......@@ -2069,8 +2069,8 @@ int cell_unskip_tasks(struct cell *c, struct scheduler *s) {
const int cj_active = (cj != NULL) ? cell_is_active(cj, e) : 0;
/* Only activate tasks that involve a local active cell. */
if ((ci_active && ci->nodeID == engine_rank) ||
(cj_active && cj->nodeID == engine_rank)) {
if ((ci_active && ci->nodeID == nodeID) ||
(cj_active && cj->nodeID == nodeID)) {
scheduler_activate(s, t);
/* Set the drifting flags */
......@@ -2088,7 +2088,7 @@ int cell_unskip_tasks(struct cell *c, struct scheduler *s) {
#ifdef WITH_MPI
/* Activate the send/recv tasks. */
if (ci->nodeID != engine_rank) {
if (ci->nodeID != nodeID) {
/* If the local cell is active, receive data from the foreign cell. */
if (cj_active) {
......@@ -2112,7 +2112,7 @@ int cell_unskip_tasks(struct cell *c, struct scheduler *s) {
/* If the local cell is active, send its ti_end values. */
if (cj_active) scheduler_activate_send(s, cj->send_ti, ci->nodeID);
} else if (cj->nodeID != engine_rank) {
} else if (cj->nodeID != nodeID) {
/* If the local cell is active, receive data from the foreign cell. */
if (ci_active) {
......@@ -2156,8 +2156,6 @@ int cell_unskip_tasks(struct cell *c, struct scheduler *s) {
if (c->kick1 != NULL) scheduler_activate(s, c->kick1);
if (c->kick2 != NULL) scheduler_activate(s, c->kick2);
if (c->timestep != NULL) scheduler_activate(s, c->timestep);
// if (c->grav_ghost[0] != NULL) scheduler_activate(s, c->grav_ghost[0]);
// if (c->grav_ghost[1] != NULL) scheduler_activate(s, c->grav_ghost[1]);
if (c->grav_down != NULL) scheduler_activate(s, c->grav_down);
if (c->grav_long_range != NULL) scheduler_activate(s, c->grav_long_range);
if (c->cooling != NULL) scheduler_activate(s, c->cooling);
......
......@@ -4314,12 +4314,14 @@ void engine_unskip(struct engine *e) {
/* Activate all the regular tasks */
threadpool_map(&e->threadpool, runner_do_unskip_mapper, e->s->local_cells_top,
e->s->nr_local_cells, sizeof(int), 1, e);
// threadpool_map(&e->threadpool, runner_do_unskip_mapper, e->s->cells_top,
// e->s->nr_cells, sizeof(int), 1, e);
/* And the top level gravity FFT one */
if (e->s->periodic && (e->policy & engine_policy_self_gravity))
/* And the top level gravity FFT one when periodicity is on.*/
if (e->s->periodic && (e->policy & engine_policy_self_gravity)) {
/* But only if there are other tasks (i.e. something happens on this node) */
if(e->sched.active_count > 0)
scheduler_activate(&e->sched, e->s->grav_top_level);
}
if (e->verbose)
message("took %.3f %s.", clocks_from_ticks(getticks() - tic),
......
......@@ -78,7 +78,7 @@ gravity_compute_timestep_self(const struct gpart* const gp,
const float epsilon = gravity_get_softening(gp);
/* Note that 0.66666667 = 2. (from Gadget) / 3. (Plummer softening) */
float dt = sqrtf(0.66666667f * grav_props->eta * epsilon * ac_inv);
const float dt = sqrtf(0.66666667f * grav_props->eta * epsilon * ac_inv);
return dt;
}
......
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