A batch has a set of input files and a set of result files that are stored in the Cluster Manager database. This enables the client to submit and disconnect while the batch is processed. Also, the results can be downloaded later when the client is ready. One consequence of this is that batches can consume significant space in the database. We may need to be careful to clean up data. It is important to discard batch data when you are done with it, to free up space in the database. Note that batch metadata is small and will still remain in the batch history for monitoring purposes even after you discard the batch.
By default, when using the grbcluster command to download the results, the batch will be discarded automatically. You can change the default behavior by using the —discard flag if you may want to download the results again later:
> grbcluster batch solve misc07.mps ResultFile=solution.sol --download --discard=false info : Batch 076225d7-a1c9-462f-bfef-8e23c81d9f16 created info : Uploading misc07.mps... info : Batch 076225d7-a1c9-462f-bfef-8e23c81d9f16 submitted with job ef0861e9... info : Batch 076225d7-a1c9-462f-bfef-8e23c81d9f16 status is SUBMITTED info : Batch 076225d7-a1c9-462f-bfef-8e23c81d9f16 status is COMPLETED info : Results will be stored in directory 076225d7-a1c9-462f-bfef-8e23c81d9f16 info : Downloading solution.sol... info : Downloading gurobi.log...
You can check the space used by this batch by looking in the SIZE column in the output of the batches command:
> grbcluster batches --batchId=076225d7 ID JOB CREATED Status STIME USER PRIO API D SIZE INPUT OUTPUT 076225d7 ef0861e9 2019... COMPLETED 2019... jones 0 grbcluster 288960 misc07.mps solution.sol
In order to discard a batch manually, you can use the batch discard command. You can verify that the size of the batch is 0 afterwards. You will also notice that the D column is flagged, indicating that the batch was discarded.
> grbcluster batch discard 076225d7 info : Batch 076225d7-a1c9-462f-bfef-8e23c81d9f16 discarded > ./grbcluster batches --batchId=076225d7 ID JOB CREATED Status STIME USER PRIO API D SIZE INPUT OUTPUT 076225d7 ef0861e9 2019... COMPLETED 2019... jones 0 grbcluster X 0 misc07.mps solution.sol
Note that the Cluster Manager will automatically discard and delete batches when they are older than the maximum age, as specified in the cluster retention policy. Developers submitting a batch with a programming language API should call the appropriate discard function once results have been retrieved.