Commit e9a35c48 authored by Kirill Smelkov's avatar Kirill Smelkov

slaprunner: Factor out number-of-build-jobs-to-spawn calculation into separate variable

The calculation is full line long, and we are going to reuse this number
in a couple of new places, so this way it makes sense to first compute
jobs number separately, and then reuse the variable.

/cc @jerome, @cedric.leninivin
parent 2138fc18
...@@ -156,7 +156,7 @@ mode = 0644 ...@@ -156,7 +156,7 @@ mode = 0644
[template-supervisord] [template-supervisord]
recipe = hexagonit.recipe.download recipe = hexagonit.recipe.download
url = ${:_profile_base_location_}/template/${:filename} url = ${:_profile_base_location_}/template/${:filename}
md5sum = 069e593e50204b227bdb08d29d7292fd md5sum = 05f86e84e6f079aa08e57839b218f7f6
location = ${buildout:parts-directory}/${:_buildout_section_name_} location = ${buildout:parts-directory}/${:_buildout_section_name_}
filename = supervisord.conf.in filename = supervisord.conf.in
download-only = true download-only = true
......
...@@ -26,7 +26,9 @@ autorestart = {{ supervisord['autorestart'] }} ...@@ -26,7 +26,9 @@ autorestart = {{ supervisord['autorestart'] }}
stdout_logfile = {{ supervisord['no_logfile'] }} stdout_logfile = {{ supervisord['no_logfile'] }}
stderr_logfile = {{ supervisord['no_logfile'] }} stderr_logfile = {{ supervisord['no_logfile'] }}
directory = {{ supervisord['directory'] }} directory = {{ supervisord['directory'] }}
environment = PATH="{{- supervisord['path'] -}}",MAKEFLAGS="-j{{- '%d' % builtin.max(1, (multiprocessing.cpu_count() / builtin.int(slapparameter_dict.get('cpu-usage-ratio', 4)))) -}}" {# how many parallel build jobs to spawn when compiling software -#}
{% set njobs = '%d' % builtin.max(1, (multiprocessing.cpu_count() / builtin.int(slapparameter_dict.get('cpu-usage-ratio', 4)))) -%}
environment = PATH="{{- supervisord['path'] -}}",MAKEFLAGS="-j{{ njobs }}"
[program:{{- supervisord['slapgrid-cp'] -}}] [program:{{- supervisord['slapgrid-cp'] -}}]
command = {{ supervisord['slapgrid-cp-command'] }} command = {{ supervisord['slapgrid-cp-command'] }}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment