Skip to content

Commit

Permalink
LookupNdBuilder: clip threads at cpu_count - 1 (avoids issues on CI)
Browse files Browse the repository at this point in the history
  • Loading branch information
schlegelp committed Jun 3, 2022
1 parent db66569 commit 895b918
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions navis/nbl/smat.py
Original file line number Diff line number Diff line change
Expand Up @@ -356,11 +356,17 @@ def build(self, threads=None, cache=False) -> LookupNd:
If None, act in serial.
If 0, use cpu_count - 1.
Otherwise, use the given value.
Will be clipped at number of available cores - 1.
Returns
-------
LookupNd
"""
# Asking for more threads than available CPU seems so crash on Github
# actions
if threads and threads >= cpu_count:
threads = cpu_counts

dig, cells = self._build(threads, cache)
return LookupNd(dig, cells)

Expand Down

0 comments on commit 895b918

Please sign in to comment.