16 |
|
The main method of the class: report status of a task |
17 |
|
""" |
18 |
|
common.logger.debug( "Reporter::run() called") |
19 |
< |
task = common._db.getTask() |
20 |
< |
#print self.cfg_params |
21 |
< |
print "\n----------------------------\n" |
22 |
< |
print "Dataset: ",task['dataset'] |
19 |
> |
task = common.scheduler.queryEverything(1) |
20 |
> |
msg= "--------------------\n" |
21 |
> |
msg += "Dataset: %s\n"%str(task['dataset']) |
22 |
|
if self.cfg_params.has_key('USER.copy_data') and int(self.cfg_params['USER.copy_data'])==1: |
23 |
< |
print "Remote output :" |
23 |
> |
msg+= "Remote output :\n" |
24 |
|
## TODO: SL should come from jobDB! |
25 |
|
from PhEDExDatasvcInfo import PhEDExDatasvcInfo |
26 |
|
stageout = PhEDExDatasvcInfo(self.cfg_params) |
27 |
|
endpoint, lfn, SE, SE_PATH, user = stageout.getEndpoint() |
28 |
|
#print endpoint, lfn, SE, SE_PATH, user |
29 |
|
|
30 |
< |
print "SE:",self.cfg_params['USER.storage_element'],SE," srmPath:",endpoint |
30 |
> |
msg+= "SE: %s %s srmPath: %s\n"%(self.cfg_params['USER.storage_element'],SE,endpoint) |
31 |
|
|
32 |
|
else: |
33 |
< |
print "Local output: ",task['outputDirectory'] |
33 |
> |
msg+= "Local output: %s"%task['outputDirectory'] |
34 |
|
#print task |
35 |
|
from ProdCommon.FwkJobRep.ReportParser import readJobReport |
36 |
|
possible_status = [ 'Created', |
77 |
|
pass |
78 |
|
#print 'no FJR avaialble for job #%s'%job['jobId'] |
79 |
|
#print "--------------------------" |
80 |
< |
print "Total Events read: ",eventsRead," required: ",eventsRequired |
81 |
< |
print "Total Files read: ",filesRead," required: ",filesRequired |
82 |
< |
print "Total Jobs : ",len(task.getJobs()) |
80 |
> |
msg+= "Total Events read: %s required: %s\n"%(eventsRead,eventsRequired) |
81 |
> |
msg+= "Total Files read: %s reuired: %s\n"%(filesRead,filesRequired) |
82 |
> |
msg+= "Total Jobs : %s \n"%len(task.getJobs()) |
83 |
|
list_ID={} |
84 |
|
for st in possible_status: |
85 |
|
list_ID = common._db.queryAttrRunJob({'statusScheduler':st},'jobId') |
86 |
|
if (len(list_ID)>0): |
87 |
< |
print " # Jobs:",str(st),":",len(list_ID) |
87 |
> |
msg+= " # Jobs: %s:%s\n"%(str(st),len(list_ID)) |
88 |
|
pass |
89 |
< |
print "\n----------------------------\n" |
90 |
< |
|
89 |
> |
msg+= "\n----------------------------\n" |
90 |
> |
common.logger.info(msg) |
91 |
|
return |