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) |
38 |
– |
taskHash = sha.new(common._db.queryTask('name')).hexdigest() |
39 |
– |
self.environment_unique_identifier = "https://" + socket.gethostname() + \ |
40 |
– |
'/' + taskHash + "/${NJob}" |
41 |
|
|
42 |
|
try: |
43 |
|
tmp = cfg_params['CMSSW.datasetpath'] |
53 |
|
|
54 |
|
self.return_data = cfg_params.get('USER.return_data', 0) |
55 |
|
self.copy_data = cfg_params.get("USER.copy_data", 0) |
56 |
– |
self.backup_copy = cfg_params.get('USER.backup_copy',0) |
57 |
– |
|
58 |
– |
if ( int(self.return_data) == 0 and int(self.copy_data) == 0 ): |
59 |
– |
msg = 'Error: return_data and copy_data cannot be set both to 0\n' |
60 |
– |
msg = msg + 'Please modify your crab.cfg file\n' |
61 |
– |
raise CrabException(msg) |
62 |
– |
|
63 |
– |
if ( int(self.return_data) == 1 and int(self.copy_data) == 1 ): |
64 |
– |
msg = 'Error: return_data and copy_data cannot be set both to 1\n' |
65 |
– |
msg = msg + 'Please modify your crab.cfg file\n' |
66 |
– |
raise CrabException(msg) |
67 |
– |
|
68 |
– |
if ( int(self.copy_data) == 0 and int(self.publish_data) == 1 ): |
69 |
– |
msg = 'Warning: publish_data = 1 must be used with copy_data = 1\n' |
70 |
– |
msg = msg + 'Please modify copy_data value in your crab.cfg file\n' |
71 |
– |
common.logger.message(msg) |
72 |
– |
raise CrabException(msg) |
73 |
– |
|
74 |
– |
if ( int(self.copy_data) == 0 and int(self.backup_copy) == 1 ): |
75 |
– |
msg = 'Error: copy_data = 0 and backup_data = 1 ==> to use the backup_copy function, the copy_data value has to be = 1\n' |
76 |
– |
msg = msg + 'Please modify copy_data value in your crab.cfg file\n' |
77 |
– |
raise CrabException(msg) |
56 |
|
|
57 |
< |
if int(self.copy_data) == 1: |
58 |
< |
self.SE = cfg_params.get('USER.storage_element', None) |
59 |
< |
if not self.SE: |
60 |
< |
msg = "Error. The [USER] section has no 'storage_element'" |
61 |
< |
common.logger.message(msg) |
62 |
< |
raise CrabException(msg) |
63 |
< |
|
64 |
< |
if ( int(self.backup_copy) == 1 and int(self.publish_data) == 1 ): |
87 |
< |
msg = 'Warning: currently the publication is not supported with the backup copy. Work in progress....\n' |
88 |
< |
common.logger.message(msg) |
89 |
< |
raise CrabException(msg) |
90 |
< |
|
91 |
< |
self.proxyValid = 0 |
92 |
< |
self.dontCheckProxy = int(cfg_params.get("EDG.dont_check_proxy",0)) |
93 |
< |
self.proxyServer = cfg_params.get("EDG.proxy_server",'myproxy.cern.ch') |
94 |
< |
common.logger.debug(5,'Setting myproxy server to ' + self.proxyServer) |
95 |
< |
|
96 |
< |
self.group = cfg_params.get("EDG.group", None) |
97 |
< |
self.role = cfg_params.get("EDG.role", None) |
98 |
< |
self.VO = cfg_params.get('EDG.virtual_organization', 'cms') |
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() |
101 |
< |
self.role = None |
66 |
> |
self.checkProxy() |
67 |
|
|
68 |
|
return |
69 |
|
|
70 |
+ |
def envUniqueID(self): |
71 |
+ |
taskHash = sha.new(common._db.queryTask('name')).hexdigest() |
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 |
112 |
< |
schedParam = '' |
113 |
< |
|
114 |
< |
for i in range(index): |
115 |
< |
pass |
116 |
< |
|
117 |
< |
return schedParam |
86 |
> |
return req |
87 |
|
|
88 |
|
|
89 |
|
def realSchedParams(self, cfg_params): |
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) |