oarsub(1) | OAR commands | oarsub(1) |
oarsub - OAR job submission command.
oarsub [OPTIONS] <command>
oarsub [OPTIONS] -I
oarsub [OPTIONS] -r "<START DATE|now>[, <END DATE>]" [<command>]
oarsub [OPTIONS] -C [<JOB ID>]
One uses oarsub to submit a job to the OAR resources and jobs management system. A job is defined by a command to run and optionally the description of a set of wanted resources to execute a task. The command can be any executable program or script file, or a script command line.
The OAR scheduler is in charge of providing a set of resources which matches the oarsub resource request (see the -l option). Once scheduled and launched, the job executes the command on the first node (machine) of the assigned resources, with some environment variables set (e.g. the assigned resources list, the job duration a.k.a walltime, ...). If many nodes (machines) are assigned to the job, it is let to the user's command to dispatch an execution on all nodes.
OAR defines two kinds of jobs: batch jobs and advance reservation jobs.
A batch job lets the OAR scheduler decide when to execute the job, depending on when the requested resources are available. If not using the -I option, oarsub returns immediately: the job is queued (use the oarstat command to list the queued jobs). When using the -I option, oarsub waits until the job can start then opens a interactive shell on the first of the assigned nodes.
Calling oarsub with the -r option creates an advance reservation job instead of a batch job. An advance reservation job lets the user decide when the job should start (and optionally end). oarsub waits for a validation of the resources availability. Whether a set of resources matching the resource request of the job is available, an OK or KO message is returned. OK means that the job will run at the requested date. KO means that the job is refused.
oarsub -l /host=4/cpu=1,walltime=2:00:00
Multiple -l options can be given to define a moldable job: a job accepting different combination of resource definitions. Example:
oarsub -l cpu=2,walltime=20:00:00 -l cpu=4,walltime=10:00:00 -l cpu=8,walltime=5:00:00 ./script.sh
OAR will allocate resources to the job accordingly to one of the 3 given definitions depending of the load of the cluster, and preferring earliest possible start.
One can also request different groups of resources, for example:
oarsub -l "{mem > 64}/host=1+{mem < 48}/host=3",walltime=1:00:00 -I
The job requests to run on 1 host with the property "mem" > 64 and 3 hosts with property "mem" < 48. The syntax between braces, {...}, is the same as the one used for -p option.
Array jobs can neither be Interactive (-I) nor a reservation (-r).
Parametric array jobs can neither be Interactive (-I) nor a reservation (-r).
Start and end dates use the YYYY-MM-DD hh:mm:ss format. If YYYY-MM-DD is omitted, it defaults to the current day. In hh:mm:ss, ss and mm can be omitted. Quotes are only required when spaces are present. When an end date is provided the job walltime is inferred, unless provided in the -l resources request which prevails. The special keyword now can be used as the start date to request an advance reservation job that starts just now.
Notes:
- a job with the besteffort type will be scheduled with the lowest
priority and will be killed if a "normal" job needs its
resources.
- a job with the idempotent type will be automatically resubmitted
if its exit code is 99 and its duration > 60s.
- a job with the idempotent and besteffort types but with
no checkpoint delay will automatically be resubmitted whenever
killed by OAR before its normal termination to execute a non-besteffort
jobs.
- a job with the idempotent and besteffort types with a
checkpoint delay will be automatically resubmitted if its exit
code is 99 and its duration > 60s (that is, as if only
idempotent was present).
- a job with the noop type does nothing except reserving the
resources. It is ended at the end of it walltime or when using the
oardel command.
The -t option can be used several times to provide different job types to the job.
Arguments are job_id, job_name, TAG, comment
TAG can be:
- RUNNING: when the job is launched
- END: when the job is finished normally
- ERROR: when the job is finished abnormally
- INFO: used when oardel is called on the job
- SUSPENDED: when the job is suspended
- RESUMING: when the job is resumed
By default all TAGs are triggered. It is possible to specify
which TAGs must be triggered. Ex:
--notify "[END,ERROR]mail:name@domain.com"
--notify "[RUNNING]mail:name@domain.com"
--notify "[RUNNING,END,ERROR]exec:/path/to/script args"
The job-key mechanism may be activated by default in the configuration of your OAR cluster. In that case, the -k option is useless.
Please note that this option is mostly useful when used together with the -e option or the -i option (see below).
When submitting a job using a script file, that script file can contain some extra OAR options, with lines starting with #OAR and using the same option syntax as described above.
oarsub -l /nodes=4 -I oarsub -q default -l /nodes=10/cpu=3,walltime=50:30:00 -p "switch = 'sw1'" /home/username/path/to/my/prog oarsub -r "2009-04-27 11:00:00" -l /nodes=12/cpu=2 oarsub -C 154
oarsub -l /nodes=4 /home/usename/path/to/my/prog --array 10
oarsub /home/users/toto/prog --array-param-file /home/username/path/to/params.txt
With /home/username/path/to/param.txt containing for instance:
# my param file # a subjob with a single parameter p100 # a subjob without parameter "" # a subjob with two strings as parameters "arg1a arg1b arg1c" "arg2a arg2b"
oarsub -S /home/username/path/to/my/script.sh
With /home/username/path/to/my/script.sh containing for instance:
#!/bin/bash #OAR -l /nodes=4/cpu=1,walltime=3:15:00 #OAR -p switch = 'sw3' or switch = 'sw5' #OAR -t besteffort #OAR -t type2 #OAR -k #OAR -e /path/to/job/key #OAR --stdout stdoutfile.log /home/username/path/to/my/prog
oarprint(1), oarsh(1), oardel(1), oarstat(1), oarnodes(1), oarhold(1), oarresume(1)
Copyright 2003-2021 Laboratoire d'Informatique de Grenoble (http://www.liglab.fr). This software is licensed under the GNU General Public License Version 2 or above. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
2023-07-10 | oarsub |