diff --git a/src/cell.c b/src/cell.c index e7003a6e7ba9f0382050d5304e3638a7a6f2749d..44383417cd42398027f9c46fe2eccddcac9e078c 100644 --- a/src/cell.c +++ b/src/cell.c @@ -3275,7 +3275,7 @@ int cell_unskip_hydro_tasks(struct cell *c, struct scheduler *s) { /* If the foreign cell is active, we want its ti_end values. */ if (ci_active || with_limiter) - scheduler_activate(s, ci->mpi.hydro.recv_ti); + scheduler_activate_recv(s, ci->mpi.recv, task_subtype_tend_part); if (with_limiter) scheduler_activate(s, ci->mpi.limiter.recv); if (with_limiter) @@ -3325,7 +3325,7 @@ int cell_unskip_hydro_tasks(struct cell *c, struct scheduler *s) { /* If the foreign cell is active, we want its ti_end values. */ if (cj_active || with_limiter) - scheduler_activate(s, cj->mpi.hydro.recv_ti); + scheduler_activate_recv(s, cj->mpi.recv, task_subtype_tend_part); if (with_limiter) scheduler_activate(s, cj->mpi.limiter.recv); if (with_limiter) @@ -3902,7 +3902,7 @@ void cell_set_super_mapper(void *map_data, int num_elements, void *extra_data) { int cell_has_tasks(struct cell *c) { #ifdef WITH_MPI - if (c->timestep != NULL || c->mpi.hydro.recv_ti != NULL || + if (c->timestep != NULL || c->mpi.recv != NULL || c->mpi.grav.recv_ti != NULL || c->mpi.stars.recv_ti != NULL) return 1; #else diff --git a/src/cell.h b/src/cell.h index b275fa26350104ceb621ce658cc15810abe8afa6..10e807617e86870ffafe536e54beb1f90a80d64b 100644 --- a/src/cell.h +++ b/src/cell.h @@ -580,11 +580,6 @@ struct cell { struct link *recv; }; - struct { - /* Task receiving data (time-step). */ - struct task *recv_ti; - } hydro; - struct { /* Task receiving gpart data. */ struct task *recv; diff --git a/src/engine.c b/src/engine.c index e0747dde19f44f20b370b2d1d806f4a7e757bb3c..1f01c3b7fd5cb1adb94a5149feb4fc6ac28aa8f1 100644 --- a/src/engine.c +++ b/src/engine.c @@ -2385,11 +2385,13 @@ void engine_barrier(struct engine *e) { void engine_collect_end_of_step_recurse_hydro(struct cell *c, const struct engine *e) { -/* Skip super-cells (Their values are already set) */ + /* Skip super-cells (Their values are already set) */ + if (c->timestep != NULL) return; #ifdef WITH_MPI - if (c->timestep != NULL || c->mpi.hydro.recv_ti != NULL) return; + struct link *l = c->mpi.recv; + while (l != NULL && l->t->subtype != task_subtype_tend_part) l = l->next; + if (l != NULL) return; #else - if (c->timestep != NULL) return; #endif /* WITH_MPI */ #ifdef SWIFT_DEBUG_CHECKS diff --git a/src/engine_maketasks.c b/src/engine_maketasks.c index 257fc70c5cc18d540805e7a24a6d02b9bd18759b..2442a102883cc9970a1e9b560d5181c697d61135 100644 --- a/src/engine_maketasks.c +++ b/src/engine_maketasks.c @@ -331,7 +331,7 @@ void engine_addtasks_recv_hydro(struct engine *e, struct cell *c, engine_addlink(e, &c->mpi.recv, t_xv); engine_addlink(e, &c->mpi.recv, t_rho); engine_addlink(e, &c->mpi.recv, t_gradient); - c->mpi.hydro.recv_ti = t_ti; + engine_addlink(e, &c->mpi.recv, t_ti); /* Add dependencies. */ if (c->hydro.sorts != NULL) { diff --git a/src/engine_marktasks.c b/src/engine_marktasks.c index f4b84b303a2f3a60da36417a84339c5b1c1d180e..859531f4803a076367a03e858bab7b893b6d4a83 100644 --- a/src/engine_marktasks.c +++ b/src/engine_marktasks.c @@ -372,7 +372,8 @@ void engine_marktasks_mapper(void *map_data, int num_elements, } /* If the foreign cell is active, we want its ti_end values. */ - if (ci_active_hydro) scheduler_activate(s, ci->mpi.hydro.recv_ti); + if (ci_active_hydro) + scheduler_activate_recv(s, ci->mpi.recv, task_subtype_tend_part); /* Is the foreign cell active and will need stuff from us? */ if (ci_active_hydro) { @@ -416,7 +417,8 @@ void engine_marktasks_mapper(void *map_data, int num_elements, } /* If the foreign cell is active, we want its ti_end values. */ - if (cj_active_hydro) scheduler_activate(s, cj->mpi.hydro.recv_ti); + if (cj_active_hydro) + scheduler_activate_recv(s, cj->mpi.recv, task_subtype_tend_part); /* Is the foreign cell active and will need stuff from us? */ if (cj_active_hydro) { diff --git a/src/space.c b/src/space.c index f00d43d3272deb77ede5836e8174ae06ca0382ba..f6ca47ef448fec9b700adb01c8b782748509e68f 100644 --- a/src/space.c +++ b/src/space.c @@ -269,7 +269,6 @@ void space_rebuild_recycle_mapper(void *map_data, int num_elements, c->mpi.tag = -1; c->mpi.recv = NULL; - c->mpi.hydro.recv_ti = NULL; c->mpi.grav.recv = NULL; c->mpi.grav.recv_ti = NULL; c->mpi.stars.recv = NULL;