Parfor + large input database for a function inside the loop

Hey,
I am using parfor which loops over a function. That function has two very large dictionaries which I want to copy inside the workers for speed.
Testp = parallel.pool.Constant(Test);
Test = 1;
Testp = parallel.pool.Constant(Test);
parfor ab = 1:2
GG(ab,:) = example(Testp);
end
function [out] = example(Const)
out = Cons.Value;
end
This doen't work on my Matlab which has parallel and access to 5 cores on local. This is the error:
Undefined variable "parallel" or class "parallel.pool.Constant".
Any help?
Thank you, Fary

2 件のコメント

Walter Roberson
Walter Roberson 2017 年 1 月 25 日
Which MATLAB release are you using?
FaryTak
FaryTak 2017 年 1 月 26 日
2014a

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

 採用された回答

Walter Roberson
Walter Roberson 2017 年 1 月 26 日

1 投票

That facility was introduced in R2015b. Either upgrade or else look in the File Exchange for Worker Object Wrapper

その他の回答 (0 件)

カテゴリ

ヘルプ センター および File ExchangeParallel for-Loops (parfor) についてさらに検索

質問済み:

2017 年 1 月 25 日

コメント済み:

2017 年 1 月 26 日

Community Treasure Hunt

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

Start Hunting!

Translated by