Skip to content

Commit 6c97441

Browse files
committed
remove max_workers
1 parent fc57805 commit 6c97441

File tree

1 file changed

+4
-12
lines changed

1 file changed

+4
-12
lines changed

cubids/workflows.py

Lines changed: 4 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@
3737
def _validate_single_subject(args):
3838
"""Validate a single subject in a temporary directory.
3939
40-
This is a helper function designed to be called in parallel for sequential validation.
40+
This is a helper function designed to be called in parallel for --validation-scope subject.
4141
It processes one subject at a time and returns the validation results.
4242
4343
Parameters
@@ -192,11 +192,6 @@ def validate(
192192
"""
193193
# Ensure n_cpus is at least 1
194194
n_cpus = max(1, n_cpus)
195-
# Derive effective worker count using heuristic
196-
# Heuristic tuned for I/O-bound workloads materializing files + validator runs.
197-
effective_workers = max(1, int((n_cpus * 16) ** 0.5))
198-
# Do not exceed n_cpus
199-
effective_workers = min(effective_workers, n_cpus)
200195

201196
# check status of output_prefix, absolute or relative?
202197
abs_path_output = True
@@ -278,12 +273,9 @@ def validate(
278273
]
279274

280275
# Use parallel processing if more than one worker requested
281-
if effective_workers > 1:
282-
logger.info(
283-
f"Using up to {effective_workers} parallel workers "
284-
f"(n_cpus={n_cpus}) for validation"
285-
)
286-
with ProcessPoolExecutor(max_workers=effective_workers) as executor:
276+
if n_cpus > 1:
277+
logger.info(f"Using {n_cpus} parallel CPUs for validation")
278+
with ProcessPoolExecutor(n_cpus) as executor:
287279
# Submit all tasks
288280
future_to_subject = {
289281
executor.submit(_validate_single_subject, args): args[0]

0 commit comments

Comments
 (0)