ViewVC Help
View File | Revision Log | Show Annotations | Root Listing
root/cvsroot/COMP/CRAB/python/SchedulerLsf.py
(Generate patch)

Comparing COMP/CRAB/python/SchedulerLsf.py (file contents):
Revision 1.7 by slacapra, Fri Apr 11 14:54:22 2008 UTC vs.
Revision 1.14 by spiga, Wed Jun 11 10:03:07 2008 UTC

# Line 17 | Line 17 | class SchedulerLsf(SchedulerLocal) :
17  
18      def __init__(self):
19          Scheduler.__init__(self,"LSF")
20 <
20 >        
21          return
22  
23      def configure(self, cfg_params):
24          SchedulerLocal.configure(self, cfg_params)
25 +        self.outputDir = cfg_params.get('USER.outputdir' ,common.work_space.resDir())
26          self.environment_unique_identifier = "https://"+common.scheduler.name()+":/${LSB_BATCH_JID}-"+ \
27              string.replace(common._db.queryTask('name'),"_","-")
28  
29          return
30  
31 +    def realSchedParams(self,cfg_params):
32 +        """
33 +        Return dictionary with specific parameters, to use
34 +        with real scheduler  
35 +        """
36 +        ### use by the BossLite script
37 +        self.cpCmd  =  cfg_params.get(self.name().upper()+'.cp_command','cp')
38 +        self.rfioName =  cfg_params.get(self.name().upper()+'.rfio_server','')
39 +
40 +        params = { 'cpCmd'  : self.cpCmd, \
41 +                   'rfipName' : self.rfioName
42 +                 }
43 +        return  params
44 +
45      def sched_parameter(self,i,task):
46          """
47          Returns parameter scheduler-specific, to use with BOSS .
# Line 42 | Line 57 | class SchedulerLsf(SchedulerLocal) :
57                  if (self.res): sched_param += ' -R '+self.res +' '
58              pass
59  
60 <        sched_param+='-cwd '+common.work_space.resDir() + ' '
60 >        sched_param+='-cwd '+ str(self.outputDir)  + ' '
61          return sched_param
62  
63      def loggingInfo(self, id):
# Line 51 | Line 66 | class SchedulerLsf(SchedulerLocal) :
66          cmd_out = runCommand(cmd)
67          return cmd_out
68  
69 <        return
69 >    def wsExitFunc(self):
70 >        """
71 >        """
72 >        txt = '\n'
73 >
74 >        txt += '#\n'
75 >        txt += '# EXECUTE THIS FUNCTION BEFORE EXIT \n'
76 >        txt += '#\n\n'
77 >
78 >        txt += 'func_exit() { \n'
79 >        txt += self.wsExitFunc_common()
80 >
81 >        txt += '    cp *.${LSB_BATCH_JID}.out CMSSW_${NJob}.stdout \n'
82 >        txt += '    cp *.${LSB_BATCH_JID}.err CMSSW_${NJob}.stderr \n'
83 >        txt += '    tar zcvf ${out_files}.tgz  ${filesToCheck}\n'
84 >        txt += '    exit $job_exit_code\n'
85 >        txt += '}\n'
86 >
87 >        return txt
88 >

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines