Why do I get a concatenation error when I try to use the remote parallel server?

1 view (last 30 days)
I'd like to use a remote Parallel Server to execute my code. I have a main script, that calls a function embedding a parfor loop. When I run this script on my computer, everything works smoothly. However, when I try to use to remote Parallel Server, I got the error
Error using parallel.internal.pool.FileManager/addAttachedFiles
Dimensions of arrays being concatenated are not consistent.
A minimal working example is
myCluster = parcluster;
parpool(myCluster, 'IdleTimeout', 180);
parfevalOnAll(@feval,0,@ExternalLibrary);
myfunction;
where ExternalLibrary is a function of an external library that loads some files in memory, and myfunction is a dummy function
function myfunction
parfor l = 1:10
for k = 1:5
end
end
end
I noticed that when I copy and paste the code of myfunction inside the main script, I do not receive the error.
Why do I get this error and how can I solve it?

Answers (0)

Categories

Find more on Startup and Shutdown 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!