230
231 # Each factor variable comes in 3 variants. The first one is reserved for users
232 # to use on command line. The other two are for predifined configurations in JDL
233 # and for machine specific configurations respectively.
234 TEST_JOBS_FACTOR ?= 1
235 TEST_JOBS_FACTOR_JDL ?= 1
236 TEST_JOBS_FACTOR_MACHINE ?= 1
237
238 ifeq ($(TEST_JOBS), 0)
239 CORES_DIVIDER := 2
240 ifeq ($(call isTargetCpuArch, sparc), true)
241 # For smaller SPARC machines we see reasonable scaling of throughput up to
242 # cpus/4 without affecting test reliability. On the bigger machines, cpus/4
243 # causes intermittent timeouts.
244 ifeq ($(shell $(EXPR) $(NUM_CORES) \> 16), 1)
245 CORES_DIVIDER := 5
246 else
247 CORES_DIVIDER := 4
248 endif
249 endif
250 MEMORY_DIVIDER := 2048
251 TEST_JOBS := $(shell $(AWK) \
252 'BEGIN { \
253 c = $(NUM_CORES) / $(CORES_DIVIDER); \
254 m = $(MEMORY_SIZE) / $(MEMORY_DIVIDER); \
255 if (c > m) c = m; \
256 c = c * $(TEST_JOBS_FACTOR); \
257 c = c * $(TEST_JOBS_FACTOR_JDL); \
258 c = c * $(TEST_JOBS_FACTOR_MACHINE); \
259 if (c < 1) c = 1; \
260 printf "%.0f", c; \
261 }')
262 endif
263
264 ################################################################################
265 # Parse control variables
266 ################################################################################
267
268 ifneq ($(TEST_OPTS), )
269 # Inform the user
270 $(info Running tests using TEST_OPTS control variable '$(TEST_OPTS)')
271 endif
272
273 ### Jtreg
274
|
230
231 # Each factor variable comes in 3 variants. The first one is reserved for users
232 # to use on command line. The other two are for predifined configurations in JDL
233 # and for machine specific configurations respectively.
234 TEST_JOBS_FACTOR ?= 1
235 TEST_JOBS_FACTOR_JDL ?= 1
236 TEST_JOBS_FACTOR_MACHINE ?= 1
237
238 ifeq ($(TEST_JOBS), 0)
239 CORES_DIVIDER := 2
240 ifeq ($(call isTargetCpuArch, sparc), true)
241 # For smaller SPARC machines we see reasonable scaling of throughput up to
242 # cpus/4 without affecting test reliability. On the bigger machines, cpus/4
243 # causes intermittent timeouts.
244 ifeq ($(shell $(EXPR) $(NUM_CORES) \> 16), 1)
245 CORES_DIVIDER := 5
246 else
247 CORES_DIVIDER := 4
248 endif
249 endif
250 # For some big multi-core machines with low ulimit -u setting we hit the max
251 # threads/process limit. In such a setup the memory/cores-only-guided
252 # TEST_JOBS config is insufficient. From experience a concurrency setting of
253 # 14 works reasonably well for low ulimit values (<= 4096). Thus, use
254 # divider 4096/14. For high ulimit -u values this shouldn't make a difference.
255 ULIMIT_DIVIDER := (4096/14)
256 PROC_ULIMIT := -1
257 ifneq ($(OPENJDK_TARGET_OS), windows)
258 PROC_ULIMIT := $(shell $(ULIMIT) -u)
259 ifeq ($(PROC_ULIMIT), unlimited)
260 PROC_ULIMIT := -1
261 endif
262 endif
263 MEMORY_DIVIDER := 2048
264 TEST_JOBS := $(shell $(AWK) \
265 'BEGIN { \
266 c = $(NUM_CORES) / $(CORES_DIVIDER); \
267 m = $(MEMORY_SIZE) / $(MEMORY_DIVIDER); \
268 u = $(PROC_ULIMIT); \
269 if (u > -1) { \
270 u = u / $(ULIMIT_DIVIDER); \
271 if (u < c) c = u; \
272 } \
273 if (c > m) c = m; \
274 c = c * $(TEST_JOBS_FACTOR); \
275 c = c * $(TEST_JOBS_FACTOR_JDL); \
276 c = c * $(TEST_JOBS_FACTOR_MACHINE); \
277 if (c < 1) c = 1; \
278 printf "%.0f", c; \
279 }')
280 endif
281
282 ################################################################################
283 # Parse control variables
284 ################################################################################
285
286 ifneq ($(TEST_OPTS), )
287 # Inform the user
288 $(info Running tests using TEST_OPTS control variable '$(TEST_OPTS)')
289 endif
290
291 ### Jtreg
292
|