From 6004d0d44c927f01fae015a07b372ed153819218 Mon Sep 17 00:00:00 2001 From: Benjamin Warren Date: Tue, 25 Nov 2014 17:00:48 +1300 Subject: [PATCH 1/5] Fix process limiting option parsing 1. The '-C' option does not set a process limit, it sets a file-size limit for process core files, so this is not the switch you are looking for... 2. The '-n' option is kind-of better, but you can't set the maximum number of processes without first setting a minimum number. My fix replaces the '-C' option with a '-n' option. Requires testing... --- moa/plugin/job/openLavaActor.py | 23 +++++++++++++++-------- 1 file changed, 15 insertions(+), 8 deletions(-) diff --git a/moa/plugin/job/openLavaActor.py b/moa/plugin/job/openLavaActor.py index b106a916..0eea8cdc 100644 --- a/moa/plugin/job/openLavaActor.py +++ b/moa/plugin/job/openLavaActor.py @@ -37,8 +37,11 @@ def hook_defineCommandOptions(job, parser): parser.add_argument('--olx', default='', dest='openlavaExtra', help='Extra arguments for bsub') - parser.add_argument('--oln', default=1, type=int, dest='openlavaProcs', - help='The number of processors the jobs requires') + parser.add_argument('--olmin', type=int, dest='openlavaProcsMin', + help='The minimum number of processors the job requires') + + parser.add_argument('--olmax', type=int, dest='openlavaProcsMax', + help='The maximum number of processors the job allows') parser.add_argument('--oldummy', default=False, dest='openlavaDummy', action='store_true', @@ -119,12 +122,16 @@ def s(*cl): s("#BSUB -e %s" % errfile) s("#BSUB -q %s" % sysConf.args.openlavaQueue) - if '--oln' in sys.argv: - procs = sysConf.args.openlavaProcs - else: - procs = sysConf.job.conf.get('threads', sysConf.args.openlavaProcs) - - s("#BSUB -C %d" % procs) + # Only specify '-n' if required + if '--olmin' in sys.argv: + minProcs = sysConf.args.openlavaProcsMin + # Max also set? + if '--olmax' in sys.argv: + maxProcs = sysConf.args.openlavaProcsMax + minMaxProcs = "%d,%d" % minProcs, maxProcs + else: + minMaxProcs = "%d" % minProcs + s("#BSUB -n %d" % minMaxProcs) if sysConf.args.openlavaExtra.strip(): s("#BSUB %s" % sysConf.args.openlavaExtra) From 05b440aec9e87031558f0366b9b1555c5f128a91 Mon Sep 17 00:00:00 2001 From: Benjamin Warren Date: Thu, 27 Nov 2014 11:49:35 +1300 Subject: [PATCH 2/5] Correct job dependancy argument syntax --- moa/plugin/job/openLavaActor.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/moa/plugin/job/openLavaActor.py b/moa/plugin/job/openLavaActor.py index 0eea8cdc..a61659ac 100644 --- a/moa/plugin/job/openLavaActor.py +++ b/moa/plugin/job/openLavaActor.py @@ -250,10 +250,10 @@ def s(*cl): #BSUB -m {{ args.openlavaHost }} {%- endif %} -#BSUB -w '({%- for j in job.data.openlava.alljids -%} +#BSUB -w '{%- for j in job.data.openlava.alljids -%} {%- if loop.index0 > 0 %}&&{% endif -%} done({{j}}) -{%- endfor -%})' +{%- endfor -%}' cd {{ job.wd }} echo "Openlava OnSuccess Start" echo "Killing the OnError job" @@ -272,11 +272,11 @@ def s(*cl): {% if args.openlavaHost -%} #BSUB -m {{ args.openlavaHost }} {%- endif %} -#BSUB -w '({%- for j in job.data.openlava.alljids -%} +#BSUB -w '{%- for j in job.data.openlava.alljids -%} {%- if loop.index0 > 0 %}||{% endif -%} exit({{j}},!=0) {%- endfor -%} -)' +' cd {{ job.wd }} echo "Openlava OnError Start" From 3c9566ab2917d038d8de160f5d4e32367df33a5f Mon Sep 17 00:00:00 2001 From: Ben Warren Date: Thu, 27 Nov 2014 16:06:25 +1300 Subject: [PATCH 3/5] edit: fixed syntax for sprintf-like statement --- moa/plugin/job/openLavaActor.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/moa/plugin/job/openLavaActor.py b/moa/plugin/job/openLavaActor.py index a61659ac..3d2c031b 100644 --- a/moa/plugin/job/openLavaActor.py +++ b/moa/plugin/job/openLavaActor.py @@ -128,7 +128,7 @@ def s(*cl): # Max also set? if '--olmax' in sys.argv: maxProcs = sysConf.args.openlavaProcsMax - minMaxProcs = "%d,%d" % minProcs, maxProcs + minMaxProcs = "%d,%d" % (minProcs, maxProcs) else: minMaxProcs = "%d" % minProcs s("#BSUB -n %d" % minMaxProcs) From abc1db745a40d062e4b799fd8f26f03c9a4e083f Mon Sep 17 00:00:00 2001 From: Ben Warren Date: Thu, 27 Nov 2014 16:12:01 +1300 Subject: [PATCH 4/5] edit: fixed more syntax, var is now a string, not an int --- moa/plugin/job/openLavaActor.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/moa/plugin/job/openLavaActor.py b/moa/plugin/job/openLavaActor.py index 3d2c031b..f3d8aa64 100644 --- a/moa/plugin/job/openLavaActor.py +++ b/moa/plugin/job/openLavaActor.py @@ -131,7 +131,7 @@ def s(*cl): minMaxProcs = "%d,%d" % (minProcs, maxProcs) else: minMaxProcs = "%d" % minProcs - s("#BSUB -n %d" % minMaxProcs) + s("#BSUB -n %s" % minMaxProcs) if sysConf.args.openlavaExtra.strip(): s("#BSUB %s" % sysConf.args.openlavaExtra) From 5ad62819ce35bf81c3f6321571e24cbd2d83ac52 Mon Sep 17 00:00:00 2001 From: Benjamin Warren Date: Tue, 27 Jan 2015 15:30:28 +1300 Subject: [PATCH 5/5] enabled git integration --- moa/data/etc/config | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/moa/data/etc/config b/moa/data/etc/config index 98f37374..84f3d166 100644 --- a/moa/data/etc/config +++ b/moa/data/etc/config @@ -18,7 +18,7 @@ plugins: system: moaGit: module: moa.plugin.system.moaGit - enabled: false + enabled: true enforce: false commit: - '.moa/template'