The bcancel Command

To cancel a batch job pending on the Manager, use bcancel:

bcancel batchid

The argument is the batch ID returned by bsub or pdriver in bsub mode.

There is an important distinction between batch IDs and Service IDs. A batch ID refers to a Service that is pending execution in the batch queue but has not been handed over to the scheduler. Once that Service is scheduled, a Service with a separate Service ID is launched. The -canceljob switch in bstatus only works for Service IDs. To remove a pending batch job, bcancel must be used. This is unavoidable since running Services and pending batch jobs are separate entities and are tracked differently. Likewise, to perform output collection and to see the contents of the staging directory, the batch ID must be used. This is due to the fact that at batch submission, only the batch ID is known since the Service ID is not generated until run-time. Therefore the batch ID is used as a key for the staging directory.