Gurobi: Difference between revisions

From Alliance Doc
Jump to navigation Jump to search
mNo edit summary
mNo edit summary
Line 24: Line 24:
  [gra-login2:~] salloc --time=1:00:0 --cpus-per-task=8 --mem=1G --account=def-xyz
  [gra-login2:~] salloc --time=1:00:0 --cpus-per-task=8 --mem=1G --account=def-xyz
  [gra800:~] module load gurobi
  [gra800:~] module load gurobi
  [gra800:~] echo "Record 1" > gurobi.env
  [gra800:~] echo "Record 1" > gurobi.env   see *
  [gra800:~] gurobi.sh
  [gra800:~] gurobi.sh
  gurobi> m = read('/cvmfs/restricted.computecanada.ca/easybuild/software/2017/Core/gurobi/8.1.1/examples/data/p0033.mps')  
  gurobi> m = read('/cvmfs/restricted.computecanada.ca/easybuild/software/2017/Core/gurobi/8.1.1/examples/data/glass4.mps')  
  gurobi> m.Params.Threads = 8
  gurobi> m.Params.Threads = 8               see **
  gurobi> m.Params.Method = 2
  gurobi> m.Params.Method = 2
  gurobi> m.Params.ResultFile = "p0033.sol"
  gurobi> m.Params.ResultFile = "glass4.sol"
  gurobi> m.Params.LogFile = "p0033.log"
  gurobi> m.Params.LogFile = "glass4.log"
  gurobi> m.optimize()
  gurobi> m.optimize()
gurobi> m.write('glass4.lp')
gurobi> m.status                          see ***
gurobi> m.runtime                          see ****
  gurobi> help()
  gurobi> help()
where
    * https://www.gurobi.com/documentation/8.1/refman/recording_api_calls.html
  ** https://www.gurobi.com/documentation/8.1/refman/parameter_descriptions.html
  *** https://www.gurobi.com/documentation/8.1/refman/optimization_status_codes.html
**** https://www.gurobi.com/documentation/8.1/refman/attributes.html


==Replay API Call Recordings== <!--T:7-->
==Replay API Call Recordings== <!--T:7-->
   
   
  [gra800:~] gurobi_cl recording000.grbr
  [gra800:~] gurobi_cl recording000.grbr

Revision as of 02:35, 30 November 2019

Other languages:

Gurobi is a commercial software suite for solving complex optimization problems. This page wiki page describes the non-commercial use of Gurobi software on Compute Canada clusters and is currently a work in progress.

License limitations

Compute Canada supports and provides a free license to use Gurobi Graham, Cedar, Beluga and Niagara clusters. The license provides a total number of 4096 simultaneous uses (tokens in use) and permits distributed usage. A single user can run multiple simultaneous jobs. In order to use Gurobi you must agree to certain conditions. Please contact support with a copy of the following statement. You will then be added into the Compute Canada license file as a permitted user.

My Compute Canada username is "_______" and I am a member of the academic institution "_____________________".  This message confirms that I will only use the Compute Canada Gurobi license provided on Compute Canada systems for the purpose of non-commercial research project(s) to be published in a publicly available article(s).

Gurobi Command-Line Tools

[gra-login2:~] salloc --time=1:00:0 --cpus-per-task=8 --mem=1G --account=def-xyz
[gra800:~] module load gurobi
[gra800:~] gurobi_cl Record=1 Threads=8 Method=2 ResultFile=p0033.sol LogFile=p0033.log $GUROBI_HOME/examples/data/p0033.mps
[gra800:~] gurobi_cl --help

Gurobi Interactive Shell

[gra-login2:~] salloc --time=1:00:0 --cpus-per-task=8 --mem=1G --account=def-xyz
[gra800:~] module load gurobi
[gra800:~] echo "Record 1" > gurobi.env    see *
[gra800:~] gurobi.sh
gurobi> m = read('/cvmfs/restricted.computecanada.ca/easybuild/software/2017/Core/gurobi/8.1.1/examples/data/glass4.mps') 
gurobi> m.Params.Threads = 8               see **
gurobi> m.Params.Method = 2
gurobi> m.Params.ResultFile = "glass4.sol"
gurobi> m.Params.LogFile = "glass4.log"
gurobi> m.optimize()
gurobi> m.write('glass4.lp')
gurobi> m.status                           see ***
gurobi> m.runtime                          see ****
gurobi> help()

where

   * https://www.gurobi.com/documentation/8.1/refman/recording_api_calls.html
  ** https://www.gurobi.com/documentation/8.1/refman/parameter_descriptions.html
 *** https://www.gurobi.com/documentation/8.1/refman/optimization_status_codes.html
**** https://www.gurobi.com/documentation/8.1/refman/attributes.html

Replay API Call Recordings

[gra800:~] gurobi_cl recording000.grbr