Writing the nodelog to a text file

56 views
Skip to first unread message

varu...@gmail.com

unread,
Oct 23, 2016, 4:09:43 PM10/23/16
to julia-opt
Hello All,

I am solving a MILP using JuMP and CPLEX as the underlying solver. I would like to write the solution separately on a .sol file as well as the nodelog during the MILP optimisation onto a .log file. The .sol file could be written by calling getvalue(vars) and then writing them onto the file. But, I am not able to write the nodelog onto the .log file. I earlier used Python for modelling a MILP and I didn't have to call out any functions to write the log file. I want to write the nodelog onto a file using JuMP too and I kindly ask you for your help in this issue.

Thanks in advance

Joaquim Masset Lacombe Dias Garcia

unread,
Oct 25, 2016, 8:43:53 PM10/25/16
to julia-opt
You might need to set a parameter in CPLEX, create some informational callback or wrap some CPLEX function.
Probably you python interface sets some parameter by default or had some default info callback...

varu...@gmail.com

unread,
Oct 26, 2016, 1:19:12 AM10/26/16
to julia-opt
The CPLEX Parameter setting is as follows (in Python)

CPLEX Parameter File Version 12.5.0.0
CPX_PARAM_TILIM 3600
CPX_PARAM_EPGAP 0.01
CPX_PARAM_TRELIM 20000.00
CPX_PARAM_EACHCUTLIM 2100000000
CPX_PARAM_FLOWCOVERS 0
CPX_PARAM_FLOWPATHS 0
CPX_PARAM_CLIQUES 0
CPX_PARAM_DISJCUTS 0
CPX_PARAM_COVERS 0
CPX_PARAM_ZEROHALFCUTS 0
CPX_PARAM_MIRCUTS 0
CPX_PARAM_MCFCUTS 0
CPX_PARAM_IMPLBD 0
CPX_PARAM_GUBCOVERS 0
CPX_PARAM_AGGCUTLIM 3   

But nothing happens if I set the parameters in JuMP the same way.

varu...@gmail.com

unread,
Oct 26, 2016, 5:44:35 AM10/26/16
to julia-opt
I found an open issue on Github related to the problem I have https://github.com/JuliaOpt/CPLEX.jl/issues/42
I tried the first part of the suggestion (Joey's) before calling the solver

JuMP.build(m)
intm = internalmodel(m).inner
CPLEX.set_logfile(intm.env, "myoutput.txt")

but I get an error saying MethodError: no method matching unsafe_convert(::Type{Ptr}{Void}}, ::CPLEX,Env)

Joaquim Masset Lacombe Dias Garcia

unread,
Oct 31, 2016, 1:36:09 PM10/31/16
to julia-opt
Could you post the complete error message?

And you might try doing Pkg.update() (and  if it does not work do Pkg.checkout("CPLEX") ), just to be sure it wasn't already fixed...

Sorry I can't give much help (I don't have CPLEX currently).

Reply all
Reply to author
Forward
0 new messages