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

1x1 matrix gives out of memory error in Pardiso

DirkvanMeeuwen
Beginner
569 Views

In a large code base, I split my large matrices in blocks. It can happen that there is a 1x1 matrix block that will be solved in the same general way, using pardiso. However, since 2025 I get an out of memory error in this case.

Is this a known issue, or should I change settings to avoid this?

The following small example gives me a -2 error.

program pardiso_example
  use, intrinsic :: iso_fortran_env, only: wp => real64
  implicit none

  integer :: ia(2), ja(1)
  real(wp) :: a(1), b(1), x(1)
  integer :: nnz, phase, maxfct, mnum, error, msglvl
  integer :: iparm(64)
  integer(kind=8) :: pt(64)
  integer, parameter :: mtype = 11 ! Real unsymmetric matrix

  ! Fill a tiny dense matrix
  ia(1) = 1
  ia(2) = 2
  a(1) = 2.0_wp
  b(1) = 1.0_wp
  ja(1) = 1
  
  ! Initialize PARDISO control parameters
  pt = 0
  iparm = 0
  iparm(1) = 1 ! No default values
  iparm(2) = 2 ! Fill-in reordering from METIS
  iparm(3) = 0 ! No iterative-direct algorithm
  iparm(4) = 0 ! No user fill-in reducing permutation
  iparm(5) = 0 ! Write solution into x
  iparm(7) = 2 ! Max number of iterative refinement steps
  iparm(9) = 13 ! Perturb the pivot elements with 1E-13
  iparm(10) = 1 ! Use nonsymmetric permutation and scaling MPS
  iparm(11) = 0 ! Not available
  iparm(13) = 0 ! Output: Number of perturbed pivots
  iparm(17) = -1 ! Output: Number of nonzeros in factors
  iparm(18) = -1 ! Output: Mflops for LU factorization
  iparm(19) = 0 ! Output: Numbers of CG Iterations
  maxfct = 1
  mnum = 1
  msglvl = 0
  error = 0

  ! Factorization and solve
  phase = 13
  x = b
  call pardiso(pt, maxfct, mnum, mtype, phase, 1, a, ia, ja, 0, 1, iparm, msglvl, b, x, error)
  if (error /= 0) then
    print *, "PARDISO error:", error
  end if

  print *, "Solution x:"
  print *, x

end program pardiso_example
0 Kudos
1 Solution
Fengrui
Moderator
483 Views

It is a known issue and has been fixed internally. The fix will be included in oneMKL 2025.3 release.

View solution in original post

0 Kudos
1 Reply
Fengrui
Moderator
484 Views

It is a known issue and has been fixed internally. The fix will be included in oneMKL 2025.3 release.

0 Kudos
Reply