Skip to content

Commit

Permalink
Merge PR cosmos#4344: set runsim's default maxprocs to match system's…
Browse files Browse the repository at this point in the history
… GOMAXPROCS

* set maxprocs to match system's GOMAXPROCS

* Update circleci

* Cap maxprocs in CI to 4

* Try to fix failures
  • Loading branch information
alessio authored and rigelrozanski committed May 16, 2019
1 parent 805de8b commit f8fd50a
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 6 deletions.
12 changes: 8 additions & 4 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand All @@ -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
Expand All @@ -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
Expand Down
7 changes: 5 additions & 2 deletions cmd/gaia/contrib/runsim/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import (
"os/exec"
"os/signal"
"path/filepath"
"runtime"
"strings"
"sync"
"syscall"
Expand All @@ -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
Expand All @@ -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() {
Expand Down Expand Up @@ -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)
Expand Down

0 comments on commit f8fd50a

Please sign in to comment.