ViewVC Help
View File | Revision Log | Show Annotations | Root Listing
root/cvsroot/COMP/CRAB/python/Resubmitter.py
Revision: 1.2
Committed: Fri Mar 28 17:18:20 2008 UTC (17 years, 1 month ago) by spiga
Content type: text/x-python
Branch: MAIN
CVS Tags: CRAB_2_2_0_pre12, CRAB_2_2_0_pre11, CRAB_2_2_0_pre10, bp_osg_bdii, CRAB_2_2_0_pre9, CRAB_2_2_0_pre8, CRAB_2_2_0_pre7, CRAB_2_2_0_pre5, CRAB_2_2_0_pre4, CRAB_2_2_0_pre2
Branch point for: osg_bdii
Changes since 1.1: +1 -1 lines
Log Message:
removed getOutput stuff and various fix...

File Contents

# User Rev Content
1 slacapra 1.1 from Submitter import Submitter
2     import common
3     from crab_util import *
4    
5     class Resubmitter(Submitter):
6     def __init__(self, cfg_params, jobs, UseServer=0):
7     nj_list = []
8     for nj in jobs:
9     st = common.jobDB.status(int(nj)-1)
10     if st in ['K','A']:
11     nj_list.append(int(nj)-1)
12     common.jobDB.setStatus(int(nj)-1,'C')
13     elif st == 'Y':
14 spiga 1.2 # common.scheduler.moveOutput(nj)
15 slacapra 1.1 nj_list.append(int(nj)-1)
16     st = common.jobDB.setStatus(int(nj)-1,'RC')
17     elif st in ['C','X']:
18     common.logger.message('Job #'+`int(nj)`+' has status '+crabJobStatusToString(st)+' not yet submitted!!!')
19     pass
20     elif st == 'D':
21     common.logger.message('Job #'+`int(nj)`+' has status '+crabJobStatusToString(st)+' must be retrieved before resubmission')
22     else:
23     common.logger.message('Job #'+`nj`+' has status '+crabJobStatusToString(st)+' must be "killed" before resubmission')
24     pass
25    
26    
27     if len(nj_list) != 0:
28     nj_list.sort()
29    
30     # remove job ids from the submission history file (for the server) # Fabio
31     if (UseServer == 1):
32     file = open(common.work_space.shareDir()+'/submit_directive','r')
33     prev_subms = str(file.readlines()[0]).split('\n')[0]
34     file.close()
35    
36     new_subms = []
37     if prev_subms != 'all':
38     # remove the jobs in nj_list from the history
39     new_subms = [ j for j in eval(prev_subms) not in nj_list ]
40    
41     file = open(common.work_space.shareDir()+'/submit_directive','w')
42     file.write(str(new_subms))
43     file.close()
44     pass
45     pass
46     Submitter.__init__(self, cfg_params, nj_list, 'range')
47     pass