ViewVC Help
View File | Revision Log | Show Annotations | Root Listing
root/cvsroot/COMP/CRAB/python/Checker.py
Revision: 1.16
Committed: Thu Jan 8 17:42:16 2009 UTC (16 years, 3 months ago) by slacapra
Content type: text/x-python
Branch: MAIN
CVS Tags: CRAB_2_6_0_pre2, CRAB_2_6_0_pre1, CRAB_2_5_1, CRAB_2_5_1_pre4, CRAB_2_5_1_pre3, CRAB_2_5_1_pre2, CRAB_2_5_1_pre1, CRAB_2_5_0, CRAB_2_5_0_pre7, CRAB_2_5_0_pre6, CRAB_2_5_0_pre5, CRAB_2_5_0_pre4, CRAB_2_5_0_pre3, CRAB_2_5_0_pre2, CRAB_2_5_0_pre1, CRAB_2_4_4, CRAB_2_4_4_pre6, CRAB_2_4_4_pre5, CRAB_2_4_4_pre4, CRAB_2_4_4_pre3, CRAB_2_4_4_pre2, CRAB_2_4_4_pre1
Changes since 1.15: +18 -12 lines
Log Message:
deal the case of datasetpath == none

File Contents

# User Rev Content
1 slacapra 1.1 from Actor import *
2     import common
3 slacapra 1.16 import string
4 slacapra 1.1
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 slacapra 1.14 from WMCore.SiteScreening.BlackWhiteListParser import SEBlackWhiteListParser
10     seWhiteList = cfg_params.get('EDG.se_white_list',[])
11     seBlackList = cfg_params.get('EDG.se_black_list',[])
12     self.blackWhiteListParser = SEBlackWhiteListParser(seWhiteList, seBlackList, common.logger)
13 slacapra 1.16 self.datasetpath=self.cfg_params['CMSSW.datasetpath']
14     if string.lower(self.datasetpath)=='none':
15     self.datasetpath = None
16 slacapra 1.1 return
17 ewv 1.9
18 slacapra 1.1 def run(self):
19     """
20     The main method of the class.
21     """
22     common.logger.debug(5, "Checker::run() called")
23    
24     if len(self.nj_list)==0:
25     common.logger.debug(5, "No jobs to check")
26     return
27 slacapra 1.10
28 spiga 1.11 task=common._db.getTask(self.nj_list)
29 slacapra 1.10 allMatch={}
30 slacapra 1.15
31 spiga 1.11 for job in task.jobs:
32 spiga 1.12 id_job = job['jobId']
33 slacapra 1.15 jobDest = job['dlsDestination']
34     if not jobDest: jobDest=[]
35     dest = self.blackWhiteListParser.cleanForBlackWhiteList(jobDest, True)
36 slacapra 1.14
37 slacapra 1.16 # 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.message("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.message("Found "+str(len(match))+" compatible site(s) for job "+str(id_job)+" : "+str(match))
46     else:
47     common.logger.message("No compatible site found, will not submit jobs "+str(id_job))
48     pass
49     pass
50 ewv 1.9 else:
51 slacapra 1.16 common.logger.message("No compatible site found, will not submit jobs "+str(id_job))
52 slacapra 1.1 return