Parallel.Job error message when 'PathDependencies' are set

2 visualizaciones (últimos 30 días)
KatPa
KatPa el 4 de Sept. de 2020
Comentada: Raymond Norris el 8 de Sept. de 2020
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

Respuestas (2)

Raymond Norris
Raymond Norris el 4 de Sept. de 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

KatPa
KatPa el 8 de Sept. de 2020
Editada: KatPa el 8 de Sept. de 2020
I added what Raymond suggested and it seemed to work.
However, I still run into problems. The paths that I add include amongst others a Matlab toolbox, which seems alright, as well as some additional functions and plugins, which do not seem to work. I do not really understand the error message (see below), as everything (using the same paths and functions and scripts) is working when called directly or in a normal for loop. So I do not think that there is a problem in the functions itself, but how they are added to the call.
Do you have an idea how I can solve this? Or where I should start looking ?
I receive the following error message:
Warning: Unable to calculate the dependencies of the files:
....
because:
MATLAB code '.....' contains the following syntax error(s):
L 162 (C 15): SYNER: Parse error at '(': usage might be invalid MATLAB syntax.
> In parallel.internal.apishared.AttachedFiles.calculateAttachedFiles (line 308)
In parallel.Job>iGetDependenciesAndSubfolders (line 1388)
In parallel.Job/attachRequiredFiles (line 787)
In parallel.Job/preSubmit (line 543)
In parallel.Job/submit (line 347)
  1 comentario
Raymond Norris
Raymond Norris el 8 de Sept. de 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
  1. Don't bother including MATLAB toolbox folders. Everything you have is already installed wherever the code is running.
  2. 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.

Iniciar sesión para comentar.

Categorías

Más información sobre Programming en Help Center y File Exchange.

Community Treasure Hunt

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

Start Hunting!

Translated by