How to time reconstruction and memory consumption

  • add in your cfg :
process.load('Configuration/StandardSequences/Services_cff')
process.Timing = cms.Service("Timing")

process.SimpleMemoryCheck = cms.Service('SimpleMemoryCheck',
               ignoreTotal=cms.untracked.int32(0),
               oncePerEventMode =  cms.untracked.bool(True)
               )
If the logs are named like HYDJET_RECO_CENTRAL_#aog
  • one can use grab.pl to grab the right numbers
--------- grab.pl ------

open (LOG, ">mem_central_reco.log");

for ( $i = 0; $i<100; $i++)
{
   @lines = qx( cat HYDJET_RECO_CENTRAL_$i.log | grep "MemoryCheck: event" );
   foreach $line (@lines)
   {
      @a = split " ", $line;
      print LOG "$a[7]\n";      }
}
close LOG;

open (LOG, ">time_mb_raw.log");

for ( $i = 0; $i<100; $i++)
{
 @lines = qx( cat HYDJET_RECO_CENTRAL_$i.log | grep "TimeEvent>" );
 foreach $line (@lines)
 {
    @a = split " ", $line;
    print LOG "$a[3]\n";    }
}
close LOG;
  • and analyze.C to make the plots
------------- analyze.C -----------

{
 ifstream time;
 float t;

 ifstream rss;
 float mem;

 TH1F *ht_c_r = new TH1F("ht_c_r","Reconstruction (Central b=0-4) Wall Clock Time per Event",400,0.,400.);
   time.open("time_central_reco.log");
 for( int i = 0; i<1000; i++)
 {
   time >> t;
   ht_c_r->Fill(t);
 }
 time.close();

 TH1F *hm_c_r  = new TH1F("hm_c_r","Reconstruction (Central b=0-4) RSS Memory Usage",200,0.,3000.);
 rss.open("mem_central_reco.log");
 for( int i = 0; i<1000; i++)
 {
   rss >> mem;
   hm_c_r->Fill(mem);
 }
 rss.close();

 hm_c_r->GetXaxis()->SetTitle("MegaBytes");
 ht_c_r->GetXaxis()->SetTitle("Seconds");
}
  • I also did a thing were I read the RSS memory usage directly out of the /proc directory ten times a second to see if I could trust SimpleMemoryCheck and I found it to reliably report the peak memory usage during the event.

-- CatherineSilvestre - 05-Feb-2010

Edit | Attach | Watch | Print version | History: r1 | Backlinks | Raw View | WYSIWYG | More topic actions
Topic revision: r1 - 2010-02-05 - CatherineSilvestre
 
    • Cern Search Icon Cern Search
    • TWiki Search Icon TWiki Search
    • Google Search Icon Google Search

    Main All webs login

This site is powered by the TWiki collaboration platform Powered by PerlCopyright &© 2008-2024 by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
or Ideas, requests, problems regarding TWiki? use Discourse or Send feedback