Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions sigmf/validate.py
Original file line number Diff line number Diff line change
Expand Up @@ -121,10 +121,10 @@ def main(arg_tuple: Optional[Tuple[str, ...]] = None) -> None:
n_total = len(paths)
# estimate number of CPU cores
# https://stackoverflow.com/questions/1006289/how-to-find-out-the-number-of-cpus-using-python
est_cpu_cores = len(os.sched_getaffinity(0))
est_num_workers = len(os.sched_getaffinity(0)) if os.name == 'posix' else os.cpu_count()
# create a thread pool
# https://docs.python.org/3.7/library/concurrent.futures.html#threadpoolexecutor
with ThreadPoolExecutor(max_workers=est_cpu_cores - 1) as executor:
with ThreadPoolExecutor(max_workers=est_num_workers) as executor:
# submit jobs
future_validations = {executor.submit(_validate_single_file, path, args.skip_checksum, log) for path in paths}
# load and await jobs to complete... no return
Expand Down