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

Add support for Gurobi 9.1.0 #365

Merged
merged 3 commits into from
Nov 3, 2020
Merged

Add support for Gurobi 9.1.0 #365

merged 3 commits into from
Nov 3, 2020

Conversation

odow
Copy link
Member

@odow odow commented Nov 2, 2020

There were quite a few changes, so I decided it was easiest just to have two separate folders with the full API of each version.

Presumably, if there is a version that changes the API of functions used in the MOI wrapper, that is a good point to drop support for older versions, delete their C wrapper, and bump the minor version of Gurobi.jl.

diff --git a/src/gen/libgrb_api.jl b/src/gen/libgrb_api.jl
index 6990d64..0b4afe8 100644
--- a/src/gen/libgrb_api.jl
+++ b/src/gen/libgrb_api.jl
@@ -662,6 +662,10 @@ function GRBgetstrparam(env, paramname, valueP)
     ccall((:GRBgetstrparam, libgurobi), Cint, (Ptr{GRBenv}, Ptr{Cchar}, Ptr{Cchar}), env, paramname, valueP)
 end
 
+function GRBgetlongstrparam(env, paramname, valueP, size, requiredlenP)
+    ccall((:GRBgetlongstrparam, libgurobi), Cint, (Ptr{GRBenv}, Ptr{Cchar}, Ptr{Cchar}, Cint, Ptr{Cint}), env, paramname, valueP, size, requiredlenP)
+end
+
 function GRBgetintparaminfo(env, paramname, valueP, minP, maxP, defP)
     ccall((:GRBgetintparaminfo, libgurobi), Cint, (Ptr{GRBenv}, Ptr{Cchar}, Ptr{Cint}, Ptr{Cint}, Ptr{Cint}, Ptr{Cint}), env, paramname, valueP, minP, maxP, defP)
 end
@@ -782,6 +786,14 @@ function GRBdiscardmultiobjenvs(model)
     ccall((:GRBdiscardmultiobjenvs, libgurobi), Cvoid, (Ptr{GRBmodel},), model)
 end
 
+function GRBgettuneenv(model, num)
+    ccall((:GRBgettuneenv, libgurobi), Ptr{GRBenv}, (Ptr{GRBmodel}, Cint), model, num)
+end
+
+function GRBdiscardtuneenvs(model)
+    ccall((:GRBdiscardtuneenvs, libgurobi), Cvoid, (Ptr{GRBmodel},), model)
+end
+
 function GRBreleaselicense(env)
     ccall((:GRBreleaselicense, libgurobi), Cvoid, (Ptr{GRBenv},), env)
 end
@@ -798,6 +810,10 @@ function GRBgetmerrormsg(model)
     ccall((:GRBgetmerrormsg, libgurobi), Ptr{Cchar}, (Ptr{GRBmodel},), model)
 end
 
+function GRBgetcommstats(env, recvtimeP, recvbytesP, recvmsgsP, sendtimeP, sendbytesP, sendmsgsP)
+    ccall((:GRBgetcommstats, libgurobi), Cvoid, (Ptr{GRBenv}, Ptr{Cdouble}, Ptr{Cdouble}, Ptr{Cdouble}, Ptr{Cdouble}, Ptr{Cdouble}, Ptr{Cdouble}), env, recvtimeP, recvbytesP, recvmsgsP, sendtimeP, sendbytesP, sendmsgsP)
+end
+
 function GRBversion(majorP, minorP, technicalP)
     ccall((:GRBversion, libgurobi), Cvoid, (Ptr{Cint}, Ptr{Cint}, Ptr{Cint}), majorP, minorP, technicalP)
 end
@@ -810,12 +826,16 @@ function GRBlisttokens()
     ccall((:GRBlisttokens, libgurobi), Cint, ())
 end
 
+function GRBprinttuneparams()
+    ccall((:GRBprinttuneparams, libgurobi), Cvoid, ())
+end
+
 function GRBtunemodel(model)
     ccall((:GRBtunemodel, libgurobi), Cint, (Ptr{GRBmodel},), model)
 end
 
-function GRBtunemodels(nummodels, models, ignore, hint)
-    ccall((:GRBtunemodels, libgurobi), Cint, (Cint, Ptr{Ptr{GRBmodel}}, Ptr{GRBmodel}, Ptr{GRBmodel}), nummodels, models, ignore, hint)
+function GRBtunemodels(nummodels, models, ignore)
+    ccall((:GRBtunemodels, libgurobi), Cint, (Cint, Ptr{Ptr{GRBmodel}}, Ptr{GRBmodel}), nummodels, models, ignore)
 end
 
 function GRBgettuneresult(model, i)
@@ -826,8 +846,8 @@ function GRBgettunelog(model, i, logP)
     ccall((:GRBgettunelog, libgurobi), Cint, (Ptr{GRBmodel}, Cint, Ptr{Ptr{Cchar}}), model, i, logP)
 end
 
-function GRBtunemodeladv(model, ignore, hint)
-    ccall((:GRBtunemodeladv, libgurobi), Cint, (Ptr{GRBmodel}, Ptr{GRBmodel}, Ptr{GRBmodel}), model, ignore, hint)
+function GRBtunemodeladv(model, ignore)
+    ccall((:GRBtunemodeladv, libgurobi), Cint, (Ptr{GRBmodel}, Ptr{GRBmodel}), model, ignore)
 end
 
 function GRBsortIDi(len, ind, val)
