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

Comparing COMP/CRAB/python/cms_cmssw.py (file contents):
Revision 1.116.2.2 by fanzago, Tue Oct 9 17:18:11 2007 UTC vs.
Revision 1.128 by fanzago, Thu Oct 11 16:23:44 2007 UTC

# Line 583 | Line 583 | class Cmssw(JobType):
583          # screen output
584          screenOutput = "List of jobs and available destination sites:\n\n"
585  
586 +        # keep trace of block with no sites to print a warning at the end
587 +        noSiteBlock = []
588 +        bloskNoSite = []
589 +
590          blockCounter = 0
591          for block in blocks:
592              if block in jobsOfBlock.keys() :
593                  blockCounter += 1
594                  screenOutput += "Block %5i: jobs %20s: sites: %s\n" % (blockCounter,spanRanges(jobsOfBlock[block]),','.join(self.blackWhiteListParser.checkWhiteList(self.blackWhiteListParser.checkBlackList(blockSites[block],block),block)))
595 <
595 >                if len(self.blackWhiteListParser.checkWhiteList(self.blackWhiteListParser.checkBlackList(blockSites[block],block),block)) == 0:
596 >                    noSiteBlock.append( spanRanges(jobsOfBlock[block]) )
597 >                    bloskNoSite.append( blockCounter )
598 >        
599          common.logger.message(screenOutput)
600 +        if len(noSiteBlock) > 0 and len(bloskNoSite) > 0:
601 +            msg = 'WARNING: No sites are hosting any part of data for block:\n                '
602 +            virgola = ""
603 +            if len(bloskNoSite) > 1:
604 +                virgola = ","
605 +            for block in bloskNoSite:
606 +                msg += ' ' + str(block) + virgola
607 +            msg += '\n               Related jobs:\n                 '
608 +            virgola = ""
609 +            if len(noSiteBlock) > 1:
610 +                virgola = ","
611 +            for range_jobs in noSiteBlock:
612 +                msg += str(range_jobs) + virgola
613 +            msg += '\n               will not be submitted and this block of data can not be analyzed!\n'
614 +            common.logger.message(msg)
615  
616          self.list_of_args = list_of_lists
617          return
# Line 1182 | Line 1204 | class Cmssw(JobType):
1204          txt += '# directory content\n'
1205          txt += 'ls \n'
1206  
1207 <        for fileWithSuffix in (self.output_file+self.output_file_sandbox):
1207 >        txt += 'output_exit_status=0\n'
1208 >        
1209 >        for fileWithSuffix in (self.output_file_sandbox):
1210 >            output_file_num = self.numberFile_(fileWithSuffix, '$NJob')
1211 >            txt += '\n'
1212 >            txt += '# check output file\n'
1213 >            txt += 'if [ -e ./'+fileWithSuffix+' ] ; then\n'
1214 >            txt += '    mv '+fileWithSuffix+' $RUNTIME_AREA\n'
1215 >            txt += '    cp $RUNTIME_AREA/'+fileWithSuffix+' $RUNTIME_AREA/'+output_file_num+'\n'
1216 >            txt += 'else\n'
1217 >            txt += '    exit_status=60302\n'
1218 >            txt += '    echo "ERROR: Problem with output file '+fileWithSuffix+'"\n'
1219 >            if common.scheduler.boss_scheduler_name == 'condor_g':
1220 >                txt += '    if [ $middleware == OSG ]; then \n'
1221 >                txt += '        echo "prepare dummy output file"\n'
1222 >                txt += '        echo "Processing of job output failed" > $RUNTIME_AREA/'+output_file_num+'\n'
1223 >                txt += '    fi \n'
1224 >            txt += 'fi\n'
1225 >        
1226 >        for fileWithSuffix in (self.output_file):
1227              output_file_num = self.numberFile_(fileWithSuffix, '$NJob')
1228              txt += '\n'
1229              txt += '# check output file\n'
1189            # txt += 'ls '+fileWithSuffix+'\n'
1190            # txt += 'ls_result=$?\n'
1230              txt += 'if [ -e ./'+fileWithSuffix+' ] ; then\n'
1192            ###### FEDE FOR OUTPUT DATA PUBLICATION ########
1231              txt += '    mv '+fileWithSuffix+' $RUNTIME_AREA\n'
1232              txt += '    cp $RUNTIME_AREA/'+fileWithSuffix+' $RUNTIME_AREA/'+output_file_num+'\n'
1195            ################################################
1233              txt += 'else\n'
1234              txt += '    exit_status=60302\n'
1235              txt += '    echo "ERROR: Problem with output file '+fileWithSuffix+'"\n'
1236 <            ############# FEDE ADDED CHECK FOR OUTPUT #############
1237 <            ## MATTY's FIX: the exit option was interrupting the execution
1201 <            if fileWithSuffix in self.output_file:
1202 <                txt += '    echo "JOB_EXIT_STATUS = $exit_status"\n'
1203 <                txt += '    output_exit_status=$exit_status\n'
1204 <                txt += '    # exit $exit_status\n'
1205 <            #######################################################    
1236 >            txt += '    echo "JOB_EXIT_STATUS = $exit_status"\n'
1237 >            txt += '    output_exit_status=$exit_status\n'
1238              if common.scheduler.boss_scheduler_name == 'condor_g':
1239                  txt += '    if [ $middleware == OSG ]; then \n'
1240                  txt += '        echo "prepare dummy output file"\n'

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines