10 |
|
|
11 |
|
import common |
12 |
|
import os |
13 |
< |
|
13 |
> |
import socket |
14 |
> |
import sha |
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'] |
54 |
|
self.return_data = cfg_params.get('USER.return_data', 0) |
55 |
|
self.copy_data = cfg_params.get("USER.copy_data", 0) |
56 |
|
|
55 |
– |
if ( int(self.return_data) == 0 and int(self.copy_data) == 0 ): |
56 |
– |
msg = 'Error: return_data and copy_data cannot be set both to 0\n' |
57 |
– |
msg = msg + 'Please modify your crab.cfg file\n' |
58 |
– |
raise CrabException(msg) |
59 |
– |
|
60 |
– |
if ( int(self.return_data) == 1 and int(self.copy_data) == 1 ): |
61 |
– |
msg = 'Error: return_data and copy_data cannot be set both to 1\n' |
62 |
– |
msg = msg + 'Please modify your crab.cfg file\n' |
63 |
– |
raise CrabException(msg) |
64 |
– |
|
65 |
– |
if ( int(self.copy_data) == 0 and int(self.publish_data) == 1 ): |
66 |
– |
msg = 'Warning: publish_data = 1 must be used with copy_data = 1\n' |
67 |
– |
msg = msg + 'Please modify copy_data value in your crab.cfg file\n' |
68 |
– |
common.logger.message(msg) |
69 |
– |
raise CrabException(msg) |
70 |
– |
|
57 |
|
if int(self.copy_data) == 1: |
72 |
– |
self.SE = cfg_params.get('USER.storage_element', None) |
73 |
– |
if not self.SE: |
74 |
– |
msg = "Error. The [USER] section has no 'storage_element'" |
75 |
– |
common.logger.message(msg) |
76 |
– |
raise CrabException(msg) |
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') |
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) |
67 |
|
|
68 |
|
self.checkProxy() |
69 |
|
|
70 |
+ |
self.role = None |
71 |
+ |
|
72 |
|
return |
73 |
|
|
74 |
+ |
def envUniqueID(self): |
75 |
+ |
taskHash = sha.new(common._db.queryTask('name')).hexdigest() |
76 |
+ |
id = "https://" + socket.gethostname() + '/' + taskHash + "/${NJob}" |
77 |
+ |
return id |
78 |
|
|
79 |
|
def sched_parameter(self, i, task): |
80 |
|
""" |
108 |
|
Check the compatibility of available resources |
109 |
|
""" |
110 |
|
|
111 |
< |
if self.selectNoInput: |
125 |
< |
return [True] |
126 |
< |
else: |
127 |
< |
return SchedulerLocal.listMatch(self, seList, full) |
111 |
> |
return [True] |
112 |
|
|
113 |
|
|
114 |
|
def decodeLogInfo(self, fileName): |