The Intel® Math Kernel Library provides both C and Fortran interfaces for many of its functions. The PARDISO solver also supports calls from both C and Fortran, but its use of 1-based indexing (more familiar to Fortran programmers) has been the only option. For those that are more familiar with C-style of indexing, Intel MKL 10.3 introduces the ability to use 0-based indexing for describing the sparse matrix.
Configuring the sparse solver
By default the direct sparse solver will use 1-based indexing so it is necessary to be explicit if 0-based indexing is desired. In PARDISO, iparm(35) must be set (that is the 35th element of the array).
iparm(35)= 0 => Fortran-style: first element referenced as element 1
iparm(35)<>0 => C-style: first element referenced as element 0
Note that in C this is iparm.
If using the DSS interface to this same sparse solver you should use the following:
dss_create(handle, MKL_DSS_MSG_LVL_WARNING + MKL_DSS_TERM_LVL_ERROR + MKL_DSS_ZERO_BASED_INDEXING);
If 0-based indexing is used then error and other output messages that are displayed will make reference to the chosen indexing style.
One should note that for both PARDISO and DSS, the 0-based indices are copied into an array of corresponding 1-based indices. In cases where the array is large and memory is an issue, the user may need to do the conversion to avoid the added memory use.
A C source code example has been added to the collection of other solver examples already available in the examples sub-directory of Intel MKL.