Using parallel.pool.constant with parfeval
Ältere Kommentare anzeigen
I've got large constant topological matrixes, I want to work with in parallel. I'm trying to find out how parfeval work's with a parallel.pool.constant. It's mentioned that it works on http://de.mathworks.com/help/distcomp/parallel.pool.constant.html
Here is my Test_Script.m:
Test = 1;
Testp = parallel.pool.Constant(Test)
for ab = 1:2
F(ab) = parfeval(@Test2,1);
end
parfor ab = 1:2
x(ab,:) = Testp.Value;
end
The function Test2.m ist only
function [out]=Test2()
out = Testp.Value
end
So the parfor-loop works, but the parfeval-loop says, that "Undefined variable "Testp" or class "Testp.Value"." Can you tell me, how it works?
Akzeptierte Antwort
Weitere Antworten (0)
Kategorien
Mehr zu Background and Parallel Processing finden Sie in Hilfe-Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!