Skip to content

Commit 438affd

Browse files
committed
[TEMPORARY] cherry-pick of part of 3f05ed3 from branch: eb/refactor/simplify-make-parallelism
1 parent e85475b commit 438affd

1 file changed

Lines changed: 8 additions & 3 deletions

File tree

Makefile

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -999,10 +999,15 @@ prioritize_long_running_tests = \
999999

10001000
# "make check" uses
10011001
# Run with "make J=1 check" to disable parallelism in "make check".
1002-
# Run with "make J=200% check" to run two parallel jobs per core.
1003-
# The default is to run one job per core (J=100%).
1002+
# Run with "make J=$(shell expr $(NPROC) * 2) check" to run two parallel jobs per core.
1003+
# The default is to run one job per core except to leave one core free (J=$(shell expr $(NPROC) - 1)).
10041004
# See "man parallel" for its "-j ..." option.
1005-
J ?= 100%
1005+
ifeq ($(PLATFORM),OS_MACOSX)
1006+
NPROC ?= $(shell sysctl -n hw.logicalcpu)
1007+
else
1008+
NPROC ?= $(shell nproc)
1009+
endif
1010+
J ?= $(shell expr $(NPROC) - 1)
10061011

10071012
# Use this regexp to select the subset of tests whose names match.
10081013
tests-regexp = .

0 commit comments

Comments
 (0)