CMS 3D CMS Logo

Classes | Functions | Variables

cmsRelvalreport Namespace Reference

Classes

class  Candles_file
class  Profile

Functions

def clean_name
def execute
def green
def logger
def principal
def red
def yellow

Variables

string action = 'store_true'
list cmssw_base = os.environ["CMSSW_BASE"]
list cmssw_release_base = os.environ["CMSSW_RELEASE_BASE"]
 DEBUG = True
string default = ''
string dest = 'profiler'
 EXEC = True
string EXECUTABLE = 'cmsRun'
tuple exit = principal(options)
string help = 'Profilers are: %s'
string IGPROFANALYS = 'cmsIgProf_Analysis.py'
dictionary IgProfCounters
dictionary IgProfProfiles
string MAKESKIMDRIVER = '%s/makeSkimDriver.py'
string MAKESKIMDRIVERDIR = '%s/src/Configuration/EventContent/test'
tuple parser = optparse.OptionParser(usage)
string PERFREPORT2_PATH = '/share/perfreport'
string PERFREPORT3_PATH = '/share/perfreport'
string PERL5_LIB = '/afs/cern.ch/user/d/dpiparo/w0/PERLlibs/5.8.0'
string PR2 = '%s'
string PR2_BASE = '/afs/cern.ch/user/g/gbenelli/public/PerfReport2/2.0.1/'
string PR3 = '/bin/perfreport'
string PR3_BASE = '/afs/cern.ch/user/d/dpiparo/w0/perfreport3installation/'
string PR3_PRODUCER_PLUGIN = '/afs/cern.ch/user/d/dpiparo/w0/pr3/perfreport/plugins/cmssw_by_producer/libcmssw_by_producer.so'
list PROFILERS
string pyrelvallocal = "/src/Configuration/PyReleaseValidation"
string RELEASE = 'CMSSW_BASE'
string SIMPLEMEMPARSER = 'cmsSimplememchecker_parser.py'
list STDOUTPROFILERS
string TIMEREPORTPARSER = 'cmsTimeReport.pl'
string TIMINGPARSER = 'cmsTiming_parser.py'
string usage = '\n'
string valperf = "/src/Validation/Performance"
string VFCE_LIB = '/afs/cern.ch/user/m/moserro/public/vgfcelib'
string VMPARSER = 'valgrindMemcheckParser.pl'
string VMPARSERSTYLE = '%s/src/Utilities/ReleaseScripts/data/valgrindMemcheckParser.css'

Function Documentation

def cmsRelvalreport::clean_name (   name)
Trivially removes an underscore if present as last char of a string

Definition at line 114 of file cmsRelvalreport.py.

00115                     :
00116     '''
00117     Trivially removes an underscore if present as last char of a string
00118     '''
00119     i=-1
00120     is_dirty=True
00121     while(is_dirty):
00122         if name[i]=='_':
00123             name=name[:-1]
00124         else:
00125             return name
00126         i-=1

def cmsRelvalreport::execute (   command)
It executes command if the EXEC switch is True. 
Catches exitcodes different from 0.

Definition at line 129 of file cmsRelvalreport.py.

00130                     :
00131         '''
00132         It executes command if the EXEC switch is True. 
00133         Catches exitcodes different from 0.
00134         '''
00135         logger('%s %s ' %(green('[execute]'),command))
00136         if EXEC:
00137             exit_code=os.system(command)
00138             if exit_code!=0:
00139                 logger(red('*** Seems like "%s" encountered problems.' %command))
00140             return exit_code
00141         else:
00142             return 0
            
def cmsRelvalreport::green (   string)
def cmsRelvalreport::logger (   message,
  level = 0 
)
level=0 output, level 1 debug.

Definition at line 145 of file cmsRelvalreport.py.

00146                            :
00147     '''
00148     level=0 output, level 1 debug.
00149     '''                  
00150     message='%s %s' %(yellow('[RelValreport]'),message)
00151     
00152     sys.stdout.flush()
00153     
00154     if level==0:
00155         print message
00156     if level==1 and DEBUG:
00157         print message    
00158     
00159     sys.stdout.flush()

def cmsRelvalreport::principal (   options)
Here the objects of the Profile class are istantiated.

Definition at line 703 of file cmsRelvalreport.py.

Referenced by edm::RootOutputFile::fillBranches(), and ora::ContainerSchema::setAccessPermission().

00704                       :
00705     '''
00706     Here the objects of the Profile class are istantiated.
00707     '''
00708     #Add a global exit code variable, that is the sum of all exit codes, to return it at the end:
00709     exitCodeSum=0
00710     # Build a list of commands for programs to benchmark.
00711     # It will be only one if -c option is selected
00712     commands_profilers_meta_list=[]
00713     
00714     # We have only one
00715     if options.infile=='':
00716         logger('Single command found...')
00717         commands_profilers_meta_list.append([options.command,'','',False,''])
00718     
00719     # We have more: we parse the list of candles    
00720     else:
00721         logger('List of commands found. Processing %s ...' %options.infile)
00722         
00723         # an object that represents the candles file:
00724         candles_file = Candles_file(options.infile)
00725         
00726         commands_profilers_meta_list=candles_file.get_commands_profilers_meta_list()
00727        
00728         
00729     logger('Iterating through commands of executables to profile ...')
00730     
00731     # Cycle through the commands
00732     len_commands_profilers_meta_list=len(commands_profilers_meta_list)    
00733     
00734     commands_counter=1
00735     precedent_profile_name=''
00736     precedent_reuseprofile=False
00737     for command,profiler_opt,meta,reuseprofile,db_metastring in commands_profilers_meta_list:
00738                   
00739         exit_code=0
00740         
00741         logger('Processing command %d/%d' \
00742                     %(commands_counter,len_commands_profilers_meta_list))
00743         logger('Process started on %s' %time.asctime())
00744         
00745         # for multiple directories and outputs let's put the meta
00746         # just before the output profile and the outputdir
00747         profile_name=''
00748         profiler=''
00749         reportdir=options.output
00750         IgProf_counter=options.IgProf_counter
00751            
00752         
00753         if options.infile!='': # we have a list of commands
00754 
00755             reportdir='%s_%s' %(meta,options.output) #Usually options.output is not used
00756             reportdir=clean_name(reportdir)          #Remove _
00757          
00758             profile_name=clean_name('%s_%s'%(meta,options.profile_name)) #Also options.profile_name is usually not used... should clean up...
00759                     
00760             # profiler is igprof: we need to disentangle the profiler and the counter
00761             
00762             if profiler_opt.find('.')!=-1 and profiler_opt.find('IgProf')!=-1:
00763                 profiler_opt_split=profiler_opt.split('.')
00764                 profiler=profiler_opt_split[0]
00765                 IgProf_counter=profiler_opt_split[1:] #This way can handle IgProfMem.ANALYSE.MEM_TOT etc.
00766                 if profile_name[-3:]!='.gz':
00767                     profile_name+='.gz'
00768             
00769             # Profiler is Timereport_Parser
00770             elif profiler_opt in STDOUTPROFILERS:
00771                 # a first maquillage about the profilename:
00772                 if profile_name[:-4]!='.log':
00773                     profile_name+='.log'
00774                 profiler=profiler_opt
00775                         
00776             # profiler is not igprof
00777             else:
00778                 profiler=profiler_opt
00779             
00780             if precedent_reuseprofile:
00781                 profile_name=precedent_profile_name
00782             if reuseprofile:
00783                 precedent_profile_name=profile_name 
00784 
00785                                 
00786                         
00787         else: # we have a single command: easy job!
00788             profile_name=options.profile_name
00789             reportdir=options.output
00790             profiler=options.profiler
00791 
00792         
00793         
00794         # istantiate a Profile object    
00795         if precedent_profile_name!='':
00796             if os.path.exists(precedent_profile_name):
00797                 logger('Reusing precedent profile: %s ...' %precedent_profile_name)
00798                 if profile_name!=precedent_profile_name:
00799                     logger('Copying the old profile to the new name %s ...' %profile_name)
00800                     execute('cp %s %s' %(precedent_profile_name, profile_name))
00801                 
00802         performance_profile=Profile(command,
00803                                     profiler,
00804                                     profile_name)   
00805 
00806         # make profile if needed
00807         if options.profile:                                         
00808             if reuseprofile:
00809                 logger('Saving profile name to reuse it ...')
00810                 precedent_profile_name=profile_name
00811             else:
00812                 precedent_profile_name=''                                
00813             
00814             if not precedent_reuseprofile:
00815                 logger('Creating profile for command %d using %s ...' \
00816                                                 %(commands_counter,profiler))     
00817                 exit_code=performance_profile.make_profile()
00818                 print exit_code
00819                 logger('The exit code was %s'%exit_code)
00820                 exitCodeSum=exitCodeSum+exit_code #Add all exit codes into the global exitCodeSum in order to return it on cmsRelvareport.py exit.
00821                 logger('The exit code sum is %s'%exitCodeSum)
00822             
00823         
00824         # make report if needed   
00825         if options.report:
00826             if exit_code!=0:
00827                 logger('Halting report creation procedure: unexpected exit code %s from %s ...' \
00828                                             %(exit_code,profiler))
00829             else:   
00830                 logger('Creating report for command %d using %s ...' \
00831                                                 %(commands_counter,profiler))     
00832                                                
00833                 # Write into the db instead of producing html if this is the case:
00834                 if options.db:
00835                     exit_code=performance_profile.make_report(fill_db=True,
00836                                                     db_name=options.output,
00837                                                     metastring=db_metastring,
00838                                                     tmp_dir=options.pr_temp,
00839                                                     IgProf_option=IgProf_counter)
00840                     exitCodeSum=exitCodeSum+exit_code #this is to also check that the reporting works... a little more ambitious testing... could do without for release integration
00841                 else:
00842                     exit_code=performance_profile.make_report(outdir=reportdir,
00843                                                     tmp_dir=options.pr_temp,
00844                                                     IgProf_option=IgProf_counter)
00845                     exitCodeSum=exitCodeSum+exit_code #this is to also check that the reporting works... a little more ambitious testing... could do without for release integration
00846                     
00847         commands_counter+=1                                                
00848         precedent_reuseprofile=reuseprofile
00849         if not precedent_reuseprofile:
00850             precedent_profile_name=''
00851         
00852         logger('Process ended on %s\n' %time.asctime())
00853     
00854     logger('Procedure finished on %s' %time.asctime())
00855     logger("Exit code sum is %s"%exitCodeSum)
00856     return exitCodeSum

