ViewVC Help
View File | Revision Log | Show Annotations | Root Listing
root/cvsroot/COMP/CRAB/python/Checker.py
Revision: 1.11
Committed: Sat Apr 26 09:22:04 2008 UTC (17 years ago) by spiga
Content type: text/x-python
Branch: MAIN
CVS Tags: CRAB_2_2_0_pre18, CRAB_2_2_0_pre17, CRAB_2_2_0_pre16, CRAB_2_2_0_pre15, CRAB_2_2_0_pre13
Changes since 1.10: +5 -6 lines
Log Message:
use task.jobs object and removed a db query

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     id_job = job['id']
24     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