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 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 113 of file cmsRelvalreport.py.

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

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

Definition at line 128 of file cmsRelvalreport.py.

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

Definition at line 144 of file cmsRelvalreport.py.

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

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

Definition at line 692 of file cmsRelvalreport.py.

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

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

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

Definition at line 109 of file cmsRelvalreport.py.

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

Variable Documentation

string cmsRelvalreport::action = 'store_true'

Definition at line 897 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 88 of file cmsRelvalreport.py.

Definition at line 880 of file cmsRelvalreport.py.

string cmsRelvalreport::dest = 'profiler'

Definition at line 881 of file cmsRelvalreport.py.

Definition at line 87 of file cmsRelvalreport.py.

string cmsRelvalreport::EXECUTABLE = 'cmsRun'

Definition at line 84 of file cmsRelvalreport.py.

int cmsRelvalreport::exit = principal(options)

Definition at line 989 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(), FWProxyBuilderBase::build(), CocoaDaqReaderRoot::BuildMeasurementsFromOptAlign(), Measurement::buildOptOList(), Measurement::buildOptONamesList(), MeasurementDiffEntry::buildOptONamesList(), SiStripDetVOffBuilder::buildPSUdetIdMap(), ALIUtils::CalculateAngleDimensionFactorFromInt(), ALIUtils::CalculateAngleDimensionFactorFromString(), TagProbeFitTreeAnalyzer::calculateEfficiency(), ALIUtils::CalculateLengthDimensionFactorFromInt(), ALIUtils::CalculateLengthDimensionFactorFromString(), MeasurementSensor2D::calculateSimulatedValue(), MeasurementTiltmeter::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(), edm::EventProcessor::forkProcess(), 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(), 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(), MeasurementCOPS::setConversionFactor(), MeasurementSensor2D::setConversionFactor(), MeasurementTiltmeter::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::PixelLowVoltageMap::writeASCII(), pos::PixelMaxVsf::writeASCII(), pos::PixelDetectorConfig::writeASCII(), HcalChannelQualityXml::writeStatusWordToStdout(), RootTreeHandler::writeTree(), Fit::WriteVisualisationFiles(), and EcalDccWeightBuilder::writeWeightToDB().

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

Definition at line 879 of file cmsRelvalreport.py.

string cmsRelvalreport::IGPROFANALYS = 'cmsIgProf_Analysis.py'

Definition at line 44 of file cmsRelvalreport.py.

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

Definition at line 91 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 94 of file cmsRelvalreport.py.

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

Definition at line 60 of file cmsRelvalreport.py.

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

Definition at line 59 of file cmsRelvalreport.py.

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

Definition at line 876 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 67 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 77 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 28 of file cmsRelvalreport.py.

string cmsRelvalreport::SIMPLEMEMPARSER = 'cmsSimplememchecker_parser.py'

Definition at line 52 of file cmsRelvalreport.py.

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

Definition at line 72 of file cmsRelvalreport.py.

string cmsRelvalreport::TIMEREPORTPARSER = 'cmsTimeReport.pl'

Definition at line 48 of file cmsRelvalreport.py.

string cmsRelvalreport::TIMINGPARSER = 'cmsTiming_parser.py'

Definition at line 56 of file cmsRelvalreport.py.

Definition at line 850 of file cmsRelvalreport.py.

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

Definition at line 66 of file cmsRelvalreport.py.

string cmsRelvalreport::VMPARSER = 'valgrindMemcheckParser.pl'

Definition at line 36 of file cmsRelvalreport.py.

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

Definition at line 40 of file cmsRelvalreport.py.