def cmsRelvalreport::red (   string)
def cmsRelvalreport::yellow (   string)

Definition at line 110 of file cmsRelvalreport.py.

00111                   :
    return '%s%s%s' %('\033[1;33m',string,'\033[1;0m')     

Variable Documentation

string cmsRelvalreport::action = 'store_true'

Definition at line 908 of file cmsRelvalreport.py.

list cmsRelvalreport::cmssw_base = os.environ["CMSSW_BASE"]

Definition at line 23 of file cmsRelvalreport.py.

list cmsRelvalreport::cmssw_release_base = os.environ["CMSSW_RELEASE_BASE"]

Definition at line 24 of file cmsRelvalreport.py.

Definition at line 89 of file cmsRelvalreport.py.

Definition at line 891 of file cmsRelvalreport.py.

string cmsRelvalreport::dest = 'profiler'

Definition at line 892 of file cmsRelvalreport.py.

Definition at line 88 of file cmsRelvalreport.py.

string cmsRelvalreport::EXECUTABLE = 'cmsRun'

Definition at line 85 of file cmsRelvalreport.py.

int cmsRelvalreport::exit = principal(options)

Definition at line 1000 of file cmsRelvalreport.py.

Referenced by optutl::CommandLineParser::_finishDefaultOptions(), optutl::CommandLineParser::_setVariablesFromFile(), abConnect(), XMLRBXPedestalsLoader::addRBXSlot(), SiStripGainRandomCalculator::algoAnalyze(), SiStripGainCosmicCalculator::algoBeginJob(), SiStripGainFromData::algoBeginJob(), SiStripGainFromCalibTree::algoBeginJob(), SiStripGainFromData::algoBeginRun(), evf::ExceptionGenerator::analyze(), MonitorElementsDb::analyze(), SiStripApvGainBuilderFromTag::analyze(), backgroundFunctionService(), hcalCalib::Begin(), MuonAlignment::beginJob(), HFLightCal::beginJob(), HFPreLightCal::beginJob(), DeDxDiscriminatorProducer::beginRun(), HLTHiggsSubAnalysis::beginRun(), FWProxyBuilderBase::build(), CocoaDaqReaderRoot::BuildMeasurementsFromOptAlign(), Measurement::buildOptOList(), Measurement::buildOptONamesList(), MeasurementDiffEntry::buildOptONamesList(), SiStripDetVOffBuilder::buildPSUdetIdMap(), ALIUtils::CalculateAngleDimensionFactorFromInt(), ALIUtils::CalculateAngleDimensionFactorFromString(), TagProbeFitTreeAnalyzer::calculateEfficiency(), ALIUtils::CalculateLengthDimensionFactorFromInt(), ALIUtils::CalculateLengthDimensionFactorFromString(), MeasurementTiltmeter::calculateSimulatedValue(), MeasurementSensor2D::calculateSimulatedValue(), MeasurementCOPS::calculateSimulatedValue(), CastorDumpConditions::CastorDumpConditions(), condbon::cdbon_write(), CmsShowMain::CmsShowMain(), ManipHist::configBlockDivide(), FitHist::configBlockFit(), CompHist::configBlockHist(), CompHist::configBlockIO(), CalibClosureTest::configBlockSpecific(), ManipHist::configBlockSum(), ConfigurableAnnealing::ConfigurableAnnealing(), BaseFunction::convertToArrays(), OpticalObject::createComponentOptOs(), SiStripApvGainGenerator::createObject(), DBWriter::DBWriter(), OpticalObject::defaultBehaviour(), Measurement::DerivativeRespectEntry(), OpticalObject::detailedDeviatesLightRay(), OpticalObject::detailedTraversesLightRay(), OpticalObject::displaceRmGlobOriginal(), OpticalObject::displaceRmGlobOriginalOriginal(), Measurement::DumpBadOrderOptOs(), ALIUtils::dumpDimensions(), EcalEleCalibLooper::EcalEleCalibLooper(), FWModelChangeManager::endChanges(), ErrorsAnalyzer::ErrorsAnalyzer(), ErrorsPropagationAnalyzer::ErrorsPropagationAnalyzer(), PFRootEventManager::expand(), OpticalObject::fastDeviatesLightRay(), OpticalObject::fastTraversesLightRay(), Entry::fill(), OpticalObject::fillCoordinateEntry(), Measurement::fillData(), FittedEntriesSet::FillEntriesAveragingSets(), OpticalObject::fillExtraEntry(), Entry::fillFromInputFileQuality(), Entry::fillFromInputFileSigma(), Entry::fillFromInputFileValue(), HSCPHLTFilter::filter(), Fit::findEntryFitPosition(), OpticalObject::findExtraEntryValue(), OpticalObject::findExtraEntryValueMustExist(), OpticalObjectMgr::findOptO(), OpticalObjectMgr::findOptOs(), Fit::fitParameters(), FittedEntry::FittedEntry(), LutXml::get_checksum(), ZdcLut::get_lut(), ALIUtils::getBool(), getCompressedBuffer(), ErrorCorrelationMgr::getCorrelation(), DeviationsFromFileSensor2D::getDevis(), OpticalObject::getDisplacementInLocalCoordinates(), Model::getEntryByName(), getFlagStream(), ALIUtils::getFloat(), ALIFileOut::getInstance(), ALIFileIn::getInstanceOpened(), ALIUtils::getInt(), HcalLutManager::getLutFromXml_old(), HCALConfigDB::getOnlineLUT(), Model::getOptOByName(), Model::getOptOByType(), Model::getParamFittedSigmaVectorItem(), Measurement::getPreviousOptO(), OpticalObject::getRotationAnglesInOptOFrame(), ZIterativeAlgorithmWithFit::getStatWeights(), ALIFileIn::getWordsInLine(), DDI::Ellipsoid::halfVol(), HCovarianceVSxy::HCovarianceVSxy(), optutl::CommandLineParser::help(), FWGeometryTableViewManager::initGeoManager(), DBReader::initialize(), SiStripCoralIface::initialize(), SiStripDetVOffFakeBuilder::initialize(), ZeroSuppressFP420::initParams(), ALILine::intersect(), LightRay::intersect(), InvRingCalib::InvRingCalib(), L1RCTSaveInput::L1RCTSaveInput(), CmsShowMainBase::loadGeometry(), main(), OpticalObject::makeMeasurement(), OptOCOPS::makeMeasurement(), TrajectoryManager::makeSinglePSimHit(), MatcherUsingTracksAlgorithm::match(), ResidualRefitting::MatchTrackWithRecHits(), MonitorXMLParser::MonitorXMLParser(), MuonAlignmentSummary::MuonAlignmentSummary(), MuonErrorMatrix::MuonErrorMatrix(), MuScleFit::MuScleFit(), edm::openFileHdl(), ALIFileIn::openNewFile(), optutl::CommandLineParser::parseArguments(), OptORisleyPrism::participateInMeasurement(), OptOLens::participateInMeasurement(), OptOCameraDetector::participateInMeasurement(), CSCBadChambersConditions::prefillBadChambers(), CSCBadStripsConditions::prefillBadStrips(), CSCBadWiresConditions::prefillBadWires(), CSCCrosstalkConditions::prefillCrosstalk(), CSCCrosstalkDBConditions::prefillDBCrosstalk(), CSCGainsDBConditions::prefillDBGains(), CSCNoiseMatrixDBConditions::prefillDBNoiseMatrix(), CSCPedestalsDBConditions::prefillDBPedestals(), CSCGainsConditions::prefillGains(), CSCNoiseMatrixConditions::prefillNoiseMatrix(), MuonSimHitProducer::produce(), Fit::PropagateErrors(), CSCTFPtMethods::Pt2StnChiSq(), CSCTFPtMethods::Pt3StnChiSq(), BuildTrackerMapPlugin::read(), OpticalObject::readCoordinates(), DeviationsFromFileSensor2D::readFile(), Model::readMeasurementsFromFile(), evf::FUShmClient::readNext(), AsciiNeutronReader::readNextEvent(), CocoaDaqReaderText::ReadNextEvent(), PFRootEventManager::readOptions(), MuScleFitBase::readProbabilityDistributionsFromFile(), PFRootEventManagerColin::readSpecificOptions(), readSRF(), HcalChannelQualityXml::readStatusWordFromStdin(), Model::readSystemDescription(), RootTreeHandler::readTree(), readTTF(), LightRay::refract(), scaleFunctionBase< std::vector< double > >::resetParameters(), resolutionFunctionService(), resolutionFunctionVecService(), RPCRecHitProducer::RPCRecHitProducer(), runInspector(), scaleFunctionType25< T >::scale(), scaleFunctionType23< T >::scale(), scaleFunctionType24< T >::scale(), scaleFunctionType22< T >::scale(), scaleFunctionService(), scaleFunctionVecService(), HDQMInspector::setBlackList(), MeasurementTiltmeter::setConversionFactor(), MeasurementSensor2D::setConversionFactor(), MeasurementCOPS::setConversionFactor(), Measurement::setConversionFactor(), Measurement::setCurrentDate(), HDQMInspector::setDB(), Comparator::SetDirs(), GlobalOptionMgr::setGlobalOption(), Measurement::setName(), resolutionFunctionBase< double * >::setPar(), ClassBasedElectronID::setup(), CmsShowMainBase::setupConfiguration(), CmsShowMain::setupSocket(), HDQMInspector::setWhiteList(), ResolutionFunction::sigmaCotgTh(), ResolutionFunction::sigmaPhi(), ResolutionFunction::sigmaPt(), smearFunctionService(), LutXml::subdet_from_crate(), ALIUtils::subQuotes(), GraphPath< N, E >::update(), OptOUserDefined::userDefinedBehaviour(), OpticalObject::userDefinedBehaviour(), VertexFitterManager::VertexFitterManager(), VertexRecoManager::VertexRecoManager(), pos::PixelMaxVsf::writeASCII(), pos::PixelLowVoltageMap::writeASCII(), pos::PixelDetectorConfig::writeASCII(), HcalChannelQualityXml::writeStatusWordToStdout(), RootTreeHandler::writeTree(), Fit::WriteVisualisationFiles(), and EcalDccWeightBuilder::writeWeightToDB().

