10 |
|
|
11 |
|
import common |
12 |
|
import os |
13 |
< |
|
13 |
> |
import socket |
14 |
> |
from crab_util import hashlib_wrap |
15 |
|
|
16 |
|
class SchedulerCondor(SchedulerLocal) : |
17 |
|
""" |
25 |
|
SchedulerLocal.__init__(self,"CONDOR") |
26 |
|
self.datasetPath = None |
27 |
|
self.selectNoInput = None |
28 |
+ |
self.return_data = 0 |
29 |
+ |
self.copy_data = 0 |
30 |
+ |
|
31 |
|
self.environment_unique_identifier = None |
32 |
|
return |
33 |
|
|
38 |
|
""" |
39 |
|
|
40 |
|
SchedulerLocal.configure(self, cfg_params) |
37 |
– |
self.environment_unique_identifier = '${HOSTNAME}_${CONDOR_ID}_' \ |
38 |
– |
+ common._db.queryTask('name') |
41 |
|
|
42 |
|
try: |
43 |
|
tmp = cfg_params['CMSSW.datasetpath'] |
51 |
|
msg = "Error: datasetpath not defined " |
52 |
|
raise CrabException(msg) |
53 |
|
|
54 |
+ |
self.return_data = cfg_params.get('USER.return_data', 0) |
55 |
+ |
self.copy_data = cfg_params.get("USER.copy_data", 0) |
56 |
+ |
|
57 |
+ |
self.proxyValid = 0 |
58 |
+ |
self.dontCheckProxy = int(cfg_params.get("GRID.dont_check_proxy", 0)) |
59 |
+ |
self.proxyServer = cfg_params.get("GRID.proxy_server", 'myproxy.cern.ch') |
60 |
+ |
common.logger.debug('Setting myproxy server to ' + self.proxyServer) |
61 |
+ |
|
62 |
+ |
self.group = cfg_params.get("GRID.group", None) |
63 |
+ |
self.role = cfg_params.get("GRID.role", None) |
64 |
+ |
self.VO = cfg_params.get('GRID.virtual_organization', 'cms') |
65 |
+ |
|
66 |
+ |
self.checkProxy() |
67 |
+ |
|
68 |
|
return |
69 |
|
|
70 |
+ |
def envUniqueID(self): |
71 |
+ |
taskHash = hashlib_wrap(common._db.queryTask('name')) |
72 |
+ |
id = "https://" + socket.gethostname() + '/' + taskHash + "/${NJob}" |
73 |
+ |
return id |
74 |
|
|
75 |
|
def sched_parameter(self, i, task): |
76 |
|
""" |
77 |
|
Return scheduler-specific parameters |
78 |
|
""" |
79 |
+ |
req = '' |
80 |
+ |
if self.EDG_addJdlParam: |
81 |
+ |
if self.EDG_addJdlParam[-1] == '': |
82 |
+ |
self.EDG_addJdlParam = self.EDG_addJdlParam[:-1] |
83 |
+ |
for p in self.EDG_addJdlParam: |
84 |
+ |
req += p.strip()+';\n' |
85 |
|
|
86 |
< |
index = int(common._db.nJobs()) - 1 |
61 |
< |
schedParam = '' |
62 |
< |
|
63 |
< |
for i in range(index): |
64 |
< |
pass |
65 |
< |
|
66 |
< |
return schedParam |
86 |
> |
return req |
87 |
|
|
88 |
|
|
89 |
|
def realSchedParams(self, cfg_params): |
104 |
|
Check the compatibility of available resources |
105 |
|
""" |
106 |
|
|
107 |
< |
if self.selectNoInput: |
88 |
< |
return [True] |
89 |
< |
else: |
90 |
< |
return SchedulerLocal.listMatch(self, seList, full) |
107 |
> |
return [True] |
108 |
|
|
109 |
|
|
110 |
|
def decodeLogInfo(self, fileName): |
175 |
|
""" |
176 |
|
|
177 |
|
return txt |
178 |
+ |
|
179 |
+ |
|
180 |
+ |
def sched_fix_parameter(self): |
181 |
+ |
""" |
182 |
+ |
Returns string with requirements and scheduler-specific parameters |
183 |
+ |
""" |
184 |
+ |
|
185 |
+ |
if self.EDG_requirements: |
186 |
+ |
req = self.EDG_requirements |
187 |
+ |
taskReq = {'commonRequirements':req} |
188 |
+ |
common._db.updateTask_(taskReq) |