Invoke function in a parfor loop
Show older comments
Hi all, I run a for loop where the iterations are independent and it's works well. To speed up my simulation, I'm trying to use a parfor loop. But I'm having some trouble with the invoke function I use to call another software to make some calculation. I get the following error :
An UndefinedFunction error was thrown on the workers for 'invoke'. This might be because the
file containing 'invoke' is not accessible on the workers. Use addAttachedFiles(pool, files)
to specify the required files to be attached. See the documentation for
'parallel.Pool/addAttachedFiles' for more details.
I understand that the file containing invoke could not be found but I could not find in the documentation the location of this file. Has someone already obtained this error and fix it ?
2 Comments
Edric Ellis
on 6 Dec 2016
Edited: Edric Ellis
on 6 Dec 2016
A few questions. What cluster type are you using? (Normally, if you are using the 'local' cluster type, then the workers can see the same code on the path as your desktop MATLAB). Is your invoke a function or a method? What happens if you try
addAttachedFiles(gcp(), {'invoke'})
?
Guillaume Worms
on 6 Dec 2016
Accepted Answer
More Answers (0)
Categories
Find more on Use COM Objects in MATLAB in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!