Commit 7f486859 authored by Pedro Gonnet's avatar Pedro Gonnet
Browse files

split the ghost task into implicit ghost_in and ghost_out tasks.

parent 577a9022
......@@ -1752,7 +1752,8 @@ int cell_unskip_tasks(struct cell *c, struct scheduler *s) {
for (struct link *l = c->grav; l != NULL; l = l->next)
scheduler_activate(s, l->t);
if (c->extra_ghost != NULL) scheduler_activate(s, c->extra_ghost);
if (c->ghost != NULL) scheduler_activate(s, c->ghost);
if (c->ghost_in != NULL) scheduler_activate(s, c->ghost_in);
if (c->ghost_out != NULL) scheduler_activate(s, c->ghost_out);
if (c->init_grav != NULL) scheduler_activate(s, c->init_grav);
if (c->drift != NULL) scheduler_activate(s, c->drift);
if (c->kick1 != NULL) scheduler_activate(s, c->kick1);
......
......@@ -151,8 +151,9 @@ struct cell {
/*! The multipole initialistation task */
struct task *init_grav;
/*! The ghost task */
struct task *ghost;
/*! The ghost tasks */
struct task *ghost_in;
struct task *ghost_out;
/*! The extra ghost task for complex hydro schemes */
struct task *extra_ghost;
......
......@@ -183,10 +183,13 @@ void engine_make_hierarchical_tasks(struct engine *e, struct cell *c) {
scheduler_addunlock(s, c->grav_down, c->kick2);
}
/* Generate the ghost task. */
if (is_hydro)
c->ghost = scheduler_addtask(s, task_type_ghost, task_subtype_none, 0,
0, c, NULL);
/* Generate the ghost tasks. */
if (is_hydro) {
c->ghost_in = scheduler_addtask(s, task_type_ghost, task_subtype_none, 0,
/* implicit = */ 1, c, NULL);
c->ghost_out = scheduler_addtask(s, task_type_ghost, task_subtype_none, 0,
/* implicit = */ 1, c, NULL);
}
#ifdef EXTRA_HYDRO_LOOP
/* Generate the extra ghost task. */
......@@ -1041,10 +1044,10 @@ void engine_addtasks_send(struct engine *e, struct cell *ci, struct cell *cj,
scheduler_addunlock(s, t_rho, ci->super->kick2);
/* The send_rho task depends on the cell's ghost task. */
scheduler_addunlock(s, ci->super->ghost, t_rho);
scheduler_addunlock(s, ci->super->ghost_out, t_rho);
/* The send_xv task should unlock the super-cell's ghost task. */
scheduler_addunlock(s, t_xv, ci->super->ghost);
scheduler_addunlock(s, t_xv, ci->super->ghost_in);
#endif
......@@ -2035,8 +2038,8 @@ static inline void engine_make_hydro_loops_dependencies(struct scheduler *sched,
struct cell *c,
int with_cooling) {
/* density loop --> ghost --> force loop */
scheduler_addunlock(sched, density, c->super->ghost);
scheduler_addunlock(sched, c->super->ghost, force);
scheduler_addunlock(sched, density, c->super->ghost_in);
scheduler_addunlock(sched, c->super->ghost_out, force);
if (with_cooling) {
/* force loop --> cooling (--> kick2) */
......
......@@ -213,7 +213,8 @@ void space_rebuild_recycle_mapper(void *map_data, int num_elements,
c->scount = 0;
c->init_grav = NULL;
c->extra_ghost = NULL;
c->ghost = NULL;
c->ghost_in = NULL;
c->ghost_out = NULL;
c->kick1 = NULL;
c->kick2 = NULL;
c->timestep = NULL;
......
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