MUMPS tutorial
This tutorial shows how to use the MUMPS linear solver to solve a problem from the CUTEst.jl (see this tutorial) collection with Penelopt.jl.
Penelopt.jl uses an extension to load the MUMPS linear solver. Therefore, you need to load both MPI.jl and MUMPS.jl. Our algorithm will throw a warning and switch to the default LDLFactorizations.jl package if you try to use MUMPS without loading the required packages.
1. Load a CUTEst problem
In this example, we choose a medium size problem MSS1.
using CUTEst
nlp = CUTEstModel("MSS1")2. Load the MUMPS packages
using MPI, MUMPS3. Solve with Penelopt
using Penelopt
stats = L2Penalty(nlp; linear_solver = "mumps", print_level = 1)┌ Info:
│ This is Penelopt.jl v0.1.0.
│ Running with linear solver MUMPS v5.9.1.
│
│ Problem name: MSS1
│ All variables: ████████████████████ 90 All constraints: ████████████████████ 73
│ free: ████████████████████ 90 free: ⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅ 0
│ lower: ⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅ 0 lower: ⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅ 0
│ upper: ⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅ 0 upper: ⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅ 0
│ low/upp: ⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅ 0 low/upp: ⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅ 0
│ fixed: ⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅ 0 fixed: ████████████████████ 73
│ infeas: ⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅ 0 infeas: ⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅ 0
│ nnzh: ( 49.45% sparsity) 2070 linear: ⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅ 0
│ nonlinear: ████████████████████ 73
│ nnzj: ( 94.25% sparsity) 378
│ lin_nnzj: (------% sparsity)
│ nln_nnzj: ( 94.25% sparsity) 378
│
└
[ Info: ------------------------------------------------------------------------------------------------------
[ Info: Iter sIter Objective pfeas dfeas τ ptol dtol ‖x‖
[ Info: ------------------------------------------------------------------------------------------------------
[ Info: 0 0 -4.0500000e+03 1.80e+02 8.90e+01 1.10e+02 1.00e+00 1.00e+00 9.49e+00
[ Info: 1 0 -4.0500000e+03 8.90e+01 7.84e-14 1.11e+02 1.00e+00 2.70e-06 9.49e+00
[ Info: 2 31 -4.6724477e+01 4.38e-02 8.55e-07 9.43e+02 1.00e+00 2.70e-06 1.02e+00
[ Info: 3 84 -1.6000000e+01 1.45e-08 6.75e-07 9.43e+02 1.34e-06 2.70e-06 1.00e+00
┌ Info:
│ Number of Iterations: 3
│
│
│ Objective...........: -1.600000023233704e+01
│ Primal Feasibility..: 1.452093087444428e-08
│ Dual Feasibility....: 6.745802422299950e-07
│
│
└ EXIT: first_order.println("status : ", stats.status)
println("objective : ", stats.objective)
println("solution : ", stats.solution)status : first_order
objective : -16.000000232337044
solution : [3.3732353841953264e-7, 2.82365589787764e-7, 1.6948566889762058e-10, 1.4183540837258534e-10, 0.16046919936224627, -0.1917019482515257, 1.6947452581824707e-10, 1.4184461326174046e-10, 0.1604691990910806, -0.1917019484784799, 3.3730025397516627e-7, 2.8234611629951236e-7, 0.16046919948086763, -0.1917019481522401, 3.3753714966752943e-7, 2.825443674737819e-7, 0.160469199023296, -0.19170194853522174, 0.16046919922665387, -0.19170194836498577, 1.6948739908120389e-10, 1.4183685666545646e-10, 3.371044636905702e-7, 2.8218223295879e-7, 1.694859004995514e-10, 1.4183560223348169e-10, 3.3727909808899725e-7, 2.823283840386792e-7, 0.16046919919275573, -0.19170194839335616, 1.694753379069893e-10, 1.418452930283825e-10, 0.16046919901199436, -0.1917019485446676, 3.374315015350887e-7, 2.824559319029445e-7, 0.1604691991136814, -0.19170194845956134, 1.6947731586527773e-10, 1.4184694871183418e-10, 3.373584716096115e-7, 2.823948106918011e-7, 8.475322391068509e-11, 7.090786845276624e-11, 3.374937814445152e-7, 2.8250802557143134e-7, 0.16046919891592917, -0.19170194862501425, 8.475242720698189e-11, 7.090720157760764e-11, 0.16046919932268783, -0.191701948284613, 3.37097938955723e-7, 2.821767932621436e-7, 1.6948617292036384e-10, 1.4183583026905244e-10, 0.1604691991814473, -0.19170194840280172, 3.3727804348902707e-7, 2.82327493150225e-7, 0.1604691992492373, -0.19170194834606935, 3.3721031052781953e-7, 2.8227080937801653e-7, 1.6947639581819646e-10, 1.4184617859658567e-10, 3.3725670699240117e-7, 2.823096247614462e-7, 0.16046919915320135, -0.19170194842644495, 8.475223951209984e-11, 7.090704445104688e-11, 1.6947630278977808e-10, 1.4184610071171424e-10, 0.16046919917017, -0.19170194841227867, 3.3729321166728427e-7, 2.8234018891768684e-7, 1.6947632644479575e-10, 1.4184612050384002e-10, 3.3737787814375075e-7, 2.8241105428732343e-7, 0.1604691990345915, -0.1917019485257552, 3.3693935720251504e-7, 2.820440563100714e-7, 0.16046919952043026, -0.19170194811913996, 1.6947753289624274e-10, 1.418471304358409e-10]4. Finalize the CUTEst model
Once the CUTEst problem has been used, you should finalize it, see the CUTEst documentation.
finalize(nlp)