Commit 9396e6cc authored by Matthieu Schaller's avatar Matthieu Schaller
Browse files

Only construct the send/recv tasks for a hydro/gravity when required by the...

Only construct the send/recv tasks for a hydro/gravity when required by the type of cell in the proxy.
parent add8e1c0
...@@ -2905,26 +2905,37 @@ void engine_maketasks(struct engine *e) { ...@@ -2905,26 +2905,37 @@ void engine_maketasks(struct engine *e) {
struct proxy *p = &e->proxies[pid]; struct proxy *p = &e->proxies[pid];
/* Loop through the proxy's incoming cells and add the /* Loop through the proxy's incoming cells and add the
recv tasks. */ recv tasks for the cells in the proxy that have a hydro connection. */
if (e->policy & engine_policy_hydro) if (e->policy & engine_policy_hydro)
for (int k = 0; k < p->nr_cells_in; k++) for (int k = 0; k < p->nr_cells_in; k++)
engine_addtasks_recv_hydro(e, p->cells_in[k], NULL, NULL, NULL, NULL); if (p->cells_in_type[k] & proxy_cell_type_hydro)
engine_addtasks_recv_hydro(e, p->cells_in[k], NULL, NULL, NULL,
NULL);
/* Loop through the proxy's incoming cells and add the
recv tasks for the cells in the proxy that have a gravity connection.
*/
if (e->policy & engine_policy_self_gravity) if (e->policy & engine_policy_self_gravity)
for (int k = 0; k < p->nr_cells_in; k++) for (int k = 0; k < p->nr_cells_in; k++)
engine_addtasks_recv_gravity(e, p->cells_in[k], NULL, NULL); if (p->cells_in_type[k] & proxy_cell_type_gravity)
engine_addtasks_recv_gravity(e, p->cells_in[k], NULL, NULL);
/* Loop through the proxy's outgoing cells and add the /* Loop through the proxy's outgoing cells and add the
send tasks. */ send tasks for the cells in the proxy that have a hydro connection. */
if (e->policy & engine_policy_hydro) if (e->policy & engine_policy_hydro)
for (int k = 0; k < p->nr_cells_out; k++) for (int k = 0; k < p->nr_cells_out; k++)
engine_addtasks_send_hydro(e, p->cells_out[k], p->cells_in[0], NULL, if (p->cells_out_type[k] & proxy_cell_type_hydro)
NULL, NULL, NULL); engine_addtasks_send_hydro(e, p->cells_out[k], p->cells_in[0], NULL,
NULL, NULL, NULL);
/* Loop through the proxy's outgoing cells and add the
send tasks for the cells in the proxy that have a gravity connection.
*/
if (e->policy & engine_policy_self_gravity) if (e->policy & engine_policy_self_gravity)
for (int k = 0; k < p->nr_cells_out; k++) for (int k = 0; k < p->nr_cells_out; k++)
engine_addtasks_send_gravity(e, p->cells_out[k], p->cells_in[0], NULL, if (p->cells_out_type[k] & proxy_cell_type_gravity)
NULL); engine_addtasks_send_gravity(e, p->cells_out[k], p->cells_in[0],
NULL, NULL);
} }
} }
#endif #endif
......
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