The gurobi python api allows the user to release a floating license (shared, limited-use) by using the commands "Model.dispose()" and "disposeDefaultEnv()". However, when modeling in pyomo, could anyone please inform me how to release the gurobi floating license after the optimization model is solved? Thanks a lot!
I tried to read pyomo document, but cannot find similar commands like "Model.dispose()" and "disposeDefaultEnv()" provided by gurobi python api.
This recent PR in Pyomo added a method to explicitly release the Gurobi license if you're using the APPSI persistent interface. You'll need Pyomo 6.4.2 or later to try it. I think the syntax is something like:
from pyomo.contrib import appsi
# Build Pyomo model (not shown)
opt = appsi.solvers.Gurobi()
res = opt.solve(model)
opt.release_license()