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.191 by spiga, Tue May 27 22:14:26 2008 UTC vs.
Revision 1.195 by slacapra, Wed May 28 15:42:01 2008 UTC

# Line 35 | Line 35 | class Cmssw(JobType):
35          self.executable_arch = self.scram.getArch()
36          self.tgz_name = 'default.tgz'
37          self.scriptName = 'CMSSW.sh'
38 <        self.pset = ''  
38 >        self.pset = ''
39          self.datasetPath = ''
40  
41          # set FJR file name
# Line 69 | Line 69 | class Cmssw(JobType):
69              self.selectNoInput = 0
70  
71          self.dataTiers = []
72 <
72 >
73          self.debug_pset = cfg_params.get('USER.debug_pset',False)
74  
75          ## now the application
# Line 162 | Line 162 | class Cmssw(JobType):
162          if cfg_params.has_key('CMSSW.total_number_of_events'):
163              self.total_number_of_events = int(cfg_params['CMSSW.total_number_of_events'])
164              self.selectTotalNumberEvents = 1
165 +            if self.selectNumberOfJobs  == 1:
166 +                if int(self.total_number_of_events) < int(self.theNumberOfJobs):
167 +                    msg = 'Must specify at least one event per job. total_number_of_events > number_of_jobs '
168 +                    raise CrabException(msg)
169          else:
170              self.total_number_of_events = 0
171              self.selectTotalNumberEvents = 0
# Line 247 | Line 251 | class Cmssw(JobType):
251              self.jobSplittingByBlocks(blockSites)
252  
253          # modify Pset
254 <        if self.pset != None:
254 >        if self.pset != None:
255              try:
256                  # Add FrameworkJobReport to parameter-set, set max events.
257                  # Reset later for data jobs by writeCFG which does all modifications
# Line 288 | Line 292 | class Cmssw(JobType):
292          self.eventsbyfile=self.pubdata.getEventsPerFile()
293  
294          ## get max number of events
295 <        self.maxEvents=self.pubdata.getMaxEvents()
295 >        self.maxEvents=self.pubdata.getMaxEvents()
296  
297          ## Contact the DLS and build a list of sites hosting the fileblocks
298          try:
# Line 862 | Line 866 | class Cmssw(JobType):
866          if self.pset != None:
867              # FUTURE: Can simply for 2_1_x and higher
868              txt += '\n'
869 <            if self.debug_pset==True:  
869 >            if self.debug_pset==True:
870                  txt += 'echo "***** cat ' + psetName + ' *********"\n'
871                  txt += 'cat ' + psetName + '\n'
872                  txt += 'echo "****** end ' + psetName + ' ********"\n'
# Line 943 | Line 947 | class Cmssw(JobType):
947          """
948  
949      def executableName(self):
950 <        if self.scriptExe:
950 >        if self.scriptExe:
951              return "sh "
952          else:
953              return self.executable
# Line 1066 | Line 1070 | class Cmssw(JobType):
1070              req='Member("VO-cms-' + \
1071                   self.version + \
1072                   '", other.GlueHostApplicationSoftwareRunTimeEnvironment)'
1073 <        if self.executable_arch:
1073 >        if self.executable_arch:
1074              req+=' && Member("VO-cms-' + \
1075                   self.executable_arch + \
1076                   '", other.GlueHostApplicationSoftwareRunTimeEnvironment)'
# Line 1182 | Line 1186 | class Cmssw(JobType):
1186              txt += 'fi\n'
1187          return txt
1188  
1189 <    def wsParseFJR(self):  
1189 >    def wsParseFJR(self):
1190          """
1191 <        Parse the FrameworkJobReport to obtain useful infos
1191 >        Parse the FrameworkJobReport to obtain useful infos
1192          """
1193          txt = '\n#Written by cms_cmssw::wsParseFJR\n'
1194          txt += 'echo ">>> Parse FrameworkJobReport crab_fjr.xml"\n'
# Line 1192 | Line 1196 | class Cmssw(JobType):
1196          txt += '    if [ -s $RUNTIME_AREA/parseCrabFjr.py ]; then\n'
1197          txt += '        cmd_out=`python $RUNTIME_AREA/parseCrabFjr.py --input $RUNTIME_AREA/crab_fjr_$NJob.xml --MonitorID $MonitorID --MonitorJobID $MonitorJobID`\n'
1198          txt += '        echo "Result of parsing the FrameworkJobReport crab_fjr.xml: $cmd_out"\n'
1199 <        txt += '        executable_exit_status=`echo $cmd_out | awk -F\; "{print $1}" | awk -F ' ' "{print $NF}"`\n'
1199 >        txt += '        tmp_executable_exit_status=`echo $cmd_out | awk -F\; \'{print $1}\' | awk -F \' \' \'{print $NF}\'`\n'
1200 >        txt += '        if [ -n $tmp_executable_exit_status ];then\n'
1201 >        txt += '            executable_exit_status=$tmp_executable_exit_status\n'
1202 >        txt += '        fi\n'
1203          txt += '        if [ $executable_exit_status -eq 50115 ];then\n'
1204          txt += '            echo ">>> crab_fjr.xml contents: "\n'
1205          txt += '            cat $RUNTIME_AREA/crab_fjr_NJob.xml\n'
# Line 1209 | Line 1216 | class Cmssw(JobType):
1216            # VERIFY PROCESSED DATA
1217              txt += '    if [ $executable_exit_status -eq 0 ];then\n'
1218              txt += '      echo ">>> Verify list of processed files:"\n'
1219 <            txt += '      echo $InputFiles |tr -d "\\" |tr "," \n"|tr -d "\"" > input-files.txt\n'
1219 >            txt += '      echo $InputFiles |tr -d "\\\\" |tr "," "\\n"|tr -d "\\"" > input-files.txt\n'
1220              txt += '      grep LFN $RUNTIME_AREA/crab_fjr_$NJob.xml |cut -d">" -f2|cut -d"<" -f1|grep "/" > processed-files.txt\n'
1221              txt += '      cat input-files.txt  | sort | uniq > tmp.txt\n'
1222              txt += '      mv tmp.txt input-files.txt\n'

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines