24 |
|
def configure(self, cfg_params): |
25 |
|
SchedulerLocal.configure(self, cfg_params) |
26 |
|
self.environment_unique_identifier ='${HOSTNAME}_${CONDOR_ID}_' + common._db.queryTask('name') |
27 |
+ |
|
28 |
+ |
try: |
29 |
+ |
tmp = cfg_params['CMSSW.datasetpath'] |
30 |
+ |
if string.lower(tmp)=='none': |
31 |
+ |
self.datasetPath = None |
32 |
+ |
self.selectNoInput = 1 |
33 |
+ |
else: |
34 |
+ |
self.datasetPath = tmp |
35 |
+ |
self.selectNoInput = 0 |
36 |
+ |
except KeyError: |
37 |
+ |
msg = "Error: datasetpath not defined " |
38 |
+ |
raise CrabException(msg) |
39 |
+ |
|
40 |
|
return |
41 |
|
|
42 |
|
|
64 |
|
return params |
65 |
|
|
66 |
|
|
67 |
+ |
def listMatch(self, seList, full, onlyOSG=True): |
68 |
+ |
""" |
69 |
+ |
Check the compatibility of available resources |
70 |
+ |
""" |
71 |
+ |
|
72 |
+ |
# May have problems with onlyOSG being false, probably due to lengths of lists and command line. |
73 |
+ |
# Either re-write osg_bdii.py with a proper ldap library or break the queries apart |
74 |
+ |
|
75 |
+ |
if self.selectNoInput: |
76 |
+ |
return [True] |
77 |
+ |
else: |
78 |
+ |
return SchedulerLocal.listMatch(self, seList, full) |
79 |
+ |
|
80 |
|
def decodeLogInfo(self, file): |
81 |
|
""" |
82 |
|
Parse logging info file and return main info |
96 |
|
txt += '#\n\n' |
97 |
|
|
98 |
|
txt += 'func_exit() { \n' |
99 |
< |
txt += ' if [ $PYTHONPATH ]; then \n' |
100 |
< |
txt += ' update_fjr\n' |
75 |
< |
txt += ' fi\n' |
76 |
< |
txt += ' for file in $filesToCheck ; do\n' |
77 |
< |
txt += ' if [ -e $file ]; then\n' |
78 |
< |
txt += ' echo "tarring file $file in $out_files"\n' |
79 |
< |
txt += ' else\n' |
80 |
< |
txt += ' echo "WARNING: output file $file not found!"\n' |
81 |
< |
txt += ' fi\n' |
82 |
< |
txt += ' done\n' |
83 |
< |
txt += ' final_list=$filesToCheck\n' |
84 |
< |
txt += ' echo "JOB_EXIT_STATUS = $job_exit_code"\n' |
85 |
< |
txt += ' echo "JobExitCode=$job_exit_code" >> $RUNTIME_AREA/$repo\n' |
86 |
< |
txt += ' dumpStatus $RUNTIME_AREA/$repo\n' |
99 |
> |
txt += self.wsExitFunc_common() |
100 |
> |
|
101 |
|
txt += ' tar zcvf ${out_files}.tgz ${final_list}\n' |
102 |
|
txt += ' cp ${out_files}.tgz $ORIG_WD/\n' |
103 |
|
txt += ' cp crab_fjr_$NJob.xml $ORIG_WD/\n' |
106 |
|
txt += '}\n' |
107 |
|
|
108 |
|
return txt |
109 |
+ |
|
110 |
+ |
def wsInitialEnvironment(self): |
111 |
+ |
""" |
112 |
+ |
Returns part of a job script which does scheduler-specific work. |
113 |
+ |
""" |
114 |
+ |
|
115 |
+ |
txt = '\n# Written by SchedulerCondor::wsInitialEnvironment\n' |
116 |
+ |
txt += 'echo "Beginning environment"\n' |
117 |
+ |
txt += 'printenv | sort\n' |
118 |
+ |
|
119 |
+ |
txt += 'middleware='+self.name()+' \n' |
120 |
+ |
txt += """ |
121 |
+ |
if [ $_CONDOR_SCRATCH_DIR ] && [ -d $_CONDOR_SCRATCH_DIR ]; then |
122 |
+ |
ORIG_WD=`pwd` |
123 |
+ |
echo "Change from $ORIG_WD to Condor scratch directory: $_CONDOR_SCRATCH_DIR" |
124 |
+ |
if [ -e ../default.tgz ] ;then |
125 |
+ |
echo "Found ISB in parent directory (Local Condor)" |
126 |
+ |
cp ../default.tgz $_CONDOR_SCRATCH_DIR |
127 |
+ |
fi |
128 |
+ |
cd $_CONDOR_SCRATCH_DIR |
129 |
+ |
fi |
130 |
+ |
""" |
131 |
+ |
|
132 |
+ |
return txt |