Skip to content

Commit 46d3590

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

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
@@ -924,10 +924,15 @@ prioritize_long_running_tests = \
924924

925925
# "make check" uses
926926
# Run with "make J=1 check" to disable parallelism in "make check".
927-
# Run with "make J=200% check" to run two parallel jobs per core.
928-
# The default is to run one job per core (J=100%).
927+
# Run with "make J=$(shell expr $(NPROC) * 2) check" to run two parallel jobs per core.
928+
# The default is to run one job per core except to leave one core free (J=$(shell expr $(NPROC) - 1)).
929929
# See "man parallel" for its "-j ..." option.
930-
J ?= 100%
930+
ifeq ($(PLATFORM),OS_MACOSX)
931+
NPROC ?= $(shell sysctl -n hw.logicalcpu)
932+
else
933+
NPROC ?= $(shell nproc)
934+
endif
935+
J ?= $(shell expr $(NPROC) - 1)
931936

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

0 commit comments

Comments
 (0)