Dummy error in parfor
1 次查看(过去 30 天)
显示 更早的评论
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
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
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 个评论
更多回答(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!