Hi all. Here is a sample code of what I am attempting to run.
parfor i = 1:num
answer(:,i) = someFunction(someData(:,i));
end
Key information: "someFunction" is a C++ mex file. "someData" is a memmapfile (memmapfilename.data) because it is too large to be loaded onto each worker
Oddly, the parfor loop just hangs, the CPU usage goes to zero, and when I CTRL+C, here is what I get:
Operation terminated by user during distcomp.remoteparfor/getCompleteIntervals (line
127)
In parallel_function>distributed_execution (line 820)
[tags, out] = P.getCompleteIntervals(chunkSize);
In parallel_function (line 587)
R = distributed_execution(...
This isn't an issue if I replace the "parfor" with a simple "for" - everything works fine. What seems to happen is that some of the workers become unresponsive. After the above issue is encountered, even running a simple command such as
will return "2" on only some, but not all, workers.
Any help would be great. A fresh re-installation did not help. Validation for "parpool" passed.
5 Comments
Direct link to this comment
https://ch.mathworks.com/matlabcentral/answers/273509-parfor-loop-just-hangs-cpu-usage-goes-to-zero#comment_450458
Direct link to this comment
https://ch.mathworks.com/matlabcentral/answers/273509-parfor-loop-just-hangs-cpu-usage-goes-to-zero#comment_450458
Direct link to this comment
https://ch.mathworks.com/matlabcentral/answers/273509-parfor-loop-just-hangs-cpu-usage-goes-to-zero#comment_473553
Direct link to this comment
https://ch.mathworks.com/matlabcentral/answers/273509-parfor-loop-just-hangs-cpu-usage-goes-to-zero#comment_473553
Direct link to this comment
https://ch.mathworks.com/matlabcentral/answers/273509-parfor-loop-just-hangs-cpu-usage-goes-to-zero#comment_521254
Direct link to this comment
https://ch.mathworks.com/matlabcentral/answers/273509-parfor-loop-just-hangs-cpu-usage-goes-to-zero#comment_521254
Direct link to this comment
https://ch.mathworks.com/matlabcentral/answers/273509-parfor-loop-just-hangs-cpu-usage-goes-to-zero#comment_552897
Direct link to this comment
https://ch.mathworks.com/matlabcentral/answers/273509-parfor-loop-just-hangs-cpu-usage-goes-to-zero#comment_552897
Direct link to this comment
https://ch.mathworks.com/matlabcentral/answers/273509-parfor-loop-just-hangs-cpu-usage-goes-to-zero#comment_786020
Direct link to this comment
https://ch.mathworks.com/matlabcentral/answers/273509-parfor-loop-just-hangs-cpu-usage-goes-to-zero#comment_786020
Sign in to comment.