use the parfor loop and the distributed array together

1 回表示 (過去 30 日間)
Othman
Othman 2011 年 2 月 21 日
Hi,
I would like to use the parfor loop and the distributed array together.
I run this code
matlabpool open tic; n=200; parfor i = 1:n M = magic(n); R = rand(n, codistributor()); A(i) = sum(M(i,:).*R(n+1-i,:)); end toc matlabpool close
but i obtained an error:
??? Error using ==> parallel_function at 598 Distributed SUBASGN does not yet support expansion with linear indexing.
Error in ==> test20 at 9 parfor i = 1:n
any help please and thank you in advance

回答 (1 件)

Sarah Wait Zaranek
Sarah Wait Zaranek 2011 年 2 月 22 日
Hello.
You can not use distributed arrays and parfor together. If you only want to use part of the distributed array in each iteration - then drange may be able to help you out.
Help documentation on drange: web([docroot '/toolbox/distcomp/bqkoovb.html#bqxwxiv'])
Depending on what you may want to do - you could also just use the local part.
I may be able to provide more information if I knew what you were wanting to do.
Good Luck.
Cheers, Sarah

カテゴリ

Help Center および File ExchangeLoops and Conditional Statements についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by