Error in parfor loop: Unexpected failure to indicate all intervals added

4 views (last 30 days)
I have a parfor loop code which following structure:
% set defults value, array, load required data and save them to the the memory!
parfor i = 1 : h
n = 1;
array_1 = [];
array_2 = {};
K_repeats = myDefults_1[i];
...
...
% I set all temporary variables here
for ii = 1 : hh
% I get some A values from array
for iii = 1 hhh
% I get some B values from some objects
...
....
for r = 1 : K_repeats
Z = getFromArray(W);
is_successful = false;
while ~is_successful
try
calculateSomeThing(A,B,..,Z)
is_successful = true;
catch ME
disp(ME.message)
end
end
var_1(n,1) = AA;
var_2(n,1) = BB;
...
var_k(n,1) = KK;
n = n + 1;
end
end
end
for j = 1 : length(Z)
% create a table based on the results
% and save it as a csv file in a directory!
T = table(var_1,var_2,..,var_k)
saveTableAsCSV(T)
end
end
I noticed that I needed the MATLAB version after 2017b to save the data in the parloop. So, now, I am using MATLAB 2019b. I also check the code on my PC; I do not have sufficient RAM to do it in parallel, and it takes a long time to be done, so, on a limited number of the default values, I tested the code, and it was fine without error when I ran it via a simple "for" loop. But I always get an error when I run it from a server using "parfor". Although I put all the temporary variables at the beginning of the parloop, I have no warning. Still, I receive the following error, and the code will be terminated!
Unexpected failure to indicate all intervals added.
I can't figure out what that error is about! I don't even know which line I'm getting this error and what I should do about it!
Any thought or suggestion?
  2 Comments
Edric Ellis
Edric Ellis on 9 Dec 2020
I think this problem is caused by a bug that should be fixed in the latest release, R2020b. This unhelpful message can show up under certain circumstances, but I thought that they were always related to cases where the loop would fail anyway. Can I ask: are you using the 'local' cluster type, or a remote cluster? (If you're using a remote cluster, it might work to ensure you've attached all the necessary files to the parallel pool prior to running your parfor loop).
Mojtaba Zarei
Mojtaba Zarei on 9 Dec 2020
I appreciate your response. Are you saying that in Matlab 2020b, I get the detailed message on what is the problem or there was a bug in the previous Matlab that is solved and I probably have no error in the execution?
BTW, I'm executing the code in a local cluster.
Thank you!

Sign in to comment.

Answers (0)

Tags

Products


Release

R2019b

Community Treasure Hunt

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

Start Hunting!