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

Comparing COMP/CRAB/python/SchedulerCondor.py (file contents):
Revision 1.21 by spiga, Fri Mar 6 16:54:42 2009 UTC vs.
Revision 1.33 by belforte, Thu Jun 14 15:47:28 2012 UTC

# Line 11 | Line 11 | from crab_exceptions import CrabExceptio
11   import common
12   import os
13   import socket
14 < import sha
14 >
15 > # FUTURE: for python 2.4 & 2.6
16 > try:
17 >    from hashlib import sha1
18 > except:
19 >    from sha import sha as sha1
20  
21   class SchedulerCondor(SchedulerLocal) :
22      """
# Line 25 | Line 30 | class SchedulerCondor(SchedulerLocal) :
30          SchedulerLocal.__init__(self,"CONDOR")
31          self.datasetPath   = None
32          self.selectNoInput = None
33 <        self.return_data   = 0
29 <        self.copy_data     = 0
33 >        self.OSBsize = None
34  
35          self.environment_unique_identifier = None
36          return
# Line 38 | Line 42 | class SchedulerCondor(SchedulerLocal) :
42          """
43  
44          SchedulerLocal.configure(self, cfg_params)
45 <        taskHash = sha.new(common._db.queryTask('name')).hexdigest()
46 <        self.environment_unique_identifier = "https://" + \
47 <            socket.gethostname() + '/' + taskHash + "/${NJob}"
45 >
46 >        self.proxyValid=0
47 >        self.dontCheckProxy=int(cfg_params.get("GRID.dont_check_proxy",0))
48 >        self.space_token = cfg_params.get("USER.space_token",None)
49 >        try:
50 >            self.proxyServer = Downloader("http://cmsdoc.cern.ch/cms/LCG/crab/config/").config("myproxy_server.conf")
51 >            self.proxyServer = self.proxyServer.strip()
52 >            if self.proxyServer is None:
53 >                raise CrabException("myproxy_server.conf retrieved but empty")
54 >        except Exception, e:
55 >            common.logger.info("Problem setting myproxy server endpoint: using myproxy.cern.ch")
56 >            common.logger.debug(e)
57 >            self.proxyServer= 'myproxy.cern.ch'
58 >        self.group = cfg_params.get("GRID.group", None)
59 >        self.role = cfg_params.get("GRID.role", None)
60 >        self.VO = cfg_params.get('GRID.virtual_organization','cms')
61  
62          try:
63              tmp =  cfg_params['CMSSW.datasetpath']
# Line 54 | Line 71 | class SchedulerCondor(SchedulerLocal) :
71              msg = "Error: datasetpath not defined "
72              raise CrabException(msg)
73  
74 <        self.return_data = cfg_params.get('USER.return_data', 0)
58 <        self.copy_data   = cfg_params.get("USER.copy_data", 0)
59 <
60 <        if int(self.copy_data) == 1:
61 <
62 <            self.proxyValid = 0
63 <            self.dontCheckProxy = int(cfg_params.get("EDG.dont_check_proxy", 0))
64 <            self.proxyServer = cfg_params.get("EDG.proxy_server", 'myproxy.cern.ch')
65 <            common.logger.debug(5,'Setting myproxy server to ' + self.proxyServer)
66 <
67 <            self.group = cfg_params.get("EDG.group", None)
68 <            self.role  = cfg_params.get("EDG.role", None)
69 <            self.VO    = cfg_params.get('EDG.virtual_organization', 'cms')
70 <
71 <            self.checkProxy()
72 <
73 <        self.role  = None
74 >        self.checkProxy()
75  
76          return
77  
78 +    def envUniqueID(self):
79 +        taskHash = sha1(common._db.queryTask('name')).hexdigest()
80 +        id = "https://" + socket.gethostname() + '/' + taskHash + "/${NJob}"
81 +        return id
82  
83      def sched_parameter(self, i, task):
84          """
85          Return scheduler-specific parameters
86          """
87 +        req = ''
88 +        if self.EDG_addJdlParam:
89 +            if self.EDG_addJdlParam[-1] == '':
90 +                self.EDG_addJdlParam = self.EDG_addJdlParam[:-1]
91 +            for p in self.EDG_addJdlParam:
92 +                req += p.strip()+';\n'
93  
94 <        index = int(common._db.nJobs()) - 1
84 <        schedParam = ''
85 <
86 <        for i in range(index):
87 <            pass
88 <
89 <        return schedParam
94 >        return req
95  
96  
97      def realSchedParams(self, cfg_params):
# Line 178 | Line 183 | fi
183   """
184  
185          return txt
186 +
187 +
188 +    def sched_fix_parameter(self):
189 +        """
190 +        Returns string with requirements and scheduler-specific parameters
191 +        """
192 +
193 +        if self.EDG_requirements:
194 +            req = self.EDG_requirements
195 +            taskReq = {'commonRequirements':req}
196 +            common._db.updateTask_(taskReq)

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines