File tree Expand file tree Collapse file tree 1 file changed +4
-12
lines changed Expand file tree Collapse file tree 1 file changed +4
-12
lines changed Original file line number Diff line number Diff line change 3737def _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 ]
You can’t perform that action at this time.
0 commit comments