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.73 by spiga, Thu Jan 14 10:24:17 2010 UTC vs.
Revision 1.86 by belforte, Thu Jan 17 15:15:03 2013 UTC

# Line 8 | Line 8 | __version__ = "$Revision$"
8   from SchedulerGrid import SchedulerGrid
9   from crab_exceptions import *
10   from crab_util import *
11 from GliteConfig import *
11   import EdgLoggingInfo
12   import common
13   from WMCore.SiteScreening.BlackWhiteListParser import CEBlackWhiteListParser
# Line 19 | Line 18 | class SchedulerGlite(SchedulerGrid):
18      def __init__(self, name="GLITE"):
19          SchedulerGrid.__init__(self,name)
20  
21 <        self.OSBsize = 55000000
21 >        self.EDG_retry_count        = 0
22 >        self.EDG_shallow_retry_count= -1
23 >        self.OSBsize = 55*1000*1000  # 55MB
24  
25      def configure(self,cfg_params):
26          SchedulerGrid.configure(self, cfg_params)
# Line 44 | Line 45 | class SchedulerGlite(SchedulerGrid):
45  
46  
47      def rb_configure(self, RB):
48 +        url ='http://cmsdoc.cern.ch/cms/LCG/crab/config/'
49 +        from Downloader import Downloader
50 +        import httplib
51 +        common.logger.debug('Downloading config files for WMS: '+url)
52          ## 25-Jun-2009 SL: patch to use Cream enabled WMS
53          if ( self.cfg_params.get('GRID.use_cream',None) ):
54              RB='CREAM'
55          if not RB: return None
51        glite_config = None
56          rb_param_file = None
57 +        configFileName = 'glite_wms_'+str(RB)+'.conf'
58  
59 <        gliteConfig = GliteConfig(RB)
60 <        glite_config = gliteConfig.config()
59 >        results = Downloader(url)
60 >        try:
61 >            gliteConfig  = results.filePath(configFileName)
62 >        except httplib.HTTPException, ex:
63 >            raise CrabException( "Problem getting RB config file: %s, reason:"%(configFileName, ex) )
64  
65 <        if (glite_config ):
66 <            rb_param_file = glite_config
65 >        if (gliteConfig ):
66 >            rb_param_file = gliteConfig
67          return rb_param_file
68  
69      def ce_list(self):
# Line 155 | Line 163 | class SchedulerGlite(SchedulerGrid):
163          dest=  task.jobs[i-1]['dlsDestination']
164  
165          req=''
166 <        req +=task['jobType']
166 >        #req +=task['jobType']
167 >        ####### FEDE FOR BUG 73010 ############
168 >        try:
169 >            #print "task['jobType'] = ", task['jobType']
170 >            req +=task['jobType']
171 >        except TypeError:
172 >            msg = "Error: wrong or missing task info. Your created task can not be submitted. Please check your configuration file and create the task again.  \n "
173 >            raise CrabException(msg)
174 >        #######################################
175  
176          sched_param=''
177          sched_param+='Requirements = ' + req +self.specific_req() + self.se_list(dest) +\
# Line 164 | Line 180 | class SchedulerGlite(SchedulerGrid):
180          sched_param+='MyProxyServer = "' + self.proxyServer + '";\n'
181          sched_param+='VirtualOrganisation = "' + self.VO + '";\n'
182          sched_param+='RetryCount = '+str(self.EDG_retry_count)+';\n'
183 +        sched_param+='DefaultNodeRetryCount = '+str(self.EDG_retry_count)+';\n'
184          sched_param+='ShallowRetryCount = '+str(self.EDG_shallow_retry_count)+';\n'
185 +        sched_param+='DefaultNodeShallowRetryCount = '+str(self.EDG_shallow_retry_count)+';\n'
186  
187          return sched_param
188  
# Line 203 | Line 221 | class SchedulerGlite(SchedulerGrid):
221  
222          txt += 'func_exit() { \n'
223          txt += self.wsExitFunc_common()
206        ### specific Glite check for OSB
207        txt += '    tar zcvf ${out_files}.tgz  ${final_list}\n'
208        txt += '    tmp_size=`ls -gGrta ${out_files}.tgz | awk \'{ print $3 }\'`\n'
209        txt += '    rm ${out_files}.tgz\n'
210        txt += '    size=`expr $tmp_size`\n'
211        txt += '    echo "Total Output dimension: $size"\n'
212        txt += '    limit='+str(self.OSBsize) +' \n'
213        txt += '    echo "WARNING: output files size limit is set to: $limit"\n'
214        txt += '    if [ "$limit" -lt "$size" ]; then\n'
215        txt += '        exceed=1\n'
216        txt += '        job_exit_code=70000\n'
217        txt += '        echo "Output Sanbox too big. Produced output is lost "\n'
218        txt += '    else\n'
219        txt += '        exceed=0\n'
220        txt += '        echo "Total Output dimension $size is fine."\n'
221        txt += '    fi\n'
222
223        txt += '    echo "JOB_EXIT_STATUS = $job_exit_code"\n'
224        txt += '    echo "JobExitCode=$job_exit_code" >> $RUNTIME_AREA/$repo\n'
225        txt += '    dumpStatus $RUNTIME_AREA/$repo\n'
226        txt += '    if [ $exceed -ne 1 ]; then\n'
227        txt += '        tar zcvf ${out_files}.tgz  ${final_list}\n'
228        txt += '    else\n'
229        txt += '        tar zcvf ${out_files}.tgz CMSSW_${NJob}.stdout CMSSW_${NJob}.stderr\n'
230        txt += '    fi\n'
231        txt += '    python $RUNTIME_AREA/fillCrabFjr.py $RUNTIME_AREA/crab_fjr_$NJob.xml --errorcode $job_exit_code \n'
224          txt += '    exit $job_exit_code\n'
225  
226          txt += '}\n'
227          return txt
228 +
229 +    def listMatch(self, dest, full):
230 +        matching='fast'
231 +        
232 +        if self.boss().schedulerConfig['name'] == 'SchedulerGLite' :
233 +            taskId=common._db.getTask()
234 +            req=str(self.sched_parameter(1,taskId))
235 +            sites = self.boss().schedSession().matchResources(taskId, requirements=req)
236 +        else :
237 +            sites = SchedulerGrid.listMatch(self, dest, full)
238 +            
239 +        if full == True: matching='full'
240 +        common.logger.debug("list of available site ( "+str(matching) +" matching ) : "+str(sites))
241 +        
242 +        return sites

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines