Skip to content

Commit

Permalink
Allow for flux exec arguments to limit the number of celery workers. (#…
Browse files Browse the repository at this point in the history
…366)

* Added the flux_exec batch argument to allow for flux exec arguments,
e.g. flux_exec: flux exec -r "0-1" to run celery workers only on
ranks 0 and 1 of a multi-rank allocation.

* Remove period.
  • Loading branch information
koning authored Jun 7, 2022
1 parent df96126 commit 98469c3
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 1 deletion.
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,9 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- Added redis.conf for default redis configuration for merlin in server/redis.conf
- Added default configurations for merlin server command in merlin/server/*.yaml
- Added documentation page docs/merlin_server.rst, docs/modules/server/configuration.rst, and docs/modules/server/commands.rst
- Added the flux_exec batch argument to allow for flux exec arguments,
e.g. flux_exec: flux exec -r "0-1" to run celery workers only on
ranks 0 and 1 of a multi-rank allocation
### Changed
- Rename lgtm.yml to .lgtm.yml
### Fixed
Expand Down
3 changes: 3 additions & 0 deletions docs/source/merlin_specification.rst
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,9 @@ see :doc:`./merlin_variables`.
queue: pbatch
flux_path: <optional path to flux bin>
flux_start_opts: <optional flux start options>
flux_exec: <optional, flux exec command to launch workers on
all nodes if using flux and flux_exec_workers is True
(flux exec) >
flux_exec_workers: <optional, flux argument to launch workers on
all nodes. (True)>
launch_pre: <Any configuration needed before the srun or jsrun launch>
Expand Down
1 change: 1 addition & 0 deletions merlin/examples/workflows/flux/flux_par.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ batch:
type: flux
nodes: 1
queue: pbatch
flux_exec: flux exec -r "0-1"
flux_start_opts: -o,-S,log-filename=flux_par.out

env:
Expand Down
1 change: 1 addition & 0 deletions merlin/spec/all_keys.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@
"shell",
"flux_path",
"flux_start_opts",
"flux_exec",
"flux_exec_workers",
"launch_pre",
"launch_args",
Expand Down
2 changes: 1 addition & 1 deletion merlin/study/batch.py
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,7 @@ def batch_worker_launch(

flux_exec: str = ""
if flux_exec_workers:
flux_exec = "flux exec"
flux_exec = get_yaml_var(batch, "flux_exec", "flux exec")

if "/" in flux_path:
flux_path += "/"
Expand Down

0 comments on commit 98469c3

Please sign in to comment.