parfor works locally, but not on the cluster (transparency issue)
9 次查看(过去 30 天)
显示 更早的评论
Hi everybody!
I parallelized most of my code to run it efficiently on our cluster. Testing my code on my local machine is no problem and it runs quite fine and fast. Moving the exact same code to our cluster results in some problems and throws the following error:
Error using %SCRIPTNAME%>(parfor supply)
Using exist to check for a variable in the transparent workspace is not supported.
To check for a function, folder, file, or class, specify the appropriate second input argument to exist: 'builtin', 'class', 'dir' or 'file'.
Error in %SCRIPTNAME% (line 3)
parfor iX = 1:nX
I reviewed my code several times and i am NOT using the exist command. Here is a list of commands i am using inside the parfor-loop (besides multiplication and matrix indexing and so on): tic, toc, reshape, svd, trace, eye, pinv, ones, zeros, inv, real, min, ind2sub, size.
Right AFTER the parfor-loop i use a save-command to save the generated results. As it is not in the parallel part of the script, i dont think this should be causing the problem.
As i have no clue, i am really looking forward to any hint.
Best Regards ;-)
11 个评论
Daniel
2017-3-8
I worked around this by putting this one line (a sprintf statement that included the offending string) into a silly little one-line function, and calling that from my parfor loop. Nonetheless, a wild bug. I unfortunately could not repro this in a standalone loop; i.e., it's dependent on the overall content of the loop. This makes it hard to file a bug report. My guess is that something about the way the loop body is serialized for transfer to the parallel instances is getting freaked out by this string (e.g. I've hit upon a magic escape sequence), but we may never know... FWIW this is R2016b.
-Dan
Walter Roberson
2017-3-8
Daniel, what if you had assigned that format string to a variable and then used the variable in the code, instead of using a function?
回答(1 个)
Sean de Wolski
2017-1-4
编辑:Sean de Wolski
2017-1-4
Are there other paths or files that the cluster has access to where one of those functions could be overloaded?
My suggestion would be to run it serially on the cluster first (in parfeval or batch) and see if that works.
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Loops and Conditional Statements 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!