string cmsRelvalreport::help = 'Profilers are: %s'

Definition at line 890 of file cmsRelvalreport.py.

string cmsRelvalreport::IGPROFANALYS = 'cmsIgProf_Analysis.py'

Definition at line 45 of file cmsRelvalreport.py.

Initial value:
00001 {'IgProfPerf':['PERF_TICKS'],
00002                 'IgProfMem':['MEM_TOTAL','MEM_LIVE','MEM_MAX']
00003                 }

Definition at line 92 of file cmsRelvalreport.py.

Initial value:
00001 {'PERF_TICKS':'IgProfPerf',
00002                'MEM_TOTAL':'IgProfMem',
00003                'MEM_LIVE':'IgProfMem',
00004                'MEM_MAX':'IgProfMem'
00005                }

Definition at line 95 of file cmsRelvalreport.py.

string cmsRelvalreport::MAKESKIMDRIVER = '%s/makeSkimDriver.py'

Definition at line 61 of file cmsRelvalreport.py.

string cmsRelvalreport::MAKESKIMDRIVERDIR = '%s/src/Configuration/EventContent/test'

Definition at line 60 of file cmsRelvalreport.py.

tuple cmsRelvalreport::parser = optparse.OptionParser(usage)

Definition at line 887 of file cmsRelvalreport.py.

