Skip to content

Commit

Permalink
Update Pool argument and comment
Browse files Browse the repository at this point in the history
  • Loading branch information
sgreenbury committed Dec 12, 2024
1 parent 8226ccd commit 4a3bfed
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions src/acbm/assigning/select_facility.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import logging
import multiprocessing
from multiprocessing import Pool
from typing import Optional, Tuple

Expand Down Expand Up @@ -204,10 +203,9 @@ def select_facility(
dict[str, Tuple[str, Point ] | Tuple[float, float]]: Unique ID column as
keys with selected facility ID and facility ID's geometry, or (np.nan, np.nan)
"""
# TODO: update this to be configurable
n_threads = multiprocessing.cpu_count()
with Pool(n_threads) as p:
# Set to a large enough chunk size so that each thread
# TODO: update this to be configurable, `None` is os.process_cpu_count()
with Pool(None) as p:
# Set to a large enough chunk size so that each process
# has a sufficiently large amount of processing to do.
chunk_size = 16_000
d = {}
Expand Down

0 comments on commit 4a3bfed

Please sign in to comment.