diff --git a/Unified/rejector.py b/Unified/rejector.py index 24d60dd00..21c60a93c 100755 --- a/Unified/rejector.py +++ b/Unified/rejector.py @@ -211,6 +211,19 @@ def rejector(url, specific, options=None): ## transform the schema into StepChain schema print "Transforming a TaskChain into a StepChain" mcore = 0 + ## find maximum mcore + it=1 + while True: + tt = 'Task%d'% it + it+=1 + if tt in schema: + tmcore = schema[tt].get('Multicore',1) + mcore = max(mcore, tmcore) + else: + break + if mcore > UC.get("max_nCores_for_stepchain"): + mcore = UC.get("max_nCores_for_stepchain") + mem = 0 schema['RequestType'] = 'StepChain' schema['StepChain'] = schema.pop('TaskChain') @@ -236,7 +249,6 @@ def rejector(url, specific, options=None): else: wfi.sendLog('rejector','the conversion to stepchain encoutered different value of Multicore %d != %d'%( tmcore, mcore)) sendLog('rejector','the conversion of %s to stepchain encoutered different value of Multicore %d != %d'%( wfo.name, tmcore, mcore)) - mcore = max(mcore, tmcore) mem = max(mem, tmem) schema[sname]['StepName'] = schema[sname].pop('TaskName') s_n[ schema[sname]['StepName'] ] = sname @@ -257,7 +269,8 @@ def rejector(url, specific, options=None): if not 'KeepOutput' in schema[sname]: ## this is a weird translation capability. Absence of keepoutput in step means : keep the output. while in TaskChain absence means : drop schema[sname]['KeepOutput'] = False - schema['TimePerEvent'] += eff*schema[sname].pop('TimePerEvent') + factor = (float(tmcore) / float(mcore)) + schema['TimePerEvent'] += eff*schema[sname].pop('TimePerEvent')*factor schema['SizePerEvent'] += eff*schema[sname].pop('SizePerEvent') step+=1 else: