Skip to content

Commit

Permalink
Add ability for request_by_nodes=False for LSF
Browse files Browse the repository at this point in the history
  • Loading branch information
bennybp committed Aug 30, 2023
1 parent d192cdf commit c75b311
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 0 deletions.
2 changes: 2 additions & 0 deletions qcfractalcompute/qcfractalcompute/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -131,6 +131,8 @@ class LSFExecutorConfig(ExecutorConfig):
workers_per_node: int
max_nodes: int

request_by_nodes: bool = True

scheduler_options: List[str] = []

@validator("walltime", pre=True)
Expand Down
8 changes: 8 additions & 0 deletions qcfractalcompute/qcfractalcompute/executors.py
Original file line number Diff line number Diff line change
Expand Up @@ -146,6 +146,12 @@ def build_executor(executor_label: str, executor_config: ExecutorConfig) -> Pars
# User specifies resources per worker, so convert to resources per node
cores_per_node = executor_config.cores_per_worker * executor_config.workers_per_node

cores_per_block = None

if executor_config.request_by_nodes is False:
# For us, 1 block = 1 node
cores_per_block = cores_per_node

return HighThroughputExecutor(
label=executor_label,
cores_per_worker=executor_config.cores_per_worker,
Expand All @@ -156,11 +162,13 @@ def build_executor(executor_label: str, executor_config: ExecutorConfig) -> Pars
init_blocks=1,
min_blocks=0,
max_blocks=executor_config.max_nodes,
cores_per_block=cores_per_block,
nodes_per_block=1,
cores_per_node=cores_per_node,
walltime=executor_config.walltime,
project=executor_config.project,
queue=executor_config.queue,
request_by_nodes=executor_config.request_by_nodes,
worker_init=";".join(executor_config.worker_init),
scheduler_options="\n".join(executor_config.scheduler_options),
),
Expand Down

0 comments on commit c75b311

Please sign in to comment.