3 |
|
from crab_logger import Logger |
4 |
|
from crab_exceptions import * |
5 |
|
from crab_util import * |
6 |
< |
from EdgConfig import * |
6 |
> |
#from EdgConfig import * |
7 |
> |
from GliteConfig import * |
8 |
|
import common |
9 |
|
|
10 |
|
import os, sys, time |
11 |
|
|
12 |
|
class SchedulerGlite(SchedulerEdg): |
13 |
|
def __init__(self): |
14 |
< |
SchedulerEdg.__init__(self) |
14 |
> |
SchedulerEdg.__init__(self) |
15 |
> |
|
16 |
> |
def rb_configure(self, RB): |
17 |
> |
self.glite_config = '' |
18 |
> |
self.rb_param_file = '' |
19 |
> |
|
20 |
> |
gliteConfig = GliteConfig(RB) |
21 |
> |
self.glite_config = gliteConfig.config() |
22 |
> |
|
23 |
> |
if (self.glite_config != ''): |
24 |
> |
self.rb_param_file = 'WMSconfig = '+self.glite_config+';\n' |
25 |
> |
#print "rb_param_file = ", self.rb_param_file |
26 |
> |
return self.rb_param_file |
27 |
> |
|
28 |
|
def sched_parameter(self): |
29 |
|
""" |
30 |
|
Returns file with requirements and scheduler-specific parameters |
90 |
|
param_file = open(common.work_space.shareDir()+'/'+self.param, 'w') |
91 |
|
|
92 |
|
itr4=self.findSites_(first[i]) |
93 |
< |
if (itr4 != []): |
94 |
< |
req1=[] |
95 |
< |
j = 0 |
96 |
< |
concString = '||' |
97 |
< |
for arg in itr4: |
98 |
< |
print "ITR: ", arg |
99 |
< |
############# |
100 |
< |
# MC Changed matching syntax to avoid gang matching |
101 |
< |
############# |
102 |
< |
req1.append(' Member("'+arg+'" , other.GlueCESEBindGroupSEUniqueID) ') |
103 |
< |
param_file.write('Requirements = ' + req + " && (" + concString.join(req1) + ');\n') |
93 |
> |
reqSites='' |
94 |
> |
reqtmp=[] |
95 |
> |
j = 0 |
96 |
> |
concString = '||' |
97 |
> |
for arg in itr4: |
98 |
> |
############# |
99 |
> |
# MC Changed matching syntax to avoid gang matching |
100 |
> |
############# |
101 |
> |
reqtmp.append(' Member("'+arg+'" , other.GlueCESEBindGroupSEUniqueID) ') |
102 |
> |
if len(reqtmp): reqSites = reqSites + " && (" + concString.join(reqtmp) + ')' |
103 |
> |
reqSites = reqSites + ';\n' |
104 |
> |
param_file.write('Requirements = ' + req + reqSites ) |
105 |
|
|
106 |
< |
if (self.edg_config and self.edg_config_vo != ''): |
107 |
< |
param_file.write('RBconfig = "'+self.edg_config+'";\n') |
108 |
< |
param_file.write('RBconfigVO = "'+self.edg_config_vo+'";') |
106 |
> |
# if (self.edg_config and self.edg_config_vo != ''): |
107 |
> |
# param_file.write('RBconfig = "'+self.edg_config+'";\n') |
108 |
> |
# param_file.write('RBconfigVO = "'+self.edg_config_vo+'";') |
109 |
> |
|
110 |
> |
if (self.rb_param_file != ''): |
111 |
> |
param_file.write(self.rb_param_file) |
112 |
> |
|
113 |
|
|
114 |
|
param_file.close() |
115 |
|
|
257 |
|
return cmd_out |
258 |
|
|
259 |
|
def findSites_(self, n): |
241 |
– |
itr4 =[] |
260 |
|
sites = common.jobDB.destination(n) |
261 |
< |
if len(sites)>0 and sites[0]=="Any": |
262 |
< |
return itr4 |
263 |
< |
if sites != [""]: |
246 |
< |
return sites |
261 |
> |
if len(sites)>0 and sites[0]=="": |
262 |
> |
return [] |
263 |
> |
return sites |