Commit 8ffa6ba3 authored by Matthieu Schaller's avatar Matthieu Schaller
Browse files

Hook-up the cooling task at the correct level in the tree when gravity is on.

parent 537f8366
......@@ -209,7 +209,17 @@ void engine_make_hierarchical_tasks_common(struct engine *e, struct cell *c) {
c->end_force = scheduler_addtask(s, task_type_end_force,
task_subtype_none, 0, 0, c, NULL);
if (!is_with_cooling) scheduler_addunlock(s, c->end_force, c->kick2);
if (is_with_cooling) {
c->cooling = scheduler_addtask(s, task_type_cooling, task_subtype_none,
0, 0, c, NULL);
scheduler_addunlock(s, c->end_force, c->cooling);
scheduler_addunlock(s, c->cooling, c->kick2);
} else {
scheduler_addunlock(s, c->end_force, c->kick2);
}
scheduler_addunlock(s, c->kick2, c->timestep);
scheduler_addunlock(s, c->timestep, c->kick1);
}
......@@ -239,7 +249,6 @@ void engine_make_hierarchical_tasks_common(struct engine *e, struct cell *c) {
void engine_make_hierarchical_tasks_hydro(struct engine *e, struct cell *c) {
struct scheduler *s = &e->sched;
const int is_with_cooling = (e->policy & engine_policy_cooling);
const int is_with_sourceterms = (e->policy & engine_policy_sourceterms);
/* Are we in a super-cell ? */
......@@ -271,15 +280,6 @@ void engine_make_hierarchical_tasks_hydro(struct engine *e, struct cell *c) {
task_subtype_none, 0, 0, c, NULL);
#endif
/* Cooling task */
if (is_with_cooling) {
c->cooling = scheduler_addtask(s, task_type_cooling, task_subtype_none,
0, 0, c, NULL);
scheduler_addunlock(s, c->super->end_force, c->cooling);
scheduler_addunlock(s, c->cooling, c->super->kick2);
}
/* add source terms */
if (is_with_sourceterms) {
c->sourceterms = scheduler_addtask(s, task_type_sourceterms,
......
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