ViewVC Help
View File | Revision Log | Show Annotations | Root Listing
root/cvsroot/COMP/CRAB/python/Checker.py
Revision: 1.12
Committed: Sat May 10 13:41:40 2008 UTC (16 years, 11 months ago) by spiga
Content type: text/x-python
Branch: MAIN
CVS Tags: CRAB_2_2_2_pre1, CRAB_2_2_1, CRAB_2_2_1_pre6, CRAB_2_2_1_pre5, CRAB_2_2_1_pre4, PRODCOMMON_0_10_7_testCS2, CRAB_2_2_1_pre3, CRAB_2_2_1_pre2, CRAB_2_2_1_pre1, CRAB_2_2_0, CRAB_2_2_0_pre21, CRAB_2_2_0_pre19
Changes since 1.11: +1 -1 lines
Log Message:
now resubmission working... still an optimization is needed on the status print on screen

File Contents

# User Rev Content
1 slacapra 1.1 from Actor import *
2     import common
3    
4     class Checker(Actor):
5     def __init__(self, cfg_params, nj_list):
6     self.cfg_params = cfg_params
7     self.nj_list = nj_list
8     return
9 ewv 1.9
10 slacapra 1.1 def run(self):
11     """
12     The main method of the class.
13     """
14     common.logger.debug(5, "Checker::run() called")
15    
16     if len(self.nj_list)==0:
17     common.logger.debug(5, "No jobs to check")
18     return
19 slacapra 1.10
20 spiga 1.11 task=common._db.getTask(self.nj_list)
21 slacapra 1.10 allMatch={}
22 spiga 1.11 for job in task.jobs:
23 spiga 1.12 id_job = job['jobId']
24 spiga 1.11 dest = job['dlsDestination']
25 slacapra 1.10 if dest in allMatch.keys():
26     common.logger.message("As previous job: "+str(allMatch[dest]))
27 ewv 1.9 else:
28 slacapra 1.10 match = common.scheduler.listMatch(dest)
29 spiga 1.11 # allMatch[job['dlsDestination']]= match
30 slacapra 1.10 if len(match)>0:
31     common.logger.message("Found "+str(len(match))+" compatible site(s) for job "+str(id_job)+" : "+str(match))
32     else:
33     common.logger.message("No compatible site found, will not submit jobs "+str(id_job))
34 slacapra 1.1
35     return