ViewVC Help
View File | Revision Log | Show Annotations | Root Listing
root/cvsroot/COMP/CRAB/python/SchedulerRcondor.py
(Generate patch)

Comparing COMP/CRAB/python/SchedulerRcondor.py (file contents):
Revision 1.1 by belforte, Wed Jul 11 15:52:54 2012 UTC vs.
Revision 1.2 by belforte, Thu Jul 12 15:50:51 2012 UTC

# Line 5 | Line 5 | Implements the vanilla (local) Remote Co
5   from SchedulerGrid  import SchedulerGrid
6   from crab_exceptions import CrabException
7   from crab_util import runCommand
8 + #from WMCore.SiteScreening.BlackWhiteListParser import CEBlackWhiteListParser
9 + from WMCore.SiteScreening.BlackWhiteListParser import SEBlackWhiteListParser
10 +
11  
12  
13   import common
# Line 29 | Line 32 | class SchedulerRcondor(SchedulerGrid) :
32          SchedulerGrid.__init__(self,"RCONDOR")
33          self.datasetPath   = None
34          self.selectNoInput = None
35 <        self.OSBsize = 100*1000*1000 # 100 MB
35 >        self.OSBsize = 50*1000*1000 # 50 MB
36  
37          self.environment_unique_identifier = None
38          return
# Line 86 | Line 89 | class SchedulerRcondor(SchedulerGrid) :
89  
90      def sched_parameter(self, i, task):
91          """
92 <        Return scheduler-specific parameters
92 >        Return scheduler-specific parameters. Used at crab -submit time
93          """
91        req = ''
92        if self.EDG_addJdlParam:
93            if self.EDG_addJdlParam[-1] == '':
94                self.EDG_addJdlParam = self.EDG_addJdlParam[:-1]
95            for p in self.EDG_addJdlParam:
96                req += p.strip()+';\n'
94  
95 <        return req
95 > #SB paste from crab ScheduerGlidein
96 >
97 >        jobParams = ""
98 >
99 >        seDest = task.jobs[i-1]['dlsDestination']
100 >
101 >        seString=self.blackWhiteListParser.cleanForBlackWhiteList(seDest)
102 >        print "SB: SE destinations AfterBlak and White: ", seString
103 >
104 >        jobParams += '+DESIRED_SEs = "'+seString+'"; '
105 >
106 >        if (self.EDG_clock_time):
107 >            jobParams += '+MaxWallTimeMins = '+self.EDG_clock_time+'; '
108 >        else:
109 >            jobParams += '+MaxWallTimeMins = %d; ' % (60*24)
110 >
111 >        common._db.updateTask_({'jobType':jobParams})
112 >
113 >
114 >        return jobParams
115  
116  
117      def realSchedParams(self, cfg_params):
118          """
119          Return dictionary with specific parameters, to use with real scheduler
120 +        is called when scheduler is initialized in Boss, i.e. at each crab command
121          """
122  
123          tmpDir = os.path.join(common.work_space.shareDir(),'.condor_temp')
# Line 115 | Line 132 | class SchedulerRcondor(SchedulerGrid) :
132          
133          params = {'tmpDir':tmpDir,
134                    'jobDir':jobDir}
135 +
136          return params
137  
138  
# Line 159 | Line 177 | class SchedulerRcondor(SchedulerGrid) :
177          txt += 'func_exit() { \n'
178          txt += self.wsExitFunc_common()
179  
180 <        txt += '    cp  ${out_files}.tgz $_CONDOR_SCRATCH_DIR/\n'
181 <        txt += '    cp  crab_fjr_$NJob.xml $_CONDOR_SCRATCH_DIR/\n'
180 >        #txt += '    cp  ${out_files}.tgz $_CONDOR_SCRATCH_DIR/\n'
181 >        #txt += '    cp  CMSSW_$NJob.stdout $_CONDOR_SCRATCH_DIR/\n'
182 >        #txt += '    cp  CMSSW_$NJob.stderr $_CONDOR_SCRATCH_DIR/\n'
183 >        #txt += '    cp  Watchdog_$NJob.log.gz  $_CONDOR_SCRATCH_DIR/\n'
184 >        #txt += '    cp  crab_fjr_$NJob.xml $_CONDOR_SCRATCH_DIR/\n'
185 >
186 >        
187 >        ### specific Glite check for OSB
188 >        txt += '    tar zcvf ${out_files}.tgz  ${final_list}\n'
189 >        txt += '    tmp_size=`ls -gGrta ${out_files}.tgz | awk \'{ print $3 }\'`\n'
190 >        txt += '    rm ${out_files}.tgz\n'
191 >        txt += '    size=`expr $tmp_size`\n'
192 >        txt += '    echo "Total Output dimension: $size"\n'
193 >        txt += '    limit='+str(self.OSBsize) +' \n'
194 >        txt += '    echo "WARNING: output files size limit is set to: $limit"\n'
195 >        txt += '    if [ "$limit" -lt "$size" ]; then\n'
196 >        txt += '        exceed=1\n'
197 >        txt += '        job_exit_code=70000\n'
198 >        txt += '        echo "Output Sanbox too big. Produced output is lost "\n'
199 >        txt += '    else\n'
200 >        txt += '        exceed=0\n'
201 >        txt += '        echo "Total Output dimension $size is fine."\n'
202 >        txt += '    fi\n'
203 >
204 >        txt += '    echo "JOB_EXIT_STATUS = $job_exit_code"\n'
205 >        txt += '    echo "JobExitCode=$job_exit_code" >> $RUNTIME_AREA/$repo\n'
206 >        txt += '    dumpStatus $RUNTIME_AREA/$repo\n'
207 >        txt += '    if [ $exceed -ne 1 ]; then\n'
208 >        txt += '        tar zcvf ${out_files}.tgz  ${final_list}\n'
209 >        txt += '    else\n'
210 >        txt += '        tar zcvf ${out_files}.tgz CMSSW_${NJob}.stdout CMSSW_${NJob}.stderr\n'
211 >        txt += '    fi\n'
212 >        txt += '    python $RUNTIME_AREA/fillCrabFjr.py $RUNTIME_AREA/crab_fjr_$NJob.xml --errorcode $job_exit_code \n'
213  
214          txt += '    exit $job_exit_code\n'
215          txt += '}\n'

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines