Parallel.Job error message when 'PathDependencies' are set
1 Ansicht (letzte 30 Tage)
Ältere Kommentare anzeigen
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
0 Kommentare
Antworten (2)
Raymond Norris
am 4 Sep. 2020
Hi Kat,
Try
set(j, 'AdditionalPaths', PathsToAdd)
Also, when using tab completion (as you type "set(j, ") you should see AdditionalPaths pop up.
Raymond
0 Kommentare
KatPa
am 8 Sep. 2020
Bearbeitet: KatPa
am 8 Sep. 2020
1 Kommentar
Raymond Norris
am 8 Sep. 2020
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.
Siehe auch
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!