Getting different answers when using mldivide in parfor-loop compared to in "ordinary" script
Show older comments
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?
Accepted Answer
More Answers (0)
Categories
Find more on Parallel Computing Toolbox in Help Center and File Exchange
Products
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!