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

Comparing COMP/CRAB/python/SchedulerRcondor.py (file contents):
Revision 1.6 by belforte, Tue Aug 7 23:05:18 2012 UTC vs.
Revision 1.9 by belforte, Fri Aug 10 17:04:28 2012 UTC

# Line 13 | Line 13 | from WMCore.SiteScreening.BlackWhiteList
13   import common
14   import os
15   import socket
16 + import re
17  
18   # FUTURE: for python 2.4 & 2.6
19   try:
# Line 31 | Line 32 | class SchedulerRcondor(SchedulerGrid) :
32      def __init__(self):
33          SchedulerGrid.__init__(self,"RCONDOR")
34          self.rcondorHost   = os.getenv('RCONDOR_HOST')
35 +        if self.rcondorHost == None:
36 +            raise CrabException('FATAL ERROR: env.var RCONDOR_HOST not defined')
37          self.datasetPath   = None
38          self.selectNoInput = None
39          self.OSBsize = 50*1000*1000 # 50 MB
40  
41          self.environment_unique_identifier = None
42 +
43          return
44  
45  
# Line 49 | Line 53 | class SchedulerRcondor(SchedulerGrid) :
53          self.proxyValid=0
54          self.dontCheckProxy=int(cfg_params.get("GRID.dont_check_proxy",0))
55          self.space_token = cfg_params.get("USER.space_token",None)
56 <        try:
53 <            self.proxyServer = Downloader("http://cmsdoc.cern.ch/cms/LCG/crab/config/").config("myproxy_server.conf")
54 <            self.proxyServer = self.proxyServer.strip()
55 <            if self.proxyServer is None:
56 <                raise CrabException("myproxy_server.conf retrieved but empty")
57 <        except Exception, e:
58 <            common.logger.info("Problem setting myproxy server endpoint: using myproxy.cern.ch")
59 <            common.logger.debug(e)
60 <            self.proxyServer= 'myproxy.cern.ch'
56 >        self.proxyServer= 'myproxy.cern.ch'
57          self.group = cfg_params.get("GRID.group", None)
58          self.role = cfg_params.get("GRID.role", None)
59          self.VO = cfg_params.get('GRID.virtual_organization','cms')
60 +        
61 +        self.cmsswVer  = os.environ["CMSSW_VERSION"]
62 +        self.scramArch = os.environ["SCRAM_ARCH"]
63  
64          try:
65              tmp =  cfg_params['CMSSW.datasetpath']
# Line 105 | Line 104 | class SchedulerRcondor(SchedulerGrid) :
104          seString=self.blackWhiteListParser.cleanForBlackWhiteList(seDest)
105  
106          jobParams += '+DESIRED_SEs = "'+seString+'"; '
108        myschedName = self.rcondorHost
109        jobParams += '+Glidein_MonitorID = "https://'+ myschedName + '//$(Cluster).$(Process)"; '
110
111        if (self.EDG_clock_time):
112            jobParams += '+MaxWallTimeMins = '+self.EDG_clock_time+'; '
113        else:
114            jobParams += '+MaxWallTimeMins = %d; ' % (60*24)
115
116        common._db.updateTask_({'jobType':jobParams})
117
118
119        return jobParams
120
121
122    def realSchedParams(self, cfg_params):
123        """
124        Return dictionary with specific parameters, to use with real scheduler
125        is called when scheduler is initialized in Boss, i.e. at each crab command
126        """
107  
108 <        tmpDir = os.path.join(common.work_space.shareDir(),'.condor_temp')
109 <        tmpDir = os.path.join(common.work_space.shareDir(),'.condor_temp')
110 <        jobDir = common.work_space.jobDir()
108 >        cmsVersion=self.cmsswVer
109 >        cmsver=re.split('_', cmsVersion)
110 >        numericCmsVersion = "%s%.2d%.2d" %(cmsver[1], int(cmsver[2]), int(cmsver[3]))
111  
112 <        taskDir=common.work_space.topDir().split('/')[-2]
113 <        rcondorDir ='%s/.rcondor/%s/mount/' % (os.getenv('HOME'),self.rcondorHost)
112 >        jobParams += '+DESIRED_CMSVersion ="' +cmsVersion+'";'
113 >        jobParams += '+DESIRED_CMSVersionNr ="' +numericCmsVersion+'";'
114 >        
115 >        myschedName = self.rcondorHost
116 >        jobParams += '+Glidein_MonitorID = "https://'+ myschedName + '//$(Cluster).$(Process)"; '
117  
118          if (self.EDG_clock_time):
119              jobParams += '+MaxWallTimeMins = '+self.EDG_clock_time+'; '
# Line 148 | Line 131 | class SchedulerRcondor(SchedulerGrid) :
131          Return dictionary with specific parameters, to use with real scheduler
132          is called when scheduler is initialized in Boss, i.e. at each crab command
133          """
134 +        #SB this method is used to pass directory names to Boss Scheduler
135 +        # via params dictionary
136  
152        tmpDir = os.path.join(common.work_space.shareDir(),'.condor_temp')
153        tmpDir = os.path.join(common.work_space.shareDir(),'.condor_temp')
137          jobDir = common.work_space.jobDir()
155
138          taskDir=common.work_space.topDir().split('/')[-2]
139 <        rcondorDir ='%s/.rcondor/%s/mount/' % (os.getenv('HOME'),self.rcondorHost)
140 <        tmpDir = os.path.join(rcondorDir,taskDir)
159 <        tmpDir = os.path.join(tmpDir,'condor_temp')
139 >        shareDir = common.work_space.shareDir()
140 >        #SBtmpDir = common.work_space.tmpDir()
141          
142 <        params = {'tmpDir':tmpDir,
143 <                  'jobDir':jobDir}
142 >        params = {'rcondorHost':self.rcondorHost,
143 >                  'shareDir':shareDir,
144 >                  #SB'tmpDir':tmpDir,
145 >                  'jobDir':jobDir,
146 >                  'taskDir':taskDir}
147  
148          return params
149  

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines