Regres: Limit the default number of threads to 100
Going above this causes mayhem on my 3990x.
Given that this is pretty much top end hardware, I don't think anything else in existance could cope with more than 100.
Change-Id: I8b6e4ad09312655c59084aaf5185bb99ee459bdb
Reviewed-on: https://swiftshader-review.googlesource.com/c/SwiftShader/+/44016
Tested-by: Ben Clayton <bclayton@google.com>
Kokoro-Result: kokoro <noreply+kokoro@google.com>
Reviewed-by: Antonio Maiorano <amaiorano@google.com>
diff --git a/tests/regres/cmd/run_testlist/main.go b/tests/regres/cmd/run_testlist/main.go
index c378cac..10eccbe 100644
--- a/tests/regres/cmd/run_testlist/main.go
+++ b/tests/regres/cmd/run_testlist/main.go
@@ -45,10 +45,17 @@
"../../util"
)
+func min(a, b int) int {
+ if a < b {
+ return a
+ }
+ return b
+}
+
var (
deqpVkBinary = flag.String("deqp-vk", "deqp-vk", "path to the deqp-vk binary")
testList = flag.String("test-list", "vk-master-PASS.txt", "path to a test list file")
- numThreads = flag.Int("num-threads", runtime.NumCPU(), "number of parallel test runner processes")
+ numThreads = flag.Int("num-threads", min(runtime.NumCPU(), 100), "number of parallel test runner processes")
maxProcMemory = flag.Uint64("max-proc-mem", shell.MaxProcMemory, "maximum virtual memory per child process")
output = flag.String("output", "results.json", "path to an output JSON results file")
filter = flag.String("filter", "", "filter for test names. Start with a '/' to indicate regex")