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.18 by mcinquil, Wed Oct 3 16:31:25 2007 UTC vs.
Revision 1.26 by fanzago, Wed Nov 7 13:18:09 2007 UTC

# Line 56 | Line 56 | class SchedulerGlite(SchedulerEdg):
56              concString = '&&'
57              for ce in ce_white_list:
58                  tmpCe.append('RegExp("' + string.strip(ce) + '", other.GlueCEUniqueId)')
59 <            if len(tmpCe): req = req + " && (" + concString.join(tmpCe) + ") "
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,',')
# Line 126 | 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'
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 += '    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 += 'elif [ $OSG_APP ]; then \n'
164          txt += '    middleware=OSG \n'
165 <        txt += '    echo "SyncCE=`echo $EDG_WL_LOG_DESTINATION`" | tee -a $RUNTIME_AREA/$repo \n'
165 >        txt += '    if [ $OSG_JOB_CONTACT ]; then \n'
166 >        txt += '        SyncCE="$OSG_JOB_CONTACT"; \n'
167 >        txt += '        echo "SyncCE=$SyncCE" | tee -a $RUNTIME_AREA/$repo ;\n'
168 >        txt += '    else\n'
169 >        txt += '        echo "not reporting SyncCE";\n'
170 >        txt += '    fi\n';
171          txt += '    echo "GridFlavour=`echo $middleware`" | tee -a $RUNTIME_AREA/$repo \n'
172 <        txt += '    echo "middleware =$middleware" \n'
172 >        txt += '    echo ">>> middleware =$middleware" \n'
173          txt += 'else \n'
174          txt += '    echo "SET_CMS_ENV 10030 ==> middleware not identified" \n'
175          txt += '    echo "JOB_EXIT_STATUS = 10030" \n'
176          txt += '    echo "JobExitCode=10030" | tee -a $RUNTIME_AREA/$repo \n'
177          txt += '    dumpStatus $RUNTIME_AREA/$repo \n'
150        txt += '    rm -f $RUNTIME_AREA/$repo \n'
151        txt += '    echo "MonitorJobID=`echo $MonitorJobID`" | tee -a $RUNTIME_AREA/$repo \n'
152        txt += '    echo "MonitorID=`echo $MonitorID`" | tee -a $RUNTIME_AREA/$repo\n'
178          txt += '    exit 1 \n'
179          txt += 'fi \n'
180  
156        txt += '# report first time to DashBoard \n'
181          txt += 'dumpStatus $RUNTIME_AREA/$repo \n'
182 <        txt += 'rm -f $RUNTIME_AREA/$repo \n'
183 <        txt += 'echo "MonitorJobID=`echo $MonitorJobID`" | tee -a $RUNTIME_AREA/$repo \n'
184 <        txt += 'echo "MonitorID=`echo $MonitorID`" | tee -a $RUNTIME_AREA/$repo\n'
182 >        #txt += 'rm -f $RUNTIME_AREA/$repo \n'
183 >        #txt += 'echo "MonitorJobID=`echo $MonitorJobID`" | tee -a $RUNTIME_AREA/$repo \n'
184 >        #txt += 'echo "MonitorID=`echo $MonitorID`" | tee -a $RUNTIME_AREA/$repo\n'
185          
186          txt += '\n\n'
187  
# Line 172 | Line 196 | class SchedulerGlite(SchedulerEdg):
196  
197          txt += 'export VO='+self.VO+'\n'
198          ### some line for LFC catalog setting
199 <        txt += 'if [ $middleware == LCG ]; then \n'
200 <        txt += '    if [[ $LCG_CATALOG_TYPE != \''+self.lcg_catalog_type+'\' ]]; then\n'
201 <        txt += '        export LCG_CATALOG_TYPE='+self.lcg_catalog_type+'\n'
202 <        txt += '    fi\n'
203 <        txt += '    if [[ $LFC_HOST != \''+self.lfc_host+'\' ]]; then\n'
204 <        txt += '        export LFC_HOST='+self.lfc_host+'\n'
205 <        txt += '    fi\n'
206 <        txt += '    if [[ $LFC_HOME != \''+self.lfc_home+'\' ]]; then\n'
207 <        txt += '        export LFC_HOME='+self.lfc_home+'\n'
208 <        txt += '    fi\n'
209 <        txt += 'elif [ $middleware == OSG ]; then\n'
210 <        txt += '    echo "LFC catalog setting to be implemented for OSG"\n'
211 <        txt += 'fi\n'
199 >        #txt += 'if [ $middleware == LCG ]; then \n'
200 >        #txt += '    if [[ $LCG_CATALOG_TYPE != \''+self.lcg_catalog_type+'\' ]]; then\n'
201 >        #txt += '        export LCG_CATALOG_TYPE='+self.lcg_catalog_type+'\n'
202 >        #txt += '    fi\n'
203 >        #txt += '    if [[ $LFC_HOST != \''+self.lfc_host+'\' ]]; then\n'
204 >        #txt += '        export LFC_HOST='+self.lfc_host+'\n'
205 >        #txt += '    fi\n'
206 >        #txt += '    if [[ $LFC_HOME != \''+self.lfc_home+'\' ]]; then\n'
207 >        #txt += '        export LFC_HOME='+self.lfc_home+'\n'
208 >        #txt += '    fi\n'
209 >        #txt += 'elif [ $middleware == OSG ]; then\n'
210 >        #txt += '    echo "LFC catalog setting to be implemented for OSG"\n'
211 >        #txt += 'fi\n'
212          #####
213 <        if int(self.register_data) == 1:
214 <           txt += 'if [ $middleware == LCG ]; then \n'
215 <           txt += '    export LFN='+self.LFN+'\n'
216 <           txt += '    lfc-ls $LFN\n'
217 <           txt += '    result=$?\n'
218 <           txt += '    echo $result\n'
219 <           ### creation of LFN dir in LFC catalog, under /grid/cms dir  
220 <           txt += '    if [ $result != 0 ]; then\n'
221 <           txt += '       lfc-mkdir $LFN\n'
222 <           txt += '       result=$?\n'
223 <           txt += '       echo $result\n'
224 <           txt += '    fi\n'
225 <           txt += 'elif [ $middleware == OSG ]; then\n'
226 <           txt += '    echo " Files registration to be implemented for OSG"\n'
227 <           txt += 'fi\n'
228 <           txt += '\n'
229 <
230 <           if self.VO:
231 <              txt += 'export VO='+self.VO+'\n'
232 <           if self.LFN:
233 <              txt += 'if [ $middleware == LCG ]; then \n'
234 <              txt += '    export LFN='+self.LFN+'\n'
235 <              txt += 'fi\n'
212 <              txt += '\n'
213 >        #if int(self.register_data) == 1:
214 >        #   txt += 'if [ $middleware == LCG ]; then \n'
215 >        #   txt += '    export LFN='+self.LFN+'\n'
216 >        #   txt += '    lfc-ls $LFN\n'
217 >        #   txt += '    result=$?\n'
218 >        #   txt += '    echo $result\n'
219 >        #   ### creation of LFN dir in LFC catalog, under /grid/cms dir  
220 >        #   txt += '    if [ $result != 0 ]; then\n'
221 >        #   txt += '       lfc-mkdir $LFN\n'
222 >        #   txt += '       result=$?\n'
223 >        #   txt += '       echo $result\n'
224 >        #   txt += '    fi\n'
225 >        #   txt += 'elif [ $middleware == OSG ]; then\n'
226 >        #   txt += '    echo " Files registration to be implemented for OSG"\n'
227 >        #   txt += 'fi\n'
228 >        #   txt += '\n'
229 >        #   if self.VO:
230 >        #      txt += 'export VO='+self.VO+'\n'
231 >        #   if self.LFN:
232 >        #      txt += 'if [ $middleware == LCG ]; then \n'
233 >        #      txt += '    export LFN='+self.LFN+'\n'
234 >        #      txt += 'fi\n'
235 >        #      txt += '\n'
236  
237          txt += 'if [ $middleware == LCG ]; then\n'
238          txt += '    CloseCEs=`glite-brokerinfo getCE`\n'
# Line 224 | Line 247 | class SchedulerGlite(SchedulerEdg):
247          txt += '        echo "JOB_EXIT_STATUS = 10099" \n'
248          txt += '        echo "JobExitCode=10099" | tee -a $RUNTIME_AREA/$repo \n'
249          txt += '        dumpStatus $RUNTIME_AREA/$repo \n'
250 <        txt += '        rm -f $RUNTIME_AREA/$repo \n'
251 <        txt += '        echo "MonitorJobID=`echo $MonitorJobID`" | tee -a $RUNTIME_AREA/$repo \n'
252 <        txt += '        echo "MonitorID=`echo $MonitorID`" | tee -a $RUNTIME_AREA/$repo\n'
250 >        #txt += '        rm -f $RUNTIME_AREA/$repo \n'
251 >        #txt += '        echo "MonitorJobID=`echo $MonitorJobID`" | tee -a $RUNTIME_AREA/$repo \n'
252 >        #txt += '        echo "MonitorID=`echo $MonitorID`" | tee -a $RUNTIME_AREA/$repo\n'
253          txt += '        exit 1 \n'
254          txt += '    fi \n'
255          txt += 'fi \n'
# Line 259 | Line 282 | class SchedulerGlite(SchedulerEdg):
282              if len(replicas)!=0:
283                  replicas = self.blackWhiteListParser.checkWhiteList(replicas,n)
284                
285 <            if len(replicas)==0:
286 <                msg = 'No sites remaining that host any part of the requested data! Exiting... '
287 <                raise CrabException(msg)
285 >            #if len(replicas)==0:
286 >                #msg = 'No sites remaining that host any part of the requested data! Exiting... '
287 >                #raise CrabException(msg)
288              itr4 = replicas
289              #####        
290          return itr4
291  
292      def submitTout(self, list):
293          return 180
271

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines