ViewVC Help
View File | Revision Log | Show Annotations | Root Listing
root/cvsroot/COMP/CRAB/python/Resubmitter.py
Revision: 1.8
Committed: Thu Jun 12 18:46:16 2008 UTC (16 years, 10 months ago) by spiga
Content type: text/x-python
Branch: MAIN
CVS Tags: CRAB_2_3_1_pre4, CRAB_2_3_1_pre3, CRAB_2_3_1_pre2, CRAB_2_3_1_pre1, CRAB_2_3_0, CRAB_2_3_0_pre6, CRAB_2_3_0_pre1
Branch point for: CRAB_2_3_0_br
Changes since 1.7: +1 -1 lines
Log Message:
 check also TEMPORARY EE status

File Contents

# User Rev Content
1 slacapra 1.1 from Submitter import Submitter
2     import common
3     from crab_util import *
4 spiga 1.4 from crab_exceptions import *
5 slacapra 1.1
6     class Resubmitter(Submitter):
7 spiga 1.3 def __init__(self, cfg_params, jobs):
8     self.cfg_params = cfg_params
9    
10 slacapra 1.1 nj_list = []
11 ewv 1.6
12 spiga 1.3 nj_list = self.checkAlowedJob(jobs,nj_list)
13 ewv 1.6
14    
15 spiga 1.3 common.logger.message('Jobs '+str(nj_list)+' will be resubmitted')
16     Submitter.__init__(self, cfg_params, nj_list, 'range')
17 ewv 1.6
18 spiga 1.3 return
19 slacapra 1.1
20 spiga 1.3 def checkAlowedJob(self,jobs,nj_list):
21     listRunField=[]
22 slacapra 1.1
23 spiga 1.3 task=common._db.getTask(jobs)
24     for job in task.jobs:
25     st = job.runningJob['status']
26 spiga 1.7 nj = job['jobId']
27 spiga 1.8 if st in ['K','A','SE','E','EE']:
28 spiga 1.3 nj_list.append(int(nj))
29     elif st == 'C':
30     common.logger.message('Job #'+`int(nj)`+' has status '+str(job.runningJob['statusScheduler'])+' not yet submitted!!!')
31     elif st in ['SD','D']:
32     common.logger.message('Job #'+`int(nj)`+' has status '+str(job.runningJob['statusScheduler'])+' must be retrieved before resubmission')
33     else:
34     common.logger.message('Job #'+`nj`+' has status '+str(job.runningJob['statusScheduler'])+' must be "killed" before resubmission')
35 spiga 1.4
36     if len(nj_list) == 0 :
37 spiga 1.3 msg='No jobs to resubmit'
38     raise CrabException(msg)
39 spiga 1.7 self.manageNewRunJobs(nj_list)
40     return nj_list
41 spiga 1.5
42     def manageNewRunJobs(self,nj_list):
43     """
44     Get new running instances
45     """
46     common._db.newRunJobs(nj_list)
47     return