Using the qsub Command (with examples)

Using the qsub Command (with examples)

Use case 1: Submit a script with default settings

qsub script.sh

Motivation

In this use case, the script.sh file is submitted to the TORQUE queue management system without any specific settings. This is useful when the script doesn’t require any specific resource allocation or runtime limits.

Explanation

The qsub command is used to submit a script to the queue management system TORQUE. By simply providing the name of the script file as an argument, the command will submit the script with default settings, which depend on the TORQUE configuration.

Example Output

The script will be added to the TORQUE queue and will start executing based on the availability of resources and the order in which it was submitted.

Use case 2: Submit a script with a specified wallclock runtime limit

qsub -l walltime=1:2:3 script.sh

Motivation

When executing long-running scripts, it is important to set a limit on the maximum runtime. This prevents scripts from running indefinitely and helps manage resource allocation effectively.

Explanation

The -l option is used to specify resource limits for a job submission. In this case, walltime=1:2:3 sets the maximum runtime limit for the script to 1 hour, 2 minutes, and 3 seconds.

Example Output

The script will be added to the TORQUE queue and will start executing. However, if the script runs for more than 1 hour, 2 minutes, and 3 seconds, it will be terminated.

Use case 3: Submit a script executed on multiple nodes with specified cores per node

qsub -l nodes=2:ppn=4 script.sh

Motivation

Some scripts require parallel execution on multiple nodes with a set number of cores on each node. This allows for increased computing power and faster execution of tasks.

Explanation

The -l nodes=2:ppn=4 option specifies that the script should be executed on 2 nodes, and each node should have 4 cores allocated for the script execution.

Example Output

The script will be added to the TORQUE queue and will start executing on the allocated nodes. Each node will have 4 cores available for executing tasks in parallel.

Use case 4: Submit a script to a specific queue

qsub -q queue_name script.sh

Motivation

TORQUE allows the creation of different queues, each with its own configuration and resource limits. This allows for better management of jobs and provides flexibility in assigning appropriate resources for specific types of scripts.

Explanation

The -q option is used to specify the name of the queue to which the script should be submitted. This allows the script to be processed based on the configuration and priority of that specific queue.

Example Output

The script will be added to the specified queue and will start executing based on the availability of resources and the order in which it was submitted. The runtime and other resource limits will be based on the configuration of that specific queue.

By understanding these different use cases of the qsub command, you can effectively submit scripts to the TORQUE queue management system with specific resource allocation and runtime limits. This helps optimize the usage of computing resources and ensures efficient execution of scripts.

Tags :

Related Posts

How to use the command flac (with examples)

How to use the command flac (with examples)

The flac command is a powerful tool for encoding, decoding, and testing FLAC files.

Read More
How to use the command w3m (with examples)

How to use the command w3m (with examples)

w3m is a text-based web browser that allows you to browse websites and view them within the command line interface.

Read More
How to use the command `qm move disk` (with examples)

How to use the command `qm move disk` (with examples)

The qm move disk command is an alias of the qm disk move command in Proxmox VE, a virtualization management platform.

Read More