Skip to main content

qsub

Submit jobs to the FSCHED scheduler.


Options

Basic Options

OptionDescriptionMain Differences
-bRun the command as a binary executable (y/n)No difference
-NJob nameNo difference
-cwdUse the current working directoryNo difference
-verifyVerification mode; do not actually submit the jobNo difference

Accounts and Projects

OptionDescriptionMain Differences
-AAccount nameNo difference
-PProject nameNo difference

Scheduling and Queues

OptionDescriptionMain Differences
-qQueue nameNo difference
-aJob start time (YYMMDDhhmm format)No difference
-hHold the job after submissionNo difference

Resource Requests

OptionDescriptionMain Differences
-lResource requirement listSupports mem_free, h_rt, num_proc, hostname
-peParallel environment and slot countNo difference
-masterqMaster queue (for parallel jobs); requires -peNo difference
-bindingCPU binding policy; supports linear, striding, explicit, etc.No difference

Priority

OptionDescriptionMain Differences
-pJob priority (-1023 to 1024)No difference
-jsJob share (larger SGE js means higher priority)No difference

Input/Output

OptionDescriptionMain Differences
-oStandard output pathNo difference
-eStandard error pathNo difference
-iStandard input pathNo difference
-jMerge stdout and stderr (y/n)No difference

Email Notifications

OptionDescriptionMain Differences
-mMail options (b/e/a/s/n)No difference
-MMail recipient addressNo difference

Job Dependencies

OptionDescriptionMain Differences
-hold_jidJob dependency listNo difference
-hold_jid_adArray job dependency listNo difference

Array Jobs

OptionDescriptionMain Differences
-tArray task ID range; supports start-end:stepNo difference
-tcLimit concurrent array tasksExtension option (not in SGE), maps to SLURM --array=start-end%max

Array format notes:

  • start-end - task ID range
  • :step - optional step (default 1)

Job Restart

OptionDescriptionMain Differences
-rJob restartable (y/n)No difference

Advanced Options

OptionDescriptionMain Differences
-CScript directive prefix (default #$)Prefix must start with # or error (SGE allows with warning)
-@Read options from fileNo difference
-cCheckpoint optionsOnly supports -c n (disable checkpoint)
-SScript interpreterValidates shebang to match interpreter
-shellEnable/disable shell wrapper (y/n)Accepted but shell wrapper is always used
-syncWait for job completion (y/n)No difference
-wVerification options (e/w/n/v/p)v is equivalent to -verify
-notifyNotify job before termination/suspensionAccepted but has no effect

Environment and Context

OptionDescriptionMain Differences
-vExport specific environment variables (comma-separated)No difference
-VExport all environment variablesAll environment variables are passed by default (equivalent to default -V)
-acAdd context variablesStored in job comment as CONTEXT:var=value (does not affect scheduling)
-dcDelete context variablesStored in job comment
-scSet context variables (replace all)Stored in job comment

Resource Request Control

OptionDescriptionMain Differences
-hardHard resource request; subsequent -l and -q are parsedDefault is hard mode
-softSoft resource request; subsequent -l and -q are ignoredSoft mode ignores subsequent -l and -q

Job Execution Control

OptionDescriptionMain Differences
-nowRun immediately or fail (y/n)No difference
-wdWorking directory; supports relative and absolute pathsNo difference

Examples

Example 1: Basic submission

qsub -N myjob -o out.txt script.sh
  • Effect: Submits the job and sets the output file name.

Example 2: Specify resource requirements

qsub -l num_proc=4 job.sh
  • Effect: Requests 4 CPU cores.

Example 3: Set job dependency

qsub -hold_jid 123 analysis.py
  • Effect: Runs after job ID 123 completes.

Example 4: Submit a parallel job

qsub -pe mpi 8 code.py
  • Effect: Starts an MPI parallel environment with 8 slots.

Example 5: Submit an array job

qsub -t 1-5:2 array.sh
  • Effect: Creates an array with step 2 (IDs: 1, 3, 5).

Example 6: Set start time and priority

qsub -a 202601101430 -p 500 delay_job.sh
  • Effect: Sets the start time and priority.

Example 7: Set environment variables

qsub -v DEBUG=1,WORKERS=4 -cwd test.sh
  • Effect: Exports variables and uses the current directory.

Example 8: Synchronous wait

qsub -sync y wait_job.sh
  • Effect: Submits the job and waits for completion.

Example 9: Verification mode

qsub -verify myscript.sh
  • Effect: Validates the job configuration without submitting.

Example 10: Read options from a file

qsub -@ options.txt myscript.sh
  • Effect: Reads option configuration from a file.

Example 11: Binary command execution

qsub -b y hostname
  • Effect: Runs the command as a binary executable.

Example 12: Custom script directive prefix

qsub -C '#@' custom_prefix.sh
  • Effect: Uses #@ as the script directive prefix (instead of default #$).