Script to run a Matlab Script on the event of crash
이전 댓글 표시
I run a matlab script (call it INIT.m) that takes care of parallel toolbox initialization and running original script. Now, sometimes, because of some unpredictable problem of data, parallel toolbox stops due to error in matlabpool job (possibly).
I would like to re-run INIT.m on the event of this kind of crash.
It can be another matlab script or may be a shell script/java code.
Any sort of help will be appreciated.
Thanks in advance.
##### Update (Error statements as also given in the comments)
It gives following error message and stops (But do not exit)
MATLAB is exiting because of fatal error
??? Error using ==> parallel_function at 598
The session that parfor is using has shut down
It also says that
??? The client lost connection to lab 117.
This might be due to network problems, or the interactive matlabpool job might have errored
Environment : Linux
댓글 수: 4
Daniel Shub
2013년 6월 11일
Windows, Mac, or Linux? On Linux you could call MATLAB from the shell and examine the exit code.
Sarthak
2013년 6월 12일
Edric Ellis
2013년 6월 12일
Does MATLAB produce some sort of crash dump when this happens? If so, please contact technical support. It is not expected that a worker crashing should cause your desktop MATLAB to crash.
Sarthak
2013년 6월 12일
채택된 답변
추가 답변 (1개)
Ahmed
2013년 6월 11일
The "try .. catch .. end" construct might be what you are looking for. In case an error occurs between try and catch, then the code portion between catch and end will be executed. However, this works if there is an error, if Matlab literally crashes, it won't work.
doc try
댓글 수: 3
Matt Kindig
2013년 6월 11일
I'm curious whether Matlab calls finish.m when it crashes. You could try to put your crash logic in a custom finish.m script.
doc finish
That might work...
Sarthak
2013년 6월 12일
카테고리
도움말 센터 및 File Exchange에서 Startup and Shutdown에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!