16 |
|
The main method of the class: report status of a task |
17 |
|
""" |
18 |
|
common.logger.debug( "Reporter::run() called") |
19 |
< |
task = common.scheduler.queryEverything(1) |
19 |
> |
task = common._db.getTask() |
20 |
> |
|
21 |
|
msg= "--------------------\n" |
22 |
|
msg += "Dataset: %s\n"%str(task['dataset']) |
23 |
|
if self.cfg_params.has_key('USER.copy_data') and int(self.cfg_params['USER.copy_data'])==1: |
24 |
|
msg+= "Remote output :\n" |
25 |
|
## TODO: SL should come from jobDB! |
26 |
|
from PhEDExDatasvcInfo import PhEDExDatasvcInfo |
27 |
+ |
|
28 |
|
stageout = PhEDExDatasvcInfo(self.cfg_params) |
29 |
|
endpoint, lfn, SE, SE_PATH, user = stageout.getEndpoint() |
30 |
|
#print endpoint, lfn, SE, SE_PATH, user |
61 |
|
if (job.runningJob['applicationReturnCode']>0 or job.runningJob['wrapperReturnCode']>0): continue |
62 |
|
# get FJR filename |
63 |
|
fjr=task['outputDirectory']+job['outputFiles'][-1] |
62 |
– |
#print fjr |
64 |
|
jobReport = readJobReport(fjr) |
65 |
|
if len(jobReport)>0: |
66 |
|
inputFiles=jobReport[0].inputFiles |
72 |
|
# print "Run",run,": lumi sections",runs[run] |
73 |
|
filesRead+=1 |
74 |
|
eventsRead+=int(inputFile['EventsRead']) |
74 |
– |
|
75 |
|
#print jobReport[0].inputFiles,'\n' |
76 |
|
else: |
77 |
|
pass |
81 |
|
msg+= "Total Files read: %s reuired: %s\n"%(filesRead,filesRequired) |
82 |
|
msg+= "Total Jobs : %s \n"%len(task.getJobs()) |
83 |
|
list_ID={} |
84 |
+ |
upTask = common.scheduler.queryEverything(task['id']) |
85 |
|
for st in possible_status: |
86 |
|
list_ID = common._db.queryAttrRunJob({'statusScheduler':st},'jobId') |
87 |
|
if (len(list_ID)>0): |
90 |
|
msg+= "\n----------------------------\n" |
91 |
|
common.logger.info(msg) |
92 |
|
return |
93 |
+ |
|
94 |
+ |
|