Getting different answers when using mldivide in parfor-loop compared to in "ordinary" script
Afficher commentaires plus anciens
I am getting different answers for x and xp in the following code:
format long;
n = 1000;
A = rand(n);
b = ones(n,1);
x = A\b;
xp = cell(4,1);
matlabpool open local 4
parfor i=1:4,
xp{i} = A\b;
end
h = @(y) norm(x-y,1);
disp(cellfun(h,xp(:)));
matlabpool close
.
An example of output at my computer is
1.0e-09 *
0.189364648202524
0.189364648202524
0.189364648202524
0.189364648202524
.
I am running Matlab 2011b with PCT version 5.2 on a 64 bit installation of Ubuntu Oneric.
The differences disappear when I start Matlab with "-singleCompThread".
Does anyone have an explanation for this behaviour?
Réponse acceptée
Plus de réponses (0)
Catégories
En savoir plus sur Parallel Computing Toolbox dans Centre d'aide et File Exchange
Produits
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!