Inconsistent answers from different computers using eig() function
Show older comments
I've been having issues lately with an inconsistency in answers from matlab across two different computers.
I have two sparse, double complex matrices (1800x1800 each) that are diagonally dominant. The command I'm running is
[vec,val]=eig(double(M1),double(-M2),'qz');
where M1 and M2 are the two matrices previously mentioned. A single computer gets the same answer every time, but the answers differ between computers.
I tried a simple test using the following code:
A=rand(5)+i*rand(5);
B=rand(5)+i*rand(5);
[vec,val]=eig(double(A),double(-B),'qz');
and both computers actually get the same answer. The obvious difference here is that A and B are all approximately the same order and are dense matrices as compared to M1 and M2.
I was wondering if there is anything specific I should be looking for in M1 and M2 to determine what is causing the different answers. Are there any ways I can make these answers match?
Further info:
- Both computers are running 64bit Linux Matlab 2012a (glnxa64) (7.14.0.739)
- Both computers are running Ubuntu 10.04
- Computer 1 is running: 2 Intel® Xeon® CPU X5482 @ 3.20GHz (8 cores total)
- Computer 2 is running: 2 Intel® Xeon® CPU X5670 @ 2.93GHz (12 cores total, 24 threads)
Here is a dropbox link to the M1 and M2 matrix in question https://www.dropbox.com/s/zwq6zwfkl3y3ha5/Matrices.mat
2 Comments
Richard Brown
on 31 Jul 2013
Edited: Richard Brown
on 31 Jul 2013
How different are the answers? Have you tried running single threaded?
Richard Brown
on 1 Aug 2013
I just looked at your matrices. They're stored as dense matrices, and M2 is singular (which means that you have infinite eigenvalues). Also, you're not taking advantage of sparsity at all ... normally eigs is what you'd use.
Are you sure you're computing that which you intend to be computing?
Accepted Answer
More Answers (1)
Jan
on 1 Aug 2013
0 votes
When the two machine use a different number of threads, the results are expected to be affected by rounding effects (which I would not call rounding "errors" here). So please show us the magnitude of the differences.
If the (relative) differences are large, this could be caused by the condition of the eigen-value problem.
Notice than for eig(A, B) the inputs are not normalized, such that normalizing A and B externally might improve the stability, see doc eig.
Categories
Find more on Linear Algebra 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!