197 |
|
|
198 |
|
# Process the crab tasks determined to be relevant in the last query |
199 |
|
print '\n==============================================================================' |
200 |
< |
print ' Process crab task list (please wait, crab commands are first fully parsed)\n' |
200 |
> |
print ' Process crab task list\n' |
201 |
|
i = 0 |
202 |
|
for crabTask in crabTasks: |
203 |
|
|
204 |
+ |
print '\n------------------------------------------------------------------------------' |
205 |
+ |
print ' --> PREPPING ' + crabTask.tag \ |
206 |
+ |
+ '\n -> ' + crabTask.mitDataset |
207 |
+ |
print '------------------------------------------------------------------------------\n' |
208 |
+ |
|
209 |
|
dataset = crabTask.cmsDataset |
210 |
|
storageEle = crabTask.storageEle |
211 |
|
storagePath = crabTask.storagePath |
249 |
|
+ '\n -> ' + storageEle \ |
250 |
|
+ '\n -> ' + storagePath |
251 |
|
print '------------------------------------------------------------------------------\n' |
252 |
< |
print ' --> ' + cmd |
252 |
> |
#print ' --> ' + cmd |
253 |
|
|
254 |
|
if catalog != 0: |
255 |
|
os.system(cmd) |
262 |
|
if extend == 1: |
263 |
|
cmd = 'crab -extend -c ' + crabTask.tag |
264 |
|
print '\n------------------------------------------------------------------------------' |
265 |
< |
print ' --> EXTEND ' + crabTask.tag + ' -- wait crab commands first fully parsed -- ' \ |
265 |
> |
print ' --> EXTEND ' + crabTask.tag + ' -- ' \ |
266 |
|
+ '\n -> ' + dataset + ' (' + crabTask.mitDataset + ')'\ |
267 |
|
+ '\n -> ' + storageEle \ |
268 |
|
+ '\n -> ' + storagePath |
271 |
|
os.system(cmd) |
272 |
|
|
273 |
|
print '\n------------------------------------------------------------------------------' |
274 |
< |
print ' --> STATUS ' + crabTask.tag + ' -- wait crab commands first fully parsed -- ' \ |
274 |
> |
print ' --> STATUS ' + crabTask.tag + ' -- ' \ |
275 |
|
+ '\n -> ' + dataset + ' (' + crabTask.mitDataset + ')'\ |
276 |
|
+ '\n -> ' + storageEle \ |
277 |
|
+ '\n -> ' + storagePath |
288 |
|
print ' Task status: ' + crabTask.status |
289 |
|
if crabTask.status == 'completed' or crabTask.status == 'finished': |
290 |
|
crabTask.remove(clean) |
291 |
< |
print ' INFO - crab task has been removed, continuing.' |
291 |
> |
print ' INFO - crab task has been removed, continuing.\n' |
292 |
|
continue |
293 |
|
print ' ' |
294 |
|
|
320 |
|
subList += '%d'%(status.index) |
321 |
|
else: |
322 |
|
subList += ',%d'%(status.index) |
323 |
< |
if ((status.tag == 'Aborted' or status.exitCode > 0 or status.exitStatus > 0) or |
324 |
< |
(status.tag == 'Retrieved' and status.outputFile == 0)): |
323 |
> |
if ((status.tag == 'Aborted' or status.exitCode > 0 or status.exitStatus > 0)): |
324 |
> |
##or(status.tag == 'Retrieved' and status.outputFile == 0)): |
325 |
|
status.showCompact() |
326 |
|
if resubList == '': |
327 |
|
resubList += '%d'%(status.index) |
335 |
|
if not re.search('-',subList) and not re.search(',',subList): |
336 |
|
subList = subList + ',999999999' |
337 |
|
cmd = 'crab -c ' + crabTask.tag + ' -submit ' + subList |
338 |
< |
print '\nACTION -- SUBMIT.PY: ' + cmd |
339 |
< |
if exe == 1: |
340 |
< |
status = os.system(cmd) |
338 |
> |
##print '\nACTION -- SUBMIT.PY: ' + cmd |
339 |
> |
##if exe == 1: |
340 |
> |
## status = os.system(cmd) |
341 |
|
if resubList != '': |
342 |
|
cmd = 'crab -c ' + crabTask.tag + ' -resubmit ' + resubList |
343 |
< |
print '\nACTION -- RE-SUBMIT.PY: ' + cmd |
344 |
< |
if exe == 1: |
345 |
< |
status = os.system(cmd) |
343 |
> |
##print '\nACTION -- RE-SUBMIT.PY: ' + cmd |
344 |
> |
##if exe == 1: |
345 |
> |
## status = os.system(cmd) |
346 |
|
|
347 |
|
|
348 |
|
cmd = 'crab -getoutput -continue ' + crabTask.tag |
349 |
|
print '\n------------------------------------------------------------------------------' |
350 |
< |
print ' --> GETOUTPUT ' + crabTask.tag + ' -- wait crab commands first fully parsed -- ' \ |
350 |
> |
print ' --> GETOUTPUT ' + crabTask.tag + ' -- ' \ |
351 |
|
+ '\n -> ' + dataset \ |
352 |
|
+ '\n -> ' + storageEle \ |
353 |
|
+ '\n -> ' + storagePath |