Different results by using different versions of LAPACK

Open discussion regarding features, bugs, issues, vendors, etc.

Different results by using different versions of LAPACK

Postby yeg001 » Wed May 26, 2010 9:23 am

Hi,
I have trouble when I use different versions of Lapack to calculate the same issue. I compared the results of the programs, compiling with Lapack 3.0, 3.1.1, and 3.2.1. Furthermore, I performed the same test with Intel MKL.
After compared these different versions, Lapack 3.0 seems more stable than the other versions, and I think it is possible that I encountered some bug in Lapack 3.1.1 and 3.2.1.
The compiling info and output results are below (they all have the same input data):

ifort -O3 -xSSSE3 -static-intel -mssse3 -o scat PublicDataType.o InitialPubicData.o TrapInFirstBZ.o SomeInitialFunction.o DielectricFunction.o MainSubroutine.o MatrixINVandEIG.o BuildAndSloveMatrix.o ImportantMatrixs.o CalculateEnergyFlux.o Emission.o ReflectAndTrans.o TotalEmission.o Main.o -lmkl_intel_lp64 -lmkl_core -lpthread -lmkl_sequential
now up2dated!
[wangxh6@c0124 del]$ ./scat
Data from sides(upper/lower):BOTH;
And incident from: UPPER;
Calculate with: "REAL"
-11.6188765665993 -10.6188765768530
0.999999989746327

ifort -O3 -xSSSE3 -static-intel -mssse3 -o scat PublicDataType.o InitialPubicData.o TrapInFirstBZ.o SomeInitialFunction.o DielectricFunction.o MainSubroutine.o MatrixINVandEIG.o BuildAndSloveMatrix.o ImportantMatrixs.o CalculateEnergyFlux.o Emission.o ReflectAndTrans.o TotalEmission.o Main.o -L/export/home/wangxh6/lapack/3.0/O1 -llapack -lblas
now up2dated!
[wangxh6@c0124 del]$ ./scat
Data from sides(upper/lower):BOTH;
And incident from: UPPER;
Calculate with: "REAL"
-0.141758274548027 0.858241725451776
0.999999999999803

ifort -O3 -xSSSE3 -static-intel -mssse3 -o scat PublicDataType.o InitialPubicData.o TrapInFirstBZ.o SomeInitialFunction.o DielectricFunction.o MainSubroutine.o MatrixINVandEIG.o BuildAndSloveMatrix.o ImportantMatrixs.o CalculateEnergyFlux.o Emission.o ReflectAndTrans.o TotalEmission.o Main.o -L/export/home/wangxh6/lapack/3.2.1 -llapack -lblas
now up2dated!
[wangxh6@c0124 del]$ ./scat
Data from sides(upper/lower):BOTH;
And incident from: UPPER;
Calculate with: "REAL"
-11.6188761788806 -10.6188761520427
1.00000002683791

ifort -O3 -xSSSE3 -static-intel -mssse3 -o scat PublicDataType.o InitialPubicData.o TrapInFirstBZ.o SomeInitialFunction.o DielectricFunction.o MainSubroutine.o MatrixINVandEIG.o BuildAndSloveMatrix.o ImportantMatrixs.o CalculateEnergyFlux.o Emission.o ReflectAndTrans.o TotalEmission.o Main.o -L/export/home/wangxh6/lapack/3.1.1 -llapack -lblas
now up2dated!
[wangxh6@c0124 del]$ ./scat
Data from sides(upper/lower):BOTH;
And incident from: UPPER;
Calculate with: "REAL"
-11.6188764610851 -10.6188764766732
0.999999984411938


For some reason, the first two numbers of each group must be between -1 and 1. Only the second group is rational.
Using these compiled programs to compute other input data, some results end up the same but some do not. I do not have the experience to track down the cause (perhaps it is a bug). I could provide my code if anyone could give me a help. Thanks in advance.
yeg001
 
Posts: 2
Joined: Wed May 19, 2010 1:32 am

Re: Different results by using different versions of LAPACK

Postby MarcSanders » Sun Jun 20, 2010 6:33 pm

I've also got almost the same issue. can anyone send a solution for this.
MarcSanders
 
Posts: 1
Joined: Sun Jun 20, 2010 6:30 pm

Re: Different results by using different versions of LAPACK

Postby cottrell » Fri Jul 09, 2010 9:13 pm

yeg001 wrote:Hi,
I have trouble when I use different versions of Lapack to calculate the same issue. I compared the results of the programs, compiling with Lapack 3.0, 3.1.1, and 3.2.1. Furthermore, I performed the same test with Intel MKL.
After compared these different versions, Lapack 3.0 seems more stable than the other versions, and I think it is possible that I encountered some bug in Lapack 3.1.1 and 3.2.1.


You tried this calculation on 4 different linear algebra libraries, and 3 out of 4 times you
got a result that, if I understand you correctly, is out of bounds from a theoretical point of
view. (And all the results apart from the one you report from Lapack 3.0 agree to within a
margin of machine noise.) That strongly suggests that there's a bug in your code.

To debug: put in print statements to see where the results diverge. If you can narrow it
down to a particular function, check the documentation for that function carefully:
Are you feeding it valid input? Are you interpreting the return value correctly?

Allin Cottrell
cottrell
 
Posts: 68
Joined: Thu Jan 15, 2009 1:40 pm

Re: Different results by using different versions of LAPACK

Postby Julien Langou » Sun Jul 11, 2010 3:15 am

1) Which LAPACK routine do you rely on?
2) Please have a try with 3.2.2.
--julien.
Julien Langou
 
Posts: 735
Joined: Thu Dec 09, 2004 12:32 pm
Location: Denver, CO, USA

Re: Different results by using different versions of LAPACK

Postby yeg001 » Tue Oct 19, 2010 12:13 pm

Thanks for replying. And I am sorry that i had not followed up this for a long time.
to cottrell :
I had compared the matrixs which input the different versions of lapack library, and they are almost the same.
If anyone is interest in finding out why, I can give my source codes.

to julien
1.) I used DGETRF, DGETRI, ZGETRF, ZGETRI for inverse matrix. and DGEEV, ZGEEV for eigenvalue problem.
2.) I had tried 3.2.2, but it's also not right.
yeg001
 
Posts: 2
Joined: Wed May 19, 2010 1:32 am


Return to User Discussion

Who is online

Users browsing this forum: Bing [Bot], Yahoo [Bot] and 3 guests