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

PARDISO giving error -1

Goritaboon
Beginner
588 Views

 

void* pt[64] = {};
int mtype = 11;
int iparm[64] = {};
iparm[0] = 1;   
iparm[1] = 2;   
iparm[2] = 0;   
iparm[3] = 0;   
iparm[4] = 0;   
iparm[5] = 0;   
iparm[6] = 0;   
iparm[7] = 2;   
iparm[8] = 0;   
iparm[9] = 13;  
iparm[10] = 1;  
iparm[11] = 0;          
iparm[12] = 1;      
iparm[13] = 0;   
iparm[14] = 0;   
iparm[15] = 0;   
iparm[16] = 0;   
iparm[17] = -1;  
iparm[18] = -1;  
iparm[19] = 0;   
iparm[20] = 0;
iparm[26] = 1;
iparm[27] = 0;
iparm[34] = 1;
iparm[36] = 0;
iparm[59] = 0;

int maxfct = 1, mnum = 1;
const int n = 1;
double a[n] = {1};
int ia[n + 1] = {0, 1};
int ja[n] = {0};
int perm[n];
const int nrhs = 1;
int msglvl = 1;
double b[n * nrhs] = {3};
double x[n * nrhs];
int error;

int phase = 13;

pardiso(pt, &maxfct, &mnum, &mtype, &phase, &n, a, ia, ja, perm, &nrhs,
        iparm, &msglvl, b, x, &error);
std::cout << error << std::endl;

Hello. I'm new to pardiso. This example always give me -1. What would be the error?

0 Kudos
6 Replies
VidyalathaB_Intel
Moderator
483 Views

Hi Kwon,

 

Thanks for reaching out to us.

I tried executing the provided code (please see the attached VS project file) both in Windows and Linux environments and could see that the error value is '0'.

Maybe you can give us the complete project file (if the code that you have provided is missing something) so that we can test that as well.

 

In general, if you see pardiso returns an error value of -1 it means that the input is inconsistent. Here is the link from where you can get to know more about the error values and what they mean.

https://www.intel.com/content/www/us/en/develop/documentation/onemkl-developer-reference-c/top/spars...

 

>>I'm new to pardiso

You can always refer to the mkl examples that come with the installation under the below paths

 

"C:\Program Files (x86)\Intel\oneAPI\mkl\latest\examples\examples_dpcpp\dpcpp" for Windows

 

"/opt/intel/oneapi/mkl/latest/examples/dpcpp" for linux

 

Please get back to us if you face any issues.

 

Regards,

Vidya.

 

Goritaboon
Beginner
472 Views

Hello. Thanks for the reply. pardiso_sym.c in sparse_directsolvers also terminates with ERROR during symbolic factorization: -1.
Here is my test project with pardiso_sym.c

I used intel C++ compiler and Ninja build generator. Tested on Windows 11.

Goritaboon
Beginner
460 Views

Ok. I have a fix.

 

target_compile_options(pardisotest PUBLIC ${MKL_C_COPT})

 

Changing to this line made it work. I am not using DPCPP, just CPP. MKLConfig.cmake  lacks compiler options for CXX, which leaves MKL_ILP64 undefined, breaking mkl.

 

What would be the correct solution?

VidyalathaB_Intel
Moderator
402 Views

Hi Kwon,

 

Thanks for providing the details.

 

Please find the attached file which contains the sample CMakeLists.txt which was taken from the mkl developer guide https://www.intel.com/content/www/us/en/develop/documentation/onemkl-windows-developer-guide/top/get... and the pardiso_sym.c file from samples in mkl examples folder.

 

Steps followed

>> cmake .. -G Ninja -DCMAKE_C_COMPILER=icl/icx

>> cmake --build .

>> *.exe

 

After doing the above steps we can now see the output with out any errors.

 

Regarding the compiler options, I would advise you to go through the Readme file under C:\Program Files (x86)\Intel\oneAPI\mkl\2022.2.1\examples location which gives information about all the supported compiler options.

 

Also please note that the oneMKL library provides Fortran and C programming language interfaces. oneMKL C language interfaces can be called from applications written in either C or C++, as well as in any other language that can reference a C interface.

 

Reference link: https://www.intel.com/content/www/us/en/develop/documentation/onemkl-windows-developer-guide/top.htm...

 

Please try the attached CMakeLists file and do let us know if you have any concerns.

 

Regards,

Vidya.

 

VidyalathaB_Intel
Moderator
337 Views

Hi Kwon,


As we haven't heard back from you, could you please provide us with an update regarding this issue? Please get back to us if you have any queries.


Regards,

Vidya.


VidyalathaB_Intel
Moderator
81 Views

Hi Kwon,


As we haven't heard back from you, we are closing this thread. Please post a new question if you need any additional assistance from Intel as this thread will no longer be monitored.


Regards,

Vidya.


Reply