Parallel Workers Sometimes Can’t Access Function
I’m building an app that uses the Parallel Processing toolbox to run Simulink models in parallel. I create a list of FevalFuture objects for the workers, and assign their tasks with parfeval on a function I wrote. I don’t have my code on me at the moment, but it’s basically
for p = 1:numel(taskList)
futures(p) = parfeval(appName.parallelSimulationTask(taskList{p}));
end
It was working at one point, but now it takes 3 tries to successfully run.
After the pool is first opened, none of the tasks run at all. They all immediately return a MATLAB:class:MethodRestricted error saying they cannot access the function I’m sending them.
The second time I run my app, with the pool still open, only some of them fail with the same error. The rest run successfully.
The third time and then on, everything runs perfectly with no errors.
Does anyone have any idea why parallel workers would sometimes be unable to access a function?
I don’t have my code on me at the moment, but I can add it later if necessary.I’m building an app that uses the Parallel Processing toolbox to run Simulink models in parallel. I create a list of FevalFuture objects for the workers, and assign their tasks with parfeval on a function I wrote. I don’t have my code on me at the moment, but it’s basically
for p = 1:numel(taskList)
futures(p) = parfeval(appName.parallelSimulationTask(taskList{p}));
end
It was working at one point, but now it takes 3 tries to successfully run.
After the pool is first opened, none of the tasks run at all. They all immediately return a MATLAB:class:MethodRestricted error saying they cannot access the function I’m sending them.
The second time I run my app, with the pool still open, only some of them fail with the same error. The rest run successfully.
The third time and then on, everything runs perfectly with no errors.
Does anyone have any idea why parallel workers would sometimes be unable to access a function?
I don’t have my code on me at the moment, but I can add it later if necessary. I’m building an app that uses the Parallel Processing toolbox to run Simulink models in parallel. I create a list of FevalFuture objects for the workers, and assign their tasks with parfeval on a function I wrote. I don’t have my code on me at the moment, but it’s basically
for p = 1:numel(taskList)
futures(p) = parfeval(appName.parallelSimulationTask(taskList{p}));
end
It was working at one point, but now it takes 3 tries to successfully run.
After the pool is first opened, none of the tasks run at all. They all immediately return a MATLAB:class:MethodRestricted error saying they cannot access the function I’m sending them.
The second time I run my app, with the pool still open, only some of them fail with the same error. The rest run successfully.
The third time and then on, everything runs perfectly with no errors.
Does anyone have any idea why parallel workers would sometimes be unable to access a function?
I don’t have my code on me at the moment, but I can add it later if necessary. parallel computing, simulink, methodrestricted MATLAB Answers — New Questions