swif2 modify-jobs

Modify attributes of a job.

Usage

swif2 modify-jobs <workflow> [options] [(-<field> <op> <val>)...] (-sbatch <val> ... ::) <job-selection>

Modify the selected jobs by specifying new values for certain job fields. If a selected job is undispatched, the modification simply overwrites the previous values. If a selected job is currently dispatched and is in a problem state, its attempt problem will be tagged as resolved and the corersponding job re-inserted into the dispatch queue. However, if a selected job is dispatched, but not in a problem state, its attempt will be canceled, and it will be assigned a problem of USER_CANCEL, then it will be handled as a problem job. Similarly, a completed or abandoned job (selected via -resurrect) will have its most recent job attempt assigned the problem USER_RESURRECT before being handled as a problem job.

Arguments

Flag Value Comment
-account set account-name
-cores set|add|mult n Modify core count.
-disk set|add|mult n Modify disk space limit.
-names Interpret job selection list entries as job names.
-partition set partition-name
-problems Interpret job selection list entries as problem names.
-ram set|add|mult n Modify RAM limit.
-refresh-input input-file Cause the specified input file to be freshly copied into the swif input cache.
-regexp Designate job selection list entries as regular expressions.
-resurrect Bring an abandoned or completed job back to life.
-sbatch sbatch-flags :: Specify pass-through options for sbatch, overriding any previos settings.
-tag tag-name Interpret job selection list entries as values for tag-name.
-time set|add|mult n Modify time limit.
-workflow workflow name Specify the workflow

Modifications

Modifications to job fields are requested by specifying -<field> <op> <val>. Any may be assigned a new value via the set operation. Numeric fields can also be modified via the mult or add operator, which multiply/add the current value with the supplied <val>, which is interpreted as documented in the swif2 add-jobs documentation.

By specifying -sbatch <args> :: you can fully replace any previous pass-through flags for sbatch. Note that :: is required to terminate the list of sbatch arguments.

Selection

By default, <job-selection> consists of one or more swif job id numbers. However, you also may select jobs by

You may also specify the match values as regular expressions by using the -regexp flag.

Examples

Double the memory of jobs 123 and 456, halve time, add four cores.

swif2 modify-jobs "my workflow" -ram mult 2 -time mult 0.5 -cores add 4 123 456

Subtract an hour from the requested time for all jobs, add 1GB ram.

swif2 modify-jobs "my workflow" -time add -1h -ram add 1gb -names -regexp '.*'

Request 8 cores for all unresolved problem jobs that failed owing to timeout or out of memory.

swif2 modify-jobs "my workflow" -cores set 8 -problems SLURM_TIMEOUT SLURM_OUT_OF_MEMORY