ComputationalRadiationPhysics / redGrapes

Resource-based, Declarative task-Graphs for Parallel, Event-driven Scheduling :grapes:
https://redgrapes.rtfd.io
Mozilla Public License 2.0
20 stars 5 forks source link

Fix child parent dependency #66

Closed ikbuibui closed 5 months ago

ikbuibui commented 5 months ago

Fixed a bug where a parent task is destroyed before init_graph is called on child tasks. Before this PR init_graph was adding the dependency from the child task to the post event of the parent. But init_graph is only called when the child task is actually processed to be put into the ready queue. This leads to a situation where the parent task can be destroyed and its post event will be notified while the child tasks are still in the emplacement queue. Moved adding the dependency to the parent task from the child task to emplace_task. This moves some work from scheduling to emplacement.