Skip to content

Commit fb2a632

Browse files
simevoPaolo Greppibyjtew
authored
Add --gpus option (#8)
* add gpus option * Add documentation note for usage of non-standard commands --------- Co-authored-by: Paolo Greppi <paolo.greppi@libpf.com> Co-authored-by: Benjamin Lozes <62449444+byjtew@users.noreply.github.com>
1 parent badcea9 commit fb2a632

3 files changed

Lines changed: 6 additions & 2 deletions

File tree

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -173,10 +173,10 @@ with every _SBATCH_VAR_ replaced by _SLURM_VAR_.
173173
| CI_**SLURM_CI_SLURM_PRIORITY** | [--priority](https://slurm.schedmd.com/sbatch.html#OPT_priority) || | |
174174
| CI_**SLURM_CI_SLURM_NICE** | [--nice](https://slurm.schedmd.com/sbatch.html#OPT_nice) || | |
175175
| CI_**SLURM_MEM_PER_CPU** | [--mem-per-cpu](https://slurm.schedmd.com/sbatch.html#OPT_mem-per-cpu) || | |
176-
| CI_**SLURM_COMMENT** | [--comment](https://slurm.schedmd.com/sbatch.html#OPT_comment) || | `Automatic job created from GitLab CI` |
176+
| CI_**SLURM_COMMENT** | [--comment](https://slurm.schedmd.com/sbatch.html#OPT_comment) || | _Automatic job created from GitLab CI_ |
177177
| CI_**SLURM_ACCOUNT** | [-A / --account](https://slurm.schedmd.com/sbatch.html#OPT_account) || | |
178178
| CI_**SLURM_QOS** | [--qos](https://slurm.schedmd.com/sbatch.html#OPT_qos) || | |
179-
| CI_**SLURM_GPUS** | [-G / --gpus](https://slurm.schedmd.com/sbatch.html#OPT_gpus) | | | |
179+
| CI_**SLURM_GPUS** | [-G / --gpus](https://slurm.schedmd.com/sbatch.html#OPT_gpus) | | | _Non-standard: `--gres=gpu:` is not implemented yet_ |
180180
| CI_**SLURM_GPUS_PER_NODE** | [--gpus-per-node](https://slurm.schedmd.com/sbatch.html#OPT_gpus-per-node) || | |
181181
| CI_**SLURM_GPUS_PER_TASK** | [--gpus-per-task](https://slurm.schedmd.com/sbatch.html#OPT_gpus-per-task) || | |
182182
| CI_**SLURM_CPUS_PER_GPU** | [--cpus-per-gpu](https://slurm.schedmd.com/sbatch.html#OPT_mem-per-gpu) || | |

driver/driver.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -250,6 +250,7 @@ def prepare():
250250
chdir=GitLabJobInterface.get_build_dir_path(),
251251
account=GitLabJobInterface.get_env("CI_SLURM_ACCOUNT"),
252252
qos=GitLabJobInterface.get_env("CI_SLURM_QOS"),
253+
gpus=GitLabJobInterface.get_env("CI_SLURM_GPUS"),
253254
export="ALL",
254255
stdout_file="stdout.log",
255256
stderr_file="stderr.log"

driver/slurm_interface.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -148,6 +148,7 @@ def __init__(
148148
stderr_file: str = None,
149149
account: str = None,
150150
qos: str = None,
151+
gpus: str = None,
151152
):
152153
self.job_name = job_name
153154
self.nodes = nodes
@@ -172,6 +173,7 @@ def __init__(
172173
self.stderr_file = stderr_file
173174
self.account = account
174175
self.qos = qos
176+
self.gpus = gpus
175177

176178
def get_cli_parameters(self) -> List[str]:
177179
parameters = [
@@ -198,6 +200,7 @@ def get_cli_parameters(self) -> List[str]:
198200
f"--error={self.stderr_file}" if self.stderr_file is not None else None,
199201
f"--account={self.account}" if self.account is not None else None,
200202
f"--qos={self.qos}" if self.qos is not None else None,
203+
f"--gpus={self.gpus}" if self.gpus is not None else None,
201204
]
202205
return [x for x in parameters if x is not None]
203206

0 commit comments

Comments
 (0)