Home | Trees | Indices | Help |
---|
|
1 """LCG Athena meta-data utilities. 2 3 N.B. This code is under development and should not generally be used or relied upon. 4 5 """ 6 7 from Ganga.Lib.MonitoringServices.Dashboard import CommonUtil 8 9 #----- client meta-data builders ----- 10 #TODO: add error handling code in following methods 1113 """Build application. Only run on client.""" 14 return CommonUtil.strip_to_none(job.application.atlas_exetype)1517 """Build application_version. Only run on client.""" 18 if job.application.atlas_production: 19 application_version = job.application.atlas_production 20 else: 21 application_version = job.application.atlas_release 22 return CommonUtil.strip_to_none(application_version)2325 """Build input_dataset. Only run on client.""" 26 if not job.inputdata: return None 27 datasetcsv = ','.join(job.inputdata.dataset) 28 return CommonUtil.strip_to_none(datasetcsv)29 3335 """Build nevents_requested. Only run on client.""" 36 max_events = None 37 if job.application.max_events > -1: 38 max_events = job.application.max_events 39 return max_events4042 """Build output_dataset. Only run on client.""" 43 if not job.outputdata: return None 44 return CommonUtil.strip_to_none(job.outputdata.datasetname)4547 """Build output_se. Only run on client.""" 48 if not job.outputdata: return None 49 # job.outputdata.location can be a string or a list 50 if isinstance(job.outputdata.location, list): 51 locations = [] 52 for l in job.outputdata.location: 53 if l and l not in locations: 54 locations.append(l) 55 locationcsv = ','.join(locations) 56 else: 57 locationcsv = job.outputdata.location 58 return CommonUtil.strip_to_none(locationcsv)5961 """Build target. Only run on client.""" 62 if hasattr(job.backend, 'CE'): 63 targets = [] 64 if job.backend.CE: 65 targets.append('CE_%s' % job.backend.CE) 66 for site in job.backend.requirements.sites: 67 if site: 68 targets.append('SITE_%s' % site) 69 targetcsv = ','.join(targets) 70 return CommonUtil.strip_to_none(targetcsv) 71 else: 72 return CommonUtil.hostname()73 77 78 79 #----- worker node meta-data builders ----- 80 #TODO: add error handling code in following methods 8183 """Load Athena stats. Only run on worker node. 84 85 If the Athena stats.pickle file cannot be read then an empty dictionary is 86 returned. 87 """ 88 import cPickle as pickle 89 try: 90 f = open('stats.pickle','r') 91 try: 92 stats = pickle.load(f) 93 finally: 94 f.close() 95 except: 96 stats = {} 97 return stats98
Home | Trees | Indices | Help |
---|
Generated by Epydoc 3.0.1 on Mon Jun 25 10:35:33 2012 | http://epydoc.sourceforge.net |