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.21 by fanzago, Fri Oct 5 12:55:05 2007 UTC vs.
Revision 1.28 by ewv, Wed Nov 14 16:35:21 2007 UTC

# Line 30 | Line 30 | class SchedulerGlite(SchedulerEdg):
30          index = int(common.jobDB.nJobs()) - 1
31          job = common.job_list[index]
32          jbt = job.type()
33 <        
33 >
34          lastDest=''
35          first = []
36          last  = []
# Line 39 | Line 39 | class SchedulerGlite(SchedulerEdg):
39              if (currDest!=lastDest):
40                  lastDest = currDest
41                  first.append(n)
42 <                if n != 0:last.append(n-1)
42 >                if n != 0:last.append(n-1)
43          if len(first)>len(last) :last.append(common.jobDB.nJobs())
44 <  
44 >
45          req = ''
46          req = req + jbt.getRequirements()
47 <  
48 <  
47 >
48 >
49          if self.EDG_requirements:
50              if (not req == ' '): req = req +  ' && '
51              req = req + self.EDG_requirements
# Line 75 | Line 75 | class SchedulerGlite(SchedulerEdg):
75                      req += ") "
76              ## old code
77   #            if len(tmpCe): req = req + " && (" + concString.join(tmpCe) + ") "
78 <        
78 >
79          if self.EDG_ce_black_list:
80              ce_black_list = string.split(self.EDG_ce_black_list,',')
81              tmpCe=[]
# Line 91 | Line 91 | class SchedulerGlite(SchedulerEdg):
91          if self.EDG_cpu_time:
92              if (not req == ' '): req = req + ' && '
93              req = req + ' other.GlueCEPolicyMaxCPUTime>='+self.EDG_cpu_time
94 <                
94 >
95          for i in range(len(first)): # Add loop DS
96              self.param='sched_param_'+str(i)+'.clad'
97              param_file = open(common.work_space.shareDir()+'/'+self.param, 'w')
98  
99              itr4=self.findSites_(first[i])
100              reqSites=''
101 <            reqtmp=[]  
101 >            reqtmp=[]
102              concString = '||'
103  
104              #############
# Line 113 | Line 113 | class SchedulerGlite(SchedulerEdg):
113              reqSites = reqSites + '&& (!RegExp("blah", other.GlueCEUniqueId));\n'
114  
115              param_file.write('Requirements = ' + req + reqSites )
116 <  
116 >
117              if (self.rb_param_file != ''):
118 <                param_file.write(self.rb_param_file)  
118 >                param_file.write(self.rb_param_file)
119  
120              if len(self.EDG_addJdlParam):
121                  for p in self.EDG_addJdlParam:
122                      param_file.write(p)
123  
124 <            param_file.close()  
124 >            param_file.close()
125  
126      def wsSetupEnvironment(self):
127          """
# Line 144 | Line 144 | class SchedulerGlite(SchedulerEdg):
144          txt += 'echo "SyncGridJobId=`echo $SyncGridJobId`" | tee -a $RUNTIME_AREA/$repo \n'
145          txt += 'echo "MonitorID=`echo $MonitorID`" | tee -a $RUNTIME_AREA/$repo\n'
146  
147 <        txt += 'echo "middleware discovery " \n'
147 >        txt += 'echo "middleware discovery: " \n'
148          txt += 'if [ $VO_CMS_SW_DIR ]; then \n'
149          txt += '    middleware=LCG \n'
150          txt += '    echo "SyncCE=`glite-brokerinfo getCE`" | tee -a $RUNTIME_AREA/$repo \n'
151          txt += '    echo "GridFlavour=`echo $middleware`" | tee -a $RUNTIME_AREA/$repo \n'
152 <        txt += '    echo "middleware =$middleware" \n'
153 <        txt += 'elif [ $GRID3_APP_DIR ]; then\n'
154 <        txt += '    middleware=OSG \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'
152 >        txt += '    echo ">>> middleware =$middleware" \n'
153          txt += 'elif [ $OSG_APP ]; then \n'
154          txt += '    middleware=OSG \n'
155 <        txt += '    echo "SyncCE=`echo $GLITE_WL_LOG_DESTINATION`" | tee -a $RUNTIME_AREA/$repo \n'
155 >        txt += '    if [ $OSG_JOB_CONTACT ]; then \n'
156 >        txt += '        SyncCE="$OSG_JOB_CONTACT"; \n'
157 >        txt += '        echo "SyncCE=$SyncCE" | tee -a $RUNTIME_AREA/$repo ;\n'
158 >        txt += '    else\n'
159 >        txt += '        echo "not reporting SyncCE";\n'
160 >        txt += '    fi\n';
161          txt += '    echo "GridFlavour=`echo $middleware`" | tee -a $RUNTIME_AREA/$repo \n'
162 <        txt += '    echo "middleware =$middleware" \n'
162 >        txt += '    echo ">>> middleware =$middleware" \n'
163          txt += 'else \n'
164          txt += '    echo "SET_CMS_ENV 10030 ==> middleware not identified" \n'
165          txt += '    echo "JOB_EXIT_STATUS = 10030" \n'
166          txt += '    echo "JobExitCode=10030" | tee -a $RUNTIME_AREA/$repo \n'
167          txt += '    dumpStatus $RUNTIME_AREA/$repo \n'
168        txt += '    rm -f $RUNTIME_AREA/$repo \n'
169        txt += '    echo "MonitorJobID=`echo $MonitorJobID`" | tee -a $RUNTIME_AREA/$repo \n'
170        txt += '    echo "MonitorID=`echo $MonitorID`" | tee -a $RUNTIME_AREA/$repo\n'
168          txt += '    exit 1 \n'
169          txt += 'fi \n'
170  
174        txt += '# report first time to DashBoard \n'
171          txt += 'dumpStatus $RUNTIME_AREA/$repo \n'
172 <        txt += 'rm -f $RUNTIME_AREA/$repo \n'
173 <        txt += 'echo "MonitorJobID=`echo $MonitorJobID`" | tee -a $RUNTIME_AREA/$repo \n'
174 <        txt += 'echo "MonitorID=`echo $MonitorID`" | tee -a $RUNTIME_AREA/$repo\n'
175 <        
172 >        #txt += 'rm -f $RUNTIME_AREA/$repo \n'
173 >        #txt += 'echo "MonitorJobID=`echo $MonitorJobID`" | tee -a $RUNTIME_AREA/$repo \n'
174 >        #txt += 'echo "MonitorID=`echo $MonitorID`" | tee -a $RUNTIME_AREA/$repo\n'
175 >
176          txt += '\n\n'
177  
178          #if int(self.copy_data) == 1:
# Line 189 | Line 185 | class SchedulerGlite(SchedulerEdg):
185          #      txt += 'echo "SE_PATH = $SE_PATH"\n'
186  
187          txt += 'export VO='+self.VO+'\n'
188 <        ### some line for LFC catalog setting
188 >        ### some line for LFC catalog setting
189          #txt += 'if [ $middleware == LCG ]; then \n'
190          #txt += '    if [[ $LCG_CATALOG_TYPE != \''+self.lcg_catalog_type+'\' ]]; then\n'
191          #txt += '        export LCG_CATALOG_TYPE='+self.lcg_catalog_type+'\n'
# Line 207 | Line 203 | class SchedulerGlite(SchedulerEdg):
203          #if int(self.register_data) == 1:
204          #   txt += 'if [ $middleware == LCG ]; then \n'
205          #   txt += '    export LFN='+self.LFN+'\n'
206 <        #   txt += '    lfc-ls $LFN\n'
207 <        #   txt += '    result=$?\n'
208 <        #   txt += '    echo $result\n'
209 <        #   ### creation of LFN dir in LFC catalog, under /grid/cms dir  
206 >        #   txt += '    lfc-ls $LFN\n'
207 >        #   txt += '    result=$?\n'
208 >        #   txt += '    echo $result\n'
209 >        #   ### creation of LFN dir in LFC catalog, under /grid/cms dir
210          #   txt += '    if [ $result != 0 ]; then\n'
211          #   txt += '       lfc-mkdir $LFN\n'
212 <        #   txt += '       result=$?\n'
213 <        #   txt += '       echo $result\n'
212 >        #   txt += '       result=$?\n'
213 >        #   txt += '       echo $result\n'
214          #   txt += '    fi\n'
215          #   txt += 'elif [ $middleware == OSG ]; then\n'
216          #   txt += '    echo " Files registration to be implemented for OSG"\n'
# Line 228 | Line 224 | class SchedulerGlite(SchedulerEdg):
224          #      txt += 'fi\n'
225          #      txt += '\n'
226  
227 <        txt += 'if [ $middleware == LCG ]; then\n'
227 >        txt += 'if [ $middleware == LCG ]; then\n'
228          txt += '    CloseCEs=`glite-brokerinfo getCE`\n'
229          txt += '    echo "CloseCEs = $CloseCEs"\n'
230          txt += '    CE=`echo $CloseCEs | sed -e "s/:.*//"`\n'
# Line 241 | Line 237 | class SchedulerGlite(SchedulerEdg):
237          txt += '        echo "JOB_EXIT_STATUS = 10099" \n'
238          txt += '        echo "JobExitCode=10099" | tee -a $RUNTIME_AREA/$repo \n'
239          txt += '        dumpStatus $RUNTIME_AREA/$repo \n'
240 <        txt += '        rm -f $RUNTIME_AREA/$repo \n'
241 <        txt += '        echo "MonitorJobID=`echo $MonitorJobID`" | tee -a $RUNTIME_AREA/$repo \n'
242 <        txt += '        echo "MonitorID=`echo $MonitorID`" | tee -a $RUNTIME_AREA/$repo\n'
240 >        #txt += '        rm -f $RUNTIME_AREA/$repo \n'
241 >        #txt += '        echo "MonitorJobID=`echo $MonitorJobID`" | tee -a $RUNTIME_AREA/$repo \n'
242 >        #txt += '        echo "MonitorID=`echo $MonitorID`" | tee -a $RUNTIME_AREA/$repo\n'
243          txt += '        exit 1 \n'
244          txt += '    fi \n'
245 <        txt += 'fi \n'
245 >        txt += 'fi \n'
246  
247          return txt
248 <        
248 >
249      def loggingInfo(self, id):
250          """
251          retrieve the logging info from logging and bookkeeping and return it
# Line 270 | Line 266 | class SchedulerGlite(SchedulerEdg):
266          sites = common.jobDB.destination(n)
267          if len(sites)>0 and sites[0]=="":
268              return itr4
269 <        if sites != [""]:
269 >        if sites != [""]:
270              ##Addedd Daniele
271              replicas = self.blackWhiteListParser.checkBlackList(sites,n)
272              if len(replicas)!=0:
273                  replicas = self.blackWhiteListParser.checkWhiteList(replicas,n)
274 <              
275 <            if len(replicas)==0:
276 <                msg = 'No sites remaining that host any part of the requested data! Exiting... '
277 <                raise CrabException(msg)
278 <            itr4 = replicas
279 <            #####        
274 >
275 >            #if len(replicas)==0:
276 >                #msg = 'No sites remaining that host any part of the requested data! Exiting... '
277 >                #raise CrabException(msg)
278 >            itr4 = replicas
279 >            #####
280          return itr4
281  
282 <    def submitTout(self, list):
282 >    def tOut(self, list):
283          return 180

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines