about parfor with reading from cell array ????

1 回表示 (過去 30 日間)
abdullah alzaqebah
abdullah alzaqebah 2018 年 4 月 15 日
コメント済み: abdullah alzaqebah 2018 年 4 月 15 日
hello everyone i use the following code to do some operation (maxflow) for each element of cell array, each element contains 3*n array which represent a graph. the achieved speed up is not logical any suggestions? the code :
---------------------------------------------
parpool(4);
c = parallel.pool.Constant(sss0);
tm00=tic;
parfor i=1:1:size(sss0,2)
maxflows((c.Value{1,i}(1,:)),(c.Value{1,i}(2,:)),(c.Value{1,i}(3,:)),source,sink);
end
tm01=toc(tm00)
  4 件のコメント
abdullah alzaqebah
abdullah alzaqebah 2018 年 4 月 15 日
source and sink represnt the source node and the target node in the graph which already inside the array but pass it to construct the graph inside the function
abdullah alzaqebah
abdullah alzaqebah 2018 年 4 月 15 日
sss0 contains 4 cells
1- 3*210
2- 3* 2628
3- 3*389403
4- 3*406
time taken on one worker is 24.2647
time taken on 4 workers is 21.9487
which is not logical!

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

回答 (0 件)

カテゴリ

Help Center および File ExchangeParallel Computing Fundamentals についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by