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.5 by belforte, Thu Jul 26 23:04:13 2012 UTC vs.
Revision 1.11 by belforte, Sun Aug 19 17:28:19 2012 UTC

# Line 5 | Line 5 | Implements the vanilla (local) Remote Co
5   from SchedulerGrid  import SchedulerGrid
6   from crab_exceptions import CrabException
7   from crab_util import runCommand
8 #from WMCore.SiteScreening.BlackWhiteListParser import CEBlackWhiteListParser
8   from WMCore.SiteScreening.BlackWhiteListParser import SEBlackWhiteListParser
9 <
9 > import Scram
10  
11  
12   import common
13   import os
14   import socket
15 + import re
16  
17   # FUTURE: for python 2.4 & 2.6
18   try:
# Line 30 | Line 30 | class SchedulerRcondor(SchedulerGrid) :
30  
31      def __init__(self):
32          SchedulerGrid.__init__(self,"RCONDOR")
33 +        self.rcondorHost   = os.getenv('RCONDOR_HOST')
34 +        if self.rcondorHost == None:
35 +            raise CrabException('FATAL ERROR: env.var RCONDOR_HOST not defined')
36          self.datasetPath   = None
37          self.selectNoInput = None
38          self.OSBsize = 50*1000*1000 # 50 MB
39  
40          self.environment_unique_identifier = None
41 +
42          return
43  
44  
# Line 48 | Line 52 | class SchedulerRcondor(SchedulerGrid) :
52          self.proxyValid=0
53          self.dontCheckProxy=int(cfg_params.get("GRID.dont_check_proxy",0))
54          self.space_token = cfg_params.get("USER.space_token",None)
55 <        try:
52 <            self.proxyServer = Downloader("http://cmsdoc.cern.ch/cms/LCG/crab/config/").config("myproxy_server.conf")
53 <            self.proxyServer = self.proxyServer.strip()
54 <            if self.proxyServer is None:
55 <                raise CrabException("myproxy_server.conf retrieved but empty")
56 <        except Exception, e:
57 <            common.logger.info("Problem setting myproxy server endpoint: using myproxy.cern.ch")
58 <            common.logger.debug(e)
59 <            self.proxyServer= 'myproxy.cern.ch'
55 >        self.proxyServer= 'myproxy.cern.ch'
56          self.group = cfg_params.get("GRID.group", None)
57          self.role = cfg_params.get("GRID.role", None)
58          self.VO = cfg_params.get('GRID.virtual_organization','cms')
59 <
59 >        
60          try:
61              tmp =  cfg_params['CMSSW.datasetpath']
62              if tmp.lower() == 'none':
# Line 73 | Line 69 | class SchedulerRcondor(SchedulerGrid) :
69              msg = "Error: datasetpath not defined "
70              raise CrabException(msg)
71  
72 +        if cfg_params.get('GRID.ce_black_list', None) or \
73 +           cfg_params.get('GRID.ce_white_list', None) :
74 +            msg="BEWARE: scheduler RGLIDEIN ignores CE black/white lists."
75 +            msg+="\n Remove them from crab configuration to proceed."
76 +            msg+="\n Use GRID.se_white_list and/or GRID.se_black_list instead"
77 +            raise CrabException(msg)
78 +
79          self.checkProxy()
80  
81          return
# Line 105 | Line 108 | class SchedulerRcondor(SchedulerGrid) :
108  
109          jobParams += '+DESIRED_SEs = "'+seString+'"; '
110  
111 +        scram = Scram.Scram(None)
112 +        cmsVersion = scram.getSWVersion()
113 +        scramArch  = scram.getArch()
114 +        
115 +        cmsver=re.split('_', cmsVersion)
116 +        numericCmsVersion = "%s%.2d%.2d" %(cmsver[1], int(cmsver[2]), int(cmsver[3]))
117 +
118 +        jobParams += '+DESIRED_CMSVersion ="' +cmsVersion+'";'
119 +        jobParams += '+DESIRED_CMSVersionNr ="' +numericCmsVersion+'";'
120 +        jobParams += '+DESIRED_CMSScramArch ="' +scramArch+'";'
121 +        
122 +        myschedName = self.rcondorHost
123 +        jobParams += '+Glidein_MonitorID = "https://'+ myschedName + '//$(Cluster).$(Process)"; '
124 +
125          if (self.EDG_clock_time):
126              jobParams += '+MaxWallTimeMins = '+self.EDG_clock_time+'; '
127          else:
# Line 121 | Line 138 | class SchedulerRcondor(SchedulerGrid) :
138          Return dictionary with specific parameters, to use with real scheduler
139          is called when scheduler is initialized in Boss, i.e. at each crab command
140          """
141 +        #SB this method is used to pass directory names to Boss Scheduler
142 +        # via params dictionary
143  
125        tmpDir = os.path.join(common.work_space.shareDir(),'.condor_temp')
126        tmpDir = os.path.join(common.work_space.shareDir(),'.condor_temp')
144          jobDir = common.work_space.jobDir()
128
145          taskDir=common.work_space.topDir().split('/')[-2]
146 <        rcondorDir ='%s/.rcondor/%s/mount/' % (os.getenv('HOME'),os.getenv('RCONDOR_HOST'))
147 <        tmpDir = os.path.join(rcondorDir,taskDir)
132 <        tmpDir = os.path.join(tmpDir,'condor_temp')
146 >        shareDir = common.work_space.shareDir()
147 >        #SBtmpDir = common.work_space.tmpDir()
148          
149 <        params = {'tmpDir':tmpDir,
150 <                  'jobDir':jobDir}
149 >        params = {'rcondorHost':self.rcondorHost,
150 >                  'shareDir':shareDir,
151 >                  #SB'tmpDir':tmpDir,
152 >                  'jobDir':jobDir,
153 >                  'taskDir':taskDir}
154  
155          return params
156  

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines