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

intel mkl 10.3 bus error on PARDISO use

Dear all,

I am getting a bus error while trying to use the PARDISO solver.

So bus error seems to be that it is trying to address a memory which is not physically there or due to non-alignment, I use the ilp64 support for my system, and include the

-DMKL_ILP64 -m64

and here is the link line

g++ -DNDEBUG -O3 -o test_mkl_sparse_1 csr_boost_intel_1.o boost_matrix_utilities.o matrixMarketIO.o mmio.o -L/home/utab/intel/composerxe-2011.3.174/mkl/lib/intel64 -L /home/utab/thesis/intel_mkl \\
-lboost_filesystem -lboost_system -Wl,--start-group -lmkl_intel_ilp64 -lmkl_sequential -lmkl_core -Wl,--end-group -lpthread

Compile and link goes fine. However there is another issue which bothers me. If my system is a 64 bit system. Should I get the length of my integers 8 bytes or as usual 4 bytes? A simple c++ program shows ints as 4 bytes. I am a bit confused.

Any comments are appreciated on this topic.

Best regards,
0 Kudos
2 Replies
As a reply to my own post, I realized that I did not understand the strategy to use the functions,

+ should I use pardisoinit first of all
+ if I do not use pardisoinit and set iparm[0]=0 then the other parameters are filled automatically to default values and I get a segfault.
and under gdb I found out that

Program received signal SIGSEGV, Segmentation fault.
0x00002aaaac91da38 in mkl_pds_pardiso_c () from /home/utab/intel/composerxe-2011.3.174/mkl/lib/intel64/

I can understand this segfault at least c++ arrays are zero based and iparm(35) should be changed, but then should I enter all iparm array myself?

Can you clarify the steps to follow please?

0 Kudos
Let me try to answer your questions.
Re "size of integer type".
In fact, C/C++ int type is platform independent and should be equal to 4-byte integer regardless you're on 32-bit or 64-bit system. The main difference of 64-bit system is a size of pointers (64-bit) that allows adressing much more memory. So, in general, if you're on 64-bit OS it doesn;t mean that you should compile with MKL_ILP64 and link with libmkl_intel_ilp64 library.
The only need for that is when the size of your task for PARDISO is really huge (for example, matrix A has about a billion of non-zero elements and more). In this case you can use ILP64 version of PARDISO, but please take into account that all the integer data passed to PARDISO should be 64-bit - in other words, all scalars/arrays must have "long long int" or MKL_INT type, not "int".
So, my recommendation for you is to start with LP64 (not ILP64) version of MKL.
Re "setting PARDISO parameter".
My recommendation is to set iparm[0]=1 and set all the parameters explicitly (you may refer how is was made in the examples of MKL). It's easy as far as the majority should be equal to 0.
And a comment about zero-based c++ arrays: it should be applicable (I mean iparm(35)=1) only if rows/colums in your matrix are enumerated from 0, not 1. The fact that arrays start from 0 in C/C++ is Ok for PARDISO (it's not a zero-based case).
0 Kudos