Execution trace graph analysis of dataflow programs: bounded buffer scheduling and deadlock recovery using model predictive control