JuMP/Ipopt failing on simple problem

In order to debug the issue that I mentioned in the thread https://discourse.julialang.org/t/error-in-jump-nlexpression/13147 I decided to write a simple program to solve a constrained nonlinear optimization problem in order to get myself more familar with JuMP. This is the code:

using JuMP
using Ipopt

function Townsend(args...)
    x = args[1]
    y = args[2]
    
    return - cos((x-0.1)*y)^2 - x*(sin(3x+y))
end

function Constr(args...)
    x = args[1]
    y = args[2]
    
    t = atan2(y, x)
    
    return (2cos(t) - cos(2t) / 2 - cos(3t) / 4 - cos(4t) / 8)^2 + 2sin(t)^2 
end

m = Model(solver=IpoptSolver(print_level=1))
JuMP.register(m, :Townsend, 2, Townsend, autodiff=true)
JuMP.register(m, :Constr, 2, Constr, autodiff=true)

@variable(m, -2.25 <= x <= 2.5)
@variable(m, -2.5 <= y <= 1.75)

@NLconstraint(m, c1, x^2 + y^2 <= Constr(x,y))

@NLobjective(m, Min, Townsend(x,y))

solve(m)
println("x = ", getvalue(x))
println("y = ", getvalue(y))

Given all the discussions about the transition of JuMP from 0.18 to 0.19 and Julia from .6 to 0.7/1.0 I decided to stay with Julia 0.6.4 and JuMP 0.18. Under Windows 10 I am getting this error:

******************************************************************************
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 http://projects.coin-or.org/Ipopt
******************************************************************************


Please submit a bug report with steps to reproduce this fault, and any error messages that follow (in their entirety). Thanks.
Exception: EXCEPTION_ACCESS_VIOLATION at 0x684eb7bc -- dmumps_454_ at C:\Users\arbenede\.julia\v0.6\Ipopt\deps\usr\bin\libcoinmumps-1.dll (unknown line)
while loading C:\Users\arbenede\projects\julia\test_IPopt.jl, in expression starting on line 34
dmumps_454_ at C:\Users\arbenede\.julia\v0.6\Ipopt\deps\usr\bin\libcoinmumps-1.dll (unknown line)
dmumps_559_ at C:\Users\arbenede\.julia\v0.6\Ipopt\deps\usr\bin\libcoinmumps-1.dll (unknown line)
dmumps_203_ at C:\Users\arbenede\.julia\v0.6\Ipopt\deps\usr\bin\libcoinmumps-1.dll (unknown line)
dmumps_26_ at C:\Users\arbenede\.julia\v0.6\Ipopt\deps\usr\bin\libcoinmumps-1.dll (unknown line)
dmumps_ at C:\Users\arbenede\.julia\v0.6\Ipopt\deps\usr\bin\libcoinmumps-1.dll (unknown line)
dmumps_f77_ at C:\Users\arbenede\.julia\v0.6\Ipopt\deps\usr\bin\libcoinmumps-1.dll (unknown line)
dmumps_c at C:\Users\arbenede\.julia\v0.6\Ipopt\deps\usr\bin\libcoinmumps-1.dll (unknown line)
[...]

So I decided to run the same code under Ubuntu, with the same version of Julia, and there I am getting a different error:

******************************************************************************
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 http://projects.coin-or.org/Ipopt
******************************************************************************

  Internal error 2 in QAMD : Schur size expected:           0 Real:           1
 ** MPI_ABORT called
*** Error in `/usr/local/julia-9d11f62bcb/bin/julia': free(): invalid next size (fast): 0x0000000004986d90 ***
======= Backtrace: =========
/lib/x86_64-linux-gnu/libc.so.6(+0x777e5)[0x7fbe7254f7e5]
/lib/x86_64-linux-gnu/libc.so.6(+0x8037a)[0x7fbe7255837a]
/lib/x86_64-linux-gnu/libc.so.6(cfree+0x4c)[0x7fbe7255c53c]
/usr/local/julia-9d11f62bcb/bin/../lib/julia/libLLVM-3.9.so(_ZN4llvm15LLVMContextImplD1Ev+0x17a2)[0x7fbe70af3da2]
/usr/local/julia-9d11f62bcb/bin/../lib/julia/libLLVM-3.9.so(_ZN4llvm11LLVMContextD2Ev+0x14)[0x7fbe70aec384]
/lib/x86_64-linux-gnu/libc.so.6(__cxa_finalize+0x9a)[0x7fbe7251236a]
/usr/local/julia-9d11f62bcb/bin/../lib/libjulia.so.0.6(+0x2cdb3)[0x7fbe72ef7db3]

Should I try a different solver? Is there any combination of versions of Julia/JuMP with a nonlinear solver that is known to work under Windows or Linux?

Thanks much

-Arrigo

I can reproduce this with JuMP version 0.18.2 and Ipopt version 0.4.0 under

julia> versioninfo()
Julia Version 0.6.4
Commit 9d11f62bcb (2018-07-09 19:09 UTC)
Platform Info:
  OS: Linux (x86_64-pc-linux-gnu)
  CPU: Intel(R) Core(TM) i7-6950X CPU @ 3.00GHz
  WORD_SIZE: 64
  BLAS: libopenblas (USE64BITINT DYNAMIC_ARCH NO_AFFINITY Haswell MAX_THREADS=16)
  LAPACK: libopenblas64_
  LIBM: libopenlibm
  LLVM: libLLVM-3.9.1 (ORCJIT, broadwell)

OSX seems fine:

julia> versioninfo()
Julia Version 0.6.4
Commit 9d11f62bcb (2018-07-09 19:09 UTC)
Platform Info:
  OS: macOS (x86_64-apple-darwin14.5.0)
  CPU: Intel(R) Core(TM) i7-3820QM CPU @ 2.70GHz
  WORD_SIZE: 64
  BLAS: libopenblas (USE64BITINT DYNAMIC_ARCH NO_AFFINITY Sandybridge MAX_THREADS=16)
  LAPACK: libopenblas64_
  LIBM: libopenlibm
  LLVM: libLLVM-3.9.1 (ORCJIT, ivybridge)

This should work. Please open an issue over at https://github.com/JuliaOpt/Ipopt.jl.

Edit: full error on Linux: https://gist.github.com/tkoolen/79071106c93e3c974cdb11f5a44269df.

@tkoolen thanks for posting the Linux error log. I just created an Issue for the Windows error at https://github.com/JuliaOpt/Ipopt.jl/issues/132
I am going to try to solve the same problem with Optim.jl and will report back

1 Like

So I just found that Ipopt is actually able to solve the problem in the issue description without segfaulting on Linux if you use

@variable(m, -2.25 <= x <= 2.5, start=1.0)
@variable(m, -2.5 <= y <= 1.75, start=1.0)

Edit: of course this is not a solution to the problem (it shouldn’t ever segfault), but maybe this will help solve the problem.

The same fix works for Windows. I will update the Ipopt issue.