Loading Model on Parallel Workers

12 views (last 30 days)
Rob Robinson
Rob Robinson on 21 Jul 2020
Commented: Rahul Kumar on 11 Jan 2021
I am trying to run a parsim of my Simulink model, varying the value of a resistor. The script seems to get the stage "Loading Model on Parallel Workers" however does not progress any further. My code is shown below.
model = 'ElectricalModel';
open_system(model,'loadonly');
resistances = linspace(100,110,2);
numSims = length(resistances);
simIn(1:numSims) = Simulink.SimulationInput(model);
for i = 1:numSims
simIn(i) = simIn(i).setBlockParameter([model '/Resistor'],'R',num2str(resistances(i)));
end
out = parsim(simIn, 'ShowProgress', 'on','ShowSimulationManager','on');
The script seems to be stuck in this while loop which is part of the JavaBackedFuture.m file.
while ~predicate(obj) && ~deadlineExpired
millisToWait = min(waitGranularity, iGetMillisRemaining(deadline));
deadlineExpired = (millisToWait == 0);
javaTask.await(millisToWait, millisUnit);
if ~predicate(obj)
iJavaLog(4, 'parallel.Future waiting for ID: %d', obj.ID);
% Ensure wait() is re-entrant by incorporating a drawnow.
drawnow();
end
end
Any suggestions would be greatly appreciated.
  1 Comment
Rahul Kumar
Rahul Kumar on 11 Jan 2021
Hi Rob,
Can you please confirm if your system has enough memory for all the parallel workers? The only thing I can think of is that the system is running low on memory and has started to page the memory which can make processing extremely slow.

Sign in to comment.

Answers (0)

Categories

Find more on Manual Performance Optimization in Help Center and File Exchange

Products


Release

R2020a

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!