qsub
Submit jobs to the FSCHED scheduler.
Options
Basic Options
| Option | Description | Main Differences |
|---|---|---|
-b | Run the command as a binary executable (y/n) | No difference |
-N | Job name | No difference |
-cwd | Use the current working directory | No difference |
-verify | Verification mode; do not actually submit the job | No difference |
Accounts and Projects
| Option | Description | Main Differences |
|---|---|---|
-A | Account name | No difference |
-P | Project name | No difference |
Scheduling and Queues
| Option | Description | Main Differences |
|---|---|---|
-q | Queue name | No difference |
-a | Job start time (YYMMDDhhmm format) | No difference |
-h | Hold the job after submission | No difference |
Resource Requests
| Option | Description | Main Differences |
|---|---|---|
-l | Resource requirement list | Supports mem_free, h_rt, num_proc, hostname |
-pe | Parallel environment and slot count | No difference |
-masterq | Master queue (for parallel jobs); requires -pe | No difference |
-binding | CPU binding policy; supports linear, striding, explicit, etc. | No difference |
Priority
| Option | Description | Main Differences |
|---|---|---|
-p | Job priority (-1023 to 1024) | No difference |
-js | Job share (larger SGE js means higher priority) | No difference |
Input/Output
| Option | Description | Main Differences |
|---|---|---|
-o | Standard output path | No difference |
-e | Standard error path | No difference |
-i | Standard input path | No difference |
-j | Merge stdout and stderr (y/n) | No difference |
Email Notifications
| Option | Description | Main Differences |
|---|---|---|
-m | Mail options (b/e/a/s/n) | No difference |
-M | Mail recipient address | No difference |
Job Dependencies
| Option | Description | Main Differences |
|---|---|---|
-hold_jid | Job dependency list | No difference |
-hold_jid_ad | Array job dependency list | No difference |
Array Jobs
| Option | Description | Main Differences |
|---|---|---|
-t | Array task ID range; supports start-end:step | No difference |
-tc | Limit concurrent array tasks | Extension 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
| Option | Description | Main Differences |
|---|---|---|
-r | Job restartable (y/n) | No difference |
Advanced Options
| Option | Description | Main Differences |
|---|---|---|
-C | Script directive prefix (default #$) | Prefix must start with # or error (SGE allows with warning) |
-@ | Read options from file | No difference |
-c | Checkpoint options | Only supports -c n (disable checkpoint) |
-S | Script interpreter | Validates shebang to match interpreter |
-shell | Enable/disable shell wrapper (y/n) | Accepted but shell wrapper is always used |
-sync | Wait for job completion (y/n) | No difference |
-w | Verification options (e/w/n/v/p) | v is equivalent to -verify |
-notify | Notify job before termination/suspension | Accepted but has no effect |
Environment and Context
| Option | Description | Main Differences |
|---|---|---|
-v | Export specific environment variables (comma-separated) | No difference |
-V | Export all environment variables | All environment variables are passed by default (equivalent to default -V) |
-ac | Add context variables | Stored in job comment as CONTEXT:var=value (does not affect scheduling) |
-dc | Delete context variables | Stored in job comment |
-sc | Set context variables (replace all) | Stored in job comment |
Resource Request Control
| Option | Description | Main Differences |
|---|---|---|
-hard | Hard resource request; subsequent -l and -q are parsed | Default is hard mode |
-soft | Soft resource request; subsequent -l and -q are ignored | Soft mode ignores subsequent -l and -q |
Job Execution Control
| Option | Description | Main Differences |
|---|---|---|
-now | Run immediately or fail (y/n) | No difference |
-wd | Working directory; supports relative and absolute paths | No 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#$).