- Unreprodutcible error: sometimes it happens; like any program of more than a single line, MATLAB is not exempt from bugs.
- Out of memory: it may be possible that you are running out of memory. Can you check this with a reduced dataset, or by running on another computer with more memory?
- Invalid MEX function: if you wrote MEX functions, and you use them in a parallel section, perhaps you can have some troubles (depending what you are doing, and how you are doing exactly) with work sharing by using parallel for. I admit I have no experience with this particular point.
MATLAB closing when beginning parallel processing
23 次查看(过去 30 天)
显示 更早的评论
It was working all day while I troubleshooted some things. Now, for some reason, MATLAB closes without any warning - just shuts off - when starting the parallel computing using the Parfor function. Does anyone have any ideas to what could be causing this issue? Thanks.
2 个评论
Riccardo Scorretti
2022-5-8
I see three possible options (but without the code it is hard to help you):
回答(2 个)
Shivang
2023-11-22
Hi,
I understand you are facing an issue where MATLAB shuts off when using the 'parfor' function.
While it is hard to pinpoint an issue without the code and the crash logs, you can try the following approach. Move the parfor-loop into a local function in the 'main file', passing any variables into and out of the local function as input and output arguments respectively.
From:
main.m
% user-code berfore parfor-loop
parfor i=1:10
% user-code
end
To:
main.m (modified)
% user-code berfore parfor-loop
runParforLoop()
function ParforLoop()
parfor i=1:10
% user-code
end
end
Refer to this documentation link for more details regarding local functions: https://www.mathworks.com/help/matlab/matlab_prog/local-functions.html
Hope this helps.
-Shivang
0 个评论
Zihan
about 3 hours 前
Hi, I think I'm encountering the same issue! I'm using matlab R2021a on a 32-core server. The same code has been running fine on another PC with the same matlab version, but on this server, the matlab randomly crashes when I activate parallel pools without any warning - matlab usually automatically generate a crash report as 'matlab_crash_dump.1615562-1', but it is blank inside. My RAM seems to be fine as well.
I wonder if you have already find the cause and solution of this, which will be very much appreciated! Many thanks!
0 个评论
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Parallel for-Loops (parfor) 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!