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.2 by spiga, Fri Oct 6 16:29:12 2006 UTC vs.
Revision 1.7 by slacapra, Tue Oct 17 09:52:57 2006 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
9  
10   class SchedulerGlite(SchedulerEdg):
11      def __init__(self):
12 <            SchedulerEdg.__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 76 | Line 88 | class SchedulerGlite(SchedulerEdg):
88              param_file = open(common.work_space.shareDir()+'/'+self.param, 'w')
89  
90              itr4=self.findSites_(first[i])
91 <            if (itr4 != []):
92 <                req1=[]  
93 <                j = 0
94 <                concString = '||'
95 <                for arg in itr4:
96 <                    print "ITR: ", arg
97 <                    #############
98 <                    # MC Changed matching syntax to avoid gang matching
99 <                    #############
100 <                    req1.append(' Member("'+arg+'" , other.GlueCESEBindGroupSEUniqueID) ')
101 <            param_file.write('Requirements = ' + req + " && (" + concString.join(req1) + ');\n')  
91 >            reqSites=''
92 >            reqtmp=[]  
93 >            j = 0
94 >            concString = '||'
95 >            for arg in itr4:
96 >                #############
97 >                # MC Changed matching syntax to avoid gang matching
98 >                #############
99 >                reqtmp.append(' Member("'+arg+'" , other.GlueCESEBindGroupSEUniqueID) ')
100 >            if len(reqtmp): reqSites = reqSites + " && (" + concString.join(reqtmp) + ')'
101 >            reqSites = reqSites + ';\n'
102 >            param_file.write('Requirements = ' + req + reqSites )
103    
104 <            if (self.edg_config and self.edg_config_vo != ''):
105 <                param_file.write('RBconfig = "'+self.edg_config+'";\n')  
106 <                param_file.write('RBconfigVO = "'+self.edg_config_vo+'";')
104 >            if (self.rb_param_file != ''):
105 >                param_file.write(self.rb_param_file)  
106 >
107 >            if len(self.EDG_addJdlParam):
108 >                for p in self.EDG_addJdlParam:
109 >                    param_file.write(p)
110  
111              param_file.close()  
112  
# Line 238 | Line 254 | class SchedulerGlite(SchedulerEdg):
254          return cmd_out
255  
256      def findSites_(self, n):
241        itr4 =[]
257          sites = common.jobDB.destination(n)
258 <        if len(sites)>0 and sites[0]=="Any":
259 <            return itr4
260 <        if sites != [""]:
246 <            return sites
258 >        if len(sites)>0 and sites[0]=="":
259 >            return []
260 >        return sites

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines