Job Control
Accelerator provides several commands of job controls, including wait, stop and forget.
Wait for Jobs
Besides option -w and -wl with nc
run command, you can also wait for job(s) to finish (Done or Failed)
after they are submitted using the command nc wait. Here are some
examples:
- Get usage help
-
% nc wait -h
- Wait for a job
-
% nc run sleep 10 Resources= linux Env = D(VOV_ENV_SOURCE=vnc_logs/envdexin36362.env) Command = vw vwrap sleep 10 Logfile = vnc_logs/20021231/140024.23307 JobId = 04213283 nc: message: Scheduled jobs: 1 Total estimated time: 0s % nc wait 04213283
- Wait for all jobs in current directory
-
% nc wait -dir . nc: message: Job 04193913 is already FAILED nc: message: Job 04193915 is already FAILED nc: message: Job 04193917 is already FAILED nc: message: Job 04193919 is not scheduled nc: message: Job 04194308 is not scheduled nc: message: Job 04211259 is already FAILED nc: message: Job 04211268 is not scheduled nc: message: Job 04213283 is already VALID nc: message: Job 04213297 is already VALID nc: message: Exiting with status 2 (Failed jobs)
- Wait for all jobs using tool spice
-
% nc wait -select "tool==spice"
Forget Jobs
The Accelerator server remembers the jobs you submitted for some
configurable time. You can explicitly forget them by nc forget
command, which will delete all job information from the server database.
- Get a list of jobs
-
% nc list 04146420 Done sleep 1 #in the form of "jobId status command" 04146425 Done sleep 5 04146427 Running sleep 10 04146429 Running sleep 15 04146431 Queued sleep 20 04146433 Queued sleep 60
- Forget some of them
-
% nc forget 04146420 04146425 nc: message: Forgetting 2 jobs
- List jobs again (notice those two are gone)
-
% nc list 04146427 Done sleep 10 04146429 Done sleep 15 04146431 Done sleep 20 04146433 Done sleep 60
- Forget all my jobs
-
% nc forget -mine nc: message: Forgetting 4 jobs
Stop Jobs
A job can be stopped when it is either Running or Queued. Stopping a job does not forget it from the server database. "Running" jobs will exit, and "Queued" jobs will be dequeued when you stop them.
- Stop some jobs
-
% nc run sleep 60 Resources= linux Env = D(VOV_ENV_SOURCE=vnc_logs/envdexin36362.env) Command = vw vwrap sleep 60 Logfile = vnc_logs/20021231/140803.23386 JobId = 04213393 nc: message: Scheduled jobs: 1 Total estimated time: 0s nc stop 04213393 nc: message: Stopping RETRACING job 04213393
- Stop all my jobs
-
% nc stop -mine nc: message: Stopping RETRACING job 04146627 nc: message: Stopping RETRACING job 04146629 nc: message: De-queuing job 04146631 nc: message: De-queuing job 04146633