Revision: | 1.2 |
Committed: | Wed Jun 11 10:03:07 2008 UTC (16 years, 10 months ago) by spiga |
Content type: | text/x-python |
Branch: | MAIN |
CVS Tags: | CRAB_2_5_0_pre3, CRAB_2_5_0_pre2, CRAB_2_5_0_pre1, CRAB_2_4_4, CRAB_2_4_4_pre6, CRAB_2_4_4_pre5, CRAB_2_4_4_pre4, CRAB_2_4_4_pre3, CRAB_2_4_4_pre2, CRAB_2_4_4_pre1, CRAB_2_4_3, CRAB_2_4_3_pre8, CRAB_2_4_3_pre7, CRAB_2_4_3_pre6, CRAB_2_4_3_pre5, CRAB_2_4_3_pre3, CRAB_2_4_3_pre2, CRAB_2_4_3_pre1, CRAB_2_4_2, CRAB_2_4_2_pre3, CRAB_2_4_2_pre2, CRAB_2_4_2_pre1, CRAB_2_4_1, CRAB_2_4_1_pre4, CRAB_2_4_1_pre3, CRAB_2_4_1_pre2, CRAB_2_4_1_pre1, CRAB_2_4_0_Tutorial, CRAB_2_4_0_Tutorial_pre1, CRAB_2_4_0, CRAB_2_4_0_pre9, CRAB_2_4_0_pre8, CRAB_2_4_0_pre7, CRAB_2_4_0_pre6, CRAB_2_4_0_pre5, CRAB_2_4_0_pre4, CRAB_2_4_0_pre3, CRAB_2_4_0_pre2, CRAB_2_4_0_pre1, CRAB_DLS_PHED1, CRAB_DLS_PHED, CRAB_2_3_2_Fnal, CRAB_2_3_2, CRAB_2_3_2_pre7, CRAB_2_3_2_pre5, CRAB_2_3_2_pre4, CRAB_2_3_2_pre3, CRAB_2_3_2_pre2, CRAB_2_3_2_pre1, CRAB_2_4_0_test, CRAB_2_3_1, CRAB_2_3_1_pre6, CRAB_2_3_1_pre5, CRAB_2_3_1_pre4, CRAB_2_3_1_pre3, CRAB_2_3_1_pre2, CRAB_2_3_1_pre1, CRAB_2_3_0, CRAB_2_3_0_pre6, CRAB_2_3_0_pre1, CRAB_2_2_2_pre5 |
Branch point for: | AnaDataSet, CRAB_2_3_0_br |
Changes since 1.1: | +2 -16 lines |
Log Message: | removed update_fjr() and aligned all local schedulers |
# | User | Rev | Content |
---|---|---|---|
1 | slacapra | 1.1 | from Scheduler import Scheduler |
2 | from SchedulerLocal import SchedulerLocal | ||
3 | from crab_exceptions import * | ||
4 | from crab_util import * | ||
5 | from crab_logger import Logger | ||
6 | import common | ||
7 | |||
8 | import os,string | ||
9 | |||
10 | # | ||
11 | # Naming convention: | ||
12 | # methods starting with 'ws' are responsible to provide | ||
13 | # corresponding part of the job script ('ws' stands for 'write script'). | ||
14 | # | ||
15 | # Author: Hartmut Stadie <stadie@mail.desy.de> Inst. f. Experimentalphysik; Universitaet Hamburg | ||
16 | # | ||
17 | |||
18 | class SchedulerSge(SchedulerLocal) : | ||
19 | |||
20 | def __init__(self): | ||
21 | Scheduler.__init__(self,"SGE") | ||
22 | |||
23 | return | ||
24 | |||
25 | def configure(self, cfg_params): | ||
26 | SchedulerLocal.configure(self, cfg_params) | ||
27 | self.environment_unique_identifier = "https://"+common.scheduler.name()+":/${JOB_ID}-"+ \ | ||
28 | string.replace(common._db.queryTask('name'),"_","-") | ||
29 | |||
30 | return | ||
31 | |||
32 | def realSchedParams(self,cfg_params): | ||
33 | """ | ||
34 | Return dictionary with specific parameters, to use | ||
35 | with real scheduler | ||
36 | """ | ||
37 | params = {} | ||
38 | return params | ||
39 | |||
40 | def sched_parameter(self,i,task): | ||
41 | """ | ||
42 | Returns parameter scheduler-specific, to use with BOSS . | ||
43 | """ | ||
44 | index = int(common._db.nJobs()) - 1 | ||
45 | sched_param= '' | ||
46 | |||
47 | for i in range(index): # Add loop DS | ||
48 | sched_param= '' | ||
49 | if (self.queue): | ||
50 | sched_param += '-q '+self.queue +' ' | ||
51 | if (self.res): sched_param += ' -R '+self.res +' ' | ||
52 | pass | ||
53 | |||
54 | #request 2G memory and 48 hours CPU time | ||
55 | sched_param += ' -l h_vmem=2G -l h_cpu=172800 ' | ||
56 | return sched_param | ||
57 | |||
58 | def loggingInfo(self, id): | ||
59 | """ return logging info about job nj """ | ||
60 | print "Warning: SchedulerSge::loggingInfo not implemented!" | ||
61 | return "" | ||
62 | |||
63 | def wsExitFunc(self): | ||
64 | """ | ||
65 | """ | ||
66 | txt = '\n' | ||
67 | |||
68 | txt += '#\n' | ||
69 | txt += '# EXECUTE THIS FUNCTION BEFORE EXIT \n' | ||
70 | txt += '#\n\n' | ||
71 | |||
72 | txt += 'func_exit() { \n' | ||
73 | spiga | 1.2 | txt += self.wsExitFunc_common() |
74 | |||
75 | slacapra | 1.1 | txt += ' cp ${SGE_STDOUT_PATH} CMSSW_${NJob}.stdout \n' |
76 | txt += ' cp ${SGE_STDERR_PATH} CMSSW_${NJob}.stderr \n' | ||
77 | txt += ' tar zcvf ${out_files}.tgz ${filesToCheck}\n' | ||
78 | txt += ' exit $job_exit_code\n' | ||
79 | txt += '}\n' | ||
80 | |||
81 | return txt | ||
82 |