Try our new documentation site (beta).
Filter Content By
Version
Text Search
${sidebar_list_label} - Back
Filter by Language
Recording API Calls
The Gurobi Optimizer provides the option to record the set of Gurobi commands issued by your program and store them to a file. The commands can be played back later using the Gurobi Command-Line Tool. If you replay the commands on a machine with the same specs (operating system, core count, and instruction set) as the machine where you created the recording, your Gurobi calls will take the exact same computational paths that they took when you ran your original program.
Recording can be useful in a number of situations.
- If you want to understand how much time is being spent in Gurobi routines, the replay will show you the total time spent in Gurobi API routines, and the total time spent in Gurobi algorithms.
- If you want to check for leaks of Gurobi data, the replay will show you how many Gurobi models and environments were never freed by your program.
- If you run into a question or an issue and you would like to get help from Gurobi, your recording will allow Gurobi technical support to reproduce the exact results that you are seeing without requiring you to send your entire application.
Recording is useful for testing across deployment scenarios. In particular, you can do the following:
- A recording made on a Compute Server can be replayed on a
Compute Server or locally. By default, the recording will use
localhost:61000
; this can be overridden by setting theGRB_COMPUTESERVER
environment variable. IfGRB_COMPUTESERVER
is set to an empty string, the replay will occur locally. - A Cluster Manager recording can be replayed via a Cluster
Manager, on a Compute Server, or locally.
GRB_COMPUTESERVER
has priority overGRB_CSMANAGER
. IfGRB_CSMANAGER
is set to "", the replay will run locally or on the specified Compute Server. - A Gurobi Instant Cloud recording can be replayed on the cloud,
on a Compute Server, or locally. Setting
GRB_CLOUDACCESSID
andGRB_CLOUDSECRETKEY
will run the replay on the cloud.GRB_COMPUTESERVER
has priority overGRB_CLOUDACCESSID
(andGRB_CLOUDSECRETKEY
). IfGRB_CLOUDACCESSID
is set to "", the replay will run locally or on the specified Compute Server. - A token server recording can be replayed. The recording tries
to use a token server at
localhost
(with the default port 41954). This can be overridden by setting theGRB_TOKENSERVER
environment variable. IfGRB_TOKENSERVER
is set to an empty string, the replay will be done using a local license. - A recording that includes the
WorkerPool
parameter (used in the distributed MIP and distributed concurrent algorithms) can only be done by setting theGRB_WORKERPOOL
environment variable.
Subsections