ViewVC Help
View File | Revision Log | Show Annotations | Root Listing
root/cvsroot/COMP/CRAB/python/SchedulerGlite.py
(Generate patch)

Comparing COMP/CRAB/python/SchedulerGlite.py (file contents):
Revision 1.3 by slacapra, Mon Oct 9 15:30:41 2006 UTC vs.
Revision 1.10 by slacapra, Wed Jan 17 18:17:58 2007 UTC

# Line 1 | Line 1
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 *
5 < from EdgConfig import *
5 > from GliteConfig import *
6   import common
7  
8   import os, sys, time
# Line 12 | Line 11 | class SchedulerGlite(SchedulerEdg):
11      def __init__(self):
12          SchedulerEdg.__init__(self)
13  
14 +    def rb_configure(self, RB):
15 +        self.glite_config = ''
16 +        self.rb_param_file = ''
17 +
18 +        gliteConfig = GliteConfig(RB)
19 +        self.glite_config = gliteConfig.config()
20 +
21 +        if (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 +
26      def sched_parameter(self):
27          """
28          Returns file with requirements and scheduler-specific parameters
# Line 44 | Line 55 | class SchedulerGlite(SchedulerEdg):
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))'
58 >                        req = req + '((RegExp("' + string.strip(ce_white_list[i]) + '", other.GlueCEUniqueId))'
59                      else:
60 <                        req = req +  ' && ((RegExp("' + ce_white_list[i] + '", other.GlueCEUniqueId))'
60 >                        req = req +  ' && ((RegExp("' + string.strip(ce_white_list[i]) + '", other.GlueCEUniqueId))'
61                      pass
62                  else:
63 <                    req = req +  ' || (RegExp("' + ce_white_list[i] + '", other.GlueCEUniqueId))'
63 >                    req = req +  ' || (RegExp("' + string.strip(ce_white_list[i]) + '", other.GlueCEUniqueId))'
64              req = req + ')'
65          
66          if self.EDG_ce_black_list:
67              ce_black_list = string.split(self.EDG_ce_black_list,',')
68              for ce in ce_black_list:
69                  if (req == ' '):
70 <                    req = req + '(!RegExp("' + ce + '", other.GlueCEUniqueId))'
70 >                    req = req + '(!RegExp("' + string.strip(ce) + '", other.GlueCEUniqueId))'
71                  else:
72 <                    req = req +  ' && (!RegExp("' + ce + '", other.GlueCEUniqueId))'
72 >                    req = req +  ' && (!RegExp("' + string.strip(ce) + '", other.GlueCEUniqueId))'
73                  pass
74          if self.EDG_clock_time:
75              if (req == ' '):
# Line 77 | Line 88 | class SchedulerGlite(SchedulerEdg):
88              param_file = open(common.work_space.shareDir()+'/'+self.param, 'w')
89  
90              itr4=self.findSites_(first[i])
91 <            req1=[]  
92 <            j = 0
91 >            reqSites=''
92 >            reqtmp=[]  
93              concString = '||'
94              for arg in itr4:
95                  #############
96                  # MC Changed matching syntax to avoid gang matching
97                  #############
98 <                req1.append(' Member("'+arg+'" , other.GlueCESEBindGroupSEUniqueID) ')
99 <            if len(req1): req = req + " && (" + concString.join(req1) + ')'
100 <            req = req + ';\n'
101 <            param_file.write('Requirements = ' + req )
98 >                reqtmp.append(' Member("'+arg+'" , other.GlueCESEBindGroupSEUniqueID) ')
99 >            if len(reqtmp): reqSites = reqSites + " && (" + concString.join(reqtmp) + ')'
100 >            reqSites = reqSites + ';\n'
101 >            param_file.write('Requirements = ' + req + reqSites )
102    
103 <            if (self.edg_config and self.edg_config_vo != ''):
104 <                param_file.write('RBconfig = "'+self.edg_config+'";\n')  
105 <                param_file.write('RBconfigVO = "'+self.edg_config_vo+'";')
103 >            if (self.rb_param_file != ''):
104 >                param_file.write(self.rb_param_file)  
105 >
106 >            if len(self.EDG_addJdlParam):
107 >                for p in self.EDG_addJdlParam:
108 >                    param_file.write(p)
109  
110              param_file.close()  
111  
# Line 228 | Line 242 | class SchedulerGlite(SchedulerEdg):
242          retrieve the logging info from logging and bookkeeping and return it
243          """
244          self.checkProxy()
245 <        cmd = 'glite-job-logging-info -v 2 ' + id
245 >        cmd = 'glite-job-logging-info -v 3 ' + id
246          cmd_out = runCommand(cmd)
247          return cmd_out
248  

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines