Skip to content

Commit

Permalink
Prevent excessive parallel jobs during compilation
Browse files Browse the repository at this point in the history
The number of job slots should be fewer than the number of available logical CPUs in the system.

Signed-off-by: Jinzhe Zeng <jinzhe.zeng@rutgers.edu>
  • Loading branch information
njzjz committed Nov 15, 2023
1 parent 7e4d993 commit adf2acc
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ def build_extensions(self):
'-DCMAKE_LIBRARY_OUTPUT_DIRECTORY_{}={}'.format(config.upper(), build_dir),
'-DPYTHON_EXECUTABLE:FILEPATH=' + sys.executable]

make_args = ['-j8'] if not os.environ.get('MAKEFLAGS') else []
make_args = ['-j' + str(min(8, len(os.sched_getaffinity(0))))] if not os.environ.get('MAKEFLAGS') else []
if self.verbose:
make_args.append('VERBOSE=1')

Expand Down

0 comments on commit adf2acc

Please sign in to comment.