Getting different answers when using mldivide in parfor-loop compared to in "ordinary" script
古いコメントを表示
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?
採用された回答
その他の回答 (0 件)
カテゴリ
ヘルプ センター および File Exchange で Parallel Computing Toolbox についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!