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

Comparing COMP/CRAB/python/Splitter.py (file contents):
Revision 1.23 by spiga, Fri Jun 19 09:54:22 2009 UTC vs.
Revision 1.24 by spiga, Tue Jul 21 16:18:09 2009 UTC

# Line 9 | Line 9 | class JobSplitter:
9          self.args=args
10          #self.maxEvents
11          # init BlackWhiteListParser
12 <        seWhiteList = cfg_params.get('GRID.se_white_list',[])
12 >        self.seWhiteList = cfg_params.get('GRID.se_white_list',[])
13          seBlackList = cfg_params.get('GRID.se_black_list',[])
14 <        self.blackWhiteListParser = SEBlackWhiteListParser(seWhiteList, seBlackList, common.logger())
14 >        self.blackWhiteListParser = SEBlackWhiteListParser(self.seWhiteList, seBlackList, common.logger())
15  
16  
17      def checkUserSettings(self):
# Line 43 | Line 43 | class JobSplitter:
43              self.selectTotalNumberEvents = 0
44  
45  
46 +    def ComputeSubBlockSites( self, blockSites ):
47 +        """
48 +        """
49 +        sub_blockSites = {}
50 +        for k,v in blockSites.iteritems():
51 +            sites=self.blackWhiteListParser.checkWhiteList(v)
52 +            if sites : sub_blockSites[k]=v
53 +        if len(sub_blockSites) < 1:
54 +            msg = 'WARNING: the sites %s is not hosting any part of data.'%self.seWhiteList
55 +            raise CrabException(msg)
56 +        return sub_blockSites
57 +
58   ########################################################################
59      def jobSplittingByEvent( self ):
60          """
# Line 77 | Line 89 | class JobSplitter:
89          self.useParent = int(self.cfg_params.get('CMSSW.use_parent',0))
90          noBboundary = int(self.cfg_params.get('CMSSW.no_block_boundary',0))
91  
92 +        if noBboundary == 1:
93 +            if self.total_number_of_events== -1:
94 +                msg = 'You are selecting no_block_boundary=1 which does not allow to set total_number_of_events=-1\n'
95 +                msg +='\tYou shoud get the number of event from DBS web interface and use it for your configuration.'                    
96 +                raise CrabException(msg)
97 +            if len(self.seWhiteList.split(',')) != 1:
98 +                msg = 'You are selecting no_block_boundary=1 which requires to choose one and only one site.\n'
99 +                msg += "\tPlease set se_white_list with the site's storage element name."
100 +                raise  CrabException(msg)  
101 +            blockSites = self.ComputeSubBlockSites(blockSites)    
102 +
103          # ---- Handle the possible job splitting configurations ---- #
104          if (self.selectTotalNumberEvents):
105              totalEventsRequested = self.total_number_of_events

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines