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

Comparing COMP/CRAB/python/SchedulerCaf.py (file contents):
Revision 1.6.2.3 by fanzago, Tue Jul 15 10:51:25 2008 UTC vs.
Revision 1.21 by belforte, Thu Jan 17 14:48:12 2013 UTC

# Line 1 | Line 1
1   from Scheduler import Scheduler
2   from SchedulerLsf import SchedulerLsf
3   from crab_exceptions import *
4 from crab_logger import Logger
4   import common
5  
6   import os,string
# Line 17 | Line 16 | class SchedulerCaf(SchedulerLsf) :
16      def __init__(self):
17          SchedulerLsf.__init__(self)
18          Scheduler.__init__(self,"CAF")
19 +        self.OSBsize = 55*1000*1000  # 55 MB
20 +
21          return
22  
23      def configure(self, cfg_params):
# Line 24 | Line 25 | class SchedulerCaf(SchedulerLsf) :
25          CAF is just a special queue and resources for LSF at CERN
26          """
27          SchedulerLsf.configure(self, cfg_params)
28 <        self.queue = cfg_params.get(self.name().upper()+'.queue','cmscaf')
29 <        self.res = cfg_params.get(self.name().upper()+'.resource','cmscaf')
30 <        self.pool = cfg_params.get('USER.storage_pool','cmscafuser')
28 >        self.queue = cfg_params.get(self.name().upper()+'.queue','cmscaf1nw')
29 >        self.res = cfg_params.get(self.name().upper()+'.resource','"type==SLC5_64 || type==SLC4_64"')
30 >        self.group = cfg_params.get(self.name().upper()+'.group', None)
31  
32 <    def wsSetupEnvironment(self):
32 >    def sched_parameter(self,i,task):
33          """
34 <        Returns part of a job script which does scheduler-specific work.
34 >        Returns parameter scheduler-specific, to use with BOSS .
35          """
36 +        sched_param= ''
37 +
38 +        if (self.queue):
39 +            sched_param += '-q '+self.queue +' '
40 +        if (self.res): sched_param += ' -R '+self.res +' '
41 +        if (self.group): sched_param += ' -G '+str(self.group).upper() +' '
42 +        return sched_param
43 +
44 +    def wsSetupEnvironment(self):
45 +        #Returns part of a job script which does scheduler-specific work.
46          txt = SchedulerLsf.wsSetupEnvironment(self)
47          txt += '# CAF specific stuff\n'
48 +        txt += 'echo "----- ENV CAF BEFORE sourcing /afs/cern.ch/cms/caf/setup.sh  -----"\n'
49 +        txt += 'echo "CMS_PATH = $CMS_PATH"\n'
50 +        txt += 'echo "STAGE_SVCCLASS = $STAGE_SVCCLASS"\n'
51 +        txt += 'echo "STAGER_TRACE = $STAGER_TRACE"\n'
52 +        txt += 'source /afs/cern.ch/cms/caf/setup.sh \n'
53 +        txt += '\n'
54 +        txt += 'echo "----- ENV CAF AFTER sourcing /afs/cern.ch/cms/caf/setup.sh  -----"\n'
55 +        txt += 'echo "CMS_PATH = $CMS_PATH"\n'
56 +        txt += 'echo "STAGE_SVCCLASS = $STAGE_SVCCLASS"\n'
57 +        txt += 'echo "STAGER_TRACE = $STAGER_TRACE"\n'
58          txt += '\n'
59          return txt
60  
61 <    def wsCopyOutput(self):
62 <        ### default is the name of the storage pool
63 <        ### where users can copy job outputs  
64 <        txt=self.wsCopyOutput_tmp(self.pool)
61 >    def wsExitFunc(self):
62 >        """
63 >        """
64 >        txt = '\n'
65 >
66 >        txt += '#\n'
67 >        txt += '# EXECUTE THIS FUNCTION BEFORE EXIT \n'
68 >        txt += '#\n\n'
69 >        txt += 'func_exit() { \n'
70 >        txt += self.wsExitFunc_common()
71 >
72 >        txt += '    cp *.${LSB_BATCH_JID}.out CMSSW_${NJob}.stdout \n'
73 >        txt += '    cp *.${LSB_BATCH_JID}.err CMSSW_${NJob}.stderr \n'
74 >        txt += '    exit $job_exit_code\n'
75 >        txt += '}\n'
76          return txt

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines