WIP: Smarter sends
Started a merge request to keep track of what I'm doing here, since it's all a bit convoluted.
-
[done] Instead of adding send/recv tasks at the level of sub-cell density tasks, recurse down the sub-cell tree and only add them whenever we have an actual density computation. This is done in two passes, i.e. first run through the cells and mark them for send/recv (see
engine_mark_cells_for_hydro_send_recv
inengine_maketasks.c
), and then attach the tasks. - [done] When activating sub-cell density tasks, make sure to activate the send/recv tasks needed along the tree, e.g. activate whatever we see on our way down the active branches. We already do something like this for sorts, so this should not add any extra traversals.
- [done] Update the size computation for the foreign hydro particles to use the new structure.
Things to look out for, because they will almost definitely go wrong:
- [done] When doing a cross-node sub-cell task, should we blindly activate all the send/recv, or only those for the active sub-bits of the sub-cell task?
- [done] What happens if the sub-cell decomposition changes, can we still find the required send/recv tasks?
Edited by Matthieu Schaller