Merge PR #4344: set runsim's default maxprocs to match system's GOMAXPROCS
* set maxprocs to match system's GOMAXPROCS * Update circleci * Cap maxprocs in CI to 4 * Try to fix failures
This commit is contained in:
committed by
frog power 4000
parent
805de8b9f5
commit
f8fd50a0d8
@@ -141,7 +141,9 @@ jobs:
|
||||
- run:
|
||||
name: Test Gaia import/export simulation
|
||||
command: |
|
||||
make test_sim_gaia_import_export
|
||||
export GO111MODULE=on
|
||||
make runsim
|
||||
runsim -j 4 50 5 TestGaiaImportExport
|
||||
|
||||
test_sim_gaia_simulation_after_import:
|
||||
<<: *linux_defaults
|
||||
@@ -156,7 +158,9 @@ jobs:
|
||||
- run:
|
||||
name: Test Gaia import/export simulation
|
||||
command: |
|
||||
make test_sim_gaia_simulation_after_import
|
||||
export GO111MODULE=on
|
||||
make runsim
|
||||
runsim -j 4 50 5 TestGaiaSimulationAfterImport
|
||||
|
||||
test_sim_gaia_multi_seed_long:
|
||||
<<: *linux_defaults
|
||||
@@ -173,7 +177,7 @@ jobs:
|
||||
command: |
|
||||
export GO111MODULE=on
|
||||
make runsim
|
||||
runsim 500 50 TestFullGaiaSimulation
|
||||
runsim -j 4 500 50 TestFullGaiaSimulation
|
||||
|
||||
test_sim_gaia_multi_seed:
|
||||
<<: *linux_defaults
|
||||
@@ -190,7 +194,7 @@ jobs:
|
||||
command: |
|
||||
export GO111MODULE=on
|
||||
make runsim
|
||||
runsim 50 10 TestFullGaiaSimulation
|
||||
runsim -j 4 50 10 TestFullGaiaSimulation
|
||||
|
||||
test_cover:
|
||||
<<: *linux_defaults
|
||||
|
||||
@@ -9,6 +9,7 @@ import (
|
||||
"os/exec"
|
||||
"os/signal"
|
||||
"path/filepath"
|
||||
"runtime"
|
||||
"strings"
|
||||
"sync"
|
||||
"syscall"
|
||||
@@ -33,7 +34,7 @@ var (
|
||||
results chan bool
|
||||
|
||||
// command line arguments and options
|
||||
jobs int
|
||||
jobs int = runtime.GOMAXPROCS(0)
|
||||
blocks string
|
||||
period string
|
||||
testname string
|
||||
@@ -49,7 +50,8 @@ func init() {
|
||||
|
||||
procs = map[int]*os.Process{}
|
||||
mutex = &sync.Mutex{}
|
||||
flag.IntVar(&jobs, "j", 10, "Number of parallel processes")
|
||||
|
||||
flag.IntVar(&jobs, "j", jobs, "Number of parallel processes")
|
||||
flag.StringVar(&genesis, "g", "", "Genesis file")
|
||||
|
||||
flag.Usage = func() {
|
||||
@@ -111,6 +113,7 @@ func main() {
|
||||
}
|
||||
|
||||
// set up worker pool
|
||||
log.Printf("Allocating %d workers...", jobs)
|
||||
wg := sync.WaitGroup{}
|
||||
for workerId := 0; workerId < jobs; workerId++ {
|
||||
wg.Add(1)
|
||||
|
||||
Reference in New Issue
Block a user