ViewVC Help
View File | Revision Log | Show Annotations | Root Listing
root/cvsroot/COMP/CRAB/python/PostMortem.py
Revision: 1.3
Committed: Fri Dec 16 16:31:44 2005 UTC (19 years, 4 months ago) by fanzago
Content type: text/x-python
Branch: MAIN
CVS Tags: post_cmssw_integration_20060527, pre_cmssw_integration_20060527, CRAB_1_1_0, CRAB_1_1_0_pre4, CRAB_1_1_0_pre3, CRAB_1_1_0_pre1, CRAB_1_0_7, CRAB_1_0_7_pre1, CRAB_1_0_6, CRAB_1_0_5, CRAB_1_0_4
Changes since 1.2: +11 -6 lines
Log Message:
fixed postmortem

File Contents

# Content
1 from Actor import *
2 import common
3 import string, os
4
5 class PostMortem(Actor):
6 def __init__(self, cfg_params, nj_list, use_boss):
7 self.cfg_params = cfg_params
8 self.nj_list = nj_list
9 self.flag_useboss = use_boss
10 return
11
12 def run(self):
13 """
14 The main method of the class.
15 """
16 common.logger.debug(5, "PostMortem::run() called")
17
18 if len(self.nj_list)==0:
19 common.logger.debug(5, "No jobs to check")
20 return
21
22 # run a list-match on first job
23 for nj in self.nj_list:
24 #nj parte da 1 --> nj = internal_id di boss
25 if self.flag_useboss == 1 :
26 id = common.scheduler.boss_SID(nj)
27 #print "id = ", id
28 #else:
29 # id = common.jobDB.jobId(nj)
30 out = common.scheduler.loggingInfo(id)
31 # job_list inizia a contare da zero
32 job = common.job_list[nj-1]
33 #print "job.jdlFilename()", job.jdlFilename()
34 jdl_fname = string.replace(job.jdlFilename(),'jdl','loggingInfo')
35 #print "jdl_fname = ", jdl_fname
36 if os.path.exists(jdl_fname):
37 common.logger.message('Logging info for job '+str(nj)+' already present in '+jdl_fname+' Remove it for update')
38 continue
39 jdl = open(jdl_fname, 'w')
40 for line in out: jdl.write(line)
41 jdl.close()
42 common.logger.message('Logging info for job '+str(nj)+' written to '+jdl_fname)
43
44 pass
45
46 return
47