Skip to content
This repository was archived by the owner on Sep 12, 2024. It is now read-only.

Commit 5c4c05b

Browse files
committed
enforce single-core in steps where coresponding tasks were single-core
1 parent b5015a3 commit 5c4c05b

1 file changed

Lines changed: 11 additions & 1 deletion

File tree

Unified/rejector.py

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,9 @@ def rejector(url, specific, options=None):
8686
wfo.status = 'trouble'
8787
session.commit()
8888
schema = wfi.getSchema()
89+
if options.test:
90+
print "Original schema"
91+
print json.dumps( schema, indent=2 )
8992
schema['Requestor'] = os.getenv('USER')
9093
schema['Group'] = 'DATAOPS'
9194
schema['OriginalRequestName'] = wfo.name
@@ -217,7 +220,13 @@ def rejector(url, specific, options=None):
217220
if 'Task%d'%step in schema:
218221
sname = 'Step%d'%step
219222
schema[sname] = schema.pop('Task%d'%step)
220-
tmcore = schema[sname].pop('Multicore')
223+
if 'Multicore' in schema[sname] and schema[sname]['Multicore']==1:
224+
# enforce single-core mode assuming that all Tasks with
225+
# Multicore=1 are not thread-safe
226+
tmcore = schema[sname]['Multicore']
227+
else:
228+
# remove explicit assignment of the number of cores
229+
tmcore = schema[sname].pop('Multicore')
221230
tmem = schema[sname].pop('Memory')
222231
if mcore and tmcore != mcore:
223232
if options.test:
@@ -253,6 +262,7 @@ def rejector(url, specific, options=None):
253262
break
254263
schema['Multicore'] = mcore
255264
schema['Memory'] = mem
265+
print "New request schema"
256266
print json.dumps( schema, indent=2 )
257267
if not options.test:
258268
newWorkflow = reqMgrClient.submitWorkflow(url, schema)

0 commit comments

Comments
 (0)