Gurobi Optimizer

Gurobi Optimizer is a prescriptive analytics platform - it’s a mathematical programming solver used for linear programming, quadratic programming, and mixed integer programming problems.

Availability

Gurobi (gurobi_optimizer) and its python interface (gurobi_python) are available on Delta and the Illinois Campus Cluster (ICC) as apptainer image files (.sif) that were converted from Gurobi’s Docker Hub images.

Version

Delta

ICC

9.5.2

X

X

10.0.1

X

X

12.0.0

X

X

12.0.3

X

X

A free academic license is available for all users of ICC as well as Delta and other .ncsa.illinois.edu systems. The license file, gurobi.lic, needs to contain the following to access the license server:

TOKENSERVER=ici-license-svr1.ncsa.illinois.edu
SERVERTIMEOUT=30
PORT=41954

Note: the license supports Gurobi through version 12.x.x.

If you need a different version from those that are currently on the system, you may obtain it by running a command to pull it from Docker Hub:

apptainer pull gurobi_optimizer_<version>.sif docker://gurobi/optimizer:<version>

Or for Gurobi python:

apptainer pull gurobi_python_<version>.sif docker://gurobi/python:<version>

Where <version> is one of the tags listed on the respective Docker Hub page (see the References section below).

Using Gurobi

Delta and ICC have a module file for convenience. Loading it will set the GRB_LICENSE_FILE environement variable to the location of a copy of the license file, gurobi.lic, that already exists on the sytem.

module load gurobi

Delta

On Delta, the available Gurobi container files (as well as a license file and python example) are located in this directory:

/sw/external/containers_other/gurobi

Here’s an example of using Gurobi python 12.0.0. GRB_LICENSE_FILE must point to the license file before running this, so run module load gurobi first.

apptainer run --bind /sw/external/containers_other/gurobi:/gurobi /sw/external/containers_other/gurobi/gurobi_python_12.0.0.sif python3 /gurobi/gurobi_example.py
  • The bind path maps /sw/external/containers_other/gurobi to /gurobi so that Gurobi can find the license file at /gurobi/gurobi.lic and the example script at /gurobi/gurobi_example.py

  • /sw/external/containers_other/gurobi/gurobi_python_12.0.0.sif is the apptainer image file containing Gurobi (several choices are available)

  • python3 is the command to run the installation of python that’s inside the container

  • /gurobi/gurobi_example.py is the path to the Gurobi python script that you want to run (a provided example in this case)

ICC

On ICC, the available Gurobi container files (as well as a license file and python example) are located in this directory:

/sw/apps/gurobi

Here’s an example of using Gurobi python 12.0.0. GRB_LICENSE_FILE must point to the license file before running this, so run module load gurobi first.

apptainer run --bind /sw/apps/gurobi:/gurobi /sw/apps/gurobi/gurobi_python_12.0.0.sif python3 /gurobi/gurobi_example.py
  • The bind path maps /sw/apps/gurobi to /gurobi so that Gurobi can find the license file at /gurobi/gurobi.lic and the example script at /gurobi/gurobi_example.py

  • /sw/apps/gurobi/gurobi_python_12.0.0.sif is the apptainer image file containing Gurobi (several choices are available)

  • python3 is the command to run the installation of python that’s inside the container

  • /gurobi/gurobi_example.py is the path to the Gurobi python script that you want to run (a provided example in this case)

References