0-based array indexing in PARDISO

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[34].

If using the DSS interface to this same sparse solver you should use the following:




If 0-based indexing is used then error and other output messages that are displayed will make reference to the chosen indexing style.

Implementation details

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.

Other resources

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.



For more complete information about compiler optimizations, see our Optimization Notice.

1 comment

Gennady F. (Intel)'s picture

in particular, see the example:

Add a Comment

Have a technical question? Visit our forums. Have site or software product issues? Contact support.