MosekTools.jl is the MathOptInterface.jl implementation for the MOSEK solver.
The low-level solver API for MOSEK is found in the package Mosek.jl.
MosekTools.jl is maintained by the JuMP community and is not officially supported by MOSEK. However, Mosek.jl is an officially supported product of MOSEK.
If you need help, please ask a question on the JuMP community forum.
If you have a reproducible example of a bug, please open a GitHub issue.
MosekTools.jl
is licensed under the MIT License.
The underlying solver is a closed-source commercial product for which you must obtain a license.
Install MosekTools as follows:
import Pkg
Pkg.add("MosekTools")
In addition to installing the MosekTools.jl package, this will also download and install the latest version of Mosek.jl.
Follow the instructions at Mosek.jl to obtain and install an appropriate license.
To use Mosek with JuMP, use Mosek.Optimizer
:
using JuMP
import Mosek
import MosekTools
model = Model(Mosek.Optimizer)
set_silent(model)
set_attribute(model, "MSK_DPAR_INTPNT_CO_TOL_DFEAS", 1e-7)
set_attribute(model, "MSK_IPAR_OPTIMIZER", Mosek.MSK_OPTIMIZER_INTPNT)
Note that even though the optimizer is Mosek.Optimizer
, you must additionally
import MosekTools
.
All other parameters can be found in the Mosek documentation.
For integer parameters, pass either the value, or the corresponding
constant defined in the Mosek
package.
using JuMP
import Mosek
import MosekTools
model = Model(Mosek.Optimizer)
set_attribute(model, "MSK_IPAR_OPTIMIZER", Mosek.MSK_OPTIMIZER_INTPNT)
set_attribute(model, "MSK_IPAR_OPTIMIZER", 4)
set_attribute(model, "MSK_IPAR_CACHE_LICENSE", Mosek.MSK_ON)
set_attribute(model, "MSK_IPAR_CACHE_LICENSE", 1)
set_attribute(model, "MSK_IPAR_CACHE_LICENSE", Mosek.MSK_OFF)
set_attribute(model, "MSK_IPAR_CACHE_LICENSE", 0)