MultiJuMP.jl: more than 3 hours' calculation for nonlinear example

Hello,

I am learning MultiJuMP.jl to solve a MINLP multi-objective problem. Now I am testing the nonlinear example given by the developer of the package, and I find it costs more than 3 hours to solve the problem. For now, the code is still running, using just 1 core(my computer is equipped with 8 cores). Is this normal? Does MultiJuMP.jl support multi-threads calculation?

Version info of packages is below
图片
The example I test is:

using MultiJuMP, JuMP
using Ipopt

m = multi_model(Ipopt.Optimizer)
@variable(m, x[i=1:5])
@NLexpression(m, f1, sum(x[i]^2 for i=1:5))
@NLexpression(m, f2, 3x[1]+2x[2]-x[3]/3+0.01*(x[4]-x[5])^3)
@NLconstraint(m, x[1]+2x[2]-x[3]-0.5x[4]+x[5]==2)
@NLconstraint(m, 4x[1]-2x[2]+0.8x[3]+0.6x[4]+0.5x[5]^2 == 0)
@NLconstraint(m, sum(x[i]^2 for i=1:5) <= 10)

iv1 = [0.3, 0.5, -0.26, -0.13, 0.28] # Initial guess
obj1 = SingleObjective(f1, sense = MOI.MIN_SENSE,
                       iv = Dict{String,Any}("x[$i]" => iv1[i] for i in 1:length(iv1)))
obj2 = SingleObjective(f2, sense = MOI.MIN_SENSE)

md = get_multidata(m)
md.objectives = [obj1, obj2]
md.pointsperdim = 20
optimize!(m, method = NBI(false)) # or method = WeightedSum() or method = EpsilonCons()

# Get the Utopia and Nadir points
utopiapoint = getutopia(md)
nadirpoint = getnadir(md)

using Plots
pltnbi = plot(md)

Something is wrong. For me, it runs in a few seconds and produces:

(tmp) pkg> st
      Status `/private/tmp/tmp/Project.toml`
  [b6b21f68] Ipopt v0.7.0
  [4076af6c] JuMP v0.21.10
  [f6097e2c] MultiJuMP v0.6.0
  [91a5bcdd] Plots v1.31.1

What will be the suspect for this problem? My JuMP, Ipopt, MultiJuMP and Plots are the same version as yours. I am using Julia 1.7
图片

What line stalls? Is it the plotting or the optimize? Does it happen every time? If you interrupt with control+c, what line is interrupted?

The optimize stalls. It happens every time for this code. With vs code compiler, I can not stop the code from running. When I run the code in a terminal, I quickly get the core dump message below:

julia> optimize!(m, method = NBI()) # or method = WeightedSum() or method = EpsilonCons()

******************************************************************************
This program contains Ipopt, a library for large-scale nonlinear optimization.
 Ipopt is released as open source code under the Eclipse Public License (EPL).
         For more information visit https://github.com/coin-or/Ipopt
******************************************************************************

This is Ipopt version 3.13.4, running with linear solver mumps.
NOTE: Other linear solvers might be more efficient (see Ipopt documentation).

Number of nonzeros in equality constraint Jacobian...:       10
Number of nonzeros in inequality constraint Jacobian.:        5
Number of nonzeros in Lagrangian Hessian.............:       11

Total number of variables............................:        5
                     variables with only lower bounds:        0
                variables with lower and upper bounds:        0
                     variables with only upper bounds:        0
Total number of equality constraints.................:        2
Total number of inequality constraints...............:        1
        inequality constraints with only lower bounds:        0
   inequality constraints with lower and upper bounds:        0
        inequality constraints with only upper bounds:        1

