oarsub(1)
π oarsub(1) β OAR commands π
okay bestie, gather round, because this is the command. like, the main character of the whole OAR cinematic universe. oarsub lives in section 1 of the manual, it's part of the OAR commands family, and it is literally how you submit jobs to OAR. no cap. π«Ά
β¨ NAME β¨
oarsub β the OAR job submission command. that's it. that's the girl. π
πΈ SYNOPSIS πΈ
the four ways to summon her:
oarsub [OPTIONS] <command>
oarsub [OPTIONS] -I
oarsub [OPTIONS] -r "<START DATE|now>[, <END DATE>]" [<command>]
oarsub [OPTIONS] -C [<JOB ID>]
π¦ DESCRIPTION π¦
so you use oarsub to yeet a job at the OAR resources-and-jobs management system. a job is a command to run plus, optionally, a whole description of the resources you want so it can actually do the task. the command can be any executable program or script file, or honestly just a script command line. whatever, she's flexible. π
the OAR scheduler's whole job (pun intended, i'm hilarious) is to hand you a set of resources that matches your oarsub resource request β see the -l option, that's the one that matters here. once it's scheduled and launched, the job runs the command on the first node (machine) of the assigned resources, with a bunch of environment variables already set (like the assigned resources list, the job duration a.k.a walltime, and so on...). and if many nodes got assigned to your job? bestie, that's on you. it is let to the user's command to dispatch execution across all the nodes. the scheduler is not doing that for you. π
OAR defines two kinds of jobs: batch jobs and advance reservation jobs.
π BATCH JOBS π
a batch job lets the OAR scheduler decide when to run your job, based on when the resources you asked for are actually available. if you're not using the -I option, oarsub returns immediately β the job is just queued (and you can use the oarstat command to see all the queued jobs, iykyk). when you are using -I, oarsub waits until the job can start and then opens an interactive shell on the first of the assigned nodes. cute, right? π
π ADVANCE RESERVATION JOBS π
calling oarsub with the -r option creates an advance reservation job instead of a batch job. an advance reservation job lets you decide when the job should start (and optionally when it should end). oarsub waits for a validation of the resource availability, and whether a set of resources matching the resource request is available, you get an OK or KO message back.
- OK means the job will run at the requested date. slay. β¨
- KO means the job is refused. devastating, but we move. π
π OPTIONS π
okay this is the long part, but every single one of them matters, so no skimming. π
-I,--interactiveβ request an interactive job. you want in on the action live.-C,--connect[<JOB ID>] β connect to a running job. the job id may be omitted if only one job is running β but if there's more than one, bestie, you gotta specify which one.-l,--resource<DESCRIPTION>[,<WALLTIME>] β set the description of the requested resources for the job, plus a walltime which is an estimation of the maximum duration of the job (the job process can totally terminate earlier, that's fine). the walltime format ishours:minutes:seconds(and yes, seconds and minutes can be omitted).
oarsub -l /host=4/cpu=1,walltime=2:00:00
you can also give multiple -l options to define a moldable job: a job that accepts different combinations of resource definitions. example, because examples are everything:
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 according to one of the 3 given definitions, depending on the load of the cluster, and preferring the earliest possible start. she's efficient, she's adaptable, she's an icon.
you can also request different groups of resources, like so:
oarsub -l "{mem > 64}/host=1+{mem < 48}/host=3",walltime=1:00:00 -I
this job is requesting to run on 1 host with the property "mem" > 64, and 3 hosts with property "mem" < 48. and the syntax between braces, {...}, is the same as the one used for the -p option. keep that in your notes. π
--array<NUMBER> β submit an array job containing"NUMBER"subjobs. all the subjobs share the same array_id, but each subjob is independent and has its own job_id. all of them have the same characteristics (script, requirements) and can be identified by an environment variable$OAR_ARRAY_INDEX.
π¨ array jobs can neither be Interactive (-I) nor a reservation (-r). periodt.
--array-param-file<FILE> β submit a parametric array job. each non-empty line of"FILE"defines the parameters for a subjob. all the subjobs share the same characteristics (script, requirements) and can be identified by an environment variable$OAR_ARRAY_INDEX. and'#'is the comment sign, classic.
parameters are given as arguments to the command.
π¨ parametric array jobs can neither be Interactive (-I) nor a reservation (-r). same energy, same rule.
-S,--scanscriptβ asksoarsubto scan the script file you gave as the job command, looking for extra options to apply to the job β specifically lines starting with#OAR. sneaky, love that.-q,--queue<QUEUE> β set the queue to submit the job to. pick your lane.-p,--property"<SQL WHERE CLAUSE>" β add constraints to the wanted resource for the job, using the resources properties. constraints use the SQL WHERE CLAUSE syntax. yes, SQL. in a job scheduler. we love a crossover. π-r,--reservation"<START DATE|now>[, <END DATE>]" β request that the job starts (and optionally ends) at a specified time. using this option, the job is called an advance reservation.
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 it's provided in the -l resources request, which prevails. and the special keyword now can be used as the start date to request an advance reservation job that starts just now. go girl, go. πββοΈ
--checkpoint<DELAY> β enable the checkpointing mechanism for the job. a signal will be sentDELAYseconds before the walltime to the first processus of the job (on the first node of the job resources). protect your work, bestie.--signal<#SIG> β specify the signal used to trigger the checkpointing. use signal numbers (seekill -l), default is12(SIGUSR2).-t,--type<TYPE> β specify a specific type. the options are:besteffort,timesharing,idempotent,cosystem,deploy,noop,container,inner,token:xxx=yy,...
notes, because these are important:
- a job with the
bestefforttype will be scheduled with the lowest priority and will be killed if a "normal" job needs its resources. she's humble, she knows her place. - a job with the
idempotenttype will be automatically resubmitted if its exit code is99and its duration >60s. - a job with the
idempotentandbestefforttypes but with no checkpoint delay will automatically be resubmitted whenever killed by OAR before its normal termination, to execute a non-besteffort job. - a job with the
idempotentandbestefforttypes with a checkpoint delay will be automatically resubmitted if its exit code is99and its duration >60s(that is, as if onlyidempotentwas present). - a job with the
nooptype does nothing except reserving the resources. it is ended at the end of its walltime, or when using theoardelcommand. honestly, iconic behaviour. doing nothing, but on purpose. π
the -t option can be used several times to provide different job types to the job.
-d,--directory<DIR> β specify the directory where to launch the command (default is current directory).--project<TXT> β specify a name of a project the job belongs to.-n,--name<TXT> β specify an arbitrary name for the job. give her a name, she deserves one. π-a,--anterior<OAR JOB ID> β previously submitted job that the new job execution must depend on. the new job will only start upon the end of the previous one. it's giving β¨waiting for your friend to get readyβ¨ energy.--notify<TXT> β specify a notification method (email or command to execute). examples:
--notify "mail:name@domain.com"
--notify "exec:/path/to/script args"
arguments are job_id, job_name, TAG, comment.
TAG can be:
RUNNING: when the job is launchedEND: when the job is finished normallyERROR: when the job is finished abnormallyINFO: used whenoardelis called on the jobSUSPENDED: when the job is suspendedRESUMING: when the job is resumed
by default all TAGs are triggered. but it's possible to specify which TAGs must be triggered. examples:
--notify "[END,ERROR]mail:name@domain.com"
--notify "[RUNNING]mail:name@domain.com"
--notify "[RUNNING,END,ERROR]exec:/path/to/script args"
--resubmit<OAR JOB ID> β resubmit the given job as a new one. run it back. π-k,--use-job-keyβ activate the job-key mechanism: a job-key will be generated for the job, which can be used by theoarshcommand in place of theOAR_JOB_ID. that job-key also allows one to connect to a job from a machine which is outside the OAR cluster the job belongs to (e.g. in a grid of OAR clusters), given the job-key is available on that machine. so powerful honestly.
the job-key mechanism may be activated by default in the configuration of your OAR cluster. in that case, the -k option is useless. yeah. just sitting there.
π‘ please note that this option is mostly useful when used together with the-eoption or the-ioption (see below).
-e,--export-job-key-to-fileβ export the job-key to a file (the%jobid%pattern is automatically replaced in the filename).
β οΈ warning: the file will be overwritten whenever it already exists. no mercy.
-i,--import-job-key-from-fileβ import the job-key to use (you may reuse an exported job-key from a previous job, for instance) from a file, instead of generating a new one. one may also use theOAR_JOB_KEY_FILEenvironment variable to set the job-key file.--import-job-key-inlineβ import the job-key to use inline (as text in the command line), instead of generating a new one.-O<FILE> β specify the file that will store the standard output stream of the job. the%jobid%and%jobname%patterns are automatically replaced. β¨-E<FILE> β specify the file that will store the standard error stream of the job. the%jobid%and%jobname%patterns are automatically replaced. also β¨--holdβ set the job state into Hold instead of Waiting, so that it is not scheduled as long as it's not resumed (theoarresumecommand allows one to turn it back into the Waiting state). it's giving "don't perceive me" energy. π-D,--dumperβ print the command results in Perl'sData::Dumperformat.-X,--xmlβ print the command results in the XML format.-Y,--yamlβ print the command results in the YAML format.-J,--jsonβ print the command results in the JSON format.-h,--helpβ print this help message. hi help. π-V,--versionβ print the version of OAR.-vβ verbose mode.oarsuband admissions rules (if compatible) will print more information on the terminal. multiple-vcan be used to increase the level of verbosity (max:2). two is the limit, bestie, don't get greedy.
okay that's the vibes for this part... but we're not done yet, there's more coming π«Άπ
π ENVIRONMENT π
Okay so when your job is running, OAR drops a bunch of environment variables into its world. Here's the full lineup, bestie:
OAR_FILE_NODESorOAR_NODE_FILEorOAR_NODEFILEβ the pathname to the file that contains the list of nodes assigned to your job. πΈOAR_JOB_NAMEβ the name of the job, exactly like you gave it with the-noption.OAR_JOB_IDorOAR_JOBIDβ the id of the job. Every job gets its own unique job identifier. You can use this identifier to get info about the job withoarstat, or to connect to a running job withoarsub -Coroarsh, for instance.OAR_ARRAY_IDorOAR_ARRAYIDβ the array id of the job. Every array job gets a unique array identifier that all the subjobs of that array job share. This identifier can be used to identify the different subjobs that belong to the same array job. The array id can also be used to deal with all the subjobs of a given array at once (by means of the--arrayoption in the case ofoarstat,oarhold,oarresumeandoardel). NB: regular jobs are array jobs with only one subjob.OAR_JOB_INDEXorOAR_JOBINDEXβ the array index of the job: within an array job, each subjob gets a unique index (unique for a given array), starting from0, and that's what you use to identify the subjob.OAR_JOB_WALLTIMEandOAR_JOB_WALLTIME_SECONDSβ the walltime of the job in thehh:mm:ssformat and in seconds.OAR_RESOURCE_PROPERTIES_FILEβ the pathname to the file containing the list of all resources assigned for the job, and their value. Seeoarprinttoo.OAR_PROJECT_NAMEβ the name of the project the job is part of, as given with the--projectoption.OAR_STDOUTandOAR_STDERRβ the pathname to the files storing the standard output and standard error of the job executable, if it's not running in interactive mode.OAR_WORKING_DIRECTORYakaOAR_WORKDIRakaOAR_O_WORKDIRβ the working directory for the job. The job executable will be executed in that directory, on the first node that is allocated to the job.OAR_JOB_KEY_FILEβ the key file to use for the submission (or foroarsh) if you're using the job-key mechanism (-kor--use-job-keyoption). You can also provide the job-key to import using the-ior--import-job-key-from-fileoption as well.
β¨ SCRIPT β¨
When you submit a job using a script file, that script file can hold some extra OAR options. Those lines start with #OAR and use the same option syntax described above. π
π₯ EXAMPLES π₯
π Job submission with arguments π
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
π¦ Array job submission with 10 identical subjobs π¦
oarsub -l /nodes=4 /home/usename/path/to/my/prog --array 10
π Parametric array job submission π
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"
π Job submission with a job script π
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
π SEE ALSO π
π COPYRIGHTS π
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.
And the footer of this page says source/version oarsub(1), date 2025-03-24 β periodt. πβ¨
π¦ where this page comes from
- debian trixie: oar-user 2.6.1-1 Β· GPL-2.0-or-later
- ubuntu questing: oar-user 2.6.1-1
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms