Fix uninitialized task types in scheduler write dependencies
Caught a rather rarely noticeable issue while debugging gizmo-conservative.
It occurs when writing task dependencies and with the following conditions:
- when using MPI
- for a task that itself doesn't unlock any other task (but may be unlocked by others.)
My "recent" addition to the dependency graph dumps were to also explicitly write out tasks that aren't unlocking any others, but are still executed. The idea was that should there be an error when setting up dependencies, a task that isn't unlocked by any other task nor is unlocking any others wouldn't show up in the dependency graphs at all.
A bug here was missed for tasks that are the "leaves" in the graph, i.e. don't unlock any other task. In that case, their struct task_dependency
would have uninitialized values for task_type
and task_subtype
. These integers are later used to write out the task type/subtype names by accessing the corresponding name arrays, and would cause segfaults when the uninitialized values are something "unlucky".
Also add minor change to plotting script in cases we're only plotting the task graph of a singe cell of a step: If a task (like e.g. a pair task) unlocks a task that isn't associated with the traced cell, we mark its background colour in the graph red. Now it's also red for MPI tasks, which used to have a light blue as the default option.