Intel® oneAPI Math Kernel Library
Ask questions and share information with other developers who use Intel® Math Kernel Library.
6977 Discussions

## floating point exception solving a non-symmetric matrix

Beginner
358 Views

The floating point exception occurs when solving the attached non-symmetric matrix.

1 line: n

2nd line: index base (i.e. 0 based)

3rd line: nz

followed by all nonzeros in coordinate (i.e. triplet) format

Major version: 11
Minor version: 1
Update version: 1
Product status:  Product
Build: n20131010
Processor optimization: Intel(R) Advanced Vector Extensions (Intel(R) AVX) Enabled Processor

linux

Thanks,

Sam

6 Replies
Honored Contributor III
358 Views

I don't know what you mean by 'solving the matrix', and a floating point exception (FPE) can be caused by errors in your code or in the MKL library routines. If you show the code and other necessary details, we can attempt to help.

The example code pardiso_unsym_f.f that comes with MKL can be easily modified to solve the linear equation set A.x = b, with A as given by you and b = a vector with all elements = 1.0. The modified code is attached. It reads your data file, forming the matrix in COO format, and converts the matrix to CSR format before calling Pardiso to solve the linear equation set.

The code ran without any errors with IFort 15.0.4 in Windows-32, but you should probably check the solution before accepting it as correct. That the code ran without any FPEs indicates to me that the problem that you reported probably originated in your code rather than in the MKL library. A definite answer can only be given if you describe/show how you performed the calculation that resulted in a FPE.

Beginner
358 Views

I think I have a matrix to reproduce the floating point exception. Load PARDISO_matrix_7370.txt:

line 1 n

line 2 index base (0 based in this case)

line 3 nz

followed by coordinate format (i,j,a)

I solve it as general with b=0 yet solution is Nan and floating point exception occurs.

Major version: 11
Minor version: 1
Update version: 1
Product status:  Product
Build: n20131010

linux

Thanks

Honored Contributor III
358 Views

You say that the array indices are 0-based, yet the data file in #3 contains row numbers from 1 to n=7370. If you had, in fact, 0-based indices, row numbers should have ranged from 0 to n-1.

The result of this inconsistent numbering is that the first row of the matrix is taken to be zero, which would make the matrix singular. In that case, a floating point exception should be expected.

You should probably specify that 1-based indices are used, and enable checking of input matrix arrays, by setting iparm(27)=1.

Beginner
358 Views

Sorry, my bad. I was changing code to dump the matrix for matlab. Yes, output  matrix is 1 based yet my original matrix to PARDISO is 0 based. Floating point exception occurs after solving for the rhs.

Moderator
358 Views

When the matrix checker is enabled, then pardiso returns the input inconsistency ( -1) . You may try to get more details with sparse_matrix_checker routine.

*** Error in PARDISO  (incorrect input matrix  ) error_num= 22
*** Input check: i=62239, ja(i)=7371, neqns=7370 are incompatible

Honored Contributor III
358 Views