ViewVC Help
View File | Revision Log | Show Annotations | Root Listing
root/cvsroot/COMP/CRAB/python/Checker.py
Revision: 1.19
Committed: Tue Jun 9 13:12:06 2009 UTC (15 years, 10 months ago) by slacapra
Content type: text/x-python
Branch: MAIN
CVS Tags: CRAB_2_7_7_patch1, CRAB_2_7_7_patch1_pre1, CRAB_2_7_7, CRAB_2_7_7_pre2, CRAB_2_7_7_pre1, CRAB_2_7_6_patch1, CRAB_2_7_6, CRAB_2_7_6_pre1, CRAB_2_7_5_patch1, CRAB_2_7_5, CRAB_2_7_5_pre3, CRAB_2_7_5_pre2, CRAB_2_7_5_pre1, CRAB_2_7_4_patch1, CRAB_2_7_4, CRAB_2_7_4_pre6, CRAB_2_7_4_pre5, CRAB_2_7_4_pre4, CRAB_2_7_4_pre3, CRAB_2_7_4_pre2, CRAB_2_7_4_pre1, CRAB_2_7_3, CRAB_2_7_3_pre3, CRAB_2_7_3_pre3_beta, CRAB_2_7_3_pre2, CRAB_2_7_3_pre2_beta, CRAB_2_7_3_pre1, CRAB_2_7_3_beta3, CRAB_2_7_3_beta2, CRAB_2_7_3_beta1, CRAB_2_7_3_beta, CRAB_2_7_2_p1, CRAB_2_7_1_branch_firstMERGE, CRAB_2_7_2, CRAB_2_7_2_pre4, CRAB_2_7_2_pre3, CRAB_2_7_2_pre2, CRAB_2_7_2_pre1, CRAB_2_7_1, fede_170310, CRAB_2_7_1_pre12, CRAB_2_7_1_pre11, CRAB_2_7_1_pre10, CRAB_2_7_1_pre9, CRAB_LumiMask, CRAB_2_7_lumi, from_LimiMask, CRAB_2_7_1_pre8, CRAB_2_7_1_pre6, CRAB_2_7_1_pre5, CRAB_2_7_1_wmbs_pre4, CRAB_2_7_1_pre4, CRAB_2_7_1_pre3, CRAB_2_6_6_pre6, CRAB_2_7_1_pre2, CRAB_2_6_6_pre5, CRAB_2_7_1_pre1, CRAB_2_6_6_pre4, CRAB_2_6_6_pre3, CRAB_2_6_6_pre2, CRAB_2_6_6_check, CRAB_2_6_6, CRAB_2_6_6_pre1, CRAB_2_7_0, CRAB_2_6_5, CRAB_2_7_0_pre8, CRAB_2_6_5_pre1, CRAB_2_7_0_pre7, CRAB_2_6_4, CRAB_2_7_0_pre6, CRAB_2_6_4_pre1, CRAB_2_7_0_pre5, CRAB_2_6_3_patch_2, CRAB_2_6_3_patch_2_pre2, CRAB_2_6_3_patch_2_pre1, CRAB_2_6_3_patch_1, CRAB_2_7_0_pre4, CRAB_2_7_0_pre3, CRAB_2_6_3, CRAB_2_6_3_pre5, CRAB_2_6_3_pre4, CRAB_2_6_3_pre3, CRAB_2_6_3_pre2, CRAB_2_7_0_pre2, CRAB_2_6_3_pre1, test_1, CRAB_2_7_0_pre1, CRAB_2_6_2, CRAB_2_6_2_pre2, CRAB_2_6_2_pre1, CRAB_2_6_1_pre4, CRAB_2_6_1_pre3, CRAB_2_6_1_pre2, CRAB_2_6_1_pre1, CRAB_2_6_1, CRAB_2_6_0, CRAB_2_6_0_pre14, CRAB_2_6_0_pre13, CRAB_2_6_0_pre12, CRAB_2_6_0_pre11, CRAB_2_6_0_pre10, CRAB_2_6_0_pre9, CRAB_2_6_0_pre8
Branch point for: CRAB_multiout, CRAB_2_7_1_branch, Lumi2_8, CRAB_2_6_X_br
Changes since 1.18: +1 -1 lines
Log Message:
Introduce a CrabLogger class which hanlde the std python logging

File Contents

# Content
1 from Actor import *
2 import common
3 import string
4
5 class Checker(Actor):
6 def __init__(self, cfg_params, nj_list):
7 self.cfg_params = cfg_params
8 self.nj_list = nj_list
9 from WMCore.SiteScreening.BlackWhiteListParser import SEBlackWhiteListParser
10 seWhiteList = cfg_params.get('GRID.se_white_list',[])
11 seBlackList = cfg_params.get('GRID.se_black_list',[])
12 self.blackWhiteListParser = SEBlackWhiteListParser(seWhiteList, seBlackList, common.logger())
13 self.datasetpath=self.cfg_params['CMSSW.datasetpath']
14 if string.lower(self.datasetpath)=='none':
15 self.datasetpath = None
16 return
17
18 def run(self):
19 """
20 The main method of the class.
21 """
22 common.logger.debug( "Checker::run() called")
23
24 if len(self.nj_list)==0:
25 common.logger.debug( "No jobs to check")
26 return
27
28 task=common._db.getTask(self.nj_list)
29 allMatch={}
30
31 for job in task.jobs:
32 id_job = job['jobId']
33 jobDest = job['dlsDestination']
34 if not jobDest: jobDest=[]
35 dest = self.blackWhiteListParser.cleanForBlackWhiteList(jobDest, True)
36
37 # only if some dest i s available or if dataset is None
38 if len(dest) > 0 or not self.datasetpath:
39 if ','.join(dest) in allMatch.keys():
40 common.logger.info("As previous job: "+str(allMatch[','.join(dest)]))
41 else:
42 match = common.scheduler.listMatch(dest, True)
43 allMatch[','.join(dest)] = match
44 if len(match)>0:
45 common.logger.info("Found "+str(len(match))+" compatible site(s) for job "+str(id_job)+" : "+str(match))
46 else:
47 common.logger.info("No compatible site found, will not submit jobs "+str(id_job))
48 pass
49 pass
50 else:
51 common.logger.info("No compatible site found, will not submit jobs "+str(id_job))
52 return