Try our new documentation site (beta).

Creating Batches

Once you are logged in to a Cluster Manager, you can use grbcluster to create a batch. This will submit a non-interactive job. The typical process involves the following three steps:

  • Create the batch and submit the non-interactive job. In this step, we indicate what model file we want to solve, and what result file we need. With this information, grbcluster will declare the batch, upload the input model file, and submit the solve request as a batch job. At this point, you can disconnect your client machine from the network (i.e., close your laptop). The request will be processed automatically.

    > grbcluster batch solve glass4.mps ResultFile=solution.sol
    info  : Batch ada0a345-aa9e-4d6b-a7f0-05caf345d4e2 created
    info  : Uploading glass4.mps...
    info  : Batch ada0a345-aa9e-4d6b-a7f0-05caf345d4e2 submitted with job 66d4783b...
    

  • Monitoring. While the batch job is being executed, you can monitor the status if you wish. You can reference the batch you submitted using its batch ID.

    > grbcluster batch status 2e05810c-911f-47ee-b695-27e1244fefd0 --wait
    info  : Batch 2e05810c-911f-47ee-b695-27e1244fefd0 status is SUBMITTED
    info  : Batch 2e05810c-911f-47ee-b695-27e1244fefd0 status is SUBMITTED
    info  : Batch 2e05810c-911f-47ee-b695-27e1244fefd0 status is SUBMITTED
    info  : Batch 2e05810c-911f-47ee-b695-27e1244fefd0 status is SUBMITTED
    info  : Batch 2e05810c-911f-47ee-b695-27e1244fefd0 status is COMPLETED
    

  • Download the results. Once a batch is complete, you can download the log file and any optimization result. By default, results are stores in a directory having the same name as the batch ID. You should also delete the batch so that the Cluster Manager can delete the associated data from the database.

    grbcluster batch download 2e05810c-911f-47ee-b695-27e1244fefd0
    info  : Results will be stored in directory 2e05810c-911f-47ee-b695-27e1244fefd0
    info  : Downloading solution.sol...
    info  : Downloading gurobi.log...
    info  : Discarding batch data
    

You can actually use grbcluster to perform all three steps in a single command:

> grbcluster batch solve ResultFile=solution.sol misc07.mps --download
info  : Batch 5d0ea600-5068-4a0b-bee0-efa26c18f35b created
info  : Uploading misc07.mps...
info  : Batch 5d0ea600-5068-4a0b-bee0-efa26c18f35b submitted with job a9700b72...
info  : Batch 5d0ea600-5068-4a0b-bee0-efa26c18f35b status is COMPLETED
info  : Results will be stored in directory 5d0ea600-5068-4a0b-bee0-efa26c18f35b
info  : Downloading solution.sol...
info  : Downloading gurobi.log...
info  : Discarding batch data

Try Gurobi for Free

Choose the evaluation license that fits you best, and start working with our Expert Team for technical guidance and support.

Evaluation License
Get a free, full-featured license of the Gurobi Optimizer to experience the performance, support, benchmarking and tuning services we provide as part of our product offering.
Academic License
Gurobi supports the teaching and use of optimization within academic institutions. We offer free, full-featured copies of Gurobi for use in class, and for research.
Cloud Trial

Request free trial hours, so you can see how quickly and easily a model can be solved on the cloud.

Search

Gurobi Optimization