Skip to content

Commit a4ec07c

Browse files
feat: support #PBS -l ncpus=N directive for resource cost
1 parent b345ad8 commit a4ec07c

3 files changed

Lines changed: 4 additions & 1 deletion

File tree

MANUAL.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -172,7 +172,7 @@ FBQueue automatically maps embedded script directives to internal job parameters
172172
| Feature | External Notation (Example) | Internal Parameter |
173173
| :--- | :--- | :--- |
174174
| **Job Name** | `#PBS -N name`, `#SBATCH -J name` | **`name`** |
175-
| **Resource/Cost** | `#$ -pe smp 4`, `#SBATCH -c 4` | **`cost`** |
175+
| **Resource/Cost** | `#$ -pe smp 4`, `#SBATCH -c 4`, `#PBS -l ncpus=4` | **`cost`** |
176176
| **Target Queue** | `#PBS -q express`, `#SBATCH -p express` | **`queue`** |
177177
| **Stdout Path** | `#$ -o /path/to/log`, `#SBATCH -o ...` | **`stdout`** |
178178
| **Stderr Path** | `#PBS -e /path/to/err`, `#SBATCH -e ...` | **`stderr`** |

PBS_COMPATIBILITY.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@ FBQueue respects your existing job scripts. You don't need to rewrite them. It a
3838
| `#PBS -N <name>` | Sets the job display name |
3939
| `#PBS -q <queue>` | Routes the job to a specific FBQueue queue |
4040
| `#PBS -l nodes=1:ppn=N` | Maps `ppn` to the job's resource `cost` |
41+
| `#PBS -l ncpus=N` | Maps `ncpus` to the job's resource `cost` |
4142
| `#$ -pe smp N` | Maps `N` to the job's resource `cost` |
4243
| `#PBS -o <path>` | Redirects standard output |
4344
| `#PBS -e <path>` | Redirects standard error |

src/job.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -133,6 +133,8 @@ pub fn submit_job(cmd_tmpl: &str, args_tmpl: &[String], cwd: &Path, val: Option<
133133
if let Some(pos) = arg.find("ppn=") {
134134
script_cost = arg[pos+4..].parse().unwrap_or(script_cost);
135135
}
136+
} else if arg.starts_with("ncpus=") {
137+
script_cost = arg[6..].parse().unwrap_or(script_cost);
136138
}
137139
i += 2;
138140
}

0 commit comments

Comments
 (0)