1 |
|
from Actor import * |
2 |
+ |
import EdgLoggingInfo |
3 |
|
import common |
4 |
|
import string, os |
5 |
|
|
22 |
|
|
23 |
|
# run a list-match on first job |
24 |
|
for nj in self.nj_list: |
25 |
+ |
#nj parte da 1 --> nj = internal_id di boss |
26 |
|
if self.flag_useboss == 1 : |
27 |
< |
id = common.scheduler.boss_SID(nj+1) |
28 |
< |
else: |
29 |
< |
id = common.jobDB.jobId(nj) |
27 |
> |
id = common.scheduler.boss_SID(nj) |
28 |
> |
#print "id = ", id |
29 |
> |
#else: |
30 |
> |
# id = common.jobDB.jobId(nj) |
31 |
|
out = common.scheduler.loggingInfo(id) |
32 |
< |
job = common.job_list[nj] |
32 |
> |
# job_list inizia a contare da zero |
33 |
> |
job = common.job_list[nj-1] |
34 |
> |
#print "job.jdlFilename()", job.jdlFilename() |
35 |
|
jdl_fname = string.replace(job.jdlFilename(),'jdl','loggingInfo') |
36 |
+ |
#print "jdl_fname = ", jdl_fname |
37 |
|
if os.path.exists(jdl_fname): |
38 |
< |
common.logger.message('Logging info for job '+str(nj+1)+' already present in '+jdl_fname+' Remove it for update') |
38 |
> |
common.logger.message('Logging info for job '+str(nj)+' already present in '+jdl_fname+' Remove it for update') |
39 |
|
continue |
40 |
|
jdl = open(jdl_fname, 'w') |
41 |
|
for line in out: jdl.write(line) |
42 |
|
jdl.close() |
43 |
< |
common.logger.message('Logging info for job '+str(nj+1)+' written to '+jdl_fname) |
43 |
> |
|
44 |
> |
loggingInfo = EdgLoggingInfo.EdgLoggingInfo() |
45 |
> |
|
46 |
> |
reason = loggingInfo.decodeReason(out) |
47 |
> |
|
48 |
> |
common.logger.message('Logging info for job '+str(nj)+': '+reason+'\n written to '+jdl_fname) |
49 |
|
|
50 |
+ |
# ML reporting |
51 |
+ |
jobId = '' |
52 |
+ |
if common.scheduler.boss_scheduler_name == 'condor_g': |
53 |
+ |
# create hash of cfg file |
54 |
+ |
hash = makeCksum(common.work_space.cfgFileName()) |
55 |
+ |
jobId = str(nj) + '_' + hash + '_' + id |
56 |
+ |
else: |
57 |
+ |
jobId = str(nj) + '_' + id |
58 |
+ |
|
59 |
+ |
params = {'taskId': self.cfg_params['taskId'], 'jobId': jobId, \ |
60 |
+ |
'sid': id, |
61 |
+ |
'PostMortemCategory': loggingInfo.getCategory(), \ |
62 |
+ |
'PostMortemReason': loggingInfo.getReason()} |
63 |
+ |
self.cfg_params['apmon'].sendToML(params) |
64 |
|
pass |
65 |
|
|
66 |
|
return |