GUROBI¶
How to get¶
To download gurobi you have to register at https://www.gurobi.com/academia/academic-program-and-licenses/
then you can download and activate your key.
On the CIRRELT/GERAD Linux computers, gurobi is already installed and you can acces it by loading the gurobi
module.
module load gurobi
Installation¶
for some languages like python and julia, evn if gurobi is installed you have to install the package specific to the language.
gurobipy is available on pypy so it can be installed with pip.
Compilation¶
C++¶
When you compile your C++ program with gurobi, you need to specify which g++ library to use. This varies depending on the version of the compiler that you use. you can check the version with this command:
g++ --version
-
g++ < 7 use: -lgurobi_g++4.8
-
g++ >= 7 use: -lgurobi_g++5.2
If you're not using the default version of gurobi, you might need to adjust the library versions.
Number of threads¶
By default, gurobi will use all the core of a machine when you optimise. Since computers are shared, limit the number of cores for your application. Also, the more threads you use, the more memory it will use.
Check used gurobi licenses¶
gurobi_cl --tokens
Manage gurobi environment¶
When solving many models sequentially, it may be better to use a single Gurobi environment to avoid paying the overhead cost multiple times. To use multiple models in sequence within an environment folloow the instructions on the following link https://support.gurobi.com/hc/en-us/articles/4424054948881-How-do-I-manage-Gurobi-environments-in-gurobipy