Search code examples
arraysfortranlapackintel-fortranintel-mkl

How save memory for a solving a symmetric (or upper traingular) matrix?


I need to solve system of linear algebraic equations A.X = B

The matrix A is double precision with about size of 33000x33000 and I will get an error when I try to allocate it:

Cannot allocate array - overflow on array size calculation.

Since I am using LAPACK dposv with the Intel MKL library, I was wondering if there is a way to somehow pass an smaller matrix to the library function? (because only half of the matrix arrays are needed to solve)

The dposv function only needs an upper or lower triangular matrix for A. Here is more details about dposv.

Update: Please notice that the A matrix is N x N and yet it takes lda: INTEGER as The leading dimension of a; lda ≥ max(1, n). So may be there is a way to parse A as an 1D array?


Solution

  • Thanks to mecej4

    There are several options to pass a huge matrix using less memory: