From 5fdd36379c84c18d04cb5b32bdf21197f2ec4a59 Mon Sep 17 00:00:00 2001 From: odow Date: Thu, 17 Oct 2024 11:35:59 +1300 Subject: [PATCH 01/32] Add Uno_jll to MINLPTests --- test/MINLPTests/Project.toml | 1 + test/MINLPTests/run_minlptests.jl | 20 ++++++++++++++++++-- 2 files changed, 19 insertions(+), 2 deletions(-) diff --git a/test/MINLPTests/Project.toml b/test/MINLPTests/Project.toml index 685a461..3599231 100644 --- a/test/MINLPTests/Project.toml +++ b/test/MINLPTests/Project.toml @@ -6,6 +6,7 @@ JuMP = "4076af6c-e467-56ae-b986-b466b2749572" MINLPTests = "ee0a3090-8ee9-5cdb-b8cb-8eeba3165522" SHOT_jll = "c1ab834c-c4a5-50f5-9156-8f0fe7758b0e" Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40" +Uno_jll = "396d5378-14f1-5ab1-981d-48acd51740ed" [compat] Bonmin_jll = "100.800.801" diff --git a/test/MINLPTests/run_minlptests.jl b/test/MINLPTests/run_minlptests.jl index 279dfa4..291f7fc 100644 --- a/test/MINLPTests/run_minlptests.jl +++ b/test/MINLPTests/run_minlptests.jl @@ -33,6 +33,7 @@ const CONFIG = Dict{String,Any}() import Bonmin_jll CONFIG["Bonmin"] = Dict( + "mixed-integer" => true, "amplexe" => Bonmin_jll.amplexe, "options" => String["bonmin.nlp_log_level=0"], "tol" => 1e-5, @@ -46,6 +47,7 @@ CONFIG["Bonmin"] = Dict( import Couenne_jll CONFIG["Couenne"] = Dict( + "mixed-integer" => true, "amplexe" => Couenne_jll.amplexe, "options" => String[], "tol" => 1e-2, @@ -59,6 +61,7 @@ CONFIG["Couenne"] = Dict( import Ipopt_jll CONFIG["Ipopt"] = Dict( + "mixed-integer" => false, "amplexe" => Ipopt_jll.amplexe, "options" => String["print_level=0"], "tol" => 1e-5, @@ -98,7 +101,20 @@ CONFIG["Ipopt"] = Dict( # "infeasible_point" => AmplNLWriter.MOI.UNKNOWN_RESULT_STATUS, # ) -@testset "$(name)" for name in ["Ipopt", "Bonmin", "Couenne"] +import Uno_jll +CONFIG["Uno"] = Dict( + "mixed-integer" => false, + "amplexe" => Uno_jll.amplexe, + "options" => String[], + "tol" => 1e-5, + "dual_tol" => 1e-5, + "nlp_exclude" => String[], + "nlpcvx_exclude" => String[], + "nlpmi_exclude" => String[], + "infeasible_point" => AmplNLWriter.MOI.NO_SOLUTION, +) + +@testset "$(name)" for name in ["Uno", "Ipopt", "Bonmin", "Couenne"] config = CONFIG[name] OPTIMIZER = () -> AmplNLWriter.Optimizer(config["amplexe"], config["options"]) @@ -143,7 +159,7 @@ CONFIG["Ipopt"] = Dict( dual_tol = config["dual_tol"], ) end - if name != "Ipopt" + if config["mixed-integer"] @testset "NLP-MI" begin MINLPTests.test_nlp_mi( OPTIMIZER, From 999ea2cf2b467f9b2b573addaeb6697d8dbf1b2d Mon Sep 17 00:00:00 2001 From: odow Date: Thu, 17 Oct 2024 11:48:02 +1300 Subject: [PATCH 02/32] Add to README --- README.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 9e6d537..3c41a02 100644 --- a/README.md +++ b/README.md @@ -67,8 +67,10 @@ Supported packages include: | [Bonmin](https://github.com/coin-or/Bonmin) | `Bonmin_jll.jl` | `Bomin_jll.amplexe` | | [Couenne](https://github.com/coin-or/Couenne) | `Couenne_jll.jl` | `Couenne_jll.amplexe` | | [Ipopt](https://github.com/coin-or/Ipopt) | `Ipopt_jll.jl` | `Ipopt_jll.amplexe` | -| [SHOT](https://github.com/coin-or/SHOT) | `SHOT_jll.jl` | `SHOT_jll.amplexe` | | [KNITRO](https://github.comjump-dev/KNITRO.jl)| `KNITRO.jl` | `KNITRO.amplexe` | +| [SHOT](https://github.com/coin-or/SHOT) | `SHOT_jll.jl` | `SHOT_jll.amplexe` | +| [Uno](https://github.com/cvanaret/Uno) | `Uno_jll.jl` | `Uno_jll.amplexe` | + ## MathOptInterface API From ab4cbb56f30466765a13f6dee0ecfcf293daf947 Mon Sep 17 00:00:00 2001 From: odow Date: Thu, 17 Oct 2024 12:00:30 +1300 Subject: [PATCH 03/32] Update --- src/AmplNLWriter.jl | 2 +- test/MINLPTests/run_minlptests.jl | 5 +++++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/src/AmplNLWriter.jl b/src/AmplNLWriter.jl index 45fa908..de21d4a 100644 --- a/src/AmplNLWriter.jl +++ b/src/AmplNLWriter.jl @@ -71,7 +71,7 @@ function call_solver( # the BLAS library via the LBT_DEFAULT_LIBS environment variable. # Provide a default in case the user doesn't set. lbt_default_libs = get(ENV, "LBT_DEFAULT_LIBS", _get_blas_loaded_libs()) - cmd = `$(solver_path) $(nl_filename) -AMPL $(options)` + cmd = `$(solver_path) $(nl_filename) $(options)` if !isempty(lbt_default_libs) cmd = addenv(cmd, "LBT_DEFAULT_LIBS" => lbt_default_libs) end diff --git a/test/MINLPTests/run_minlptests.jl b/test/MINLPTests/run_minlptests.jl index 291f7fc..f0775c0 100644 --- a/test/MINLPTests/run_minlptests.jl +++ b/test/MINLPTests/run_minlptests.jl @@ -114,6 +114,11 @@ CONFIG["Uno"] = Dict( "infeasible_point" => AmplNLWriter.MOI.NO_SOLUTION, ) +# Uno needs the full uno.options file... +run( + `curl https://raw.githubusercontent.com/cvanaret/Uno/refs/heads/main/uno.options -o uno.options` +) + @testset "$(name)" for name in ["Uno", "Ipopt", "Bonmin", "Couenne"] config = CONFIG[name] OPTIMIZER = From 637ecf63123c9e9fd4afcf365bee271ed7af04f7 Mon Sep 17 00:00:00 2001 From: odow Date: Thu, 17 Oct 2024 15:33:35 +1300 Subject: [PATCH 04/32] Update --- src/AmplNLWriter.jl | 12 +++++++----- test/MINLPTests/run_minlptests.jl | 11 +++++++++-- 2 files changed, 16 insertions(+), 7 deletions(-) diff --git a/src/AmplNLWriter.jl b/src/AmplNLWriter.jl index de21d4a..ed569c4 100644 --- a/src/AmplNLWriter.jl +++ b/src/AmplNLWriter.jl @@ -57,6 +57,7 @@ function call_solver end struct _DefaultSolverCommand{F} <: AbstractSolverCommand f::F + flags::Vector{String} end function call_solver( @@ -71,7 +72,7 @@ function call_solver( # the BLAS library via the LBT_DEFAULT_LIBS environment variable. # Provide a default in case the user doesn't set. lbt_default_libs = get(ENV, "LBT_DEFAULT_LIBS", _get_blas_loaded_libs()) - cmd = `$(solver_path) $(nl_filename) $(options)` + cmd = `$solver_path $nl_filename $(solver.flags) $options` if !isempty(lbt_default_libs) cmd = addenv(cmd, "LBT_DEFAULT_LIBS" => lbt_default_libs) end @@ -94,9 +95,9 @@ foo() do path end ``` """ -_solver_command(x::String) = _DefaultSolverCommand(f -> f(x)) -_solver_command(x::Function) = _DefaultSolverCommand(x) -_solver_command(x::AbstractSolverCommand) = x +_solver_command(x::String, flags) = _DefaultSolverCommand(f -> f(x), flags) +_solver_command(x::Function, flags) = _DefaultSolverCommand(x, flags) +_solver_command(x::AbstractSolverCommand, flags) = x mutable struct Optimizer <: MOI.AbstractOptimizer inner::MOI.FileFormats.NL.Model @@ -176,10 +177,11 @@ function Optimizer( stdin::Any = stdin, stdout::Any = stdout, directory::String = "", + flags::Vector{String} = ["-AMPL"], ) return Optimizer( MOI.FileFormats.NL.Model(), - _solver_command(solver_command), + _solver_command(solver_command, flags), Dict{String,String}(opt => "" for opt in solver_args), stdin, stdout, diff --git a/test/MINLPTests/run_minlptests.jl b/test/MINLPTests/run_minlptests.jl index f0775c0..7acda15 100644 --- a/test/MINLPTests/run_minlptests.jl +++ b/test/MINLPTests/run_minlptests.jl @@ -116,13 +116,20 @@ CONFIG["Uno"] = Dict( # Uno needs the full uno.options file... run( - `curl https://raw.githubusercontent.com/cvanaret/Uno/refs/heads/main/uno.options -o uno.options` + `curl https://raw.githubusercontent.com/cvanaret/Uno/refs/heads/main/uno.options -o uno.options`, ) @testset "$(name)" for name in ["Uno", "Ipopt", "Bonmin", "Couenne"] config = CONFIG[name] - OPTIMIZER = + OPTIMIZER = if name == "Uno" + () -> AmplNLWriter.Optimizer( + config["amplexe"], + config["options"]; + flags = String[], + ) + else () -> AmplNLWriter.Optimizer(config["amplexe"], config["options"]) + end PRIMAL_TARGET[MINLPTests.INFEASIBLE_PROBLEM] = config["infeasible_point"] @testset "NLP" begin MINLPTests.test_nlp( From 6aeb56c4eac22280416c49ebcd437a11a9c9b6d6 Mon Sep 17 00:00:00 2001 From: odow Date: Fri, 18 Oct 2024 09:34:55 +1300 Subject: [PATCH 05/32] Update --- src/AmplNLWriter.jl | 12 ++++---- test/MINLPTests/run_minlptests.jl | 48 +++++++++++++++++++++---------- 2 files changed, 38 insertions(+), 22 deletions(-) diff --git a/src/AmplNLWriter.jl b/src/AmplNLWriter.jl index ed569c4..45fa908 100644 --- a/src/AmplNLWriter.jl +++ b/src/AmplNLWriter.jl @@ -57,7 +57,6 @@ function call_solver end struct _DefaultSolverCommand{F} <: AbstractSolverCommand f::F - flags::Vector{String} end function call_solver( @@ -72,7 +71,7 @@ function call_solver( # the BLAS library via the LBT_DEFAULT_LIBS environment variable. # Provide a default in case the user doesn't set. lbt_default_libs = get(ENV, "LBT_DEFAULT_LIBS", _get_blas_loaded_libs()) - cmd = `$solver_path $nl_filename $(solver.flags) $options` + cmd = `$(solver_path) $(nl_filename) -AMPL $(options)` if !isempty(lbt_default_libs) cmd = addenv(cmd, "LBT_DEFAULT_LIBS" => lbt_default_libs) end @@ -95,9 +94,9 @@ foo() do path end ``` """ -_solver_command(x::String, flags) = _DefaultSolverCommand(f -> f(x), flags) -_solver_command(x::Function, flags) = _DefaultSolverCommand(x, flags) -_solver_command(x::AbstractSolverCommand, flags) = x +_solver_command(x::String) = _DefaultSolverCommand(f -> f(x)) +_solver_command(x::Function) = _DefaultSolverCommand(x) +_solver_command(x::AbstractSolverCommand) = x mutable struct Optimizer <: MOI.AbstractOptimizer inner::MOI.FileFormats.NL.Model @@ -177,11 +176,10 @@ function Optimizer( stdin::Any = stdin, stdout::Any = stdout, directory::String = "", - flags::Vector{String} = ["-AMPL"], ) return Optimizer( MOI.FileFormats.NL.Model(), - _solver_command(solver_command, flags), + _solver_command(solver_command), Dict{String,String}(opt => "" for opt in solver_args), stdin, stdout, diff --git a/test/MINLPTests/run_minlptests.jl b/test/MINLPTests/run_minlptests.jl index 7acda15..ac54e30 100644 --- a/test/MINLPTests/run_minlptests.jl +++ b/test/MINLPTests/run_minlptests.jl @@ -102,10 +102,40 @@ CONFIG["Ipopt"] = Dict( # ) import Uno_jll + +# Uno needs the full uno.options file... +run( + `curl https://raw.githubusercontent.com/cvanaret/Uno/refs/heads/main/uno.options -o uno.options`, +) + +struct UnoSolverCommand <: AbstractSolverCommand + +function AmplNLWriter.call_solver( + solver::UnoSolverCommand, + nl_filename::String, + options::Vector{String}, + stdin::IO, + stdout::IO, +) + Uno_jll.amplexe() do solver_path + lbt_default_libs = + get(ENV, "LBT_DEFAULT_LIBS", AmplNLWriter._get_blas_loaded_libs()) + cmd = `$solver_path $options $nl_filename` + if !isempty(lbt_default_libs) + cmd = addenv(cmd, "LBT_DEFAULT_LIBS" => lbt_default_libs) + end + ret = run(pipeline(cmd; stdin = stdin, stdout = stdout)) + if ret.exitcode != 0 + error("Nonzero exit code: $(ret.exitcode)") + end + end + return replace(nl_filename, "model.nl" => "model.sol") +end + CONFIG["Uno"] = Dict( "mixed-integer" => false, - "amplexe" => Uno_jll.amplexe, - "options" => String[], + "amplexe" => UnoSolverCommand(), + "options" => String["-preset ipopt"], "tol" => 1e-5, "dual_tol" => 1e-5, "nlp_exclude" => String[], @@ -114,22 +144,10 @@ CONFIG["Uno"] = Dict( "infeasible_point" => AmplNLWriter.MOI.NO_SOLUTION, ) -# Uno needs the full uno.options file... -run( - `curl https://raw.githubusercontent.com/cvanaret/Uno/refs/heads/main/uno.options -o uno.options`, -) - @testset "$(name)" for name in ["Uno", "Ipopt", "Bonmin", "Couenne"] config = CONFIG[name] - OPTIMIZER = if name == "Uno" - () -> AmplNLWriter.Optimizer( - config["amplexe"], - config["options"]; - flags = String[], - ) - else + OPTIMIZER = () -> AmplNLWriter.Optimizer(config["amplexe"], config["options"]) - end PRIMAL_TARGET[MINLPTests.INFEASIBLE_PROBLEM] = config["infeasible_point"] @testset "NLP" begin MINLPTests.test_nlp( From 1dbe0e7421b28a7a65b999198658b073cba42f9d Mon Sep 17 00:00:00 2001 From: odow Date: Fri, 18 Oct 2024 09:38:17 +1300 Subject: [PATCH 06/32] Update --- test/MINLPTests/run_minlptests.jl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/MINLPTests/run_minlptests.jl b/test/MINLPTests/run_minlptests.jl index ac54e30..54440e9 100644 --- a/test/MINLPTests/run_minlptests.jl +++ b/test/MINLPTests/run_minlptests.jl @@ -108,7 +108,7 @@ run( `curl https://raw.githubusercontent.com/cvanaret/Uno/refs/heads/main/uno.options -o uno.options`, ) -struct UnoSolverCommand <: AbstractSolverCommand +struct UnoSolverCommand <: AmplNLWriter.AbstractSolverCommand end function AmplNLWriter.call_solver( solver::UnoSolverCommand, From 6685aea5a074ad9a5624afe760f702d9df1ea076 Mon Sep 17 00:00:00 2001 From: odow Date: Fri, 18 Oct 2024 12:35:07 +1300 Subject: [PATCH 07/32] Update --- test/MINLPTests/run_minlptests.jl | 38 ++++++------------------------- 1 file changed, 7 insertions(+), 31 deletions(-) diff --git a/test/MINLPTests/run_minlptests.jl b/test/MINLPTests/run_minlptests.jl index 54440e9..b590502 100644 --- a/test/MINLPTests/run_minlptests.jl +++ b/test/MINLPTests/run_minlptests.jl @@ -103,39 +103,10 @@ CONFIG["Ipopt"] = Dict( import Uno_jll -# Uno needs the full uno.options file... -run( - `curl https://raw.githubusercontent.com/cvanaret/Uno/refs/heads/main/uno.options -o uno.options`, -) - -struct UnoSolverCommand <: AmplNLWriter.AbstractSolverCommand end - -function AmplNLWriter.call_solver( - solver::UnoSolverCommand, - nl_filename::String, - options::Vector{String}, - stdin::IO, - stdout::IO, -) - Uno_jll.amplexe() do solver_path - lbt_default_libs = - get(ENV, "LBT_DEFAULT_LIBS", AmplNLWriter._get_blas_loaded_libs()) - cmd = `$solver_path $options $nl_filename` - if !isempty(lbt_default_libs) - cmd = addenv(cmd, "LBT_DEFAULT_LIBS" => lbt_default_libs) - end - ret = run(pipeline(cmd; stdin = stdin, stdout = stdout)) - if ret.exitcode != 0 - error("Nonzero exit code: $(ret.exitcode)") - end - end - return replace(nl_filename, "model.nl" => "model.sol") -end - CONFIG["Uno"] = Dict( "mixed-integer" => false, - "amplexe" => UnoSolverCommand(), - "options" => String["-preset ipopt"], + "amplexe" => Uno_jll.amplexe, + "options" => String["preset=ipopt", "linear_solver=MUMPS"], "tol" => 1e-5, "dual_tol" => 1e-5, "nlp_exclude" => String[], @@ -144,6 +115,11 @@ CONFIG["Uno"] = Dict( "infeasible_point" => AmplNLWriter.MOI.NO_SOLUTION, ) +# Uno needs the full uno.options file... +run( + `curl https://raw.githubusercontent.com/cvanaret/Uno/refs/heads/main/uno.options -o uno.options`, +) + @testset "$(name)" for name in ["Uno", "Ipopt", "Bonmin", "Couenne"] config = CONFIG[name] OPTIMIZER = From bc2f60b9ea4d43eabcb19b27629c5d923c800c56 Mon Sep 17 00:00:00 2001 From: Oscar Dowson Date: Mon, 21 Oct 2024 07:52:31 +1300 Subject: [PATCH 08/32] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 3c41a02..465d74c 100644 --- a/README.md +++ b/README.md @@ -69,7 +69,7 @@ Supported packages include: | [Ipopt](https://github.com/coin-or/Ipopt) | `Ipopt_jll.jl` | `Ipopt_jll.amplexe` | | [KNITRO](https://github.comjump-dev/KNITRO.jl)| `KNITRO.jl` | `KNITRO.amplexe` | | [SHOT](https://github.com/coin-or/SHOT) | `SHOT_jll.jl` | `SHOT_jll.amplexe` | -| [Uno](https://github.com/cvanaret/Uno) | `Uno_jll.jl` | `Uno_jll.amplexe` | +| [Uno](https://github.com/cvanaret/Uno) | `Uno_jll.jl` | `Uno_jll.amplexe` | ## MathOptInterface API From f9a9793fa04b29c5b79497370c5abe576320ee35 Mon Sep 17 00:00:00 2001 From: odow Date: Mon, 21 Oct 2024 08:35:30 +1300 Subject: [PATCH 09/32] Update --- test/MINLPTests/Project.toml | 1 + test/MINLPTests/run_minlptests.jl | 3 ++- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/test/MINLPTests/Project.toml b/test/MINLPTests/Project.toml index 3599231..59ec3a2 100644 --- a/test/MINLPTests/Project.toml +++ b/test/MINLPTests/Project.toml @@ -15,4 +15,5 @@ Ipopt_jll = "=300.1400.400, =300.1400.1400" JuMP = "1" MINLPTests = "0.6" SHOT_jll = "100.100.0" +Uno_jll = "1.1.0" julia = "1.6" diff --git a/test/MINLPTests/run_minlptests.jl b/test/MINLPTests/run_minlptests.jl index b590502..71c597d 100644 --- a/test/MINLPTests/run_minlptests.jl +++ b/test/MINLPTests/run_minlptests.jl @@ -109,7 +109,8 @@ CONFIG["Uno"] = Dict( "options" => String["preset=ipopt", "linear_solver=MUMPS"], "tol" => 1e-5, "dual_tol" => 1e-5, - "nlp_exclude" => String[], + "nlp_exclude" => + ["005_010", "005_011", "006_010", "007_010", "008_010", "008_011"], "nlpcvx_exclude" => String[], "nlpmi_exclude" => String[], "infeasible_point" => AmplNLWriter.MOI.NO_SOLUTION, From 628ac734f8b40d6786a690e0c7dd77c8642265ed Mon Sep 17 00:00:00 2001 From: odow Date: Mon, 21 Oct 2024 08:47:06 +1300 Subject: [PATCH 10/32] Bump Ipopt_jll --- test/MINLPTests/Project.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/MINLPTests/Project.toml b/test/MINLPTests/Project.toml index 59ec3a2..b32db53 100644 --- a/test/MINLPTests/Project.toml +++ b/test/MINLPTests/Project.toml @@ -11,7 +11,7 @@ Uno_jll = "396d5378-14f1-5ab1-981d-48acd51740ed" [compat] Bonmin_jll = "100.800.801" Couenne_jll = "0.500.801" -Ipopt_jll = "=300.1400.400, =300.1400.1400" +Ipopt_jll = "=300.1400.1600" JuMP = "1" MINLPTests = "0.6" SHOT_jll = "100.100.0" From 0960af049ae8e53ffadd8d03e4e261415732d7ba Mon Sep 17 00:00:00 2001 From: Oscar Dowson Date: Mon, 21 Oct 2024 11:01:30 +1300 Subject: [PATCH 11/32] Update run_minlptests.jl --- test/MINLPTests/run_minlptests.jl | 5 ----- 1 file changed, 5 deletions(-) diff --git a/test/MINLPTests/run_minlptests.jl b/test/MINLPTests/run_minlptests.jl index 71c597d..b27fa05 100644 --- a/test/MINLPTests/run_minlptests.jl +++ b/test/MINLPTests/run_minlptests.jl @@ -116,11 +116,6 @@ CONFIG["Uno"] = Dict( "infeasible_point" => AmplNLWriter.MOI.NO_SOLUTION, ) -# Uno needs the full uno.options file... -run( - `curl https://raw.githubusercontent.com/cvanaret/Uno/refs/heads/main/uno.options -o uno.options`, -) - @testset "$(name)" for name in ["Uno", "Ipopt", "Bonmin", "Couenne"] config = CONFIG[name] OPTIMIZER = From d0c50eded31491a454f8a36824b26c7ad45b2671 Mon Sep 17 00:00:00 2001 From: Oscar Dowson Date: Mon, 21 Oct 2024 11:02:49 +1300 Subject: [PATCH 12/32] Update test/MINLPTests/run_minlptests.jl --- test/MINLPTests/run_minlptests.jl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/MINLPTests/run_minlptests.jl b/test/MINLPTests/run_minlptests.jl index b27fa05..0cc6813 100644 --- a/test/MINLPTests/run_minlptests.jl +++ b/test/MINLPTests/run_minlptests.jl @@ -106,7 +106,7 @@ import Uno_jll CONFIG["Uno"] = Dict( "mixed-integer" => false, "amplexe" => Uno_jll.amplexe, - "options" => String["preset=ipopt", "linear_solver=MUMPS"], + "options" => String["logger=ERROR", "preset=ipopt", "linear_solver=MUMPS"], "tol" => 1e-5, "dual_tol" => 1e-5, "nlp_exclude" => From 9c14c8bb065cc02773812d3c15940f2ea3022dcd Mon Sep 17 00:00:00 2001 From: Oscar Dowson Date: Mon, 21 Oct 2024 11:07:16 +1300 Subject: [PATCH 13/32] Update test/MINLPTests/run_minlptests.jl --- test/MINLPTests/run_minlptests.jl | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/test/MINLPTests/run_minlptests.jl b/test/MINLPTests/run_minlptests.jl index 0cc6813..1868df8 100644 --- a/test/MINLPTests/run_minlptests.jl +++ b/test/MINLPTests/run_minlptests.jl @@ -106,7 +106,8 @@ import Uno_jll CONFIG["Uno"] = Dict( "mixed-integer" => false, "amplexe" => Uno_jll.amplexe, - "options" => String["logger=ERROR", "preset=ipopt", "linear_solver=MUMPS"], + "options" => + String["logger=ERROR", "preset=ipopt", "linear_solver=MUMPS"], "tol" => 1e-5, "dual_tol" => 1e-5, "nlp_exclude" => From 3311cd11e5393c003dc0187817ad062e3f186f3b Mon Sep 17 00:00:00 2001 From: odow Date: Mon, 21 Oct 2024 13:51:40 +1300 Subject: [PATCH 14/32] Run full suite of tests with Uno --- Project.toml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/Project.toml b/Project.toml index cd0263b..0914aa5 100644 --- a/Project.toml +++ b/Project.toml @@ -13,11 +13,13 @@ LinearAlgebra = "<0.0.1, 1.6" MathOptInterface = "1.18" OpenBLAS32_jll = "0.3.12, 0.3.24" Test = "<0.0.1, 1.6" +Uno_jll = "1.1" julia = "1.6" [extras] Ipopt_jll = "9cc047cb-c261-5740-88fc-0cf96f7bdcc7" Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40" +Uno_jll = "396d5378-14f1-5ab1-981d-48acd51740ed" [targets] -test = ["Ipopt_jll", "Test"] +test = ["Ipopt_jll", "Test", "Uno_jll"] From da2d2845925f02b9347a62d9447e3fa8377185ee Mon Sep 17 00:00:00 2001 From: Oscar Dowson Date: Thu, 24 Oct 2024 14:30:32 +1300 Subject: [PATCH 15/32] Update run_minlptests.jl --- test/MINLPTests/run_minlptests.jl | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/test/MINLPTests/run_minlptests.jl b/test/MINLPTests/run_minlptests.jl index 1868df8..2038402 100644 --- a/test/MINLPTests/run_minlptests.jl +++ b/test/MINLPTests/run_minlptests.jl @@ -106,12 +106,10 @@ import Uno_jll CONFIG["Uno"] = Dict( "mixed-integer" => false, "amplexe" => Uno_jll.amplexe, - "options" => - String["logger=ERROR", "preset=ipopt", "linear_solver=MUMPS"], + "options" => ["logger=SILENT", "preset=ipopt"], "tol" => 1e-5, "dual_tol" => 1e-5, - "nlp_exclude" => - ["005_010", "005_011", "006_010", "007_010", "008_010", "008_011"], + "nlp_exclude" => ["005_010", "006_010", "007_010", "008_010", "008_011"], "nlpcvx_exclude" => String[], "nlpmi_exclude" => String[], "infeasible_point" => AmplNLWriter.MOI.NO_SOLUTION, From af429574524c3ac48099812f49e1f29c03b06a71 Mon Sep 17 00:00:00 2001 From: Oscar Dowson Date: Thu, 24 Oct 2024 14:53:35 +1300 Subject: [PATCH 16/32] Update test/MINLPTests/run_minlptests.jl --- test/MINLPTests/run_minlptests.jl | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/test/MINLPTests/run_minlptests.jl b/test/MINLPTests/run_minlptests.jl index 2038402..f5ac766 100644 --- a/test/MINLPTests/run_minlptests.jl +++ b/test/MINLPTests/run_minlptests.jl @@ -109,7 +109,8 @@ CONFIG["Uno"] = Dict( "options" => ["logger=SILENT", "preset=ipopt"], "tol" => 1e-5, "dual_tol" => 1e-5, - "nlp_exclude" => ["005_010", "006_010", "007_010", "008_010", "008_011"], + "nlp_exclude" => + ["005_010", "006_010", "007_010", "008_010", "008_011"], "nlpcvx_exclude" => String[], "nlpmi_exclude" => String[], "infeasible_point" => AmplNLWriter.MOI.NO_SOLUTION, From 475d0e399ca5561e7d19e8a71817fb4ee6c59731 Mon Sep 17 00:00:00 2001 From: Oscar Dowson Date: Sat, 26 Oct 2024 11:32:54 +1300 Subject: [PATCH 17/32] Update run_minlptests.jl --- test/MINLPTests/run_minlptests.jl | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/test/MINLPTests/run_minlptests.jl b/test/MINLPTests/run_minlptests.jl index f5ac766..6b7ee21 100644 --- a/test/MINLPTests/run_minlptests.jl +++ b/test/MINLPTests/run_minlptests.jl @@ -109,8 +109,8 @@ CONFIG["Uno"] = Dict( "options" => ["logger=SILENT", "preset=ipopt"], "tol" => 1e-5, "dual_tol" => 1e-5, - "nlp_exclude" => - ["005_010", "006_010", "007_010", "008_010", "008_011"], + "nlp_exclude" => String[], + # ["005_010", "006_010", "007_010", "008_010", "008_011"], "nlpcvx_exclude" => String[], "nlpmi_exclude" => String[], "infeasible_point" => AmplNLWriter.MOI.NO_SOLUTION, From 88c6af38db6c59f19bbc0dc9e63c59d9c06092b0 Mon Sep 17 00:00:00 2001 From: Oscar Dowson Date: Sat, 26 Oct 2024 11:33:41 +1300 Subject: [PATCH 18/32] Apply suggestions from code review --- test/MINLPTests/run_minlptests.jl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/MINLPTests/run_minlptests.jl b/test/MINLPTests/run_minlptests.jl index 6b7ee21..9cb4db8 100644 --- a/test/MINLPTests/run_minlptests.jl +++ b/test/MINLPTests/run_minlptests.jl @@ -106,7 +106,7 @@ import Uno_jll CONFIG["Uno"] = Dict( "mixed-integer" => false, "amplexe" => Uno_jll.amplexe, - "options" => ["logger=SILENT", "preset=ipopt"], + "options" => ["logger=SILENT"], "tol" => 1e-5, "dual_tol" => 1e-5, "nlp_exclude" => String[], From 517be7a41c9f050662754496c9c3c38b510598f8 Mon Sep 17 00:00:00 2001 From: Oscar Dowson Date: Sat, 26 Oct 2024 11:37:14 +1300 Subject: [PATCH 19/32] Update run_minlptests.jl --- test/MINLPTests/run_minlptests.jl | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/test/MINLPTests/run_minlptests.jl b/test/MINLPTests/run_minlptests.jl index 9cb4db8..b927543 100644 --- a/test/MINLPTests/run_minlptests.jl +++ b/test/MINLPTests/run_minlptests.jl @@ -109,8 +109,7 @@ CONFIG["Uno"] = Dict( "options" => ["logger=SILENT"], "tol" => 1e-5, "dual_tol" => 1e-5, - "nlp_exclude" => String[], - # ["005_010", "006_010", "007_010", "008_010", "008_011"], + "nlp_exclude" => ["005_010", "006_010", "007_010"], "nlpcvx_exclude" => String[], "nlpmi_exclude" => String[], "infeasible_point" => AmplNLWriter.MOI.NO_SOLUTION, From a0a4efc8c067db9c1993163f4d4dc5b0c7da33ba Mon Sep 17 00:00:00 2001 From: Oscar Dowson Date: Sat, 26 Oct 2024 11:51:04 +1300 Subject: [PATCH 20/32] Update run_minlptests.jl --- test/MINLPTests/run_minlptests.jl | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/test/MINLPTests/run_minlptests.jl b/test/MINLPTests/run_minlptests.jl index b927543..bd9cf45 100644 --- a/test/MINLPTests/run_minlptests.jl +++ b/test/MINLPTests/run_minlptests.jl @@ -109,7 +109,14 @@ CONFIG["Uno"] = Dict( "options" => ["logger=SILENT"], "tol" => 1e-5, "dual_tol" => 1e-5, - "nlp_exclude" => ["005_010", "006_010", "007_010"], + "nlp_exclude" => [ + # See https://github.com/cvanaret/Uno/issues/39 + "005_010", + # Unsupported user-defined function + "006_010", + # See https://github.com/cvanaret/Uno/issues/38 + "007_010", + ], "nlpcvx_exclude" => String[], "nlpmi_exclude" => String[], "infeasible_point" => AmplNLWriter.MOI.NO_SOLUTION, From c65d2ddc1e8d9f459b9b84600c32772d53fb9c7c Mon Sep 17 00:00:00 2001 From: odow Date: Sat, 26 Oct 2024 17:34:03 +1300 Subject: [PATCH 21/32] Update --- .github/workflows/ci.yml | 2 +- test/MOI_wrapper.jl | 60 ++++++++++++++++++++++++++++++++++++++++ 2 files changed, 61 insertions(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 0c0fb85..7143c4f 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -15,7 +15,7 @@ jobs: strategy: fail-fast: false matrix: - version: ['1.6', '1'] # Test against current minor release + version: ['1.10', '1'] # Test against current minor release os: [ubuntu-latest, macOS-latest, windows-latest] arch: [x64] include: diff --git a/test/MOI_wrapper.jl b/test/MOI_wrapper.jl index fbb59bf..b99dfbf 100644 --- a/test/MOI_wrapper.jl +++ b/test/MOI_wrapper.jl @@ -10,6 +10,7 @@ using Test import AmplNLWriter import AmplNLWriter: MOI import Ipopt_jll +import Uno_jll function runtests() for name in names(@__MODULE__; all = true) @@ -83,6 +84,65 @@ function test_ipopt_runtests() return end +function test_uno_runtests() + optimizer = MOI.instantiate( + () -> AmplNLWriter.Optimizer(Uno_jll.amplexe, ["logger=SILENT"]); + with_cache_type = Float64, + with_bridge_type = Float64, + ) + MOI.Test.runtests( + optimizer, + MOI.Test.Config( + atol = 1e-4, + rtol = 1e-4, + optimal_status = MOI.LOCALLY_SOLVED, + infeasible_status = MOI.LOCALLY_INFEASIBLE, + exclude = Any[ + MOI.VariableBasisStatus, + MOI.ConstraintBasisStatus, + MOI.ObjectiveBound, + # Bug: Uno returns incorrect duals, and does not support + # variable duals. + MOI.ConstraintDual, + MOI.NLPBlockDual, + ], + ), + exclude = [ + # OTHER_LIMIT instead of LOCALLY_SOLVED + "test_conic_linear_VectorOfVariables_2", + "test_nonlinear_expression_hs109", + "test_quadratic_constraint_GreaterThan", + "test_quadratic_constraint_LessThan", + # OTHER_ERROR instead of LOCALLY_SOLVED + "test_linear_integer_integration", + "test_linear_integration", + "test_linear_transform", + # OTHER_LIMIT instead of DUAL_INFEASIBLE + "test_solve_TerminationStatus_DUAL_INFEASIBLE", + # OTHER_LIMIT instead of LOCALLY_INFEASIBLE + "test_conic_NormInfinityCone_INFEASIBLE", + "test_conic_NormOneCone_INFEASIBLE", + "test_conic_linear_INFEASIBLE", + "test_linear_INFEASIBLE", + # TODO(odow): implement + "test_attribute_SolverVersion", + # Uno does not support integrality + "Indicator", + r"[Ii]nteger", + "Semicontinuous", + "Semiinteger", + "SOS1", + "SOS2", + "ZeroOne", + "test_cpsat_", + # Existing MOI issues + "test_nonlinear_invalid", + "test_basic_VectorNonlinearFunction_", + ], + ) + return +end + function test_show() @test sprint(show, AmplNLWriter.Optimizer()) == "An AMPL (.nl) model" return From 68a316f7b5434bcebdb78ccf5d6ca6831aed341c Mon Sep 17 00:00:00 2001 From: Oscar Dowson Date: Mon, 28 Oct 2024 11:16:03 +1300 Subject: [PATCH 22/32] Update test/MOI_wrapper.jl --- test/MOI_wrapper.jl | 1 - 1 file changed, 1 deletion(-) diff --git a/test/MOI_wrapper.jl b/test/MOI_wrapper.jl index b99dfbf..0cccb4c 100644 --- a/test/MOI_wrapper.jl +++ b/test/MOI_wrapper.jl @@ -104,7 +104,6 @@ function test_uno_runtests() # Bug: Uno returns incorrect duals, and does not support # variable duals. MOI.ConstraintDual, - MOI.NLPBlockDual, ], ), exclude = [ From 50f57b23a3476d6965febe7ab8445c2f557165f7 Mon Sep 17 00:00:00 2001 From: odow Date: Mon, 28 Oct 2024 12:06:16 +1300 Subject: [PATCH 23/32] Update --- Project.toml | 3 ++- test/MOI_wrapper.jl | 1 - test/runtests.jl | 3 +++ 3 files changed, 5 insertions(+), 2 deletions(-) diff --git a/Project.toml b/Project.toml index 0914aa5..15ac927 100644 --- a/Project.toml +++ b/Project.toml @@ -18,8 +18,9 @@ julia = "1.6" [extras] Ipopt_jll = "9cc047cb-c261-5740-88fc-0cf96f7bdcc7" +Pkg = "44cfe95a-1eb2-52ea-b672-e2afdf69b78f" Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40" Uno_jll = "396d5378-14f1-5ab1-981d-48acd51740ed" [targets] -test = ["Ipopt_jll", "Test", "Uno_jll"] +test = ["Ipopt_jll", "Pkg", "Test", "Uno_jll"] diff --git a/test/MOI_wrapper.jl b/test/MOI_wrapper.jl index 0cccb4c..ed2c9ae 100644 --- a/test/MOI_wrapper.jl +++ b/test/MOI_wrapper.jl @@ -113,7 +113,6 @@ function test_uno_runtests() "test_quadratic_constraint_GreaterThan", "test_quadratic_constraint_LessThan", # OTHER_ERROR instead of LOCALLY_SOLVED - "test_linear_integer_integration", "test_linear_integration", "test_linear_transform", # OTHER_LIMIT instead of DUAL_INFEASIBLE diff --git a/test/runtests.jl b/test/runtests.jl index cb62cd0..409b901 100644 --- a/test/runtests.jl +++ b/test/runtests.jl @@ -3,6 +3,9 @@ # Use of this source code is governed by an MIT-style license that can be found # in the LICENSE.md file or at https://opensource.org/licenses/MIT. +import Pkg +Pkg.pkg"add MathOptInterface#master" + using Test @testset "MOI_wrapper" begin From bf0def33f8fbdae265e30a984e03ff848ef86482 Mon Sep 17 00:00:00 2001 From: odow Date: Mon, 28 Oct 2024 12:22:48 +1300 Subject: [PATCH 24/32] Update --- test/MOI_wrapper.jl | 35 ++++++++++++++++------------------- 1 file changed, 16 insertions(+), 19 deletions(-) diff --git a/test/MOI_wrapper.jl b/test/MOI_wrapper.jl index ed2c9ae..97a0151 100644 --- a/test/MOI_wrapper.jl +++ b/test/MOI_wrapper.jl @@ -101,29 +101,26 @@ function test_uno_runtests() MOI.VariableBasisStatus, MOI.ConstraintBasisStatus, MOI.ObjectiveBound, - # Bug: Uno returns incorrect duals, and does not support - # variable duals. - MOI.ConstraintDual, ], - ), + ); exclude = [ # OTHER_LIMIT instead of LOCALLY_SOLVED - "test_conic_linear_VectorOfVariables_2", - "test_nonlinear_expression_hs109", - "test_quadratic_constraint_GreaterThan", - "test_quadratic_constraint_LessThan", + r"^test_conic_linear_VectorOfVariables_2$", + r"^test_nonlinear_expression_hs109$", + r"^test_quadratic_constraint_GreaterThan$", + r"^test_quadratic_constraint_LessThan$", # OTHER_ERROR instead of LOCALLY_SOLVED - "test_linear_integration", - "test_linear_transform", + r"^test_linear_integration$", + r"^test_linear_transform$", # OTHER_LIMIT instead of DUAL_INFEASIBLE - "test_solve_TerminationStatus_DUAL_INFEASIBLE", + r"^test_solve_TerminationStatus_DUAL_INFEASIBLE$", # OTHER_LIMIT instead of LOCALLY_INFEASIBLE - "test_conic_NormInfinityCone_INFEASIBLE", - "test_conic_NormOneCone_INFEASIBLE", - "test_conic_linear_INFEASIBLE", - "test_linear_INFEASIBLE", + r"^test_conic_NormInfinityCone_INFEASIBLE$", + r"^test_conic_NormOneCone_INFEASIBLE$", + r"^test_conic_linear_INFEASIBLE$", + r"^test_linear_INFEASIBLE$", # TODO(odow): implement - "test_attribute_SolverVersion", + r"^test_attribute_SolverVersion$", # Uno does not support integrality "Indicator", r"[Ii]nteger", @@ -132,10 +129,10 @@ function test_uno_runtests() "SOS1", "SOS2", "ZeroOne", - "test_cpsat_", + r"^test_cpsat_", # Existing MOI issues - "test_nonlinear_invalid", - "test_basic_VectorNonlinearFunction_", + r"^test_nonlinear_invalid$", + r"^test_basic_VectorNonlinearFunction_", ], ) return From 77015fda6e05863cd55d96b4bce570a09bc6850b Mon Sep 17 00:00:00 2001 From: odow Date: Mon, 28 Oct 2024 12:45:54 +1300 Subject: [PATCH 25/32] Update --- test/MOI_wrapper.jl | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/test/MOI_wrapper.jl b/test/MOI_wrapper.jl index 97a0151..c72aeb4 100644 --- a/test/MOI_wrapper.jl +++ b/test/MOI_wrapper.jl @@ -109,6 +109,8 @@ function test_uno_runtests() r"^test_nonlinear_expression_hs109$", r"^test_quadratic_constraint_GreaterThan$", r"^test_quadratic_constraint_LessThan$", + r"^test_solve_VariableIndex_ConstraintDual_MAX_SENSE$", + r"^test_solve_VariableIndex_ConstraintDual_MIN_SENSE$", # OTHER_ERROR instead of LOCALLY_SOLVED r"^test_linear_integration$", r"^test_linear_transform$", @@ -118,7 +120,10 @@ function test_uno_runtests() r"^test_conic_NormInfinityCone_INFEASIBLE$", r"^test_conic_NormOneCone_INFEASIBLE$", r"^test_conic_linear_INFEASIBLE$", + r"^test_conic_linear_INFEASIBLE_2$", r"^test_linear_INFEASIBLE$", + r"^test_linear_INFEASIBLE_2$", + r"^test_solve_DualStatus_INFEASIBILITY_CERTIFICATE_", # TODO(odow): implement r"^test_attribute_SolverVersion$", # Uno does not support integrality From 00787a3284ad1821a3fff1c434a3ec049dcda913 Mon Sep 17 00:00:00 2001 From: odow Date: Mon, 28 Oct 2024 16:15:14 +1300 Subject: [PATCH 26/32] Update --- Project.toml | 2 +- test/MOI_wrapper.jl | 8 -------- test/runtests.jl | 3 --- 3 files changed, 1 insertion(+), 12 deletions(-) diff --git a/Project.toml b/Project.toml index 15ac927..d82a1bb 100644 --- a/Project.toml +++ b/Project.toml @@ -10,7 +10,7 @@ OpenBLAS32_jll = "656ef2d0-ae68-5445-9ca0-591084a874a2" [compat] Ipopt_jll = "=300.1400.400, =300.1400.1400, =300.1400.1600" LinearAlgebra = "<0.0.1, 1.6" -MathOptInterface = "1.18" +MathOptInterface = "1.33" OpenBLAS32_jll = "0.3.12, 0.3.24" Test = "<0.0.1, 1.6" Uno_jll = "1.1" diff --git a/test/MOI_wrapper.jl b/test/MOI_wrapper.jl index c72aeb4..a2405c8 100644 --- a/test/MOI_wrapper.jl +++ b/test/MOI_wrapper.jl @@ -59,12 +59,6 @@ function test_ipopt_runtests() ], ), exclude = [ - # TODO(odow): Bug in MOI/AmplNLWriter - "test_model_copy_to_", - # TODO(odow): implement - "test_attribute_SolverVersion", - # Skip the test with NaNs - "test_nonlinear_invalid", # Returns UnknownResultStatus "test_conic_NormInfinityCone_INFEASIBLE", "test_conic_NormOneCone_INFEASIBLE", @@ -124,8 +118,6 @@ function test_uno_runtests() r"^test_linear_INFEASIBLE$", r"^test_linear_INFEASIBLE_2$", r"^test_solve_DualStatus_INFEASIBILITY_CERTIFICATE_", - # TODO(odow): implement - r"^test_attribute_SolverVersion$", # Uno does not support integrality "Indicator", r"[Ii]nteger", diff --git a/test/runtests.jl b/test/runtests.jl index 409b901..cb62cd0 100644 --- a/test/runtests.jl +++ b/test/runtests.jl @@ -3,9 +3,6 @@ # Use of this source code is governed by an MIT-style license that can be found # in the LICENSE.md file or at https://opensource.org/licenses/MIT. -import Pkg -Pkg.pkg"add MathOptInterface#master" - using Test @testset "MOI_wrapper" begin From 3279c99e8595845cb3cf57e541af78de71a988fe Mon Sep 17 00:00:00 2001 From: odow Date: Mon, 28 Oct 2024 16:16:04 +1300 Subject: [PATCH 27/32] Update --- Project.toml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/Project.toml b/Project.toml index d82a1bb..8a1c6c0 100644 --- a/Project.toml +++ b/Project.toml @@ -18,9 +18,8 @@ julia = "1.6" [extras] Ipopt_jll = "9cc047cb-c261-5740-88fc-0cf96f7bdcc7" -Pkg = "44cfe95a-1eb2-52ea-b672-e2afdf69b78f" Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40" Uno_jll = "396d5378-14f1-5ab1-981d-48acd51740ed" [targets] -test = ["Ipopt_jll", "Pkg", "Test", "Uno_jll"] +test = ["Ipopt_jll", "Test", "Uno_jll"] From de0acb81fa3bed263e5d18dbfeea0ea45fedb8bf Mon Sep 17 00:00:00 2001 From: odow Date: Mon, 28 Oct 2024 16:34:51 +1300 Subject: [PATCH 28/32] Update --- test/MOI_wrapper.jl | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/test/MOI_wrapper.jl b/test/MOI_wrapper.jl index a2405c8..343718e 100644 --- a/test/MOI_wrapper.jl +++ b/test/MOI_wrapper.jl @@ -73,6 +73,10 @@ function test_ipopt_runtests() "_SOS2_", "test_linear_integer_", "test_cpsat_", + # We should debug why this does not skip + r"^test_attribute_SolverVersion$", + # Okay to skip. Returns OTHER_ERROR instead of INVALID_MODEL + r"^test_nonlinear_invalid$", ], ) return @@ -128,6 +132,7 @@ function test_uno_runtests() "ZeroOne", r"^test_cpsat_", # Existing MOI issues + r"^test_attribute_SolverVersion$", r"^test_nonlinear_invalid$", r"^test_basic_VectorNonlinearFunction_", ], From f9ff9dec281193154131e0cb19f71f44bb5bfe7a Mon Sep 17 00:00:00 2001 From: odow Date: Mon, 28 Oct 2024 17:02:59 +1300 Subject: [PATCH 29/32] Update --- .github/workflows/ci.yml | 2 +- Project.toml | 6 +-- test/MINLPTests/Project.toml | 2 + test/MINLPTests/run_minlptests.jl | 76 +++++++++++++++++++++++++++---- test/MOI_wrapper.jl | 69 +++------------------------- 5 files changed, 78 insertions(+), 77 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 7143c4f..0c0fb85 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -15,7 +15,7 @@ jobs: strategy: fail-fast: false matrix: - version: ['1.10', '1'] # Test against current minor release + version: ['1.6', '1'] # Test against current minor release os: [ubuntu-latest, macOS-latest, windows-latest] arch: [x64] include: diff --git a/Project.toml b/Project.toml index 8a1c6c0..cd0263b 100644 --- a/Project.toml +++ b/Project.toml @@ -10,16 +10,14 @@ OpenBLAS32_jll = "656ef2d0-ae68-5445-9ca0-591084a874a2" [compat] Ipopt_jll = "=300.1400.400, =300.1400.1400, =300.1400.1600" LinearAlgebra = "<0.0.1, 1.6" -MathOptInterface = "1.33" +MathOptInterface = "1.18" OpenBLAS32_jll = "0.3.12, 0.3.24" Test = "<0.0.1, 1.6" -Uno_jll = "1.1" julia = "1.6" [extras] Ipopt_jll = "9cc047cb-c261-5740-88fc-0cf96f7bdcc7" Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40" -Uno_jll = "396d5378-14f1-5ab1-981d-48acd51740ed" [targets] -test = ["Ipopt_jll", "Test", "Uno_jll"] +test = ["Ipopt_jll", "Test"] diff --git a/test/MINLPTests/Project.toml b/test/MINLPTests/Project.toml index b32db53..bda7e0c 100644 --- a/test/MINLPTests/Project.toml +++ b/test/MINLPTests/Project.toml @@ -4,6 +4,7 @@ Couenne_jll = "f09e9e23-9010-5c9e-b679-9f1d8f79b85c" Ipopt_jll = "9cc047cb-c261-5740-88fc-0cf96f7bdcc7" JuMP = "4076af6c-e467-56ae-b986-b466b2749572" MINLPTests = "ee0a3090-8ee9-5cdb-b8cb-8eeba3165522" +MathOptInterface = "b8f27783-ece8-5eb3-8dc8-9495eed66fee" SHOT_jll = "c1ab834c-c4a5-50f5-9156-8f0fe7758b0e" Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40" Uno_jll = "396d5378-14f1-5ab1-981d-48acd51740ed" @@ -13,6 +14,7 @@ Bonmin_jll = "100.800.801" Couenne_jll = "0.500.801" Ipopt_jll = "=300.1400.1600" JuMP = "1" +MathOptInterface = "1.33" MINLPTests = "0.6" SHOT_jll = "100.100.0" Uno_jll = "1.1.0" diff --git a/test/MINLPTests/run_minlptests.jl b/test/MINLPTests/run_minlptests.jl index bd9cf45..fa2ef06 100644 --- a/test/MINLPTests/run_minlptests.jl +++ b/test/MINLPTests/run_minlptests.jl @@ -3,9 +3,14 @@ # Use of this source code is governed by an MIT-style license that can be found # in the LICENSE.md file or at https://opensource.org/licenses/MIT. +using Test + import AmplNLWriter +import Bonmin_jll +import Couenne_jll +import Ipopt_jll import MINLPTests -using Test +import Uno_jll const TERMINATION_TARGET = Dict( MINLPTests.FEASIBLE_PROBLEM => AmplNLWriter.MOI.LOCALLY_SOLVED, @@ -31,7 +36,6 @@ const PRIMAL_TARGET = Dict( const CONFIG = Dict{String,Any}() -import Bonmin_jll CONFIG["Bonmin"] = Dict( "mixed-integer" => true, "amplexe" => Bonmin_jll.amplexe, @@ -44,8 +48,6 @@ CONFIG["Bonmin"] = Dict( "nlpmi_exclude" => ["004_010", "004_011", "005_011", "006_010"], "infeasible_point" => AmplNLWriter.MOI.NO_SOLUTION, ) - -import Couenne_jll CONFIG["Couenne"] = Dict( "mixed-integer" => true, "amplexe" => Couenne_jll.amplexe, @@ -59,7 +61,6 @@ CONFIG["Couenne"] = Dict( "infeasible_point" => AmplNLWriter.MOI.NO_SOLUTION, ) -import Ipopt_jll CONFIG["Ipopt"] = Dict( "mixed-integer" => false, "amplexe" => Ipopt_jll.amplexe, @@ -101,8 +102,6 @@ CONFIG["Ipopt"] = Dict( # "infeasible_point" => AmplNLWriter.MOI.UNKNOWN_RESULT_STATUS, # ) -import Uno_jll - CONFIG["Uno"] = Dict( "mixed-integer" => false, "amplexe" => Uno_jll.amplexe, @@ -122,8 +121,7 @@ CONFIG["Uno"] = Dict( "infeasible_point" => AmplNLWriter.MOI.NO_SOLUTION, ) -@testset "$(name)" for name in ["Uno", "Ipopt", "Bonmin", "Couenne"] - config = CONFIG[name] +@testset "$k" for (k, config) in CONFIG OPTIMIZER = () -> AmplNLWriter.Optimizer(config["amplexe"], config["options"]) PRIMAL_TARGET[MINLPTests.INFEASIBLE_PROBLEM] = config["infeasible_point"] @@ -190,3 +188,63 @@ CONFIG["Uno"] = Dict( end end end + +function test_uno_runtests() + optimizer = MOI.instantiate( + () -> AmplNLWriter.Optimizer(Uno_jll.amplexe, ["logger=SILENT"]); + with_cache_type = Float64, + with_bridge_type = Float64, + ) + MOI.Test.runtests( + optimizer, + MOI.Test.Config( + atol = 1e-4, + rtol = 1e-4, + optimal_status = MOI.LOCALLY_SOLVED, + infeasible_status = MOI.LOCALLY_INFEASIBLE, + exclude = Any[ + MOI.VariableBasisStatus, + MOI.ConstraintBasisStatus, + MOI.ObjectiveBound, + ], + ); + exclude = [ + # OTHER_LIMIT instead of LOCALLY_SOLVED + r"^test_conic_linear_VectorOfVariables_2$", + r"^test_nonlinear_expression_hs109$", + r"^test_quadratic_constraint_GreaterThan$", + r"^test_quadratic_constraint_LessThan$", + r"^test_solve_VariableIndex_ConstraintDual_MAX_SENSE$", + r"^test_solve_VariableIndex_ConstraintDual_MIN_SENSE$", + # OTHER_ERROR instead of LOCALLY_SOLVED + r"^test_linear_integration$", + r"^test_linear_transform$", + # OTHER_LIMIT instead of DUAL_INFEASIBLE + r"^test_solve_TerminationStatus_DUAL_INFEASIBLE$", + # OTHER_LIMIT instead of LOCALLY_INFEASIBLE + r"^test_conic_NormInfinityCone_INFEASIBLE$", + r"^test_conic_NormOneCone_INFEASIBLE$", + r"^test_conic_linear_INFEASIBLE$", + r"^test_conic_linear_INFEASIBLE_2$", + r"^test_linear_INFEASIBLE$", + r"^test_linear_INFEASIBLE_2$", + r"^test_solve_DualStatus_INFEASIBILITY_CERTIFICATE_", + # Uno does not support integrality + "Indicator", + r"[Ii]nteger", + "Semicontinuous", + "Semiinteger", + "SOS1", + "SOS2", + "ZeroOne", + r"^test_cpsat_", + # Existing MOI issues + r"^test_attribute_SolverVersion$", + r"^test_nonlinear_invalid$", + r"^test_basic_VectorNonlinearFunction_", + ], + ) + return +end + +test_uno_runtests() diff --git a/test/MOI_wrapper.jl b/test/MOI_wrapper.jl index 343718e..fbb59bf 100644 --- a/test/MOI_wrapper.jl +++ b/test/MOI_wrapper.jl @@ -10,7 +10,6 @@ using Test import AmplNLWriter import AmplNLWriter: MOI import Ipopt_jll -import Uno_jll function runtests() for name in names(@__MODULE__; all = true) @@ -59,6 +58,12 @@ function test_ipopt_runtests() ], ), exclude = [ + # TODO(odow): Bug in MOI/AmplNLWriter + "test_model_copy_to_", + # TODO(odow): implement + "test_attribute_SolverVersion", + # Skip the test with NaNs + "test_nonlinear_invalid", # Returns UnknownResultStatus "test_conic_NormInfinityCone_INFEASIBLE", "test_conic_NormOneCone_INFEASIBLE", @@ -73,68 +78,6 @@ function test_ipopt_runtests() "_SOS2_", "test_linear_integer_", "test_cpsat_", - # We should debug why this does not skip - r"^test_attribute_SolverVersion$", - # Okay to skip. Returns OTHER_ERROR instead of INVALID_MODEL - r"^test_nonlinear_invalid$", - ], - ) - return -end - -function test_uno_runtests() - optimizer = MOI.instantiate( - () -> AmplNLWriter.Optimizer(Uno_jll.amplexe, ["logger=SILENT"]); - with_cache_type = Float64, - with_bridge_type = Float64, - ) - MOI.Test.runtests( - optimizer, - MOI.Test.Config( - atol = 1e-4, - rtol = 1e-4, - optimal_status = MOI.LOCALLY_SOLVED, - infeasible_status = MOI.LOCALLY_INFEASIBLE, - exclude = Any[ - MOI.VariableBasisStatus, - MOI.ConstraintBasisStatus, - MOI.ObjectiveBound, - ], - ); - exclude = [ - # OTHER_LIMIT instead of LOCALLY_SOLVED - r"^test_conic_linear_VectorOfVariables_2$", - r"^test_nonlinear_expression_hs109$", - r"^test_quadratic_constraint_GreaterThan$", - r"^test_quadratic_constraint_LessThan$", - r"^test_solve_VariableIndex_ConstraintDual_MAX_SENSE$", - r"^test_solve_VariableIndex_ConstraintDual_MIN_SENSE$", - # OTHER_ERROR instead of LOCALLY_SOLVED - r"^test_linear_integration$", - r"^test_linear_transform$", - # OTHER_LIMIT instead of DUAL_INFEASIBLE - r"^test_solve_TerminationStatus_DUAL_INFEASIBLE$", - # OTHER_LIMIT instead of LOCALLY_INFEASIBLE - r"^test_conic_NormInfinityCone_INFEASIBLE$", - r"^test_conic_NormOneCone_INFEASIBLE$", - r"^test_conic_linear_INFEASIBLE$", - r"^test_conic_linear_INFEASIBLE_2$", - r"^test_linear_INFEASIBLE$", - r"^test_linear_INFEASIBLE_2$", - r"^test_solve_DualStatus_INFEASIBILITY_CERTIFICATE_", - # Uno does not support integrality - "Indicator", - r"[Ii]nteger", - "Semicontinuous", - "Semiinteger", - "SOS1", - "SOS2", - "ZeroOne", - r"^test_cpsat_", - # Existing MOI issues - r"^test_attribute_SolverVersion$", - r"^test_nonlinear_invalid$", - r"^test_basic_VectorNonlinearFunction_", ], ) return From 7c188ed4d0687ac18cfc72edfc33889036abcf00 Mon Sep 17 00:00:00 2001 From: odow Date: Mon, 28 Oct 2024 17:12:54 +1300 Subject: [PATCH 30/32] Update --- test/MINLPTests/run_minlptests.jl | 194 +++++++++++++----------------- 1 file changed, 83 insertions(+), 111 deletions(-) diff --git a/test/MINLPTests/run_minlptests.jl b/test/MINLPTests/run_minlptests.jl index fa2ef06..dbfd879 100644 --- a/test/MINLPTests/run_minlptests.jl +++ b/test/MINLPTests/run_minlptests.jl @@ -10,6 +10,7 @@ import Bonmin_jll import Couenne_jll import Ipopt_jll import MINLPTests +import SHOT_jll import Uno_jll const TERMINATION_TARGET = Dict( @@ -23,7 +24,6 @@ const PRIMAL_TARGET = Dict( ) # Common reasons for exclusion: -# nlp/005_011 : Uses the function `\` # nlp/006_010 : Uses a user-defined function # nlp/007_010 : Ipopt returns an infeasible point, not NO_SOLUTION. # nlp/008_010 : Couenne fails to converge @@ -34,156 +34,128 @@ const PRIMAL_TARGET = Dict( # nlp-cvx/206_010 : Couenne can't evaluate pow # nlp-mi/001_010 : Couenne fails to converge -const CONFIG = Dict{String,Any}() - -CONFIG["Bonmin"] = Dict( - "mixed-integer" => true, - "amplexe" => Bonmin_jll.amplexe, - "options" => String["bonmin.nlp_log_level=0"], - "tol" => 1e-5, - "dual_tol" => NaN, - "nlp_exclude" => ["005_011", "006_010"], - "nlpcvx_exclude" => ["109_010"], - # 004_010 and 004_011 are tolerance failures on Bonmin - "nlpmi_exclude" => ["004_010", "004_011", "005_011", "006_010"], - "infeasible_point" => AmplNLWriter.MOI.NO_SOLUTION, -) -CONFIG["Couenne"] = Dict( - "mixed-integer" => true, - "amplexe" => Couenne_jll.amplexe, - "options" => String[], - "tol" => 1e-2, - "dual_tol" => NaN, - "nlp_exclude" => - ["005_011", "006_010", "008_010", "008_011", "009_010", "009_011"], - "nlpcvx_exclude" => ["109_010", "206_010"], - "nlpmi_exclude" => ["001_010", "005_011", "006_010"], - "infeasible_point" => AmplNLWriter.MOI.NO_SOLUTION, -) - -CONFIG["Ipopt"] = Dict( - "mixed-integer" => false, - "amplexe" => Ipopt_jll.amplexe, - "options" => String["print_level=0"], - "tol" => 1e-5, - "dual_tol" => 1e-5, - "nlp_exclude" => ["005_011", "006_010", "007_010"], - "nlpcvx_exclude" => ["109_010"], - "nlpmi_exclude" => ["005_011", "006_010"], - "infeasible_point" => AmplNLWriter.MOI.NO_SOLUTION, -) - -# SHOT fails too many tests to recommend using it. -# e.g., https://github.com/coin-or/SHOT/issues/134 -# Even problems such as `@variable(model, x); @objective(model, Min, (x-1)^2)` -# -# import SHOT_jll -# CONFIG["SHOT"] = Dict( -# "amplexe" => SHOT_jll.amplexe, -# "options" => String[ -# "Output.Console.LogLevel=6", -# "Output.File.LogLevel=6", -# "Termination.ObjectiveGap.Absolute=1e-6", -# "Termination.ObjectiveGap.Relative=1e-6", -# ], -# "tol" => 1e-2, -# "dual_tol" => NaN, -# "nlp_exclude" => [ -# "005_011", # `\` function -# "006_010", # User-defined function -# ], -# "nlpcvx_exclude" => [ -# "501_011", # `\` function -# ], -# "nlpmi_exclude" => [ -# "005_011", # `\` function -# "006_010", # User-defined function -# ], -# "infeasible_point" => AmplNLWriter.MOI.UNKNOWN_RESULT_STATUS, -# ) - -CONFIG["Uno"] = Dict( - "mixed-integer" => false, - "amplexe" => Uno_jll.amplexe, - "options" => ["logger=SILENT"], - "tol" => 1e-5, - "dual_tol" => 1e-5, - "nlp_exclude" => [ - # See https://github.com/cvanaret/Uno/issues/39 - "005_010", - # Unsupported user-defined function - "006_010", - # See https://github.com/cvanaret/Uno/issues/38 - "007_010", - ], - "nlpcvx_exclude" => String[], - "nlpmi_exclude" => String[], - "infeasible_point" => AmplNLWriter.MOI.NO_SOLUTION, +const CONFIG = Dict{String,Any}( + "Bonmin" => Dict( + "mixed-integer" => true, + "amplexe" => Bonmin_jll.amplexe, + "options" => String["bonmin.nlp_log_level=0"], + "dual_tol" => NaN, + "nlpcvx_exclude" => ["109_010"], + # 004_010 and 004_011 are tolerance failures on Bonmin + "nlpmi_exclude" => ["004_010", "004_011", "006_010"], + ), + "Couenne" => Dict( + "mixed-integer" => true, + "amplexe" => Couenne_jll.amplexe, + "options" => String[], + "tol" => 1e-2, + "dual_tol" => NaN, + "nlp_exclude" => + ["006_010", "008_010", "008_011", "009_010", "009_011"], + "nlpcvx_exclude" => ["109_010", "206_010"], + "nlpmi_exclude" => ["001_010", "006_010"], + ), + "Ipopt" => Dict( + "mixed-integer" => false, + "amplexe" => Ipopt_jll.amplexe, + "options" => String["print_level=0"], + "nlp_exclude" => ["006_010", "007_010"], + "nlpcvx_exclude" => ["109_010"], + "nlpmi_exclude" => ["006_010"], + ), + # SHOT fails too many tests to recommend using it. + # e.g., https://github.com/coin-or/SHOT/issues/134 + # Even problems such as `@variable(model, x); @objective(model, Min, (x-1)^2)` + # "SHOT" => Dict( + # "amplexe" => SHOT_jll.amplexe, + # "options" => String[ + # "Output.Console.LogLevel=6", + # "Output.File.LogLevel=6", + # "Termination.ObjectiveGap.Absolute=1e-6", + # "Termination.ObjectiveGap.Relative=1e-6", + # ], + # "tol" => 1e-2, + # "dual_tol" => NaN, + # "infeasible_point" => AmplNLWriter.MOI.UNKNOWN_RESULT_STATUS, + # ), + "Uno" => Dict( + "mixed-integer" => false, + "amplexe" => Uno_jll.amplexe, + "options" => ["logger=SILENT"], + "nlp_exclude" => [ + # See https://github.com/cvanaret/Uno/issues/39 + "005_010", + # Unsupported user-defined function + "006_010", + # See https://github.com/cvanaret/Uno/issues/38 + "007_010", + ], + ), ) @testset "$k" for (k, config) in CONFIG OPTIMIZER = () -> AmplNLWriter.Optimizer(config["amplexe"], config["options"]) - PRIMAL_TARGET[MINLPTests.INFEASIBLE_PROBLEM] = config["infeasible_point"] + # PRIMAL_TARGET[MINLPTests.INFEASIBLE_PROBLEM] = config["infeasible_point"] @testset "NLP" begin MINLPTests.test_nlp( OPTIMIZER, - exclude = config["nlp_exclude"], + exclude = get(config, "nlp_exclude", ["006_010"]), termination_target = TERMINATION_TARGET, primal_target = PRIMAL_TARGET, - objective_tol = config["tol"], - primal_tol = config["tol"], - dual_tol = config["dual_tol"], + objective_tol = get(config, "tol", 1e-5), + primal_tol = get(config, "tol", 1e-5), + dual_tol = get(config, "dual_tol", 1e-5), ) MINLPTests.test_nlp_expr( OPTIMIZER, - exclude = config["nlp_exclude"], + exclude = get(config, "nlp_exclude", ["006_010"]), termination_target = TERMINATION_TARGET, primal_target = PRIMAL_TARGET, - objective_tol = config["tol"], - primal_tol = config["tol"], - dual_tol = config["dual_tol"], + objective_tol = get(config, "tol", 1e-5), + primal_tol = get(config, "tol", 1e-5), + dual_tol = get(config, "dual_tol", 1e-5), ) end @testset "NLP-CVX" begin MINLPTests.test_nlp_cvx( OPTIMIZER, - exclude = config["nlpcvx_exclude"], + exclude = get(config, "nlpcvx_exclude", String[]), termination_target = TERMINATION_TARGET, primal_target = PRIMAL_TARGET, - objective_tol = config["tol"], - primal_tol = config["tol"], - dual_tol = config["dual_tol"], + objective_tol = get(config, "tol", 1e-5), + primal_tol = get(config, "tol", 1e-5), + dual_tol = get(config, "dual_tol", 1e-5), ) MINLPTests.test_nlp_cvx_expr( OPTIMIZER, - exclude = config["nlpcvx_exclude"], + exclude = get(config, "nlpcvx_exclude", String[]), termination_target = TERMINATION_TARGET, primal_target = PRIMAL_TARGET, - objective_tol = config["tol"], - primal_tol = config["tol"], - dual_tol = config["dual_tol"], + objective_tol = get(config, "tol", 1e-5), + primal_tol = get(config, "tol", 1e-5), + dual_tol = get(config, "dual_tol", 1e-5), ) end if config["mixed-integer"] @testset "NLP-MI" begin MINLPTests.test_nlp_mi( OPTIMIZER, - exclude = config["nlpmi_exclude"], + exclude = get(config, "nlpmi_exclude", ["006_010"]), termination_target = TERMINATION_TARGET, primal_target = PRIMAL_TARGET, - objective_tol = config["tol"], - primal_tol = config["tol"], - dual_tol = config["dual_tol"], + objective_tol = get(config, "tol", 1e-5), + primal_tol = get(config, "tol", 1e-5), + dual_tol = get(config, "dual_tol", 1e-5), ) MINLPTests.test_nlp_mi_expr( OPTIMIZER, - exclude = config["nlpmi_exclude"], + exclude = get(config, "nlpmi_exclude", ["006_010"]), termination_target = TERMINATION_TARGET, primal_target = PRIMAL_TARGET, - objective_tol = config["tol"], - primal_tol = config["tol"], - dual_tol = config["dual_tol"], + objective_tol = get(config, "tol", 1e-5), + primal_tol = get(config, "tol", 1e-5), + dual_tol = get(config, "dual_tol", 1e-5), ) end end From 8fe24cfa924d8e7f42bca4ee454c7f12b9b2d4c5 Mon Sep 17 00:00:00 2001 From: odow Date: Mon, 28 Oct 2024 19:20:09 +1300 Subject: [PATCH 31/32] Update --- test/MINLPTests/run_minlptests.jl | 48 +++++++++++++++---------------- 1 file changed, 24 insertions(+), 24 deletions(-) diff --git a/test/MINLPTests/run_minlptests.jl b/test/MINLPTests/run_minlptests.jl index dbfd879..cf4e497 100644 --- a/test/MINLPTests/run_minlptests.jl +++ b/test/MINLPTests/run_minlptests.jl @@ -9,18 +9,19 @@ import AmplNLWriter import Bonmin_jll import Couenne_jll import Ipopt_jll +import MathOptInterface as MOI import MINLPTests import SHOT_jll import Uno_jll const TERMINATION_TARGET = Dict( - MINLPTests.FEASIBLE_PROBLEM => AmplNLWriter.MOI.LOCALLY_SOLVED, - MINLPTests.INFEASIBLE_PROBLEM => AmplNLWriter.MOI.LOCALLY_INFEASIBLE, + MINLPTests.FEASIBLE_PROBLEM => MOI.LOCALLY_SOLVED, + MINLPTests.INFEASIBLE_PROBLEM => MOI.LOCALLY_INFEASIBLE, ) const PRIMAL_TARGET = Dict( - MINLPTests.FEASIBLE_PROBLEM => AmplNLWriter.MOI.FEASIBLE_POINT, - MINLPTests.INFEASIBLE_PROBLEM => AmplNLWriter.MOI.NO_SOLUTION, + MINLPTests.FEASIBLE_PROBLEM => MOI.FEASIBLE_POINT, + MINLPTests.INFEASIBLE_PROBLEM => MOI.NO_SOLUTION, ) # Common reasons for exclusion: @@ -42,7 +43,7 @@ const CONFIG = Dict{String,Any}( "dual_tol" => NaN, "nlpcvx_exclude" => ["109_010"], # 004_010 and 004_011 are tolerance failures on Bonmin - "nlpmi_exclude" => ["004_010", "004_011", "006_010"], + "nlpmi_exclude" => ["004_010", "004_011"], ), "Couenne" => Dict( "mixed-integer" => true, @@ -50,18 +51,16 @@ const CONFIG = Dict{String,Any}( "options" => String[], "tol" => 1e-2, "dual_tol" => NaN, - "nlp_exclude" => - ["006_010", "008_010", "008_011", "009_010", "009_011"], + "nlp_exclude" => ["008_010", "008_011", "009_010", "009_011"], "nlpcvx_exclude" => ["109_010", "206_010"], - "nlpmi_exclude" => ["001_010", "006_010"], + "nlpmi_exclude" => ["001_010"], ), "Ipopt" => Dict( "mixed-integer" => false, "amplexe" => Ipopt_jll.amplexe, "options" => String["print_level=0"], - "nlp_exclude" => ["006_010", "007_010"], + "nlp_exclude" => ["007_010"], "nlpcvx_exclude" => ["109_010"], - "nlpmi_exclude" => ["006_010"], ), # SHOT fails too many tests to recommend using it. # e.g., https://github.com/coin-or/SHOT/issues/134 @@ -85,8 +84,6 @@ const CONFIG = Dict{String,Any}( "nlp_exclude" => [ # See https://github.com/cvanaret/Uno/issues/39 "005_010", - # Unsupported user-defined function - "006_010", # See https://github.com/cvanaret/Uno/issues/38 "007_010", ], @@ -98,9 +95,10 @@ const CONFIG = Dict{String,Any}( () -> AmplNLWriter.Optimizer(config["amplexe"], config["options"]) # PRIMAL_TARGET[MINLPTests.INFEASIBLE_PROBLEM] = config["infeasible_point"] @testset "NLP" begin + exclude = vcat(get(config, "nlp_exclude", String[]), ["006_010"]) MINLPTests.test_nlp( - OPTIMIZER, - exclude = get(config, "nlp_exclude", ["006_010"]), + OPTIMIZER; + exclude = exclude, termination_target = TERMINATION_TARGET, primal_target = PRIMAL_TARGET, objective_tol = get(config, "tol", 1e-5), @@ -108,8 +106,8 @@ const CONFIG = Dict{String,Any}( dual_tol = get(config, "dual_tol", 1e-5), ) MINLPTests.test_nlp_expr( - OPTIMIZER, - exclude = get(config, "nlp_exclude", ["006_010"]), + OPTIMIZER; + exclude = exclude, termination_target = TERMINATION_TARGET, primal_target = PRIMAL_TARGET, objective_tol = get(config, "tol", 1e-5), @@ -118,9 +116,10 @@ const CONFIG = Dict{String,Any}( ) end @testset "NLP-CVX" begin + exclude = get(config, "nlpcvx_exclude", String[]) MINLPTests.test_nlp_cvx( - OPTIMIZER, - exclude = get(config, "nlpcvx_exclude", String[]), + OPTIMIZER; + exclude = exclude, termination_target = TERMINATION_TARGET, primal_target = PRIMAL_TARGET, objective_tol = get(config, "tol", 1e-5), @@ -128,8 +127,8 @@ const CONFIG = Dict{String,Any}( dual_tol = get(config, "dual_tol", 1e-5), ) MINLPTests.test_nlp_cvx_expr( - OPTIMIZER, - exclude = get(config, "nlpcvx_exclude", String[]), + OPTIMIZER; + exclude = exclude, termination_target = TERMINATION_TARGET, primal_target = PRIMAL_TARGET, objective_tol = get(config, "tol", 1e-5), @@ -138,10 +137,11 @@ const CONFIG = Dict{String,Any}( ) end if config["mixed-integer"] + exclude = vcat(get(config, "nlpmi_exclude", String[]), ["006_010"]) @testset "NLP-MI" begin MINLPTests.test_nlp_mi( - OPTIMIZER, - exclude = get(config, "nlpmi_exclude", ["006_010"]), + OPTIMIZER; + exclude = exclude, termination_target = TERMINATION_TARGET, primal_target = PRIMAL_TARGET, objective_tol = get(config, "tol", 1e-5), @@ -149,8 +149,8 @@ const CONFIG = Dict{String,Any}( dual_tol = get(config, "dual_tol", 1e-5), ) MINLPTests.test_nlp_mi_expr( - OPTIMIZER, - exclude = get(config, "nlpmi_exclude", ["006_010"]), + OPTIMIZER; + exclude = exclude, termination_target = TERMINATION_TARGET, primal_target = PRIMAL_TARGET, objective_tol = get(config, "tol", 1e-5), From c0dc7fb0eae6ce4d057ea6c99db68968c144bb20 Mon Sep 17 00:00:00 2001 From: Oscar Dowson Date: Mon, 28 Oct 2024 21:11:59 +1300 Subject: [PATCH 32/32] Update README.md --- README.md | 1 - 1 file changed, 1 deletion(-) diff --git a/README.md b/README.md index 465d74c..5d27ead 100644 --- a/README.md +++ b/README.md @@ -71,7 +71,6 @@ Supported packages include: | [SHOT](https://github.com/coin-or/SHOT) | `SHOT_jll.jl` | `SHOT_jll.amplexe` | | [Uno](https://github.com/cvanaret/Uno) | `Uno_jll.jl` | `Uno_jll.amplexe` | - ## MathOptInterface API The AmplNLWriter optimizer supports the following constraints and attributes.