29 |
|
self.datasetpath = cfg_params.get("CMSSW.datasetpath") |
30 |
|
self.publish_data_name = cfg_params.get('USER.publish_data_name','') |
31 |
|
|
32 |
– |
self.user_lfn = cfg_params.get("USER.lfn",'') |
33 |
– |
if self.user_lfn: |
34 |
– |
if ( self.user_lfn[-1] != '/' ) : self.user_lfn = self.user_lfn + '/' |
35 |
– |
|
32 |
|
self.user_port = cfg_params.get("USER.storage_port",'8443') |
33 |
|
self.user_se_path = cfg_params.get("USER.storage_path",'') |
34 |
|
if self.user_se_path: |
35 |
|
if ( self.user_se_path[-1] != '/' ) : self.user_se_path = self.user_se_path + '/' |
36 |
|
|
41 |
– |
|
37 |
|
#check if using "private" Storage |
38 |
|
self.usePhedex = True |
39 |
+ |
stage_out_faq='https://twiki.cern.ch/twiki/bin/view/CMS/SWGuideCrabFaq#How_to_store_output_with_CRAB_2' |
40 |
+ |
if not self.node : |
41 |
+ |
msg = 'Please specify the storage_element name in your crab.cfg section [USER].\n' |
42 |
+ |
msg +=' For further information please visit : %s'%stage_out_faq |
43 |
+ |
raise CrabException(msg) |
44 |
|
if (self.node.find('T1_') + self.node.find('T2_')+self.node.find('T3_')) == -3: self.usePhedex = False |
45 |
< |
if not self.usePhedex and ( self.user_lfn == '' or self.user_se_path == '' ): |
45 |
> |
if not self.usePhedex : |
46 |
> |
self.user_lfn = cfg_params.get("USER.lfn",'') |
47 |
> |
if self.user_lfn: |
48 |
> |
if ( self.user_lfn[-1] != '/' ) : self.user_lfn = self.user_lfn + '/' |
49 |
> |
if ( self.user_lfn[1] != '/' ) : self.user_lfn = '/' + self.user_lfn |
50 |
> |
if self.user_remote_dir: |
51 |
> |
if ( self.user_remote_dir[-1] != '/' ) : self.user_remote_dir = self.user_remote_dir + '/' |
52 |
> |
if ( self.user_remote_dir[1] != '/' ) : self.user_remote_dir = '/' + self.user_remote_dir |
53 |
> |
if self.user_remote_dir == self.user_lfn : |
54 |
> |
msg = 'WARINING: In your crab.cfg you are specifying both lfn and user_remote_dir parameters.\n' |
55 |
> |
msg += '\t lfn is now deprecated. Please use only user_remote_dir removing lfn from your crab.cfg' |
56 |
> |
common.logger.message(msg) |
57 |
> |
else: |
58 |
> |
msg = 'ERROR: In your crab.cfg you are specifying both lfn and user_remote_dir parameters giving different values. \n' |
59 |
> |
msg += '\t lfn is now deprecated. Please use only user_remote_dir removing lfn from your crab.cfg' |
60 |
> |
raise CrabException(msg) |
61 |
> |
else: |
62 |
> |
msg = 'WARINING: In your crab.cfg you are using "lfn" which is now a deprecating parameter.\n' |
63 |
> |
msg += '\t Please use user_remote_dir removing lfn from your crab.cfg' |
64 |
> |
common.logger.message(msg) |
65 |
> |
self.user_remote_dir = self.user_lfn |
66 |
> |
|
67 |
> |
if not self.usePhedex and ( self.user_remote_dir == '' or self.user_se_path == '' ): |
68 |
|
msg = 'You are asking to stage out without using CMS Storage Name convention. In this case you \n' |
69 |
< |
msg += ' must specify both lfn and storage_path in the crab.cfg section [USER].\n ' |
70 |
< |
msg += ' For further information please visit: ADD_TWIKI_LINK' |
69 |
> |
msg += '\t must specify both user_remote_dir and storage_path in the crab.cfg section [USER].\n ' |
70 |
> |
msg += '\t For further information please visit : %s'%stage_out_faq |
71 |
|
raise CrabException(msg) |
72 |
|
self.sched = common.scheduler.name().upper() |
73 |
|
self.protocol = self.srm_version |
74 |
|
if self.sched in ['CAF','LSF']:self.protocol = 'direct' |
75 |
|
|
76 |
+ |
self.forced_path = '/store/user/' |
77 |
+ |
if not self.usePhedex: |
78 |
+ |
self.forced_path = self.user_remote_dir |
79 |
|
return |
80 |
|
|
81 |
|
def getEndpoint(self): |
103 |
|
if self.protocol == 'direct': |
104 |
|
query=endpoint |
105 |
|
SE_PATH = endpoint |
81 |
– |
### FEDE added SE ### |
106 |
|
SE = self.sched |
107 |
|
else: |
108 |
|
url = 'http://'+endpoint.split('://')[1] |
114 |
|
USER = (query.split('user')[1]).split('/')[1] |
115 |
|
else: |
116 |
|
SE = self.node |
117 |
< |
SE_PATH = self.user_se_path + self.user_lfn |
117 |
> |
SE_PATH = self.user_se_path + self.user_remote_dir |
118 |
|
try: |
119 |
|
USER = (self.lfn.split('user')[1]).split('/')[1] |
120 |
|
except: |
134 |
|
## check if storage_name is a T2 (siteDB query) |
135 |
|
## if yes :match self.user_lfn with LFNBaseName... |
136 |
|
## if NOT : raise (you are using a T2. It's not allowed stage out into self.user_path+self.user_lfn) |
137 |
< |
lfn = self.user_lfn |
137 |
> |
lfn = self.user_remote_dir |
138 |
|
return lfn |
139 |
|
if self.publish_data_name == '' and int(self.publish_data) == 1: |
140 |
|
msg = "Eeror. The [USER] section does not have 'publish_data_name'" |
144 |
|
if int(self.publish_data) == 1 or int(self.usenamespace) == 1: |
145 |
|
if self.sched in ['CAF']: l_User=True |
146 |
|
primaryDataset = self.computePrimaryDataset() |
147 |
< |
lfn = LFNBase(primaryDataset,self.publish_data_name,LocalUser=l_User) + '/${PSETHASH}/' |
147 |
> |
lfn = LFNBase(self.forced_path, primaryDataset, self.publish_data_name, LocalUser=l_User) + '/${PSETHASH}/' |
148 |
|
else: |
149 |
|
if self.sched in ['CAF','LSF']: l_User=True |
150 |
< |
lfn = LFNBase(self.user_remote_dir,LocalUser=l_User) |
150 |
> |
lfn = LFNBase(self.forced_path,self.user_remote_dir,LocalUser=l_User) |
151 |
|
return lfn |
152 |
|
|
153 |
|
def computePrimaryDataset(self): |
235 |
|
msg+=' OriginalSubmission: stageout path is not retrieved from %s \n'%fullurl |
236 |
|
raise CrabException(msg) |
237 |
|
else: |
238 |
< |
stageoutpfn = 'srm://'+self.node+':'+self.user_port+self.user_se_path+self.lfn |
238 |
> |
if self.sched in ['CAF','LSF'] : |
239 |
> |
stageoutpfn = self.user_se_path+self.lfn |
240 |
> |
else: |
241 |
> |
stageoutpfn = 'srm://'+self.node+':'+self.user_port+self.user_se_path+self.lfn |
242 |
|
|
243 |
|
return stageoutpfn |
244 |
|
|