aboutsummaryrefslogtreecommitdiffhomepage
path: root/tools/buildgen
diff options
context:
space:
mode:
authorGravatar Nicolas Noble <nicolasnoble@users.noreply.github.com>2016-01-26 16:43:55 -0800
committerGravatar Nicolas Noble <nicolasnoble@users.noreply.github.com>2016-01-26 16:43:55 -0800
commit6a25656fece0f644239cf79a80348455a1a7c754 (patch)
treeeb99d5173d7fd363053789b92a0c9db22ddce2c3 /tools/buildgen
parentbee33b0f5243defae6d445b06ccbd4646383d0b4 (diff)
parent528fd1e75c3946e521ad45bb6f0b71df3738ea16 (diff)
Merge pull request #4819 from ctiller/less-cpu-sanity
Ensure sanity generate projects doesnt eat all available cpu
Diffstat (limited to 'tools/buildgen')
-rwxr-xr-xtools/buildgen/generate_projects.py3
1 files changed, 2 insertions, 1 deletions
diff --git a/tools/buildgen/generate_projects.py b/tools/buildgen/generate_projects.py
index 083a97874d..965dd292af 100755
--- a/tools/buildgen/generate_projects.py
+++ b/tools/buildgen/generate_projects.py
@@ -47,6 +47,7 @@ os.chdir(os.path.join(os.path.dirname(sys.argv[0]), '..', '..'))
argp = argparse.ArgumentParser()
argp.add_argument('json', nargs='+')
argp.add_argument('--templates', nargs='+', default=[])
+argp.add_argument('--jobs', '-j', default=multiprocessing.cpu_count(), type=int)
args = argp.parse_args()
json = args.json
@@ -87,7 +88,7 @@ for template in templates:
cmd.append(root + '/' + f)
jobs.append(jobset.JobSpec(cmd, shortname=out, timeout_seconds=None))
-jobset.run(jobs, maxjobs=multiprocessing.cpu_count())
+jobset.run(jobs, maxjobs=args.jobs)
if test is not None:
for s, g in test.iteritems():