MATLAB: Are changes to the Simulink model not reflected between successive runs of the distributed task using the Distributed Computing Toolbox

dctMATLAB Parallel ServermdceParallel Computing Toolboxsimulink

I have written a distributed computing task that runs my Simulink model on a cluster of worker machines. In between runs, I make changes to the parameters in my model on the client machine before re-running the tasks to run the updated the model. However, the changes to my model are not being propagated to the cluster, as the workers return results based on the original model settings.

Best Answer

This behavior is reproducible without the Distributed Computing Toolbox and Engine. If you open the model in two instances of MATLAB and make changes in one instance, the changes will not be reflected in the other instance until you close and re-open the model. In order to work around this in the distributed computing environment, you can use one of the following options:
1) Modify the task to close the model (if open) and reopen it before running it.
2) Use the "RestartWorker" property of the task to force the worker session to restart (thus clearing the model from memory). For more information on this property, type the following command at the MATLAB command prompt:
web([docroot,'/toolbox/distcomp/restartworker.html'])