Dummy error in parfor

조회 수: 1 (최근 30일)
Laurent
Laurent 2013년 9월 4일
댓글: Arnon 2017년 6월 16일
Hi,
While running a parfor loop i am getting the following error:
Caught-error breakpoint was hit in ParallelException>iGetCurrentStack at line 183. The error was:
Error using ParallelException>iGetCurrentStack (line 183)
This is a dummy error
183 error('parallel:internal:cluster:DummyError', 'This is a dummy error')
Does anyone know what this error means?
  댓글 수: 1
Arnon
Arnon 2017년 6월 16일
Though it's been four years since the above question was asked, since no one answered, yet, I will give it a try. I recently ran into the same dummy error and looked at the code of iGetCurrentStack. It's some thing like this: try error('dummy error'); catch e return some properties of e; end
Apparently, it first throws the dummy error, then catches it, obtains the stack list of calls from the error object and returns the list - the call stack. Hence the function name.
I personally don't like such code. It's strange to find it in Mathworks own code. I don't think that a try-catch should be part of any normal operation. Try-catch is designated to handle errors, not as an if-then-else GOTO statement. I wonder if there is no better way to access the calls stack?
In any rate, if you too hit it, it only means that you were using, like myself, the debugging event
dbstop if caught error
You may try, at that break point, to Continue. Though, within a parfor, parallel runs don't always behave as expected... Debugging a parfor is still as painful as it was four years ago. All errors are caught and re-thrown at the parfor line, therefore loosing any information about the actual error location. Well, trying to debug if caught error lands right on this mine.

댓글을 달려면 로그인하십시오.

채택된 답변

Elwin Chan
Elwin Chan 2013년 9월 4일
Hi Laurent,
It looks like you have done
dbstop if all error
or something similar.
That error is used to deduce the current stack and is purely an implementation detail. You don't need to worry about it. I think you'll find more interesting errors further up the stack of your application.
Thanks, Elwin

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Parallel for-Loops (parfor)에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by