Commit ac61ca52 authored by Pedro Gonnet's avatar Pedro Gonnet
Browse files

oops -- be careful of linking NULL tasks.

parent b5567d65
......@@ -149,6 +149,12 @@ struct end_of_step_data {
*/
void engine_addlink(struct engine *e, struct link **l, struct task *t) {
#ifdef SWIFT_DEBUG_CHECKS
if (t == NULL) {
error("Trying to link NULL task.");
}
#endif
/* Get the next free link. */
const size_t ind = atomic_inc(&e->nr_links);
if (ind >= e->size_links) {
......
......@@ -328,10 +328,14 @@ void engine_addtasks_recv_hydro(struct engine *e, struct cell *c,
c->mpi.tag, 0, c, NULL);
}
engine_addlink(e, &c->mpi.recv, t_xv);
engine_addlink(e, &c->mpi.recv, t_rho);
engine_addlink(e, &c->mpi.recv, t_gradient);
engine_addlink(e, &c->mpi.recv, t_ti);
if (t_xv != NULL) {
engine_addlink(e, &c->mpi.recv, t_xv);
engine_addlink(e, &c->mpi.recv, t_rho);
#ifdef EXTRA_HYDRO_LOOP
engine_addlink(e, &c->mpi.recv, t_gradient);
#endif
engine_addlink(e, &c->mpi.recv, t_ti);
}
/* Add dependencies. */
if (c->hydro.sorts != 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