Skip to content

Commit 2167dcd

Browse files
committed
Control thread pool with EXTRA_NUM_THREADS environment variable
1 parent 66c5f67 commit 2167dcd

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

extra_data/utils.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,10 +24,10 @@ def available_cpu_cores():
2424

2525

2626
def default_num_threads(fixed_limit=16):
27-
# Default to 16, OMP_NUM_THREADS, or available CPU cores (picking lowest)
27+
# Default to 16, EXTRA_NUM_THREADS, or available CPU cores (picking lowest)
2828
threads_limits = ([fixed_limit, available_cpu_cores()])
2929
try:
30-
threads_limits.append(int(os.environ['OMP_NUM_THREADS']))
30+
threads_limits.append(int(os.environ['EXTRA_NUM_THREADS']))
3131
except (KeyError, ValueError): # Not set, or not an integer
3232
pass
3333
return min(threads_limits)

0 commit comments

Comments
 (0)