parallel computing issue (R2014b)
Show older comments
Hello,
I was running matlab parallel computing and it was working fine but after few days it stopped running and gave me same errors as reported above. I tried a bunch of different things but nothing worked out. My code is as follows:
%%Load the model
load_system('fourteenbus_DR_OR_c1');
parpool;
simout = cell(1,4);
tic
spmd
% Setup tempdir and cd into it
currDir = pwd;
addpath(currDir);
tmpDir = tempname;
mkdir(tmpDir);
cd(tmpDir);
% Load the model on the worker
load_system('fourteenbus_DR_OR_c1');
end
parfor i=1:4
load_system('fourteenbus_DR_OR_c1');
set_param(['fourteenbus_DR_OR_c1/DR_Protection_System1/PA_BR' num2str(i)],'tsc','.5');
% disp(['executed A' num2str(i)])
set_param(['fourteenbus_DR_OR_c1/OR_Protection_System1/PA_BR' num2str(i)],'tsc','.5');
% disp(['executed C' num2str(i)]) set_param(['fourteenbus_DR_OR_c1/Fault_' num2str(i)],'SwitchTimes','.5'); % disp(['fourteenbus_DR_OR_c1/Fault_' num2str(i)]) % disp(['executed B' num2str(i)]) sim('fourteenbus_DR_OR_c1'); end delete(gcp); toc
I noticed that when I comment out the line
set_param(['fourteenbus_DR_OR_c1/Fault_' num2str(i)],'SwitchTimes','.5');
the code runs fine in parallel but I cannot understand why it is doing that because it is just a set_param command like the above commands in the script. Can you please tell me how to solve this issue?
Thanks. Saqib.
6 Comments
Walter Roberson
on 6 Jan 2017
What is the error message you see?
Saqib Hasan
on 7 Jan 2017
Walter Roberson
on 8 Jan 2017
Sorry, I am not familiar with that error.
Edric Ellis
on 9 Jan 2017
That error indicates that the workers crashed during execution of the parfor loop. I don't know why the workers would crash though... I suggest you might wish to contact MathWorks support to see if they can help you work out why your workers are crashing in this case.
Saqib Hasan
on 9 Jan 2017
Edited: Walter Roberson
on 9 Jan 2017
Walter Roberson
on 9 Jan 2017
That will take you to a page (hosted outside Mathworks) from which you can create a service request.
Answers (0)
Categories
Find more on Parallel Computing Fundamentals in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!