Buffer optimization in multitask implementations of Simulink models