PBS (Portable Batch System) is a workload management and job scheduling system commonly used in high-performance computing environments. It helps allocate cluster resources and manage job execution efficiently.
How does it work?
PBS organizes and manages tasks in a cluster by scheduling jobs, allocating resources, and ensuring optimal usage. It provides a robust environment for handling both simple and complex workflows.
Key Concepts
Job submission: Users submit jobs specifying resource requirements and runtime limits.
Queue: Jobs are queued and prioritized based on resource needs, job policies, and user configurations.
Resource allocation: PBS allocates resources to queued jobs based on availability and priority.
Job execution: PBS runs jobs on the allocated resources and tracks their progress.
Submitting Jobs
To submit a job to PBS, create a script with the required job details and submit it using the qsub command.
qsub myscript.pbs
Example PBS Script
#!/bin/bash
#PBS -N myjob # Job name
#PBS -q compute # Queue name
#PBS -l nodes=1:ppn=4 # Number of nodes and processors per node
#PBS -l walltime=01:00:00 # Maximum runtime
#PBS -j oe # Combine standard output and error
#PBS -d . # Start job in current working directory
# Commands to execute:
echo "Hello, PBS!"
Key Options
-N: Sets the job name.
-q: Specifies the queue to submit the job.
-l nodes=1:ppn=4: Requests 1 node with 4 processors per node.
-l walltime: Specifies the maximum runtime.
-j oe: Combines standard output and error into one file.
-d: Runs the job in the current working directory.
Checking job status: Use qstat to view job status and queue information.
qstat
Cancelling jobs: Cancel a job with
qdel job_id
Job details:
qstat -f job_id