killJobs {BatchJobs}R Documentation

Kill some jobs on the batch system.


Kill jobs which have already been submitted to the batch system. If a job is killed its internal state is reset as if it had not been submitted at all.

The function informs if (a) the job you want to kill has not been submitted, (b) the job has already terminated, (c) for some reason no batch job id is available. In all 3 cases above, nothing is changed for the state of this job and no call to the internal kill cluster function is generated.

In case of an error when killing, the function tries - after a short sleep - to kill the remaining batch jobs again. If this fails again for some jobs, the function gives up. Only jobs that could be killed are reset in the DB.


killJobs(reg, ids, progressbar = TRUE)





Ids of jobs to kill. Default is none.


Set to FALSE to disable the progress bar. To disable all progress bars, see makeProgressBar.


[integer]. Ids of killed jobs.

See Also

Other debug: debugMulticore, debugSSH, getErrorMessages, getJobInfo, getLogFiles, grepLogs, resetJobs, setJobFunction, showLog, testJob


## Not run: 
reg = makeRegistry(id = "BatchJobsExample", file.dir = tempfile(), seed = 123)
f = function(x) Sys.sleep(x)
batchMap(reg, f, 1:10 + 5)

# kill all jobs currently _running_
killJobs(reg, findRunning(reg))
# kill all jobs queued or running
killJobs(reg, findNotTerminated(reg))

## End(Not run)

[Package BatchJobs version 1.8 Index]