MadNLP
MadNLP is a nonlinear programming (NLP) solver, purely implemented in Julia. MadNLP implements a filter line-search algorithm, as that used in Ipopt. MadNLP seeks to streamline the development of modeling and algorithmic paradigms in order to exploit structures and to make efficient use of high-performance computers.
Installation
pkg> add git@github.com:sshin23/MadNLP.git
Build
Automatic build is currently only supported for Linux and MacOS.
MadNLP is interfaced with non-Julia sparse/dense linear solvers:
- Umfpack
- Mumps
- MKL-Pardiso
- HSL solvers (optional)
- Pardiso (optional)
- MKL-Lapack
- cuSOLVER (optional)
All the dependencies except for HSL solvers and Pardiso are automatically installed. To build MadNLP with HSL linear solvers (Ma27, Ma57, Ma77, Ma86, Ma97), the source codes need to be obtained by the user from http://www.hsl.rl.ac.uk/ipopt/ under Coin-HSL Full (Stable). Then, the tarball coinhsl-2015.06.23.tar.gz
should be placed at deps/download
. To use Pardiso, the user needs to obtain the Paridso shared libraries from https://www.pardiso-project.org/, place the shared library file (e.g., libpardiso600-GNU720-X86-64.so
) at deps/download
, and place the license file in the home directory. To use cuSOLVER, functional NVIDIA driver and corresponding CUDA toolkit need to be installed by the user. After obtaining the files, run
pkg> build MadNLP
Other build dependencies include gcc
and gfortran
. Build can be customized by setting the following environment variables.
julia> ENV["MADNLP_CC"] = "/usr/local/bin/gcc-9" # C compiler
julia> ENV["MADNLP_FC"] = "/usr/local/bin/gfortran" # Fortran compiler
julia> ENV["MADNLP_BLAS"] = "openblas" # default is MKL
julia> ENV["MADNLP_ENALBE_OPENMP"] = false # default is true
julia> ENV["MADNLP_OPTIMIZATION_FLAG"] = "-O2" # default is -O3
Usage
MadNLP is interfaced with modeling packages:
JuMP interface
using MadNLP, JuMP
model = Model(()->MadNLP.Optimizer(linear_solver="ma57",log_level="info",max_iter=100))
@variable(model, x, start = 0.0)
@variable(model, y, start = 0.0)
@NLobjective(model, Min, (1 - x)^2 + 100 * (y - x^2)^2)
optimize!(model)
Plasmo interface
using MadNLP, Plasmo
graph = OptiGraph()
@optinode(graph,n1)
@optinode(graph,n2)
@variable(n1,0 <= x <= 2)
@variable(n1,0 <= y <= 3)
@constraint(n1,x+y <= 4)
@objective(n1,Min,x)
@variable(n2,x)
@NLnodeconstraint(n2,exp(x) >= 2)
@linkconstraint(graph,n1[:x] == n2[:x])
MadNLP.optimize!(graph,ipopt;linear_solver="ma97",log_level="debug",max_iter=100)
NLPModels interface
using MadNLP, CUTEst
model = CUTEstModel("PRIMALC1")
plamonlp(model,linear_solver="pardisomkl",log_level="warn",max_wall_time=3600)
Solver options
To see the list of MadNLP solver options, check the Options.md file.
Bug reports and support
Please report issues and feature requests via the Github issue tracker.