iter    objective    inf_pr   inf_du lg(mu)  ||d||  lg(rg) alpha_du alpha_pr  ls
   0  5.0290000e-01 9.50e-02 5.33e-02  -1.0 0.00e+00    -  0.00e+00 0.00e+00   0
   1  5.5515080e-01 2.78e-05 5.13e-02  -1.0 5.08e-02    -  1.00e+00 1.00e+00h  1
   2  5.5508130e-01 2.13e-05 1.66e-04  -2.5 6.53e-03    -  1.00e+00 1.00e+00h  1
   3  5.5508075e-01 3.77e-09 4.88e-08  -3.8 8.68e-05    -  1.00e+00 1.00e+00h  1
   4  5.5508075e-01 4.58e-16 1.84e-11  -5.7 2.47e-08    -  1.00e+00 1.00e+00h  1
   5  5.5508075e-01 9.71e-17 2.51e-14  -8.6 3.87e-13    -  1.00e+00 1.00e+00h  1

Number of Iterations....: 5

                                   (scaled)                 (unscaled)
Objective...............:   5.5508074670427932e-01    5.5508074670427932e-01
Dual infeasibility......:   2.5059035587193448e-14    2.5059035587193448e-14
Constraint violation....:   9.7144514654701197e-17    9.7144514654701197e-17
Complementarity.........:   2.5059035596804609e-09    2.5059035596804609e-09
Overall NLP error.......:   2.5059035596804609e-09    2.5059035596804609e-09


Number of objective function evaluations             = 6
Number of objective gradient evaluations             = 6
Number of equality constraint evaluations            = 6
Number of inequality constraint evaluations          = 6
Number of equality constraint Jacobian evaluations   = 6
Number of inequality constraint Jacobian evaluations = 6
Number of Lagrangian Hessian evaluations             = 5
Total CPU secs in IPOPT (w/o function evaluations)   =      0.660
Total CPU secs in NLP function evaluations           =      0.438

EXIT: Optimal Solution Found.
This is Ipopt version 3.13.4, running with linear solver mumps.
NOTE: Other linear solvers might be more efficient (see Ipopt documentation).

Number of nonzeros in equality constraint Jacobian...:       10
Number of nonzeros in inequality constraint Jacobian.:        5
Number of nonzeros in Lagrangian Hessian.............:        9

Total number of variables............................:        5
                     variables with only lower bounds:        0
                variables with lower and upper bounds:        0
                     variables with only upper bounds:        0
Total number of equality constraints.................:        2
Total number of inequality constraints...............:        1
        inequality constraints with only lower bounds:        0
   inequality constraints with lower and upper bounds:        0
        inequality constraints with only upper bounds:        1

iter    objective    inf_pr   inf_du lg(mu)  ||d||  lg(rg) alpha_du alpha_pr  ls
   0  1.9859775e+00 9.50e-02 1.15e+00  -1.0 0.00e+00    -  0.00e+00 0.00e+00   0
   1  8.5138846e-01 2.49e-01 1.46e+00  -1.0 7.06e-01    -  1.00e+00 1.00e+00f  1
   2  4.7165268e-01 8.57e-03 9.60e-01  -1.0 9.60e-01   0.0 1.00e+00 1.00e+00h  1
   3 -1.6339018e+00 4.38e-01 1.77e+00  -1.7 2.29e+00    -  1.00e+00 1.00e+00f  1
   4 -1.9574510e+00 1.99e-03 5.20e-01  -1.7 1.56e+00  -0.5 1.00e+00 1.00e+00h  1
   5 -4.3603674e+00 1.09e+00 3.47e-01  -1.7 1.46e+01    -  1.00e+00 3.13e-01f  1
   6 -3.9942655e+00 1.29e-02 1.70e-02  -1.7 1.61e-01    -  1.00e+00 1.00e+00h  1
   7 -4.0089230e+00 4.61e-06 1.23e-04  -2.5 9.34e-02    -  1.00e+00 1.00e+00h  1
   8 -4.0109983e+00 1.76e-07 7.16e-08  -3.8 5.74e-03    -  1.00e+00 1.00e+00h  1
   9 -4.0111470e+00 9.12e-10 3.63e-10  -5.7 3.59e-04    -  1.00e+00 1.00e+00h  1
