Adding CPLEX callbacks with JuMP v0.19

Dear community,
I use CPLEX 12.8 and made an update from JuMP v18.5 to v0.19. Due to major changes in the new version I have to adapt my code, and I do not succeed to add callbacks. The release notes say that callbacks are now solver-specific, however, I cannot find something about that in the documentation of CPLEX.jl nor the documentation of MathOptInterface.

Previously I could add a callback, for instance, with

function infocallback( cb )
  println("Hello, info callback")
end

addinfocallback( model, infocallback, when = :Intermediate )

However, this does not work anymore. Do you have any suggestions?
Thank you in advance

I have not used them myself, but there is a lot of discussion in this current PR: https://github.com/JuliaOpt/CPLEX.jl/pull/207

@leethargo is right. However, we have not committed that PR yet, and we still lack the connection for callbacks between CPLEX.jl and JuMP.jl. There are some discussions about whether callbacks should be solver specific or not. I am not aware of the conclusion.

So that means that callbacks are currently not working at all with JuMP v0.19?

Actually I am not sure. I think it works with Gurobi but I haven’t tried. For CPLEX the implementation should be similar. @odow would be a better person to answer your question. He usually replies quickly so let’s wait for his reply:)

I suggest to continue using JuMP 0.18 until the callbacks you need are available and documented. Making this happen is a high priority issue.

@g001234 : thank you, hopefully @odow will do :slight_smile:

@miles.lubin: Probably you are right, however, I wanted to avoid this option since I already did many changes in my code.

There is unlikely to be any movement on this until after JuMP-dev. We’ll be discussing ways forward on the Thursday afternoon.

1 Like