Difference between revisions of "Gurobi 2016"
Line 31: | Line 31: | ||
Since there many people working with the HPC cluster, its important that everyone has an equal chance to do so. Therefore, every job should be processed by [[SLURM Job Management (Queueing) System|SLURM]]. A job script could look like this: | Since there many people working with the HPC cluster, its important that everyone has an equal chance to do so. Therefore, every job should be processed by [[SLURM Job Management (Queueing) System|SLURM]]. A job script could look like this: | ||
<pre> | <pre> | ||
#!/bin/bash | #!/bin/bash | ||
Revision as of 15:58, 7 February 2017
Introduction
Gurobi Optimizer has been designed to be a fast and powerful solver for your LP, QP, QCP, and MIP problems. More information can be found on the Gurobi webpage. Read the Quickstart Guide for examples on how to use gurobi.
Please note that Gurobi Optimizer is commercial software. The academic license available at the University Oldenburg can only be used for research and teaching puporses. If you have used Gurobi in your research you can acknowledge this by citing
@misc{gurobi, author = "Gurobi Optimization, Inc.", title = "Gurobi Optimizer Reference Manual", year = 2015, url = "http://www.gurobi.com" }
Installed Version
The currently installed Version is 7.0.2.
Using Gurobi
In order to use Gurobi Optimizer you need to load the module with the command
module load gurobi/7.0.2
This sets up the environment to run e.g. the command-line tool. To get some help type
gurobi_cl --help
The general format for the command-line tool is
gurobi_cl [--command]* [param=value]* filename
where filename contains a model for optimization. Using one of the examples described in the Quickstart Guide, a working command could look like this:
gurobi_cl Threads=1 $GUROBI_HOME/examples/data/coins.lp
Here, $GUROBI_HOME is set in the environment, coins.lp is an example model. The option Threads=1 set the parameter Threads to 1. This is an important option when you run Gurobi on the cluster: if not used Gurobi may use all available cores on a compute node which could interfere with other jobs (and therefore should be avoided!). The command above rund very quickly and produces a few lines of output. In addition, a file gurobi.log is created (or appended to if it already exists).
Using Gurobi with the HPC Cluster
Since there many people working with the HPC cluster, its important that everyone has an equal chance to do so. Therefore, every job should be processed by SLURM. A job script could look like this:
#!/bin/bash #SBATCH --ntasks=1 #SBATCH --mem=2G #SBATCH --time=0-2:00 #SBATCH --job-name GUROBI-TEST #SBATCH --output=gurobi-test.%j.out #SBATCH --error=gurobi-test.%j.err module load Gurobi/7.0.2 gurobi_cl Threads=1 $GUROBI_HOME/examples/data/coins.lp
Using Gurobi on your local work station
If you want to use Gurobi Optimizer on your own computer (within the University network) you can do so. Follow the instructions in Quickstart Guide to install Gurobi 7.0.2 (you need to create an account to download the software). Instead of retrieving your own named license you can install a license file named gurobi.lic in the location as described in guide. The license file must contain the following two lines:
TOKENSERVER=gurobi.license.uni-oldenburg.de PORT=27001