iter    objective    inf_pr   inf_du lg(mu)  ||d||  lg(rg) alpha_du alpha_pr  ls
  10 -4.0111489e+00 1.41e-13 5.59e-14  -8.6 4.44e-06    -  1.00e+00 1.00e+00h  1

Number of Iterations....: 10

                                   (scaled)                 (unscaled)
Objective...............:  -4.0111488667928699e+00   -4.0111488667928699e+00
Dual infeasibility......:   5.5899729289876632e-14    5.5899729289876632e-14
Constraint violation....:   1.4077627952246985e-13    1.4077627952246985e-13
Complementarity.........:   2.5061304709318005e-09    2.5061304709318005e-09
Overall NLP error.......:   2.5061304709318005e-09    2.5061304709318005e-09


Number of objective function evaluations             = 11
Number of objective gradient evaluations             = 11
Number of equality constraint evaluations            = 11
Number of inequality constraint evaluations          = 11
Number of equality constraint Jacobian evaluations   = 11
Number of inequality constraint Jacobian evaluations = 11
Number of Lagrangian Hessian evaluations             = 10
Total CPU secs in IPOPT (w/o function evaluations)   =      0.004
Total CPU secs in NLP function evaluations           =      0.641

EXIT: Optimal Solution Found.
This is Ipopt version 3.13.4, running with linear solver mumps.
NOTE: Other linear solvers might be more efficient (see Ipopt documentation).

Number of nonzeros in equality constraint Jacobian...:       22
Number of nonzeros in inequality constraint Jacobian.:        5
Number of nonzeros in Lagrangian Hessian.............:       14

Total number of variables............................:        6
                     variables with only lower bounds:        0
                variables with lower and upper bounds:        0
                     variables with only upper bounds:        0
Total number of equality constraints.................:        4
Total number of inequality constraints...............:        1
        inequality constraints with only lower bounds:        0
   inequality constraints with lower and upper bounds:        0
        inequality constraints with only upper bounds:        1

iter    objective    inf_pr   inf_du lg(mu)  ||d||  lg(rg) alpha_du alpha_pr  ls
   0  0.0000000e+00 9.00e+00 1.59e-03  -1.0 0.00e+00    -  0.00e+00 0.00e+00   0
   1  9.1998352e-01 5.91e+01 1.46e+02  -1.0 6.11e+00    -  1.00e+00 1.00e+00h  1
   2  7.4822166e-01 2.47e+01 1.62e+02  -1.0 3.33e+00   2.0 1.00e+00 1.00e+00h  1
   3 -4.4623047e-02 3.58e+00 6.28e+01  -1.0 7.82e+00    -  1.00e+00 9.58e-01h  1
   4 -5.2551494e-02 2.46e+00 4.29e+01  -1.0 3.60e-01    -  1.00e+00 3.19e-01h  1
   5 -4.5218268e-02 2.02e-01 1.84e+00  -1.0 3.34e-01    -  1.00e+00 1.00e+00f  1
   6 -4.0091467e-02 1.19e-02 1.46e-01  -1.0 9.11e-02    -  1.00e+00 1.00e+00h  1
   7 -2.5051724e-02 2.88e-02 7.73e-02  -2.5 1.42e-01    -  5.21e-01 1.00e+00h  1
   8  2.7479804e-01 1.51e+01 2.16e-01  -2.5 3.25e+00    -  1.00e+00 1.00e+00f  1
   9  2.4347854e-01 6.35e+00 2.31e-02  -2.5 2.08e+00    -  1.00e+00 1.00e+00h  1
iter    objective    inf_pr   inf_du lg(mu)  ||d||  lg(rg) alpha_du alpha_pr  ls
  10  2.6340798e-02 4.55e-01 2.62e-03  -2.5 2.05e+00    -  1.00e+00 1.00e+00h  1
  11  1.1470046e-02 3.78e-03 9.89e-05  -2.5 1.40e-01    -  1.00e+00 1.00e+00h  1
  12  1.1401050e-02 1.22e-06 2.50e-06  -3.8 8.08e-04    -  1.00e+00 1.00e+00h  1
  13  1.1401001e-02 1.56e-09 6.13e-09  -5.7 3.11e-05    -  1.00e+00 1.00e+00h  1
  14  1.1401001e-02 8.88e-15 1.76e-13  -8.6 7.35e-08    -  1.00e+00 1.00e+00h  1

Number of Iterations....: 14

                                   (scaled)                 (unscaled)
Objective...............:  -1.1401001182621549e-02    1.1401001182621549e-02
Dual infeasibility......:   1.7643702239728297e-13    1.7643702239728297e-13
Constraint violation....:   8.8817841970012523e-15    8.8817841970012523e-15
Complementarity.........:   2.5059052600001006e-09   -2.5059052600001006e-09
Overall NLP error.......:   2.5059052600001006e-09    1.7643702239728297e-13


Number of objective function evaluations             = 15
Number of objective gradient evaluations             = 15
Number of equality constraint evaluations            = 15
Number of inequality constraint evaluations          = 15
Number of equality constraint Jacobian evaluations   = 15
Number of inequality constraint Jacobian evaluations = 15
Number of Lagrangian Hessian evaluations             = 14
Total CPU secs in IPOPT (w/o function evaluations)   =      0.005
Total CPU secs in NLP function evaluations           =      0.000

EXIT: Optimal Solution Found.

