Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

MOI rewrite using Clang #44

Merged
merged 194 commits into from Feb 14, 2020
Merged

MOI rewrite using Clang #44

merged 194 commits into from Feb 14, 2020

Conversation

joaquimg
Copy link
Member

New plan:

  • Generate lib.jl, common.jl, ctypes.jl using Clang.jl (done!)
  • Write (minimal) Julian api.jl wrapper for all functions in Lib module
  • Write (minimal) MOI wrapper (poor performance, only LP and simple MIP integer and binary) on top of functions exposed in api.jl (minimal version)
  • Pass MOI (most basic LP and MIP) tests

This would allow Xpress to be used in the latest JuMP/MOI, which enable the broader public to use Xpress.

Then we could have a second (set of) PR(s) with:

  • Write (more complete) Julian api.jl wrapper for all functions in Lib module
  • Write (more complete) MOI wrapper (High Performance, QP, QCQP, SOCP, Callbacks, SOS, SemiContinuous etc) on top of functions exposed in api.jl (minimal version)
  • Documentation
  • Tests

This second could be done incrementally by many smaller PR's that people add as needed... and could be done in parallel.

Replaces #43

cc @kdheepak @jd-lara

Lets work on this one?

I will add you to the repo

@jd-lara
Copy link
Collaborator

jd-lara commented Feb 12, 2020

@joaquimg I added the binaries and the code to run the windows tests. It is having issues with the GitHub authentication in windows and after many tests still can't figure out what's needed for the Travis VM to authenticate properly. Will come back to this later

@joaquimg
Copy link
Member Author

whe I run:

using Xpress, MathOptInterface

MOI = MathOptInterface
MOIT = MathOptInterface.Test
Xpress.initialize()
OPTIMIZER = Xpress.Optimizer()
OPTIMIZER_2 = Xpress.Optimizer()
BRIDGED_OPTIMIZER = MOI.Bridges.full_bridge_optimizer( Xpress.Optimizer(), Float64)

BRIDGED_OPTIMIZER_2 = MOI.Bridges.full_bridge_optimizer(
    Xpress.Optimizer(), Float64)
MOIT.copytest(BRIDGED_OPTIMIZER, BRIDGED_OPTIMIZER_2)

I get

julia> MOIT.copytest(BRIDGED_OPTIMIZER, BRIDGED_OPTIMIZER_2)
Internal error: encountered unexpected error in runtime:
StackOverflowError()
forall_exists_subtype at /home/Administrator/buildbot/worker/package_win64/build/src\subtype.c:1113
subtype_ccheck at /home/Administrator/buildbot/worker/package_win64/build/src\subtype.c:472
var_gt at /home/Administrator/buildbot/worker/package_win64/build/src\subtype.c:556
exists_subtype at /home/Administrator/buildbot/worker/package_win64/build/src\subtype.c:1092 [inlined]
forall_exists_subtype at /home/Administrator/buildbot/worker/package_win64/build/src\subtype.c:1120
subtype_ccheck at /home/Administrator/buildbot/worker/package_win64/build/src\subtype.c:472
var_gt at /home/Administrator/buildbot/worker/package_win64/build/src\subtype.c:556
exists_subtype at /home/Administrator/buildbot/worker/package_win64/build/src\subtype.c:1092 [inlined]
forall_exists_subtype at /home/Administrator/buildbot/worker/package_win64/build/src\subtype.c:1120
subtype_ccheck at /home/Administrator/buildbot/worker/package_win64/build/src\subtype.c:472
var_gt at /home/Administrator/buildbot/worker/package_win64/build/src\subtype.c:556

And infinitely many other lines

@odow
Copy link
Member

odow commented Feb 13, 2020

Uh oh. That looks pretty bad and a bug in base Julia.

Gurobi only tests copying full-bridged -> Gurobi.Optimizer:
https://github.com/JuliaOpt/Gurobi.jl/blob/01dd1970985f2beda17ccbe3e1a3b832eeb1b12e/test/MOI_wrapper.jl#L114-L117

I'm at NREL all next week, so I should be able to help them push this PR over the line.

@joaquimg
Copy link
Member Author

Uh oh. That looks pretty bad and a bug in base Julia.

Gurobi only tests copying full-bridged -> Gurobi.Optimizer:
https://github.com/JuliaOpt/Gurobi.jl/blob/01dd1970985f2beda17ccbe3e1a3b832eeb1b12e/test/MOI_wrapper.jl#L114-L117

OPTIMIZER is a full bridge. So its actually full bridge to full bridge.

@joaquimg
Copy link
Member Author

Xpress works just fine in julia:
1.0.5
1.3.1
It is breaking in:
1.1.0
1.1.1

This reminds me of:
jump-dev/Dualization.jl#67 (comment)
which trigged:
jump-dev/MathOptInterface.jl#980

@odow
Copy link
Member

odow commented Feb 13, 2020

Oh. Then I have no idea.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants