Skip to content

Commit

Permalink
Exposed processpool num workers setting
Browse files Browse the repository at this point in the history
  • Loading branch information
dotsdl committed Aug 6, 2024
1 parent 70cf423 commit 1120fef
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 1 deletion.
2 changes: 1 addition & 1 deletion alchemiscale_fah/compute/service.py
Original file line number Diff line number Diff line change
Expand Up @@ -399,7 +399,7 @@ def cycle_init(self):
self._start_time = time.time()

# create process pool
self._pool = ProcessPoolExecutor()
self._pool = ProcessPoolExecutor(self.settings.max_processpool_workers)

# open index
self.index = FahComputeServiceIndex(self.index_dir, self.obj_store)
Expand Down
6 changes: 6 additions & 0 deletions alchemiscale_fah/compute/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,12 @@
class FahAsynchronousComputeServiceSettings(ComputeServiceSettings):
"""Settings schema for a FahSynchronousComputeService."""

# Maximum number of workers to allocate to the service's process pool
max_processpool_workers: Optional[int] = Field(
None,
description="Maximum number of workers to allocate to the service's process pool; `None` will default to number of processors on host.",
)

fah_as_url: str = Field(
...,
description="URL of the FAH assignment server to use.",
Expand Down
4 changes: 4 additions & 0 deletions devtools/configs/fah-asynchronous-compute-settings.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,10 @@ init:

## FAH-specific settings

# Maximum number of workers to allocate to the service's process pool;
# `null` will default to number of processors on host.
max_processpool_workers: null

# URL of the FAH assignment server to use.
fah_as_url: "https://assign1.foldingathome.org"

Expand Down

0 comments on commit 1120fef

Please sign in to comment.