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.23 by ewv, Mon Mar 9 15:56:26 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 39 | Line 43 | class SchedulerCondor(SchedulerLocal) :
43  
44          SchedulerLocal.configure(self, cfg_params)
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']
64              if tmp.lower() == 'none':
# Line 51 | 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)
55 <        self.copy_data   = cfg_params.get("USER.copy_data", 0)
56 <
57 <        if int(self.copy_data) == 1:
58 <
59 <            self.proxyValid = 0
60 <            self.dontCheckProxy = int(cfg_params.get("EDG.dont_check_proxy", 0))
61 <            self.proxyServer = cfg_params.get("EDG.proxy_server", 'myproxy.cern.ch')
62 <            common.logger.debug(5,'Setting myproxy server to ' + self.proxyServer)
63 <
64 <            self.group = cfg_params.get("EDG.group", None)
65 <            self.role  = cfg_params.get("EDG.role", None)
66 <            self.VO    = cfg_params.get('EDG.virtual_organization', 'cms')
67 <
68 <            self.checkProxy()
69 <
70 <        self.role  = None
74 >        self.checkProxy()
75  
76          return
77  
78      def envUniqueID(self):
79 <        taskHash = sha.new(common._db.queryTask('name')).hexdigest()
79 >        taskHash = sha1(common._db.queryTask('name')).hexdigest()
80          id = "https://" + socket.gethostname() + '/' + taskHash + "/${NJob}"
81          return id
82  
# Line 80 | Line 84 | class SchedulerCondor(SchedulerLocal) :
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
85 <        schedParam = ''
86 <
87 <        for i in range(index):
88 <            pass
89 <
90 <        return schedParam
94 >        return req
95  
96  
97      def realSchedParams(self, cfg_params):
# Line 179 | 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