string cmsRelvalreport::PERFREPORT2_PATH = '/share/perfreport'

Definition at line 20 of file cmsRelvalreport.py.

string cmsRelvalreport::PERFREPORT3_PATH = '/share/perfreport'

Definition at line 13 of file cmsRelvalreport.py.

string cmsRelvalreport::PERL5_LIB = '/afs/cern.ch/user/d/dpiparo/w0/PERLlibs/5.8.0'

Definition at line 68 of file cmsRelvalreport.py.

string cmsRelvalreport::PR2 = '%s'

Definition at line 19 of file cmsRelvalreport.py.

string cmsRelvalreport::PR2_BASE = '/afs/cern.ch/user/g/gbenelli/public/PerfReport2/2.0.1/'

Definition at line 18 of file cmsRelvalreport.py.

string cmsRelvalreport::PR3 = '/bin/perfreport'

Definition at line 12 of file cmsRelvalreport.py.

string cmsRelvalreport::PR3_BASE = '/afs/cern.ch/user/d/dpiparo/w0/perfreport3installation/'

Definition at line 11 of file cmsRelvalreport.py.

string cmsRelvalreport::PR3_PRODUCER_PLUGIN = '/afs/cern.ch/user/d/dpiparo/w0/pr3/perfreport/plugins/cmssw_by_producer/libcmssw_by_producer.so'

