1 |
– |
#from Scheduler import Scheduler |
1 |
|
from SchedulerEdg import SchedulerEdg |
2 |
|
from crab_logger import Logger |
3 |
|
from crab_exceptions import * |
4 |
|
from crab_util import * |
6 |
– |
#from EdgConfig import * |
5 |
|
from GliteConfig import * |
6 |
|
import common |
7 |
|
|
19 |
|
self.glite_config = gliteConfig.config() |
20 |
|
|
21 |
|
if (self.glite_config != ''): |
22 |
< |
self.rb_param_file = 'WMSconfig = '+self.glite_config+';' |
22 |
> |
self.rb_param_file = 'WMSconfig = '+self.glite_config+';\n' |
23 |
|
#print "rb_param_file = ", self.rb_param_file |
24 |
|
return self.rb_param_file |
25 |
|
|
44 |
|
|
45 |
|
req = '' |
46 |
|
req = req + jbt.getRequirements() |
47 |
< |
|
47 |
> |
|
48 |
> |
|
49 |
|
if self.EDG_requirements: |
50 |
< |
if (req == ' '): |
51 |
< |
req = req + self.EDG_requirements |
52 |
< |
else: |
54 |
< |
req = req + ' && ' + self.EDG_requirements |
50 |
> |
if (not req == ' '): req = req + ' && ' |
51 |
> |
req = req + self.EDG_requirements |
52 |
> |
|
53 |
|
if self.EDG_ce_white_list: |
54 |
|
ce_white_list = string.split(self.EDG_ce_white_list,',') |
55 |
< |
for i in range(len(ce_white_list)): |
56 |
< |
if i == 0: |
57 |
< |
if (req == ' '): |
58 |
< |
req = req + '((RegExp("' + ce_white_list[i] + '", other.GlueCEUniqueId))' |
59 |
< |
else: |
62 |
< |
req = req + ' && ((RegExp("' + ce_white_list[i] + '", other.GlueCEUniqueId))' |
63 |
< |
pass |
64 |
< |
else: |
65 |
< |
req = req + ' || (RegExp("' + ce_white_list[i] + '", other.GlueCEUniqueId))' |
66 |
< |
req = req + ')' |
55 |
> |
tmpCe=[] |
56 |
> |
concString = '&&' |
57 |
> |
for ce in ce_white_list: |
58 |
> |
tmpCe.append('RegExp("' + string.strip(ce) + '", other.GlueCEUniqueId)') |
59 |
> |
if len(tmpCe): req = req + " && (" + concString.join(tmpCe) + ") " |
60 |
|
|
61 |
|
if self.EDG_ce_black_list: |
62 |
|
ce_black_list = string.split(self.EDG_ce_black_list,',') |
63 |
+ |
tmpCe=[] |
64 |
+ |
concString = '&&' |
65 |
|
for ce in ce_black_list: |
66 |
< |
if (req == ' '): |
67 |
< |
req = req + '(!RegExp("' + ce + '", other.GlueCEUniqueId))' |
68 |
< |
else: |
74 |
< |
req = req + ' && (!RegExp("' + ce + '", other.GlueCEUniqueId))' |
75 |
< |
pass |
66 |
> |
tmpCe.append('(!RegExp("' + string.strip(ce) + '", other.GlueCEUniqueId))') |
67 |
> |
if len(tmpCe): req = req + " && (" + concString.join(tmpCe) + ") " |
68 |
> |
|
69 |
|
if self.EDG_clock_time: |
70 |
< |
if (req == ' '): |
71 |
< |
req = req + 'other.GlueCEPolicyMaxWallClockTime>='+self.EDG_clock_time |
79 |
< |
else: |
80 |
< |
req = req + ' && other.GlueCEPolicyMaxWallClockTime>='+self.EDG_clock_time |
70 |
> |
if (not req == ' '): req = req + ' && ' |
71 |
> |
req = req + 'other.GlueCEPolicyMaxWallClockTime>='+self.EDG_clock_time |
72 |
|
|
73 |
|
if self.EDG_cpu_time: |
74 |
< |
if (req == ' '): |
75 |
< |
req = req + ' other.GlueCEPolicyMaxCPUTime>='+self.EDG_cpu_time |
85 |
< |
else: |
86 |
< |
req = req + ' && other.GlueCEPolicyMaxCPUTime>='+self.EDG_cpu_time |
74 |
> |
if (not req == ' '): req = req + ' && ' |
75 |
> |
req = req + ' other.GlueCEPolicyMaxCPUTime>='+self.EDG_cpu_time |
76 |
|
|
77 |
|
for i in range(len(first)): # Add loop DS |
78 |
|
self.param='sched_param_'+str(i)+'.clad' |
79 |
|
param_file = open(common.work_space.shareDir()+'/'+self.param, 'w') |
80 |
|
|
81 |
|
itr4=self.findSites_(first[i]) |
82 |
< |
req1=[] |
83 |
< |
j = 0 |
82 |
> |
reqSites='' |
83 |
> |
reqtmp=[] |
84 |
|
concString = '||' |
85 |
+ |
|
86 |
+ |
############# |
87 |
+ |
# MC Changed matching syntax to avoid gang matching |
88 |
+ |
############# |
89 |
|
for arg in itr4: |
90 |
< |
############# |
91 |
< |
# MC Changed matching syntax to avoid gang matching |
92 |
< |
############# |
100 |
< |
req1.append(' Member("'+arg+'" , other.GlueCESEBindGroupSEUniqueID) ') |
101 |
< |
if len(req1): req = req + " && (" + concString.join(req1) + ')' |
102 |
< |
req = req + ';\n' |
103 |
< |
param_file.write('Requirements = ' + req ) |
104 |
< |
|
105 |
< |
# if (self.edg_config and self.edg_config_vo != ''): |
106 |
< |
# param_file.write('RBconfig = "'+self.edg_config+'";\n') |
107 |
< |
# param_file.write('RBconfigVO = "'+self.edg_config_vo+'";') |
90 |
> |
reqtmp.append(' Member("'+arg+'" , other.GlueCESEBindGroupSEUniqueID) ') |
91 |
> |
|
92 |
> |
if len(reqtmp): reqSites = reqSites + " && (" + concString.join(reqtmp) + ") " |
93 |
|
|
94 |
+ |
# requirement added to skip gliteCE |
95 |
+ |
reqSites = reqSites + '&& (!RegExp("blah", other.GlueCEUniqueId));\n' |
96 |
+ |
|
97 |
+ |
param_file.write('Requirements = ' + req + reqSites ) |
98 |
+ |
|
99 |
|
if (self.rb_param_file != ''): |
100 |
|
param_file.write(self.rb_param_file) |
101 |
|
|
102 |
+ |
if len(self.EDG_addJdlParam): |
103 |
+ |
for p in self.EDG_addJdlParam: |
104 |
+ |
param_file.write(p) |
105 |
|
|
106 |
|
param_file.close() |
107 |
|
|
238 |
|
retrieve the logging info from logging and bookkeeping and return it |
239 |
|
""" |
240 |
|
self.checkProxy() |
241 |
< |
cmd = 'glite-job-logging-info -v 2 ' + id |
241 |
> |
cmd = 'glite-job-logging-info -v 3 ' + id |
242 |
|
cmd_out = runCommand(cmd) |
243 |
|
return cmd_out |
244 |
|
|