signal (11): Segmentation fault
in expression starting at REPL[16]:1
jl_gc_pool_alloc at /buildworker/worker/package_linux64/build/src/gc.c:1217
Dict at ./dict.jl:90
value at /home/chenru/.julia/packages/JuMP/klrjG/src/nlp.jl:1691
unknown function (ip: 0x7f9bb694bbb1)
#value#135 at /home/chenru/.julia/packages/JuMP/klrjG/src/nlp.jl:1747 [inlined]
value at /home/chenru/.julia/packages/JuMP/klrjG/src/nlp.jl:1747
unknown function (ip: 0x7f9bb694ae9d)
_jl_invoke at /buildworker/worker/package_linux64/build/src/gf.c:2247 [inlined]
jl_apply_generic at /buildworker/worker/package_linux64/build/src/gf.c:2429
value at /home/chenru/.julia/packages/MultiJuMP/evr3V/src/types.jl:18
_broadcast_getindex_evalf at ./broadcast.jl:670 [inlined]
_broadcast_getindex at ./broadcast.jl:643 [inlined]
getindex at ./broadcast.jl:597 [inlined]
copy at ./broadcast.jl:899 [inlined]
materialize at ./broadcast.jl:860 [inlined]
multisolve at /home/chenru/.julia/packages/MultiJuMP/evr3V/src/nonlinear.jl:147
unknown function (ip: 0x7f9bb69025b9)
_jl_invoke at /buildworker/worker/package_linux64/build/src/gf.c:2247 [inlined]
jl_apply_generic at /buildworker/worker/package_linux64/build/src/gf.c:2429
#solvehook#8 at /home/chenru/.julia/packages/MultiJuMP/evr3V/src/methods.jl:29
solvehook##kw at /home/chenru/.julia/packages/MultiJuMP/evr3V/src/methods.jl:27
unknown function (ip: 0x7f9bb68f81c2)
_jl_invoke at /buildworker/worker/package_linux64/build/src/gf.c:2247 [inlined]
jl_apply_generic at /buildworker/worker/package_linux64/build/src/gf.c:2429
#optimize!#124 at /home/chenru/.julia/packages/JuMP/klrjG/src/optimizer_interface.jl:173
optimize!##kw at /home/chenru/.julia/packages/JuMP/klrjG/src/optimizer_interface.jl:157 [inlined]
optimize!##kw at /home/chenru/.julia/packages/JuMP/klrjG/src/optimizer_interface.jl:157
unknown function (ip: 0x7f9bb68f6c31)
_jl_invoke at /buildworker/worker/package_linux64/build/src/gf.c:2247 [inlined]
jl_apply_generic at /buildworker/worker/package_linux64/build/src/gf.c:2429
jl_apply at /buildworker/worker/package_linux64/build/src/julia.h:1788 [inlined]
do_call at /buildworker/worker/package_linux64/build/src/interpreter.c:126
eval_value at /buildworker/worker/package_linux64/build/src/interpreter.c:215
eval_stmt_value at /buildworker/worker/package_linux64/build/src/interpreter.c:166 [inlined]
eval_body at /buildworker/worker/package_linux64/build/src/interpreter.c:587
jl_interpret_toplevel_thunk at /buildworker/worker/package_linux64/build/src/interpreter.c:731
jl_toplevel_eval_flex at /buildworker/worker/package_linux64/build/src/toplevel.c:885
jl_toplevel_eval_flex at /buildworker/worker/package_linux64/build/src/toplevel.c:830
jl_toplevel_eval_in at /buildworker/worker/package_linux64/build/src/toplevel.c:944
eval at ./boot.jl:373 [inlined]
eval_user_input at /buildworker/worker/package_linux64/build/usr/share/julia/stdlib/v1.7/REPL/src/REPL.jl:150
repl_backend_loop at /buildworker/worker/package_linux64/build/usr/share/julia/stdlib/v1.7/REPL/src/REPL.jl:246
start_repl_backend at /buildworker/worker/package_linux64/build/usr/share/julia/stdlib/v1.7/REPL/src/REPL.jl:231
#run_repl#47 at /buildworker/worker/package_linux64/build/usr/share/julia/stdlib/v1.7/REPL/src/REPL.jl:364
run_repl at /buildworker/worker/package_linux64/build/usr/share/julia/stdlib/v1.7/REPL/src/REPL.jl:351
_jl_invoke at /buildworker/worker/package_linux64/build/src/gf.c:2247 [inlined]
jl_apply_generic at /buildworker/worker/package_linux64/build/src/gf.c:2429
#936 at ./client.jl:394
jfptr_YY.936_35454.clone_1 at /usr/local/julia-1.7.3/lib/julia/sys.so (unknown line)
_jl_invoke at /buildworker/worker/package_linux64/build/src/gf.c:2247 [inlined]
jl_apply_generic at /buildworker/worker/package_linux64/build/src/gf.c:2429
jl_apply at /buildworker/worker/package_linux64/build/src/julia.h:1788 [inlined]
jl_f__call_latest at /buildworker/worker/package_linux64/build/src/builtins.c:757
#invokelatest#2 at ./essentials.jl:716 [inlined]
invokelatest at ./essentials.jl:714 [inlined]
run_main_repl at ./client.jl:379
exec_options at ./client.jl:309
_start at ./client.jl:495
jfptr__start_22567.clone_1 at /usr/local/julia-1.7.3/lib/julia/sys.so (unknown line)
_jl_invoke at /buildworker/worker/package_linux64/build/src/gf.c:2247 [inlined]
jl_apply_generic at /buildworker/worker/package_linux64/build/src/gf.c:2429
jl_apply at /buildworker/worker/package_linux64/build/src/julia.h:1788 [inlined]
true_main at /buildworker/worker/package_linux64/build/src/jlapi.c:559
jl_repl_entrypoint at /buildworker/worker/package_linux64/build/src/jlapi.c:701
main at julia (unknown line)
__libc_start_main at /lib/x86_64-linux-gnu/libc.so.6 (unknown line)
unknown function (ip: 0x400808)
Allocations: 54418542 (Pool: 54402808; Big: 15734); GC: 51
Segmentation fault (core dumped)
(base) chenru@chenru-H310M-S2:~$