From 48d0fb547549a49e30291d44c3c3f10dbff9bab3 Mon Sep 17 00:00:00 2001 From: Devin Robison Date: Thu, 27 Feb 2025 14:46:39 -0700 Subject: [PATCH] Fix max process workers flag (#496) --- src/nv_ingest/util/multi_processing/mp_pool_singleton.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/nv_ingest/util/multi_processing/mp_pool_singleton.py b/src/nv_ingest/util/multi_processing/mp_pool_singleton.py index 511c83c7..c55b5855 100644 --- a/src/nv_ingest/util/multi_processing/mp_pool_singleton.py +++ b/src/nv_ingest/util/multi_processing/mp_pool_singleton.py @@ -152,7 +152,7 @@ def __new__(cls): if cls._instance is None: max_worker_limit = int(os.environ.get("MAX_INGEST_PROCESS_WORKERS", -1)) cls._instance = super(ProcessWorkerPoolSingleton, cls).__new__(cls) - max_workers = min(max_worker_limit, math.floor(max(1, len(os.sched_getaffinity(0)) * 0.4))) + max_workers = math.floor(max(1, len(os.sched_getaffinity(0)) * 0.4)) if (max_worker_limit > 0) and (max_workers > max_worker_limit): max_workers = max_worker_limit logger.debug("Creating ProcessWorkerPoolSingleton instance with max workers: %d", max_workers)