Parallel.Job error message when 'PathDependencies' are set
이전 댓글 표시
Dear Matlab community!
I am trying to set up some parallel computing using the parallel computing toolbox, utilzing the createJob(), createTask(), submit() functions. I am following some online tutorials and perviously answered questions. However, when I try to set the PathDependencies (to the folders with the functions applied), I receive an error message.
I tried something like this:
c1 = parcluster('local')
j = createJob(c1)
set(j, 'PathDependencies', PathsToAdd); % PathsToAdd = Cell array with three strings
and I receive this error message:
Error using parallel.internal.customattr.CustomGetSet/set (line 54)
In class 'parallel.Job', no set method is defined for Dependent property 'PathDependencies'.
A Dependent property needs a set method to assign its value.
Does anyone have an idea how I can solve this?
Thank you very much for your help
Kat
답변 (2개)
Raymond Norris
2020년 9월 4일
Hi Kat,
Try
set(j, 'AdditionalPaths', PathsToAdd)
Also, when using tab completion (as you type "set(j, ") you should see AdditionalPaths pop up.
Raymond
댓글 수: 1
Raymond Norris
2020년 9월 8일
Hi,
When Parallel Computing Toolbox trolls through your code looking for dependencies, it does a pretty good job of statically analyzing every single line of code, whether you've called it in the past or not. It's possible you've never see this error because when running your code, you've never hit it (the Code Analyzer does a good job at finding dead code or code that never gets hit when you run your code, but that's a different topic).
A couple of things
- Don't bother including MATLAB toolbox folders. Everything you have is already installed wherever the code is running.
- I would suggest taking a closer look at the file/line number the error message is refering to to see if it's a valid error.
L 162 (C 15): SYNER: Parse error at '(': usage might be invalid MATLAB syntax.
카테고리
도움말 센터 및 File Exchange에서 Programming에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!