Scheduler ignores the mask when unlocking dependencies
What I want is to run on only part of the dependency graph. i.e., just density, ghost and force, not kick.
In engine_maketasks()
, the kick tasks are linked in the form of dependencies to their parent force tasks.
Later, I call this:
engine_launch(e, e->nr_threads, (1 << task_type_sort) | (1 << task_type_self) | (1 << task_type_pair) | (1 << task_type_sub) | (1 << task_type_init) | (1 << task_type_ghost) | (1 << task_type_send) | (1 << task_type_recv) | (1 << task_type_link));
in my initialisation step. Note the absence of task_type_kick
in the mask that is passed to the engine and then scheduler (ignore the new type task_type_init
). The kick tasks are hence not enqueued at the beginning... and indeed scheduler_start()
ignores them.
Now, whenever a force task is done in runner_main()
, it will call scheduler_done()
, which will enqueue all the dependencies of the task that just completed. In the case at hand, this will enqueue the kick tasks. And they will be called. Even if they were not part of the mask in engine_launch()
. This is an unexpected behaviour I think.
The same happens in scheduler_unlock()
where no check for the mask is done either.
One possible fix would be for the scheduler to store the mask and to use in scheduler_done()
to check whether the dependencies should actually be enqueued or not. What do you think ?
Another option is to drop the mask completely and just always run through the whole graph.