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 |
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 |
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 |
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 |
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: |
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' |
947 |
|
""" |
948 |
|
|
949 |
|
def executableName(self): |
950 |
< |
if self.scriptExe: |
950 |
> |
if self.scriptExe: |
951 |
|
return "sh " |
952 |
|
else: |
953 |
|
return self.executable |
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)' |
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' |
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' |
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' |