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' |
1211 |
– |
# txt += 'ls '+fileWithSuffix+'\n' |
1212 |
– |
# txt += 'ls_result=$?\n' |
1213 |
|
txt += 'if [ -e ./'+fileWithSuffix+' ] ; then\n' |
1214 |
– |
###### FEDE FOR OUTPUT DATA PUBLICATION ######## |
1214 |
|
txt += ' mv '+fileWithSuffix+' $RUNTIME_AREA\n' |
1215 |
|
txt += ' cp $RUNTIME_AREA/'+fileWithSuffix+' $RUNTIME_AREA/'+output_file_num+'\n' |
1217 |
– |
################################################ |
1216 |
|
txt += 'else\n' |
1217 |
|
txt += ' exit_status=60302\n' |
1218 |
|
txt += ' echo "ERROR: Problem with output file '+fileWithSuffix+'"\n' |
1219 |
< |
############# FEDE ADDED CHECK FOR OUTPUT ############# |
1220 |
< |
## MATTY's FIX: the exit option was interrupting the execution |
1221 |
< |
if fileWithSuffix in self.output_file: |
1222 |
< |
txt += ' echo "JOB_EXIT_STATUS = $exit_status"\n' |
1223 |
< |
txt += ' output_exit_status=$exit_status\n' |
1224 |
< |
txt += ' # exit $exit_status\n' |
1225 |
< |
####################################################### |
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' |
1230 |
> |
txt += 'if [ -e ./'+fileWithSuffix+' ] ; then\n' |
1231 |
> |
txt += ' mv '+fileWithSuffix+' $RUNTIME_AREA\n' |
1232 |
> |
txt += ' cp $RUNTIME_AREA/'+fileWithSuffix+' $RUNTIME_AREA/'+output_file_num+'\n' |
1233 |
> |
txt += 'else\n' |
1234 |
> |
txt += ' exit_status=60302\n' |
1235 |
> |
txt += ' echo "ERROR: Problem with output file '+fileWithSuffix+'"\n' |
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' |