Skip to content

Commit

Permalink
bugfix/lsf-gpu-typo (#453)
Browse files Browse the repository at this point in the history
* fix typo in batch.py that causes a bug

* change print statements to log statements
  • Loading branch information
bgunnar5 authored Oct 23, 2023
1 parent 99d5659 commit 593dbcd
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,10 @@ All notable changes to Merlin will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [Unreleased]
### Fixed
- Typo in `batch.py` that caused lsf launches to fail (`ALL_SGPUS` changed to `ALL_GPUS`)

## [1.11.0]
### Added
- New reserved variable:
Expand Down
6 changes: 5 additions & 1 deletion merlin/study/batch.py
Original file line number Diff line number Diff line change
Expand Up @@ -299,7 +299,7 @@ def construct_scheduler_legend(parsed_batch: Dict, nodes: int) -> Dict:
"lsf": {
"check cmd": ["jsrun", "--help"],
"expected check output": b"jsrun",
"launch": f"jsrun -a 1 -c ALL_CPUS -g ALL_SGPUS --bind=none -n {nodes}",
"launch": f"jsrun -a 1 -c ALL_CPUS -g ALL_GPUS --bind=none -n {nodes}",
},
# pbs is mainly a placeholder in case a user wants to try it (we don't have it at the lab so it's mostly untested)
"pbs": {
Expand Down Expand Up @@ -335,12 +335,16 @@ def construct_worker_launch_command(parsed_batch: Dict, nodes: int) -> str:
scheduler_legend: Dict = construct_scheduler_legend(parsed_batch, nodes)
workload_manager: str = get_batch_type(scheduler_legend)

LOG.debug(f"parsed_batch: {parsed_batch}")

if parsed_batch["btype"] == "pbs" and workload_manager == parsed_batch["btype"]:
raise TypeError("The PBS scheduler is only enabled for 'batch: flux' type")

if parsed_batch["btype"] == "slurm" and workload_manager not in ("lsf", "flux", "pbs"):
workload_manager = "slurm"

LOG.debug(f"workload_manager: {workload_manager}")

try:
launch_command = scheduler_legend[workload_manager]["launch"]
except KeyError as e: # pylint: disable=C0103
Expand Down

0 comments on commit 593dbcd

Please sign in to comment.