ViewVC Help
View File | Revision Log | Show Annotations | Root Listing
root/cvsroot/COMP/CRAB/python/Submitter.py
Revision: 1.5
Committed: Wed Jun 29 09:45:53 2005 UTC (19 years, 10 months ago) by slacapra
Content type: text/x-python
Branch: MAIN
Changes since 1.4: +1 -0 lines
Log Message:
bug fixed

File Contents

# User Rev Content
1 nsmirnov 1.1 from Actor import *
2 nsmirnov 1.2 import common
3 nsmirnov 1.1
4     class Submitter(Actor):
5 nsmirnov 1.4 def __init__(self, cfg_params, nj_list):
6 nsmirnov 1.1 self.cfg_params = cfg_params
7 nsmirnov 1.4 self.nj_list = nj_list
8 nsmirnov 1.1 return
9    
10     def run(self):
11 nsmirnov 1.2 """
12     The main method of the class.
13     """
14    
15     common.logger.debug(5, "Submitter::run() called")
16    
17     # Loop over jobs
18    
19 nsmirnov 1.4 for nj in self.nj_list:
20 nsmirnov 1.2 st = common.jobDB.status(nj)
21    
22     common.logger.debug(6, "Submitter::run(): job # "+`nj`)
23 slacapra 1.5 common.logger.message("Submitting job # "+`nj`)
24 nsmirnov 1.2
25     jid = common.scheduler.submit(nj)
26    
27     common.jobDB.setStatus(nj, 'S')
28     common.jobDB.setJobId(nj, jid)
29     pass
30    
31     ####
32    
33     common.jobDB.save()
34    
35 nsmirnov 1.4 msg = '\nTotal of %d jobs submitted'%len(self.nj_list)+'.'
36 nsmirnov 1.2 common.logger.message(msg)
37 nsmirnov 1.1 return
38