|
| 1 | +# FBQueue - PBS Compatibility Guide |
| 2 | + |
| 3 | +FBQueue is designed with deep respect for the established workflows of High-Performance Computing (HPC) environments. While it is a lightweight tool for local and personal use, it maintains strong compatibility with the conventions of the **Portable Batch System (PBS)** and **Sun Grid Engine (SGE)**. |
| 4 | + |
| 5 | +This guide is for users who are accustomed to these traditional schedulers and wish to apply their existing scripts and habits to FBQueue. |
| 6 | + |
| 7 | +--- |
| 8 | + |
| 9 | +## 1. Setting up PBS-style Aliases |
| 10 | + |
| 11 | +On Linux, you can interact with FBQueue using the familiar `qsub`, `qstat`, and `qdel` commands by creating symbolic links to the `fbqueue` binary. |
| 12 | + |
| 13 | +### Installation via Symbolic Links |
| 14 | +Run the following commands in a directory that is in your `$PATH` (e.g., `~/bin` or `/usr/local/bin`): |
| 15 | + |
| 16 | +```bash |
| 17 | +# Assuming 'fbqueue' binary is in the current directory |
| 18 | +ln -s fbqueue qsub |
| 19 | +ln -s fbqueue qstat |
| 20 | +ln -s fbqueue qdel |
| 21 | +``` |
| 22 | + |
| 23 | +Once linked, FBQueue automatically detects how it was invoked and adjusts its behavior: |
| 24 | +- `qsub` behaves like `fbqueue sub` |
| 25 | +- `qstat` behaves like `fbqueue stat --style pbs` |
| 26 | +- `qdel` behaves like `fbqueue del` |
| 27 | + |
| 28 | +--- |
| 29 | + |
| 30 | +## 2. Using PBS Directives in Scripts |
| 31 | + |
| 32 | +FBQueue respects your existing job scripts. You don't need to rewrite them. It automatically parses the `#PBS` (and `#$`, `#SBATCH`) directives embedded in the first 100 lines of your script. |
| 33 | + |
| 34 | +### Supported Directives Mapping |
| 35 | + |
| 36 | +| PBS/SGE Directive | FBQueue Action | |
| 37 | +| :--- | :--- | |
| 38 | +| `#PBS -N <name>` | Sets the job display name | |
| 39 | +| `#PBS -q <queue>` | Routes the job to a specific FBQueue queue | |
| 40 | +| `#PBS -l nodes=1:ppn=N` | Maps `ppn` to the job's resource `cost` | |
| 41 | +| `#$ -pe smp N` | Maps `N` to the job's resource `cost` | |
| 42 | +| `#PBS -o <path>` | Redirects standard output | |
| 43 | +| `#PBS -e <path>` | Redirects standard error | |
| 44 | +| `#PBS -hold_jid <id>` | Sets job dependency (wait for ID to finish) | |
| 45 | +| `#PBS -l h_rt=HH:MM:SS` | Sets the Walltime execution limit | |
| 46 | + |
| 47 | +### Example Script (`my_job.sh`) |
| 48 | +```bash |
| 49 | +#!/bin/bash |
| 50 | +#PBS -N Simulation_v1 |
| 51 | +#PBS -q express |
| 52 | +#PBS -l nodes=1:ppn=4 |
| 53 | +#PBS -l h_rt=00:30:00 |
| 54 | + |
| 55 | +echo "Running simulation on 4 cores..." |
| 56 | +./my_solver |
| 57 | +``` |
| 58 | + |
| 59 | +Submit it simply with: |
| 60 | +```bash |
| 61 | +qsub my_job.sh |
| 62 | +``` |
| 63 | + |
| 64 | +--- |
| 65 | + |
| 66 | +## 3. PBS-style Status Monitoring |
| 67 | + |
| 68 | +When invoked as `qstat`, FBQueue provides a tabular output format familiar to HPC users. |
| 69 | + |
| 70 | +### Example `qstat` Output: |
| 71 | +```text |
| 72 | +Job id Name User Time Use S Queue |
| 73 | +---------------- ---------------- ---------------- -------- - ----- |
| 74 | +123.master Simulation_v1 username 00:15:22 R express |
| 75 | +124.master Analysis_task username 00:00:00 Q batch |
| 76 | +``` |
| 77 | + |
| 78 | +- **S (Status)**: |
| 79 | + - `R`: Running |
| 80 | + - `Q`: Queued (Pending) |
| 81 | +- **Time Use**: Displays the elapsed walltime for running jobs. |
| 82 | + |
| 83 | +--- |
| 84 | + |
| 85 | +## 4. Why use FBQueue for PBS Workflows? |
| 86 | + |
| 87 | +- **Personal Sandbox**: Run your PBS scripts on your local workstation or a shared server where you don't have administrative rights to a full PBS cluster. |
| 88 | +- **Portability**: Move your research scripts between a massive supercomputer and your local laptop without changing a single line of the `#PBS` directives. |
| 89 | +- **Lightweight**: Get the benefits of a robust queue manager without the overhead of complex system-wide installations. |
| 90 | + |
| 91 | +--- |
| 92 | +*FBQueue: Honoring the heritage of HPC scheduling while providing modern, lightweight local execution.* |
0 commit comments