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

change stepchain timeperevent calculation #961

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 15 additions & 2 deletions Unified/rejector.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
haozturk marked this conversation as resolved.
Show resolved Hide resolved
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')
Expand All @@ -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
Expand All @@ -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:
Expand Down