Gurobi Optimization on HPC Systems
What is the Gurobi Optimization Software Package?
Gurobi is a software for optimization problems providing state-of-the-art solvers for mathematical programming. The solvers in the Gurobi Optimizer were designed from the ground up to exploit modern architectures and multi-core processors, using the most advanced implementations of the latest algorithms. It includes the following solvers:
- linear programming solver (LP)
- mixed-integer linear programming solver (MILP)
- mixed-integer quadratic programming solver (MIQP)
- quadratic programming solver (QP)
- quadratically constrained programming solver (QCP)
- mixed-integer quadratically constrained programming solver (MIQCP)
More information can be found on Gurobi's website.
Gurobi Optimizer supports the following interfaces for a variety of programming and modeling languages:
- Object-oriented interfaces for C++, Java, .NET and Python
- Matrix-oriented interfaces for C, MATLAB® and R
- Links to standard modeling languages: AIMMS, AMPL, GAMS and MPL
- Links to Excel through Premium Solver Platform and Risk Solver Platform
Software Producer & Vendor
Gurobi GmbH
Ulmenstrasse 37-39
60325 Frankfurt am Main
Germany
Phone: +49 69 667737484
General Information: info@gurobi.com
Support: Gurobi Support Portal
Sales: sales@gurobi.de
Licensing
Gurobi Optimizer is commercial software which requires a valid user license. Until further notice LRZ has been granted by Gurobi GmbH with a Free Academic Named-User Floating License of the Gurobi software. This essentially implies:
- The Gurobi Optimizer can be used on the LRZ Linux Cluster systems for purely academic purposes free of charge. Please refer to the conditions for the use of the Free Academic Licenses on Gurobis website.
- In particular Gurobi software under the condition of this Academic License can only be used for teaching or research that will be published in a public article.
- The license has been issued for named and specific LRZ User-ID's. The addition of new user-ID's to the granted Free Academic License requires to obtain a new license key from Gurobi GmbH on request. Users interested to be included in the list of eligible Gurobi software users on LRZ systems are asked to file a corresponding LRZ Service Request to the licencing administration team at LRZ.
- Due to the necessary correspondence with Gurobi support, the addition of a new User-ID to the LRZ license might require between several days and up to several working days depending on the timely reaction from the Gurobi support side.
Once a user has been added with his User-ID to the LRZ license for the Gurobi software, the user needs to add to his $HOME directory a file named "gurobi.lic" with the following contents, which points to the Gurobi license server at LRZ:
TOKENSERVER=license1.lrz.de PORT=41954
Actual Version
Since November 2024 the actual installed version of the Gurobi Optimizer software is version 12.0.0 (the previously installed versions of Gurobi 10.0.0 / 11.0.2 can still be used; corresponding modules are provided and the Gurobi license now serves all the available versions v10.0.0, v11.0.2 and v12.0.0).
This new version Gurobi 12.0.0 has been made the default version of the Gurobi software on the LRZ Linux Clusters under SLES15. With upcoming new versions of Gurobi older versions will be still supported and provided as separate modules in the module system.
Getting Started
LRZ users are adviced NOT to use Linux Cluster login nodes for any kind of Gurobi or Matlab/Gurobi simulations which have the potential to put some heavy processor load on these login node systems or which are potentially consuming large amounts of memory in order not to disturb other cluster users. For such purposes large memory nodes are provided e.g. in interactive or serial cluster queues. Furthermore it is not permitted to use multi-core cluster nodes for non-parallelized, i.e. serial, computations, thereby wasting the potential of N-1 cores of the corresponding cluster node and steeling urgently needed parallel resources from other users. In cases where LRZ cluster administrators encounter such permitted usage of LRZ cluster resources might lead to the ban of correspondig users from any further usage of LRZ resources and to disabled LRZ user account of the corresponding user.
Gurobi software is available in the default module system of CoolMUC-3/-4 Linux clusters. Available Gurobi software modules can be looked up by typing the command:
> module avail gurobi
Load the prefered Gurobi version environment module, e.g.:
> module load gurobi/12.00
Verification of Gurobi Optimizer Functionality
Once you have been registered with your LRZ User-ID for the Gurobi Optimizer Free Academic Floating License you can as a LRZ Linux Cluster User simply verify the functionality of the Gurobi Optimizer software and license access for you by carrying out the following steps:
ssh lxlogin5.lrz.de # # --> following commands are executed on the CoolMUC-4 login node lxlogin5.lrz.de: # $HOME> module load gurobi $HOME> mkdir ~/gurobi_temp $HOME> cd ~/gurobi_temp ~/gurobi_temp> cp $GUROBI_HOME/examples/data/coins.lp . ~/gurobi_temp> gurobi_cl ResultFile=coins.sol Threads=10 ./coins.lp
In the result of the execution of the previous commands you should end up with a file gurobi.log in the subdirectory ~/gurobi_temp in your $HOME directory, showing the successful execution of the Gurobi command line interface for this simple optimization example.
The content of this gurobi.log file should look like this:
Running Gurobi Optimizer in Parallel on Linux Clusters
The Gurobi Optimizer command line interface supports the usage of multiple threads for large parallel optimization runs. For the above small coins.lp example a submission to the CoolMUC-4 (serial_std) cluster with 10 threads would look like the following.
First one needs to write a corresponding SLURM submission shell script, containing the call to Gurobi (e.g. with the filename: gurobi_cm4_serial_slurm.sh):
Assumed that this SLURM script is stored together with the input data in the file coins.lp in the users $HOME subdirectory ~/Gurobi_Slurm_Test, the SLURM job can be submitted on CoolMUC-4 (serial queue) as follows:
ssh lxlogin5.lrz.de # # --> following commands are executed on the CoolMUC-4 login node lxlogin5.lrz.de: # > cd ~/Gurobi_Slurm_Test > sbatch gurobi_cm4_serial_slurm.sh
After the execution of the Slurm job on CoolMUC-4 please check the output in the gurobi.log and the generated job output file. Watch for the statement "Non-default parameters: Threads 10".
User Support
In case of any observed issues in the usage of the Gurobi software on LRZ managed compute resources or any arising questions, please feel free to contact the LRZ support. Please submit your LRZ Service Request with a clear specification of the encountered issue with the Gurobi software, e.g. by indicating in the request subject "Gurobi Optimizer problem: ....". This will help the LRZ operators to assign your support request to the most appropriate LRZ staff to assist you.