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