16 |
|
def __init__(self): |
17 |
|
SchedulerLsf.__init__(self) |
18 |
|
Scheduler.__init__(self,"CAF") |
19 |
+ |
self.OSBsize = 55000000 |
20 |
|
|
21 |
|
return |
22 |
|
|
44 |
|
### where users can copy job outputs |
45 |
|
txt=self.wsCopyOutput_comm(self.pool) |
46 |
|
return txt |
47 |
+ |
|
48 |
+ |
def wsExitFunc(self): |
49 |
+ |
""" |
50 |
+ |
""" |
51 |
+ |
txt = '\n' |
52 |
+ |
|
53 |
+ |
txt += '#\n' |
54 |
+ |
txt += '# EXECUTE THIS FUNCTION BEFORE EXIT \n' |
55 |
+ |
txt += '#\n\n' |
56 |
+ |
txt += 'func_exit() { \n' |
57 |
+ |
txt += self.wsExitFunc_common() |
58 |
+ |
|
59 |
+ |
txt += ' cp *.${LSB_BATCH_JID}.out CMSSW_${NJob}.stdout \n' |
60 |
+ |
txt += ' cp *.${LSB_BATCH_JID}.err CMSSW_${NJob}.stderr \n' |
61 |
+ |
txt += ' tar zcvf ${out_files}.tgz ${filesToCheck}\n' |
62 |
+ |
txt += ' tmp_size=`ls -gGrta ${out_files}.tgz | awk \'{ print $3 }\'`\n' |
63 |
+ |
txt += ' rm ${out_files}.tgz\n' |
64 |
+ |
txt += ' size=`expr $tmp_size`\n' |
65 |
+ |
txt += ' echo "Total Output dimension: $size"\n' |
66 |
+ |
txt += ' limit='+str(self.OSBsize) +' \n' |
67 |
+ |
txt += ' echo "WARNING: output files size limit is set to: $limit"\n' |
68 |
+ |
txt += ' if [ "$limit" -lt "$size" ]; then\n' |
69 |
+ |
txt += ' exceed=1\n' |
70 |
+ |
txt += ' job_exit_code=70000\n' |
71 |
+ |
txt += ' echo "Output Sanbox too big. Produced output is lost "\n' |
72 |
+ |
txt += ' else\n' |
73 |
+ |
txt += ' exceed=0\n' |
74 |
+ |
txt += ' echo "Total Output dimension $size is fine."\n' |
75 |
+ |
txt += ' fi\n' |
76 |
+ |
|
77 |
+ |
txt += ' echo "JOB_EXIT_STATUS = $job_exit_code"\n' |
78 |
+ |
txt += ' echo "JobExitCode=$job_exit_code" >> $RUNTIME_AREA/$repo\n' |
79 |
+ |
txt += ' dumpStatus $RUNTIME_AREA/$repo\n' |
80 |
+ |
txt += ' if [ $exceed -ne 1 ]; then\n' |
81 |
+ |
txt += ' tar zcvf ${out_files}.tgz ${final_list}\n' |
82 |
+ |
txt += ' else\n' |
83 |
+ |
txt += ' tar zcvf ${out_files}.tgz CMSSW_${NJob}.stdout CMSSW_${NJob}.stderr\n' |
84 |
+ |
txt += ' fi\n' |
85 |
+ |
txt += ' python $RUNTIME_AREA/fillCrabFjr.py $RUNTIME_AREA/crab_fjr_$NJob.xml --errorcode $job_exit_code \n' |
86 |
+ |
txt += ' exit $job_exit_code\n' |
87 |
+ |
txt += '}\n' |
88 |
+ |
return txt |