Definition at line 15 of file cmsRelvalreport.py.

Initial value:
00001 ['ValgrindFCE',
00002            'IgProf_perf',
00003            'IgProf_mem',
00004            'Edm_Size']

Definition at line 78 of file cmsRelvalreport.py.

string cmsRelvalreport::pyrelvallocal = "/src/Configuration/PyReleaseValidation"

Definition at line 25 of file cmsRelvalreport.py.

string cmsRelvalreport::RELEASE = 'CMSSW_BASE'

Definition at line 29 of file cmsRelvalreport.py.

string cmsRelvalreport::SIMPLEMEMPARSER = 'cmsSimplememchecker_parser.py'

Definition at line 53 of file cmsRelvalreport.py.

Initial value:
00001 ['Memcheck_Valgrind',
00002                  'Timereport_Parser',
00003                  'Timing_Parser',
00004                  'SimpleMem_Parser']

Definition at line 73 of file cmsRelvalreport.py.

string cmsRelvalreport::TIMEREPORTPARSER = 'cmsTimeReport.pl'

Definition at line 49 of file cmsRelvalreport.py.

string cmsRelvalreport::TIMINGPARSER = 'cmsTiming_parser.py'

Definition at line 57 of file cmsRelvalreport.py.

Definition at line 861 of file cmsRelvalreport.py.

string cmsRelvalreport::valperf = "/src/Validation/Performance"

Definition at line 26 of file cmsRelvalreport.py.

string cmsRelvalreport::VFCE_LIB = '/afs/cern.ch/user/m/moserro/public/vgfcelib'

Definition at line 67 of file cmsRelvalreport.py.

string cmsRelvalreport::VMPARSER = 'valgrindMemcheckParser.pl'

Definition at line 37 of file cmsRelvalreport.py.

string cmsRelvalreport::VMPARSERSTYLE = '%s/src/Utilities/ReleaseScripts/data/valgrindMemcheckParser.css'

Definition at line 41 of file cmsRelvalreport.py.