Skip to content

Commit c7f3d57

Browse files
committed
We are in 2024, so raise the 'safe' limit to 16 threads
1 parent 7ef1e04 commit c7f3d57

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

numexpr/utils.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -143,10 +143,10 @@ def _init_num_threads():
143143
# configured NumExpr as desired, so we emit info logs.
144144
if n_cores > MAX_THREADS:
145145
log.info('Note: detected %d virtual cores but NumExpr set to maximum of %d, check "NUMEXPR_MAX_THREADS" environment variable.'%(n_cores, MAX_THREADS))
146-
if n_cores > 8:
147-
# The historical 'safety' limit.
148-
log.info('Note: NumExpr detected %d cores but "NUMEXPR_MAX_THREADS" not set, so enforcing safe limit of 8.'%n_cores)
149-
n_cores = 8
146+
if n_cores > 16:
147+
# Back in 2019, 8 threads would be considered safe for performance. We are in 2024 now, so adjusting.
148+
log.info('Note: NumExpr detected %d cores but "NUMEXPR_MAX_THREADS" not set, so enforcing safe limit of 16.'%n_cores)
149+
n_cores = 16
150150

151151
# Now we check for 'NUMEXPR_NUM_THREADS' or 'OMP_NUM_THREADS' to set the
152152
# actual number of threads used.

0 commit comments

Comments
 (0)