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.7 by slacapra, Tue Oct 17 09:52:57 2006 UTC vs.
Revision 1.20 by mcinquil, Fri Oct 5 12:09:51 2007 UTC

# Line 44 | Line 44 | class SchedulerGlite(SchedulerEdg):
44    
45          req = ''
46          req = req + jbt.getRequirements()
47 <    
47 >  
48 >  
49          if self.EDG_requirements:
50 <            if (req == ' '):
51 <                req = req + self.EDG_requirements
52 <            else:
52 <                req = req +  ' && ' + self.EDG_requirements
50 >            if (not req == ' '): req = req +  ' && '
51 >            req = req + self.EDG_requirements
52 >
53          if self.EDG_ce_white_list:
54              ce_white_list = string.split(self.EDG_ce_white_list,',')
55 <            for i in range(len(ce_white_list)):
56 <                if i == 0:
57 <                    if (req == ' '):
58 <                        req = req + '((RegExp("' + ce_white_list[i] + '", other.GlueCEUniqueId))'
59 <                    else:
60 <                        req = req +  ' && ((RegExp("' + ce_white_list[i] + '", other.GlueCEUniqueId))'
61 <                    pass
62 <                else:
63 <                    req = req +  ' || (RegExp("' + ce_white_list[i] + '", other.GlueCEUniqueId))'
64 <            req = req + ')'
55 >            tmpCe=[]
56 >            concString = '&&'
57 >            for ce in ce_white_list:
58 >                tmpCe.append('RegExp("' + string.strip(ce) + '", other.GlueCEUniqueId)')
59 >            ### MATTY' FIX: if more then one CE: && -> ||
60 >            #print "list CE: " + str(tmpCe)
61 >            if len(tmpCe) == 1:
62 >                req +=  " && (" + concString.join(tmpCe) + ") "
63 >            elif len(tmpCe) > 1:
64 >                firstCE = 0
65 >                for reqTemp in tmpCe:
66 >                    #print reqTemp
67 >                    if firstCE == 0:
68 >                        #print "adding: "+str(" && ( (" + reqTemp + ") ")
69 >                        req += " && ( (" + reqTemp + ") "
70 >                        firstCE = 1
71 >                    elif firstCE > 0:
72 >                        #print "adding: "+str(" || (" + reqTemp + ") ")
73 >                        req += " || (" + reqTemp + ") "
74 >                if firstCE > 0:
75 >                    req += ") "
76 >            ## old code
77 > #            if len(tmpCe): req = req + " && (" + concString.join(tmpCe) + ") "
78          
79          if self.EDG_ce_black_list:
80              ce_black_list = string.split(self.EDG_ce_black_list,',')
81 +            tmpCe=[]
82 +            concString = '&&'
83              for ce in ce_black_list:
84 <                if (req == ' '):
85 <                    req = req + '(!RegExp("' + ce + '", other.GlueCEUniqueId))'
86 <                else:
72 <                    req = req +  ' && (!RegExp("' + ce + '", other.GlueCEUniqueId))'
73 <                pass
84 >                tmpCe.append('(!RegExp("' + string.strip(ce) + '", other.GlueCEUniqueId))')
85 >            if len(tmpCe): req = req + " && (" + concString.join(tmpCe) + ") "
86 >
87          if self.EDG_clock_time:
88 <            if (req == ' '):
89 <                req = req + 'other.GlueCEPolicyMaxWallClockTime>='+self.EDG_clock_time
77 <            else:
78 <                req = req + ' && other.GlueCEPolicyMaxWallClockTime>='+self.EDG_clock_time
88 >            if (not req == ' '): req = req + ' && '
89 >            req = req + 'other.GlueCEPolicyMaxWallClockTime>='+self.EDG_clock_time
90  
91          if self.EDG_cpu_time:
92 <            if (req == ' '):
93 <                req = req + ' other.GlueCEPolicyMaxCPUTime>='+self.EDG_cpu_time
83 <            else:
84 <                req = req + ' && other.GlueCEPolicyMaxCPUTime>='+self.EDG_cpu_time
92 >            if (not req == ' '): req = req + ' && '
93 >            req = req + ' other.GlueCEPolicyMaxCPUTime>='+self.EDG_cpu_time
94                  
95          for i in range(len(first)): # Add loop DS
96              self.param='sched_param_'+str(i)+'.clad'
# Line 90 | Line 99 | class SchedulerGlite(SchedulerEdg):
99              itr4=self.findSites_(first[i])
100              reqSites=''
101              reqtmp=[]  
93            j = 0
102              concString = '||'
103 +
104 +            #############
105 +            # MC Changed matching syntax to avoid gang matching
106 +            #############
107              for arg in itr4:
96                #############
97                # MC Changed matching syntax to avoid gang matching
98                #############
108                  reqtmp.append(' Member("'+arg+'" , other.GlueCESEBindGroupSEUniqueID) ')
109 <            if len(reqtmp): reqSites = reqSites + " && (" + concString.join(reqtmp) + ')'
110 <            reqSites = reqSites + ';\n'
109 >
110 >            if len(reqtmp): reqSites = reqSites + " && (" + concString.join(reqtmp) + ") "
111 >
112 >            # requirement added to skip gliteCE
113 >            reqSites = reqSites + '&& (!RegExp("blah", other.GlueCEUniqueId));\n'
114 >
115              param_file.write('Requirements = ' + req + reqSites )
116    
117              if (self.rb_param_file != ''):
# Line 139 | Line 152 | class SchedulerGlite(SchedulerEdg):
152          txt += '    echo "middleware =$middleware" \n'
153          txt += 'elif [ $GRID3_APP_DIR ]; then\n'
154          txt += '    middleware=OSG \n'
155 <        txt += '    echo "SyncCE=`echo $EDG_WL_LOG_DESTINATION`" | tee -a $RUNTIME_AREA/$repo \n'
155 >        txt += '    echo "SyncCE=`echo $GLITE_WL_LOG_DESTINATION`" | tee -a $RUNTIME_AREA/$repo \n'
156          txt += '    echo "GridFlavour=`echo $middleware`" | tee -a $RUNTIME_AREA/$repo \n'
157          txt += '    echo "middleware =$middleware" \n'
158          txt += 'elif [ $OSG_APP ]; then \n'
159          txt += '    middleware=OSG \n'
160 <        txt += '    echo "SyncCE=`echo $EDG_WL_LOG_DESTINATION`" | tee -a $RUNTIME_AREA/$repo \n'
160 >        txt += '    echo "SyncCE=`echo $GLITE_WL_LOG_DESTINATION`" | tee -a $RUNTIME_AREA/$repo \n'
161          txt += '    echo "GridFlavour=`echo $middleware`" | tee -a $RUNTIME_AREA/$repo \n'
162          txt += '    echo "middleware =$middleware" \n'
163          txt += 'else \n'
# Line 166 | Line 179 | class SchedulerGlite(SchedulerEdg):
179          
180          txt += '\n\n'
181  
182 <        if int(self.copy_data) == 1:
183 <           if self.SE:
184 <              txt += 'export SE='+self.SE+'\n'
185 <              txt += 'echo "SE = $SE"\n'
186 <           if self.SE_PATH:
187 <              if ( self.SE_PATH[-1] != '/' ) : self.SE_PATH = self.SE_PATH + '/'
188 <              txt += 'export SE_PATH='+self.SE_PATH+'\n'
189 <              txt += 'echo "SE_PATH = $SE_PATH"\n'
182 >        #if int(self.copy_data) == 1:
183 >        #   if self.SE:
184 >        #      txt += 'export SE='+self.SE+'\n'
185 >        #      txt += 'echo "SE = $SE"\n'
186 >        #   if self.SE_PATH:
187 >        #      if ( self.SE_PATH[-1] != '/' ) : self.SE_PATH = self.SE_PATH + '/'
188 >        #      txt += 'export SE_PATH='+self.SE_PATH+'\n'
189 >        #      txt += 'echo "SE_PATH = $SE_PATH"\n'
190  
191          txt += 'export VO='+self.VO+'\n'
192          ### some line for LFC catalog setting
# Line 243 | Line 256 | class SchedulerGlite(SchedulerEdg):
256          retrieve the logging info from logging and bookkeeping and return it
257          """
258          self.checkProxy()
259 <        cmd = 'glite-job-logging-info -v 2 ' + id
259 >        cmd = 'glite-job-logging-info -v 3 ' + id
260          cmd_out = runCommand(cmd)
261          return cmd_out
262  
# Line 254 | Line 267 | class SchedulerGlite(SchedulerEdg):
267          return cmd_out
268  
269      def findSites_(self, n):
270 +        itr4 = []
271          sites = common.jobDB.destination(n)
272          if len(sites)>0 and sites[0]=="":
273 <            return []
274 <        return sites
273 >            return itr4
274 >        if sites != [""]:
275 >            ##Addedd Daniele
276 >            replicas = self.blackWhiteListParser.checkBlackList(sites,n)
277 >            if len(replicas)!=0:
278 >                replicas = self.blackWhiteListParser.checkWhiteList(replicas,n)
279 >              
280 >            if len(replicas)==0:
281 >                msg = 'No sites remaining that host any part of the requested data! Exiting... '
282 >                raise CrabException(msg)
283 >            itr4 = replicas
284 >            #####        
285 >        return itr4
286 >
287 >    def submitTout(self, list):
288 >        return 180

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines