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
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:
Since November 2022 the actual installed version of the Gurobi Optimizer software is version 10.0.0 (the previously installed versions of Gurobi 8.1.1 / 9.0.1 / 9.1.1 can still be used; corresponding modules are provided and the Gurobi license now serves all the available versions v8.1.1, v9.0.1, v9.1.1 and v10.0.0).
This new version Gurobi 10.0.0 has been made the default version of the Gurobi software on the LRZ Linux Cluster. With upcoming new versions of Gurobi older versions will be still supported and provided as separate modules in the module system.
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-2/3 Linux clusters. Available Gurobi software modules can be looked up by typing the command:
Load the prefered Gurobi version environment module, e.g.:
If you intend to use the Matlab interface in combination with the Gurobi optimizer you may want to load the following combination of moduls:
In this case of combining Gurobi Optimizer with Matlab the path to the Gurobi installation needs to be declared for the Matlab script. This can be realized by either of two possibilities:
- Opening Matlab on the login node in GUI mode. Including the path to the Matlab subdirectory within the Gurobi installation via "HOME → Set Path" and specifying "Add Folder" with the path "/lrz/sys/applications/gurobi/gurobi911/linux64/matlab". In this case a user defined file "pathdef.m" will be added by Matlab to your working directory.
Adding the path specification directly to your used Matlab script by adding:
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:
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-3 cluster with 64 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_mpp3_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-3 (mpp3) as follows:
After the execution of the Slurm job on CoolMUC-3 please check the output in the gurobi.log and the generated job output file. Watch for the statement "Set parameter Threads to value 64".
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.