21 |
|
|
22 |
|
def configure(self, cfg_params): |
23 |
|
|
24 |
< |
try: self.edg_ui_cfg = cfg_params["EDG.rb_config"] |
25 |
< |
except KeyError: self.edg_ui_cfg = '' |
26 |
< |
|
27 |
< |
try: |
28 |
< |
self.edg_config = cfg_params["EDG.config"] |
29 |
< |
if not os.path.isfile(self.edg_config): |
30 |
< |
raise CrabException("File EDG.config "+self.edg_config+" does not exist") |
24 |
> |
try: self.edg_config = cfg_params["EDG.config"] |
25 |
|
except KeyError: self.edg_config = '' |
26 |
|
|
27 |
< |
try: |
34 |
< |
self.edg_config_vo = cfg_params["EDG.config_vo"] |
35 |
< |
if not os.path.isfile(self.edg_config_vo): |
36 |
< |
raise CrabException("File EDG.config_vo "+self.edg_config_vo+" does not exist") |
27 |
> |
try: self.edg_config_vo = cfg_params["EDG.config_vo"] |
28 |
|
except KeyError: self.edg_config_vo = '' |
29 |
|
|
30 |
|
try: self.LCG_version = cfg_params["EDG.lcg_version"] |
57 |
|
self.checkProxy_() |
58 |
|
return |
59 |
|
|
60 |
+ |
|
61 |
+ |
def sched_parameter(self): |
62 |
+ |
""" |
63 |
+ |
Returns file with scheduler-specific parameters |
64 |
+ |
""" |
65 |
+ |
|
66 |
+ |
if (self.edg_config and self.edg_config_vo != ''): |
67 |
+ |
self.param='sched_param.clad' |
68 |
+ |
param_file = open(common.work_space.shareDir()+'/'+self.param, 'w') |
69 |
+ |
param_file.write('RBconfig = "'+self.edg_config+'";\n') |
70 |
+ |
param_file.write('RBconfigVO = "'+self.edg_config_vo+'";') |
71 |
+ |
param_file.close() |
72 |
+ |
return 1 |
73 |
+ |
else: |
74 |
+ |
return 0 |
75 |
|
def wsSetupEnvironment(self): |
76 |
|
""" |
77 |
|
Returns part of a job script which does scheduler-specific work. |
103 |
|
Check the compatibility of available resources |
104 |
|
""" |
105 |
|
jdl = common.job_list[nj].jdlFilename() |
100 |
– |
#print ' jdl ',nj, jdl |
106 |
|
edg_ui_cfg_opt = '' |
107 |
|
if self.edg_config: |
108 |
|
edg_ui_cfg_opt = ' -c ' + self.edg_config + ' ' |
126 |
|
Match=0 |
127 |
|
for line in out: |
128 |
|
line = line.strip() |
124 |
– |
#print line |
129 |
|
if reComment.match( line ): |
130 |
|
next = 0 |
131 |
|
continue |
202 |
|
|
203 |
|
def getExitStatus(self, id): |
204 |
|
return self.getStatusAttribute_(id, 'exit_code') |
205 |
+ |
|
206 |
|
def queryStatus(self, id): |
207 |
|
return self.getStatusAttribute_(id, 'status') |
208 |
+ |
|
209 |
|
def queryDest(self, id): |
210 |
|
return self.getStatusAttribute_(id, 'destination') |
211 |
|
|
281 |
|
raise CrabException(msg) |
282 |
|
return |
283 |
|
|
284 |
< |
def createJDL(self, nj): |
284 |
> |
def createSchScript(self, nj): |
285 |
|
""" |
286 |
|
Create a JDL-file for EDG. |
287 |
|
""" |
288 |
|
|
289 |
|
job = common.job_list[nj] |
290 |
|
jbt = job.type() |
285 |
– |
# jbt.loadJobInfo() |
291 |
|
inp_sandbox = jbt.inputSandbox(nj) |
292 |
|
out_sandbox = jbt.outputSandbox(nj) |
293 |
< |
inp_storage_subdir = ''#jbt.inputStorageSubdir() |
293 |
> |
inp_storage_subdir = '' |
294 |
|
|
295 |
|
title = '# This JDL was generated by '+\ |
296 |
|
common.prog_name+' (version '+common.prog_version_str+')\n' |