23 |
|
def configure(self, cfg_params): |
24 |
|
|
25 |
|
try: |
26 |
< |
RB = cfg_params["EDG.rb"] |
27 |
< |
edgConfig = EdgConfig(RB) |
28 |
< |
self.edg_config = edgConfig.config() |
29 |
< |
self.edg_config_vo = edgConfig.configVO() |
26 |
> |
RB=cfg_params["EDG.rb"] |
27 |
> |
self.rb_param_file=self.rb_configure(RB) |
28 |
|
except KeyError: |
29 |
< |
self.edg_config = '' |
30 |
< |
self.edg_config_vo = '' |
33 |
< |
|
29 |
> |
self.rb_param_file='' |
30 |
> |
pass |
31 |
|
try: |
32 |
|
self.proxyServer = cfg_params["EDG.proxy_server"] |
33 |
|
except KeyError: |
47 |
|
try: self.LCG_version = cfg_params["EDG.lcg_version"] |
48 |
|
except KeyError: self.LCG_version = '2' |
49 |
|
|
53 |
– |
try: self.EDG_requirements = cfg_params['EDG.requirements'] |
54 |
– |
except KeyError: self.EDG_requirements = '' |
55 |
– |
|
56 |
– |
try: self.EDG_retry_count = cfg_params['EDG.retry_count'] |
57 |
– |
except KeyError: self.EDG_retry_count = '' |
58 |
– |
|
50 |
|
try: |
51 |
|
self.EDG_ce_black_list = cfg_params['EDG.ce_black_list'] |
61 |
– |
#print "self.EDG_ce_black_list = ", self.EDG_ce_black_list |
52 |
|
except KeyError: |
53 |
|
self.EDG_ce_black_list = '' |
54 |
|
|
55 |
|
try: |
56 |
|
self.EDG_ce_white_list = cfg_params['EDG.ce_white_list'] |
67 |
– |
#print "self.EDG_ce_white_list = ", self.EDG_ce_white_list |
57 |
|
except KeyError: self.EDG_ce_white_list = '' |
58 |
|
|
59 |
|
try: self.VO = cfg_params['EDG.virtual_organization'] |
122 |
|
|
123 |
|
try: self.EDG_requirements = cfg_params['EDG.requirements'] |
124 |
|
except KeyError: self.EDG_requirements = '' |
125 |
< |
|
125 |
> |
|
126 |
> |
try: self.EDG_addJdlParam = string.split(cfg_params['EDG.additional_jdl_parameters'],',') |
127 |
> |
except KeyError: self.EDG_addJdlParam = [] |
128 |
> |
|
129 |
|
try: self.EDG_retry_count = cfg_params['EDG.retry_count'] |
130 |
|
except KeyError: self.EDG_retry_count = '' |
131 |
< |
|
131 |
> |
|
132 |
> |
try: self.EDG_shallow_retry_count= cfg_params['EDG.shallow_retry_count'] |
133 |
> |
except KeyError: self.EDG_shallow_retry_count = '' |
134 |
> |
|
135 |
|
try: self.EDG_clock_time = cfg_params['EDG.max_wall_clock_time'] |
136 |
|
except KeyError: self.EDG_clock_time= '' |
137 |
< |
|
137 |
> |
|
138 |
|
try: self.EDG_cpu_time = cfg_params['EDG.max_cpu_time'] |
139 |
|
except KeyError: self.EDG_cpu_time = '' |
140 |
|
|
167 |
|
return |
168 |
|
|
169 |
|
|
170 |
+ |
def rb_configure(self, RB): |
171 |
+ |
self.edg_config = '' |
172 |
+ |
self.edg_config_vo = '' |
173 |
+ |
self.rb_param_file = '' |
174 |
+ |
|
175 |
+ |
edgConfig = EdgConfig(RB) |
176 |
+ |
self.edg_config = edgConfig.config() |
177 |
+ |
self.edg_config_vo = edgConfig.configVO() |
178 |
+ |
|
179 |
+ |
if (self.edg_config and self.edg_config_vo != ''): |
180 |
+ |
self.rb_param_file = 'RBconfig = "'+self.edg_config+'";\nRBconfigVO = "'+self.edg_config_vo+'";' |
181 |
+ |
#print "rb_param_file = ", self.rb_param_file |
182 |
+ |
return self.rb_param_file |
183 |
+ |
|
184 |
+ |
|
185 |
|
def sched_parameter(self): |
186 |
|
""" |
187 |
|
Returns file with requirements and scheduler-specific parameters |
249 |
|
req = req + ' && anyMatch(other.storage.CloseSEs, ('+str(arg)+'))' |
250 |
|
param_file.write('Requirements = '+req +';\n') |
251 |
|
|
252 |
< |
if (self.edg_config and self.edg_config_vo != ''): |
253 |
< |
param_file.write('RBconfig = "'+self.edg_config+'";\n') |
254 |
< |
param_file.write('RBconfigVO = "'+self.edg_config_vo+'";') |
252 |
> |
if (self.rb_param_file != ''): |
253 |
> |
param_file.write(self.rb_param_file) |
254 |
> |
|
255 |
> |
if len(self.EDG_addJdlParam): |
256 |
> |
for p in self.EDG_addJdlParam: |
257 |
> |
param_file.write(p) |
258 |
|
|
259 |
|
param_file.close() |
260 |
|
|
677 |
|
req=' ' |
678 |
|
req = req + jbt.getRequirements() |
679 |
|
|
667 |
– |
|
668 |
– |
#sites = common.jobDB.destination(nj) |
669 |
– |
#if len(sites)>0 and sites[0]!="Any": |
670 |
– |
# req = req + ' && anyMatch(other.storage.CloseSEs, (_ITR4_))' |
671 |
– |
#req = req |
672 |
– |
|
680 |
|
if self.EDG_requirements: |
681 |
|
if (req == ' '): |
682 |
|
req = req + self.EDG_requirements |
719 |
|
to_write = to_write + 'RetryCount = "'+self.EDG_retry_count+'"\n' |
720 |
|
pass |
721 |
|
|
722 |
+ |
if ( self.EDG_shallow_retry_count ): |
723 |
+ |
to_write = to_write + 'ShallowRetryCount = "'+self.EDG_shallow_retry_count+'"\n' |
724 |
+ |
pass |
725 |
+ |
|
726 |
|
to_write = to_write + 'MyProxyServer = ""' + self.proxyServer + '""\n' |
727 |
|
to_write = to_write + 'VirtualOrganisation = ""' + self.VO + '""\n' |
728 |
|
|
773 |
|
xml.write('<exec> ' + os.path.basename(script) +' </exec>\n') |
774 |
|
xml.write(jt_string) |
775 |
|
|
765 |
– |
|
766 |
– |
### only one .sh JDL has arguments: |
767 |
– |
### Fabio |
768 |
– |
# xml.write('args = "' + str(nj+1)+' '+ jbt.getJobTypeArguments(nj, "EDG") +'"\n') |
776 |
|
xml.write('<args> <![CDATA[\n _ITR2_ \n]]> </args>\n') |
777 |
|
xml.write('<program_types> crabjob </program_types>\n') |
778 |
|
inp_box = script + ',' |