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

Pardiso - phase 11 errors

Jared_W_
Beginner
3,025 Views

Thank you for taking the time to look into this problem with me. I am trying to implement the Pardiso solver for a nonlinear finite element code, particularly fluid flow, and I seem to be getting stuck at the start. 

When I compile and run I get three messages:

  1. I get a message of "The file .\pardiso_ooc.cfg was not opened"
  2. *** Error in PARDISO ( sequence_ido,parameters) error_num= 18
  3. *** Input check: unexpected error with working arrays ia and/or ja

I have been searching for how to fix these issues and I cannot find anything that works! So here are the details of my code once I start trying to implement Pardiso:

MKL_INT mtype = 11; /* Real unsymmetric matrix */
MKL_INT nrhs = 1; /* Number of right hand sides. */
/* Pardiso control parameters. */
MKL_INT iparm[64];
MKL_INT maxfct, mnum, phase, error, msglvl;
/* Auxiliary variables. */
double ddum; /* Double dummy */
MKL_INT idum; /* Integer dummy. */

/* Internal solver memory pointer pt, */
/* 32-bit: int pt[64]; 64-bit: long int pt[64] */
/* or void *pt[64] should be OK on both architectures */
int *pt[64];
MKL_INT* perm;
perm = (MKL_INT*) malloc (sizeof (MKL_INT)*n);


/* -------------------------------------------------------------------- */
/* .. Initialize the internal solver memory pointer. This is only */
/* necessary for the FIRST call of the PARDISO solver. */
/* -------------------------------------------------------------------- */
for (i = 0; i < 64; i++)
{
pt = 0;
}
/* -------------------------------------------------------------------- */
/* .. Initialize the internal solver memory pointer. This is only */
/* necessary for the FIRST call of the PARDISO solver. */
/* -------------------------------------------------------------------- */
for (i = 0; i < n; i++)
{
perm = 0;
}
/* -------------------------------------------------------------------- */
/* .. Setup Pardiso control parameters. */
/* -------------------------------------------------------------------- */
iparm[1] = 0; /* Default Values */
iparm[28] = 0; /* mtype 11 double precision */
iparm[35] = 1; /* = 1 for zero-based indexing; = 0 for one-based indexing */
maxfct = 1; /* Maximum number of numerical factorizations. */
mnum = 1; /* Which factorization to use. */
msglvl = 1; /* Print statistical information in file */
error = 0; /* Initialize error flag */

/* -------------------------------------------------------------------- */
/* .. Reordering and Symbolic Factorization. This step also allocates */
/* all memory that is necessary for the factorization. */
/* -------------------------------------------------------------------- */
phase = 11;
pardiso (pt, &maxfct, &mnum, &mtype, &phase, &n, a, ia, ja, perm, &nrhs, iparm, &msglvl, &b, &x, &error);
if (error != 0) {
printf("\nERROR during symbolic factorization: %d", error);
exit(1);
}
printf("\nReordering completed ... ");
printf("\nNumber of nonzeros in factors = %d", iparm[17]);
printf("\nNumber of factorization MFLOPS = %d", iparm[18]);

Please let me know if any additional information is needed!
Sincerelywils7716

0 Kudos
29 Replies
Jared_W_
Beginner
859 Views

Thanks for keeping up on it Alexander, I'll do the same in the mean time! Let me know what you think when you get the chance.

0 Kudos
Alexander_K_Intel2
859 Views

Hi Jared,

Here i am.... But i have a problem with your code, can we made him a bit clear? I have a problem with matJacbn and with undefine init variables (n, c, dOF)... Can you add this part of file?

Thanks,

Alex

0 Kudos
Jared_W_
Beginner
859 Views

Alexander

Welcome back! Sorry about the insufficient info. I have updated the code and attached the arrays so you can verify that this is what the code should put together.

In the code I have declared fjac (dimension n*n) I get this array from the djacobi routine and it calculates the jacobian of my function and shoves it into the fjac array stacking colums, and I have also printed all the values for it into a text file. As long as this can be read in, the rest of the arrays will fill the exact same as I have in the full code. 

Also I have fixed and declared n, c, dOF, and matJacbn and these are meant to be used as follows:

 

  • matJacbn is a 2D vector (n X n) "matrix" which gets its values from fjac where each column is filled consecutively
  • c is a counter for the number of non-zero elements in matJacbn which i then use to set the length of a and ja.
  • n and dOF are the same they represent the degrees of freedom, also number of equations.

Hopefully this all makes sense, I have attached the new code. Please ignore the old code. Again thanks for all your help with this hopefully it will come together soon.

0 Kudos
Jared_W_
Beginner
859 Views

Alright

I believe I have a few more things figured out now, but I am getting stuck at this point. Basically looking at A*x = b where A is an unsymmetric square matrix, x is the solution vector, and b is my rhs. I have set the phase to 331 as outlined by the reference manual for separate forward and backward substitutions to solve A*x = b.

The a, ja, and ia I have automatically built from the mkl_ddnscsr(job, &m, &n, adns, &lda, a, ja, ia, &info). So I believe I cant be screwing these up, and everything but one issue looks fine on them. The issue is the ia array generated. the last entry is the number of non zeros, but in pardiso the reference manual says the last entry should be equal to the number of nonzeros + 1 which in my case would make it 3702. Other than this I cannot figure out why pardiso will not work and why I am getting this error.

nnz(number of non-zeros) = 3701
neqns_in = 459
ia(neqns_in)-1 = 3700
*** Error in PARDISO  ( sequence_ido,parameters) error_num= 8
*** Input check: ia[neqns]_new -1 _old -1 are incompatible
*** Input parameters: inconsistent error= 8 max_fac_store_in: 1
          matrix_number_in : 1 matrix_type_in   : 11
          ido_in           : 331 neqns_in         : 459
          ia[neqns_in]-1   : -1 nb_in            : 1

I have attached my pardiso parameters and the call to it.

0 Kudos
Alexander_K_Intel2
859 Views

Hi,

Such situation can arrange if zero based mixed with one based. Last element of ia is equal to number of nonzero elements in case of zero based numbering and number of nonzero elements + 1 in case of 1 based format. As i can see you set iparm[34] to 1 before pardiso, what about job[1] before mkl_ddnscsr. Also, i see that you set iparm[34] to 1 before solving step of pardiso, but if you set it to zero before reordering on all other step pardiso use 1-based indexing and it can not be change.

Thanks,

Alex

0 Kudos
Jared_W_
Beginner
859 Views

Alexander

Okay so I think I understand that I cannot skip directly to phase 331 without doing any previous phases. I think I am just confused on which phases to actually do to solve my problem. I just did phase 22 and I got the following output any idea how I decipher this? Is there a page in the manual that talks about understanding the output?

neqns_in = 459
ia(neqns_in)-1 = 3700
*** Error in PARDISO  ( sequence_ido,parameters) error_num= 100000
*** Error in PARDISO: clean impossible (ido?)

================  PARDISO: solving a real nonsymmetric system  ================


Summary PARDISO: ( factorize to factorize )
================

Times:
======
Time spent in additional calculations                           : 0.006919 s
Total time spent                                                : 0.006919 s

Statistics:
===========
 < Parallel Direct Factorization with #processors: >         2
 < Numerical Factorization with BLAS3 and O(n) synchronization >

 < Linear system Ax = b>
             #equations:                                   459
             #non-zeros in A:                              3701
             non-zeros in A ():                            1.756684

             #right-hand sides:                            1

 < Factors L and U >
< Preprocessing with multiple minimum degree, tree height >
< Reduction for efficient parallel factorization >
             #columns for each panel:                      96
             #independent subgraphs:                       0
             #supernodes:                                  0
             size of largest supernode:                    0
             number of nonzeros in L                       0
             number of nonzeros in U                       0
             number of nonzeros in L+U                     0
             gflop   for the numerical factorization:        0.000000

0 Kudos
Alexander_K_Intel2
859 Views

Hi,

Have you done also phase 11?

Thanks,

Alex

0 Kudos
Ying_H_Intel
Employee
859 Views

Hi Jared, 

I found your issue is open and we have same issue in https://software.intel.com/en-us/forums/topic/516336

So i did investigate your issues with your matrix, ia.txt, ja.txt and a.txt. get some result.  I believe you have fixed the problem by call mkl_ddnscsr (job, &n, &n, adns, &n, a, ja, ia, &info); but still share what i have. 

There are two key points with the errors ( other is about the  Jacobin matrix has the zero rows)

1. zero based CSR format    

( you set iparm[34] = 1; /* = 1 for zero-based indexing; = 0 for one-based indexing */1,  // PARDISO: use C-style indexing for ia and ja arrays.)

The basic rule is that Last element of ia is equal to number of nonzero elements in case of zero based numbering and number of nonzero elements + 1 in case of 1 based format.

For example, you has 459 equation, and  4746 nonzero elements, so the ia[459]=4746, not 4747.  so with  the ia.txt and phase 11 pardiso, you will get the error . val: 0.020833 ia: 4739 /t ia[n+1]: 4747

*** Error in PARDISO  (incorrect input matrix  ) error_num= 22

*** Input check: i=4746, ja=-33686019, neqns=458 are incompatible

If change the ia[459] = 4746, the phase 11 will pass. . 

2. ignore the phase steps..  (the last steps). 

For example, if  just call Phase 331 no Phase 1 and Phase 2.  one will get the error as below

val: 0.020833
ia: 4739 /t ia[n+1]: 4747
*** Error in PARDISO  ( sequence_ido,parameters) error_num= 8
*** Input check: ia[neqns]_new -1 _old -1 are incompatible
*** Input parameters: inconsistent error= 8 max_fac_store_in: 1
          matrix_number_in: 1 matrix_type_in: 11
          ido_in          : 331 neqns_in      : 459
          ia[neqns_in]-1  : -1 nb_in         : 1

• Phase 1: Fill-reduction analysis and symbolic factorization

• Phase 2: Numerical factorization

• Phase 3: Forward and Backward solve including optional iterative refinement

I attached the C code.   One can comment the steps and code ia=4746 to reproduce the errors. 

Thanks

Ying 

0 Kudos
Ying_H_Intel
Employee
859 Views

attach the file !

0 Kudos
Reply