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

Comparing COMP/CRAB/python/SchedulerGlite.py (file contents):
Revision 1.64 by spiga, Sat Nov 8 11:57:03 2008 UTC vs.
Revision 1.80 by farinafa, Thu Apr 29 10:23:06 2010 UTC

# Line 6 | Line 6 | __revision__ = "$Id$"
6   __version__ = "$Revision$"
7  
8   from SchedulerGrid import SchedulerGrid
9 from crab_logger import Logger
9   from crab_exceptions import *
10   from crab_util import *
12 from GliteConfig import *
11   import EdgLoggingInfo
12   import common
13 + from WMCore.SiteScreening.BlackWhiteListParser import CEBlackWhiteListParser
14  
15   import os, sys, time
16  
# Line 31 | Line 30 | class SchedulerGlite(SchedulerGrid):
30          with real scheduler
31          """
32          self.rb_param_file=''
33 <        if (not cfg_params.has_key('EDG.rb')):
34 <            cfg_params['EDG.rb']='CERN'
35 <        self.rb_param_file=common.scheduler.rb_configure(cfg_params.get("EDG.rb"))
36 <        self.wms_service=cfg_params.get("EDG.wms_service",'')
37 <        self.skipWMSAuth=cfg_params.get("EDG.skipwmsauth",1)
33 >        if (not cfg_params.has_key('GRID.rb')):
34 >            cfg_params['GRID.rb']='CERN'
35 >        self.rb_param_file=common.scheduler.rb_configure(cfg_params.get("GRID.rb"))
36 >        self.wms_service=cfg_params.get("GRID.wms_service",'')
37 >        self.skipWMSAuth=cfg_params.get("GRID.skipwmsauth",1)
38          params = { 'service' : self.wms_service, \
39                     'config' : self.rb_param_file, \
40                     'skipWMSAuth' : self.skipWMSAuth
# Line 44 | Line 43 | class SchedulerGlite(SchedulerGrid):
43  
44  
45      def rb_configure(self, RB):
46 +        url ='http://cmsdoc.cern.ch/cms/LCG/crab/config/'
47 +        from Downloader import Downloader
48 +        import httplib
49 +        common.logger.debug('Downloading config files for WMS: '+url)
50 +        ## 25-Jun-2009 SL: patch to use Cream enabled WMS
51 +        if ( self.cfg_params.get('GRID.use_cream',None) ):
52 +            RB='CREAM'
53          if not RB: return None
48        glite_config = None
54          rb_param_file = None
55 +        configFileName = 'glite_wms_'+str(RB)+'.conf'
56  
57 <        gliteConfig = GliteConfig(RB)
58 <        glite_config = gliteConfig.config()
57 >        results = Downloader(url)
58 >        try:
59 >            gliteConfig  = results.filePath(configFileName)
60 >        except httplib.HTTPException, ex:
61 >            raise CrabException( "Problem getting RB config file: %s, reason:"%(configFileName, ex) )
62  
63 <        if (glite_config ):
64 <            rb_param_file = glite_config
63 >        if (gliteConfig ):
64 >            rb_param_file = gliteConfig
65          return rb_param_file
66  
67      def ce_list(self):
68          """
69          Returns string with requirement CE related
70          """
71 +        ceParser = CEBlackWhiteListParser(self.EDG_ce_white_list,
72 +                                          self.EDG_ce_black_list, common.logger())
73          req = ''
74 +        ce_white_list = []
75 +        ce_black_list = []
76          if self.EDG_ce_white_list:
77 <            ce_white_list = self.EDG_ce_white_list
77 >            ce_white_list = ceParser.whiteList()
78              tmpCe=[]
79              concString = '&&'
80              for ce in ce_white_list:
# Line 80 | Line 93 | class SchedulerGlite(SchedulerGrid):
93                      req += ") "
94  
95          if self.EDG_ce_black_list:
96 <            ce_black_list = self.EDG_ce_black_list
96 >            ce_black_list = ceParser.blackList()
97              tmpCe=[]
98              concString = '&&'
99              for ce in ce_black_list:
# Line 88 | Line 101 | class SchedulerGlite(SchedulerGrid):
101              if len(tmpCe): req += " && (" + concString.join(tmpCe) + ") "
102  
103          # requirement added to skip gliteCE
104 <        req += '&& (!RegExp("blah", other.GlueCEUniqueId))'
104 >        # not more needed
105 > #       req += '&& (!RegExp("blah", other.GlueCEUniqueId))'
106 >        retWL = ','.join(ce_white_list)
107 >        retBL = ','.join(ce_black_list)
108 >        if not retWL:
109 >            retWL = None
110 >        if not retBL:
111 >            retBL = None
112  
113 <        return req,self.EDG_ce_white_list,self.EDG_ce_black_list
113 >        return req, retWL, retBL
114  
115      def se_list(self, dest):
116          """
# Line 150 | Line 170 | class SchedulerGlite(SchedulerGrid):
170          sched_param+='MyProxyServer = "' + self.proxyServer + '";\n'
171          sched_param+='VirtualOrganisation = "' + self.VO + '";\n'
172          sched_param+='RetryCount = '+str(self.EDG_retry_count)+';\n'
173 +        sched_param+='DefaultNodeRetryCount = '+str(self.EDG_retry_count)+';\n'
174          sched_param+='ShallowRetryCount = '+str(self.EDG_shallow_retry_count)+';\n'
175 +        sched_param+='DefaultNodeShallowRetryCount = '+str(self.EDG_shallow_retry_count)+';\n'
176  
177          return sched_param
178  
# Line 174 | Line 196 | class SchedulerGlite(SchedulerGrid):
196              itr4 = replicas
197          return itr4
198  
199 +    def delegateProxy(self):
200 +        self.boss().delegateProxy()  
201 +        return
202  
203      def wsExitFunc(self):
204          """
# Line 211 | Line 236 | class SchedulerGlite(SchedulerGrid):
236          txt += '    else\n'
237          txt += '        tar zcvf ${out_files}.tgz CMSSW_${NJob}.stdout CMSSW_${NJob}.stderr\n'
238          txt += '    fi\n'
239 +        txt += '    python $RUNTIME_AREA/fillCrabFjr.py $RUNTIME_AREA/crab_fjr_$NJob.xml --errorcode $job_exit_code \n'
240          txt += '    exit $job_exit_code\n'
241  
242          txt += '}\n'
243          return txt
244 +
245 +    def listMatch(self, dest, full):
246 +        matching='fast'
247 +        
248 +        if self.boss().schedulerConfig['name'] == 'SchedulerGLite' :
249 +            taskId=common._db.getTask()
250 +            req=str(self.sched_parameter(1,taskId))
251 +            sites = self.boss().schedSession().matchResources(taskId, requirements=req)
252 +        else :
253 +            sites = SchedulerGrid.listMatch(self, dest, full)
254 +            
255 +        if full == True: matching='full'
256 +        common.logger.debug("list of available site ( "+str(matching) +" matching ) : "+str(sites))
257 +        
258 +        return sites

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines