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.backup = '' |
29 |
+ |
self.return_data = 0 |
30 |
+ |
self.copy_data = 0 |
31 |
+ |
self.backup_copy = 0 |
32 |
+ |
|
33 |
|
self.environment_unique_identifier = None |
34 |
|
return |
35 |
|
|
40 |
|
""" |
41 |
|
|
42 |
|
SchedulerLocal.configure(self, cfg_params) |
43 |
< |
self.environment_unique_identifier = '${HOSTNAME}_${CONDOR_ID}_' \ |
44 |
< |
+ common._db.queryTask('name') |
43 |
> |
taskHash = sha.new(common._db.queryTask('name')).hexdigest() |
44 |
> |
self.environment_unique_identifier = "https://" + \ |
45 |
> |
socket.gethostname() + '/' + taskHash + "/${NJob}" |
46 |
|
|
47 |
|
try: |
48 |
|
tmp = cfg_params['CMSSW.datasetpath'] |
58 |
|
|
59 |
|
self.return_data = cfg_params.get('USER.return_data', 0) |
60 |
|
self.copy_data = cfg_params.get("USER.copy_data", 0) |
61 |
+ |
self.backup_copy = cfg_params.get('USER.backup_copy', 0) |
62 |
|
|
63 |
< |
if ( int(self.return_data) == 0 and int(self.copy_data) == 0 ): |
64 |
< |
msg = 'Error: return_data and copy_data cannot be set both to 0\n' |
65 |
< |
msg = msg + 'Please modify your crab.cfg file\n' |
63 |
> |
if int(self.return_data) == 0 and int(self.copy_data) == 0: |
64 |
> |
msg = 'Error: return_data and copy_data cannot both be set to 0\n' |
65 |
> |
msg += 'Please modify your crab.cfg file\n' |
66 |
|
raise CrabException(msg) |
67 |
|
|
68 |
< |
if ( int(self.return_data) == 1 and int(self.copy_data) == 1 ): |
69 |
< |
msg = 'Error: return_data and copy_data cannot be set both to 1\n' |
70 |
< |
msg = msg + 'Please modify your crab.cfg file\n' |
68 |
> |
if int(self.return_data) == 1 and int(self.copy_data) == 1: |
69 |
> |
msg = 'Error: return_data and copy_data cannot both be set to 1\n' |
70 |
> |
msg += 'Please modify your crab.cfg file\n' |
71 |
|
raise CrabException(msg) |
72 |
|
|
73 |
< |
if ( int(self.copy_data) == 0 and int(self.publish_data) == 1 ): |
74 |
< |
msg = 'Warning: publish_data = 1 must be used with copy_data = 1\n' |
75 |
< |
msg = msg + 'Please modify copy_data value in your crab.cfg file\n' |
73 |
> |
if int(self.copy_data) == 0 and int(self.publish_data) == 1: |
74 |
> |
msg = 'Warning: publish_data=1 must be used with copy_data=1\n' |
75 |
> |
msg += 'Please modify the copy_data value in your crab.cfg file\n' |
76 |
> |
common.logger.message(msg) |
77 |
> |
raise CrabException(msg) |
78 |
> |
|
79 |
> |
if int(self.copy_data) == 0 and int(self.backup_copy) == 1: |
80 |
> |
msg = 'Error: copy_data = 0 and backup_data = 1 ==> to use the ' |
81 |
> |
msg += 'backup_copy function, the copy_data value has to be = 1\n' |
82 |
> |
msg += 'Please modify copy_data value in your crab.cfg file\n' |
83 |
> |
raise CrabException(msg) |
84 |
> |
|
85 |
> |
if int(self.backup_copy) == 1 and int(self.publish_data) == 1: |
86 |
> |
msg = 'Warning: currently the publication is not supported ' |
87 |
> |
msg += 'with the backup copy. Work in progress....\n' |
88 |
|
common.logger.message(msg) |
89 |
|
raise CrabException(msg) |
90 |
|
|
96 |
|
raise CrabException(msg) |
97 |
|
|
98 |
|
self.proxyValid = 0 |
99 |
< |
self.dontCheckProxy = int(cfg_params.get("EDG.dont_check_proxy",0)) |
100 |
< |
self.proxyServer = cfg_params.get("EDG.proxy_server",'myproxy.cern.ch') |
99 |
> |
self.dontCheckProxy = int(cfg_params.get("EDG.dont_check_proxy", 0)) |
100 |
> |
self.proxyServer = cfg_params.get("EDG.proxy_server", 'myproxy.cern.ch') |
101 |
|
common.logger.debug(5,'Setting myproxy server to ' + self.proxyServer) |
102 |
|
|
103 |
|
self.group = cfg_params.get("EDG.group", None) |
105 |
|
self.VO = cfg_params.get('EDG.virtual_organization', 'cms') |
106 |
|
|
107 |
|
self.checkProxy() |
108 |
+ |
|
109 |
+ |
if int(self.backup_copy) == 1: |
110 |
+ |
self.backup = '--backup' |
111 |
+ |
|
112 |
|
self.role = None |
113 |
|
|
114 |
|
return |