Tips for using Intel® oneAPI Math Kernel Library (oneMKL) PARDISO

Published: 05/23/2012  

Last Updated: 08/11/2019

By Gennady Fedorov

Introduction

The interface to the Intel® oneAPI Math Kernel Library (oneMKL) PARDISO solver has many parameters and learning to use it for the first time can take a lot of time. The oneMKL DSS interface for PARDISO was created to provide a simpler interface to the functionality, but often users still want to use the PARDISO interface. This article provides some tips for getting started and corrects some of the mistakes made by first-time users and even occasionally by experienced users.


General tips

Explore the examples in the mklroot/examples/solverc and mklroot/examples/solverf directories of MKL. By choosing an example program that solves a problem that is close to the sort of problem you will be solving you can get to know some of the most helpful and relevant parameter settings for your case.

Use the matrix checker: The iparm(27) parameter of PARDISO controls the input checker. By default it is turned off (iparm(27)=0), so you'll need to turn it on by setting iparm(27)=1. PARDISO will run some checks on your data structure and return an error message if it finds that something was wrong. This can help you find simple errors in your indexing as well as correct misunderstandings about how PARDISO expects your matrix to be represented and stored (e.g., a symmetric matrix should be stored in the upper triangular form).

Check your link line: Sometimes a program linked against oneMKL can misbehave (crash, hang, etc.) because the program was linked against the wrong threading layer (which assumes a specific threading runtime) or wrong interface (e.g., ILP64 v. LP64; cdecl v. stdcall). The MKL link line advisor may be helpful if you're using the latest version of oneMKL. For earlier versions, you should consult the oneMKL User's Guide Chapter 5 on linking your application.

Important settings

The full list of parameters is documented in the reference manual or available as a table in the PARDISO parameters table article. The following settings may be particularly helpful to know about when getting started or trying to understand unexpected results.

Use message level information: The solver prints statistical information to the screen if the input parameter msglvl = 1 and generates no output if msglvl = 0. There is no default value for this option.

Use default values: To get started quickly with PARDISO you can use the default values for each of the elements in the iparm array. Setting iparm(1) = 0 will cause PARDISO to use the default values for the rest of the array: iparm(2) - iparm(64) are filled with default values. Otherwise, you must supply all the values in the iparm array.

Single and double precision: Starting version 10.2 Intel® oneAPI Math Kernel Library (oneMKL) supports computations in single precision as well as double precision. To switch between single and double precision modes you should use iparm(28). The default mode of iparm(28) is 0, which corresponds to the double precision. If iparm(28) = 1 all internal computations are made in single precision.

Rewrite the solution: if you need to store the output solution on the right-hand side of array b, choose iparm(6) = 1. The default value of iparm(6)=0, which corresponds to array x contains the solution.

Solve the transposed matrixes: set iparm(12) = 1 or 2 to solve conjugate transposed (AX = B) or transposed (AX = B) systems correspondingly with iparm(12) values.

To get numerically reproducible results:  set iparm(34) = Optimal number of OpenMP threads for conditional numerical reproducibility (CNR) mode. CNR is only available for an in-core mode of oneMKL Pardiso.

To use Zero-based indexing of columns and rows:  set iparm(35) = 1 to solve zero-based indexing inputs. In that case, all columns and rows indexing in arrays ia, ja, and perm start from 0 (C-style indexing).The Default value is Fortran-style ( One-based) indexing.

 Schur Complement: starting version 2018 update 2 oneMKL Pardiso introduced support for sparse Schur complement. Set iparm(36) = 1 or 2 to compute the Schur complement matrix as part of the oneMKL PARDISO factorization step and return it in the solution vector. The default value iparm(36)=0 does not compute Schur complement.

 To use different format matrix storage: by the default. oneMKL PARDISO accepts CSR input matrix format. Set iparm(37)  > 0 to use BSR format storage with blocks of the size iparm(37) or iparm(37) < 0 to convert supplied matrix to variable BSR(VBSR) format for matrix storage. 

 Choose in-core or out-of-core versions: if you need to solve very large problems ( doesn't fit with the RAM size ) iparm(60) is set to 2, then the out-of-core PARDISO is used. Please refer to this article for more information on this option.

 Low Rank Update: set iparm(39) to enable low rank update to accelerate factorization for multiple matrices with identical structure and similar values. The default mode of oneMKL PARDISO doesn't use low rank updater functionality.


Performance recommendations
To achieve the best performance, we do not recommend the use of the out-of-core (OOC) PARDISO for small matrices. We recommend using the in-core PARDISO for all cases where the memory required for storing PARDISO factors exceeds the RAM by less than 30%. The size of the factors in kbytes can be obtained with the help of iparm (17) after phase 11 (see oneMKL reference manual).

Other sources of information

If you're still having trouble and/or you suspect you've found a problem in oneMKL, you might search the oneMKL forum for other reports of a similar problem or post a question of your own.

Product and Performance Information

1

Performance varies by use, configuration and other factors. Learn more at www.Intel.com/PerformanceIndex.