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

Pardiso crashes with severe(172): Program Exception - access violation

jirina
New Contributor I
403 Views

I am trying to use Pardiso, but it keeps crashing with the error message "forrtl: severe(172): Program Exception - access violation" in the console and with the error message "Access violation reading location 0xffffffffffffffff" in the dialog box in Visual Studio.

This is how I use Pardiso:

      integer(4) :: pt(64) ! Solver internal data address pointer
      integer(4) :: mtype ! Matrix type
      integer(4) :: iparm(64) ! Pass information to and from Pardiso

      integer(4) :: nDimension
      integer(4), parameter :: numberOfRHS = 1 ! number of right-hand sides

      integer(4) :: maxfct, mnum, mtype, phase, error, msglvl, integerDummy
      
      real*8 :: doubleDummy

      do i=1,64
        pt(i) = 0
      enddo
      
      do i=1,64
        iparm(i) = 0
      end do

      iparm(1) = 1 ! no default values
      iparm(2) = 2 ! nested dissection algorithm from METIS package (default)
      !iparm(3) = 0 ! reserved, set to 0
      iparm(4) = 0 ! factorization is always computed as required by phase (nonzero settings for advanced users) (default)
      iparm(5) = 0 ! user permutation in perm array is ignored (default)
      iparm(6) = 0 ! array x contains solution, right-hand side vector b is kept (default)
      iparm(7) = 0 ! number of iterative refinement steps performed (output)
      iparm(8) = 0 ! maximum number of iterative refinement steps (value 0 means default=2)
      !iparm(9) = 0 ! reserved, set to 0
      iparm(10) = 8 ! perturbe the pivot elements with 1E-8 (default value for symmetric + indefinite)
      iparm(11) = 0 ! scaling vectors (default value for symmetric + indefinite)
      iparm(12) = 0 ! solve linear system AX=B (default)
      iparm(13) = 0 ! disable matching (default value for symmetric + indefinite)
      iparm(14) = 0 ! number of perturbed pivots (output)
      iparm(15) = 0 ! peak memory on symbolic factorization (output)
      iparm(16) = 0 ! permanent memory on symbolic factorization (output)
      iparm(17) = 0 ! size of factors/peak memory on numerical factorization and solution (output)
      iparm(18) = 0 ! report number of non-zero elements in factors (default=-1=enable)
      iparm(19) = 0 ! report number of floating point operations to factor matrix A (default)
      iparm(20) = 0 ! report CG/CGS diagnostics (output)
      iparm(21) = 1 ! pivoting for symmetric indefinite matrices (1x1 + 2x2 Bunch-Kaufman) (default)
      iparm(22) = 0 ! number of positive eigenvalues for symmetric indefinite matrices (output)
      iparm(23) = 0 ! number of negative eigenvalues for symmetric indefinite matrices (output)
      iparm(24) = 0 ! classic parallel factorization control (default)
      iparm(25) = 0 ! parallel forward/backward solve control (default)
      !iparm(26) = 0 ! reserved, set to 0
      iparm(27) = 0 ! no matrix representations check (default)
      iparm(28) = 0 ! double precision used in all arrays (default)
      !iparm(29) = 0 ! reserved, set to 0
      iparm(30) = 0 ! number of zero or negative pivots (output)
      iparm(31) = 0 ! no partial solve and no computing selected components (default)
      ! iparm(32:33) = 0 ! reserved, set to 0
      iparm(34) = 0 ! optimal number of OpenMP threads for CNR mode (default)
      iparm(35) = 0 ! one-based indexing (default)
      iparm(36) = 0 ! no Schur complement matrix computation control (default)
      iparm(37) = 0 ! three array variation of CSR matrix format (default)
      ! iparm(38:55) = 0 ! reserved, set to 0
      iparm(56) = 0 ! diagonal and pivoting control function turned off (default)
      !iparm(57-59) = 0 ! reserved, set to 0
      iparm(60) = 0 ! IC (In-Core) mode for Pardiso (default)
      ! iparm(61:62) = 0 ! reserved, set to 0
      iparm(63) = 0 ! size of minimum OOC memory for numerical factorization and solution (output)
      !iparm(64) = 0 ! reserved, set to 0

      mtype = -2 ! positive + indefinite
      
      maxfct = 1 ! maximum number of numerical factorizations
      mnum = 1 ! what factorization to use
      msglvl = 1 ! message level, 0 = no output, 1 = statistical information
      error = 0 ! error flag initialization

      call PardisoInit ( pt, mtype, iparm )

      phase = 13
      call PARDISO ( pt, maxfct, mnum, mtype, phase, nDimension, Avec, iVec, jVec,
     +               integerDummy, numberOfRHS, iParm, msglvl, Bmat, Xmat, error )

Avec(:) is real*8, iVec(:), jVec(:) are integer(4), Bmat(:,:) and Xmat(:,:) are real*8, all of them allocatable. I checked that they are initialized.

I tried setting iparm(27)=1, but this did not change anything.

I tried declaring pt as integer(8), but it did not change anything.

I tried phase = 11; the problem is the same.

Could it be that using integerDummy in the place of the argument perm is wrong? I found this to be done in several examples of calling Pardiso.

I would like to debug my application to see how the sparse solver works, so I am using Debug - x64 configuration, with the corresponding compiler setting being /Qmkl:parallel. All compiler settings are:

/nologo /debug:full /MP /Od /fixed /extend_source:132 /Qopenmp /fpscomp:general /Qdiag-disable:8290,8291,5462 /debug-parameters:all /warn:declarations /warn:truncated_source /warn:noalignments /warn:interfaces /assume:byterecl /module:"x64\Debug\\" /object:"x64\Debug\\" /Fd"x64\Debug\vc100.pdb" /traceback /check:pointer /check:uninit /check:format /check:arg_temp_created /check:stack /libs:dll /threads /dbglibs /Qmkl:parallel /c

0 Kudos
2 Replies
Gennady_F_Intel
Moderator
403 Views

pls try declare integerDummy as array 

0 Kudos
jirina
New Contributor I
403 Views

I replaced integerDummy with integer(4)::perm(:) and the problem was the same.

I then found out that some values in A, B and X are NaN, which is a problem on my side. After correcting this, Pardiso no longer crashes with the access violation error. I am sorry to have bothered you with this.

It is even possible to use integerDummy and doubleDummy in place of some arguments unneeded during certain phases; I am just not sure whether it is OK to do it this way and what potential benefits would be.

0 Kudos
Reply