Linear System Solvers¶
The linear system solver is a core part of the OSQP algorithm. Depending on the problem instance, different linear system solvers can greatly speedup or reduce the computation time of OSQP. To set the preferred linear system solver, see Linear Systems Solvers.
QDLDL¶
OSQP comes with QDLDL internally installed. It does not require any external shared library. QDLDL is a sparse direct solver that works well for most small to medium sized problems. However, it becomes not really efficient for large scale problems since it is not multi-threaded.
MKL Pardiso¶
MKL Pardiso is an efficient multi-threaded linear system solver that works well for large scale problems part of the Intel Math Kernel Library. Intel offers free lincenses for MKL for most non-commercial applications.
Install with MKL¶
We can install MKL Pardiso by using the standard MKL installer.
The main library to be loaded is called libmkl_rt
.
To add it, together with its dependencies, to your path, just execute the automatic MKL script.
Operating system |
Script |
---|---|
Linux |
|
Mac |
|
Windows |
|
where MKLROOT
is the MKL installation directory.
Install with Anaconda¶
Anaconda Python distribution comes with the intel MKL libraries preinstalled including MKL Pardiso. To use this version, the Anaconda libraries folders have to be in your system path. Anaconda environments should add them automatically so in most cases you do not have to do anything. If you get an error where OSQP cannot find MKL, you can add the right path by adding the output from the following command to your path variable:
echo "`ls -rd ${CONDA_ROOT}/pkgs/*/ | grep mkl-2 | head -n 1`lib:`ls -rd ${CONDA_ROOT}/pkgs/*/ | grep intel-openmp- | head -n 1`lib"
where ANACONDA_ROOT
is the root of your anaconda installation.