Distributing Arrays with parfor
Ältere Kommentare anzeigen
Hi, I would like to know if it's possible to use Distributing Arrays with parfor loops.
Thanks in advance!
Here the code:
for n=1:1:fbdAct
indice=find(bdAnt(:,columnaID)==bdAct(n,columnaID));
if(~isempty(indice))
if((bdAnt(indice,columnaInc)>0) && (bdAct(n,columnaInc)==0))
if(~isempty(acelerados))
indiceAcel=find(acelerados(:,colAcID)==bdAct(n,columnaID));
if(isempty(indiceAcel))
newAcelerado=[bdAct(n,columnaID) tEspera];
acelerados=vertcat(acelerados,newAcelerado);
end
else
acelerados=[bdAct(n,columnaID) tEspera];
end
bDAcelerados=acelerados;
end
end
end
1 Kommentar
Jan
am 2 Aug. 2011
Please explain any details. Currently the best answer is: "It depends".
Antworten (1)
Edric Ellis
am 2 Aug. 2011
1 Stimme
Distributed arrays are designed to be used with SPMD blocks, not PARFOR loops. In general, it is a mistake to use a distributed array within the body of a PARFOR loop. What are you trying to do?
3 Kommentare
Javier
am 2 Aug. 2011
Konrad Malkowski
am 3 Aug. 2011
Javier,
Could you post a copy of your sequential code (for loop)? This would help in determining if there is a way to parallelize that loop using parfor.
Javier
am 3 Aug. 2011
Kategorien
Mehr zu Parallel for-Loops (parfor) 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!