Gurobi Optimizer
The Gurobi Optimizer is a commercial mathematical program solver for LP, QP and MIP problems[1]. The HPC hosts an instance of the Gurobi Optimizer with a floating academic license for 4,096 concurrent users.
Gurobi Module
The Gurobi Optimizer is not compiler specific. It can be loaded under any branch as:
module load gurobi
You can test the loaded module and view how many licenses are available using the Gurobi command line:
gurobi_cl --tokens
This should output something similar to the following:
Checking status of Gurobi token server 'smaster'...
Token server functioning normally.
Maximum allowed uses: 4096, current: 0
Python Integration
Gurobi provides a python integration package called gurobipy which has been installed system wide for python/3.7.0. To install a 'user module' for another version of Python, see Installing Local Python Modules
Example programs that utilize qurobipy directly are available under /usr/local/gurobi/9.0.3/examples/python
In addition, the convex optimization package CVXPY integrates with Gurobi by specifying Gurobi as the solver. A simple example:
import cvxpy as cp
# Create two scalar optimization variables.
x = cp.Variable()
y = cp.Variable()
# Create two constraints.
constraints = [x + y == 1,
x - y >= 1]
# Form objective.
obj = cp.Minimize((x - y)**2)
# Form and solve problem.
prob = cp.Problem(obj, constraints)
prob.solve(solver=cp.GUROBI)
print("status:", prob.status)
print("optimal value", prob.value)
print("optimal var", x.value, y.value)