Undefined function 'svd' for distributed matrix

5 ビュー (過去 30 日間)
Maximilian
Maximilian 2015 年 10 月 8 日
コメント済み: Maximilian 2015 年 10 月 9 日
I want to calculate an SVD of a very large matrix and therefore I'm experimenting with SPMD and and svd's. I'm running this code:
D = rand(10000);
D = distributed(D);
tic()
spmd
svd(D);
end
toc()
and I get this error message:
Starting parallel pool (parpool) using the 'local' profile ... connected to 12 workers.
Analyzing and transferring files to the workers ...done.
Error using ParSVD (line 6)
Error detected on workers 2 6 9.
Error in run (line 96)
evalin('caller', [script ';']);
Caused by:
Error using ParSVD (line 6)
An UndefinedFunction error was thrown on the workers for 'svd'. This may
be because the file containing 'svd' is not accessible on the workers.
Specify the required files for this parallel pool using the command:
addAttachedFiles(pool, ...). See the documentation for parpool for more
details.
Undefined function 'svd' for input arguments of type 'char'.
Error using ParSVD (line 6)
An UndefinedFunction error was thrown on the workers for 'svd'. This may
be because the file containing 'svd' is not accessible on the workers.
Specify the required files for this parallel pool using the command:
addAttachedFiles(pool, ...). See the documentation for parpool for more
details.
Undefined function 'svd' for input arguments of type 'char'.
Error using ParSVD (line 6)
An UndefinedFunction error was thrown on the workers for 'svd'. This may
be because the file containing 'svd' is not accessible on the workers.
Specify the required files for this parallel pool using the command:
addAttachedFiles(pool, ...). See the documentation for parpool for more
details.
Undefined function 'svd' for input arguments of type 'char'.
I'm using R2015a 64-bit on a cluster.

採用された回答

Edric Ellis
Edric Ellis 2015 年 10 月 9 日
Firstly, you should construct your distributed array directly on the workers to avoid building the large array at the client, like so:
D = rand(10000, 'distributed');
After this, your code should work correctly - I just tried pasting the following directly into the command window in R2015a:
D = rand(10000, 'distributed');
tic()
spmd
svd(D);
end
toc()
using 4 local workers, I got the result in 213 seconds.
It looks like you might be using the run function to run your script - there are sometimes problems using that with scripts containing spmd, so it might be worth avoiding that.
  2 件のコメント
Maximilian
Maximilian 2015 年 10 月 9 日
Thanks a lot! I've tried
D = rand(10000, 'distributed');
but it gave me the same error as before. On my machine at home both versions work fine...
I don't have a GUI on the cluster, so I don't know of any other option to run a file.
Maximilian
Maximilian 2015 年 10 月 9 日
Ok, I figured out what you meant by using run. If I don't use it, everything works perfectly!
Thank you very much!

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeDistributed Arrays についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by