@@ -905,3 +925,7 @@ end
 function GRBpingserver(server, password)
     ccall((:GRBpingserver, libgurobi), Cint, (Ptr{Cchar}, Ptr{Cchar}), server, password)
 end
+
+function GRBprefetchattr(model, attrname)
+    ccall((:GRBprefetchattr, libgurobi), Cint, (Ptr{GRBmodel}, Ptr{Cchar}), model, attrname)
+end
diff --git a/src/gen/libgrb_common.jl b/src/gen/libgrb_common.jl
index 847e771..b360e54 100644
--- a/src/gen/libgrb_common.jl
+++ b/src/gen/libgrb_common.jl
@@ -2,8 +2,8 @@
 
 
 const GRB_VERSION_MAJOR = 9
-const GRB_VERSION_MINOR = 0
-const GRB_VERSION_TECHNICAL = 1
+const GRB_VERSION_MINOR = 1
+const GRB_VERSION_TECHNICAL = 0
 const DEFAULT_CS_PRIORITY = 0
 const MAX_CS_PRIORITY = 100
 const DEFAULT_CS_PORT = 61000
@@ -85,6 +85,7 @@ const GRB_STR_ATTR_SERVER = "Server"
 const GRB_STR_ATTR_JOBID = "JobID"
 const GRB_INT_ATTR_LICENSE_EXPIRATION = "LicenseExpiration"
 const GRB_INT_ATTR_NUMTAGGED = "NumTagged"
+const GRB_INT_ATTR_FINGERPRINT = "Fingerprint"
 const GRB_INT_ATTR_BATCHERRORCODE = "BatchErrorCode"
 const GRB_STR_ATTR_BATCHERRORMESSAGE = "BatchErrorMessage"
 const GRB_STR_ATTR_BATCHID = "BatchID"
@@ -379,12 +380,14 @@ const GRB_DBL_PAR_HEURISTICS = "Heuristics"
 const GRB_DBL_PAR_IMPROVESTARTGAP = "ImproveStartGap"
 const GRB_DBL_PAR_IMPROVESTARTTIME = "ImproveStartTime"
 const GRB_DBL_PAR_IMPROVESTARTNODES = "ImproveStartNodes"
+const GRB_INT_PAR_INTEGRALITYFOCUS = "IntegralityFocus"
 const GRB_INT_PAR_MINRELNODES = "MinRelNodes"
 const GRB_INT_PAR_MIPFOCUS = "MIPFocus"
 const GRB_STR_PAR_NODEFILEDIR = "NodefileDir"
 const GRB_DBL_PAR_NODEFILESTART = "NodefileStart"
 const GRB_INT_PAR_NODEMETHOD = "NodeMethod"
-const GRB_INT_PAR_NORELHEURISTIC = "NoRelHeuristic"
+const GRB_DBL_PAR_NORELHEURTIME = "NoRelHeurTime"
+const GRB_DBL_PAR_NORELHEURWORK = "NoRelHeurWork"
 const GRB_INT_PAR_PUMPPASSES = "PumpPasses"
 const GRB_INT_PAR_RINS = "RINS"
 const GRB_STR_PAR_SOLFILES = "SolFiles"
@@ -413,6 +416,7 @@ const GRB_INT_PAR_INFPROOFCUTS = "InfProofCuts"
 const GRB_INT_PAR_RLTCUTS = "RLTCuts"
 const GRB_INT_PAR_RELAXLIFTCUTS = "RelaxLiftCuts"
 const GRB_INT_PAR_BQPCUTS = "BQPCuts"
+const GRB_INT_PAR_PSDCUTS = "PSDCuts"
 const GRB_INT_PAR_CUTAGGPASSES = "CutAggPasses"
 const GRB_INT_PAR_CUTPASSES = "CutPasses"
 const GRB_INT_PAR_GOMORYPASSES = "GomoryPasses"
@@ -480,6 +484,7 @@ const GRB_INT_PAR_TUNECRITERION = "TuneCriterion"
 const GRB_INT_PAR_TUNETRIALS = "TuneTrials"
 const GRB_INT_PAR_TUNEOUTPUT = "TuneOutput"
 const GRB_INT_PAR_TUNEJOBS = "TuneJobs"
+const GRB_DBL_PAR_TUNECLEANUP = "TuneCleanup"
 const GRB_INT_PAR_UPDATEMODE = "UpdateMode"
 const GRB_INT_PAR_OBJNUMBER = "ObjNumber"
 const GRB_INT_PAR_MULTIOBJMETHOD = "MultiObjMethod"
@@ -487,6 +492,7 @@ const GRB_INT_PAR_MULTIOBJPRE = "MultiObjPre"
 const GRB_INT_PAR_SCENARIONUMBER = "ScenarioNumber"
 const GRB_INT_PAR_POOLSOLUTIONS = "PoolSolutions"
 const GRB_DBL_PAR_POOLGAP = "PoolGap"
+const GRB_DBL_PAR_POOLGAPABS = "PoolGapAbs"
 const GRB_INT_PAR_POOLSEARCHMODE = "PoolSearchMode"
 const GRB_INT_PAR_IGNORENAMES = "IgnoreNames"
 const GRB_INT_PAR_STARTNUMBER = "StartNumber"

image

Closes #364

README.md Outdated Show resolved Hide resolved
@odow odow merged commit b6766a5 into master Nov 3, 2020
@odow odow deleted the od/91 branch November 3, 2020 18:34
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.

2 participants