Geant4-11
Macros | Typedefs | Functions
G4Profiler.cc File Reference
#include "G4Profiler.hh"
#include "G4TiMemory.hh"
#include <regex>
#include <thread>

Go to the source code of this file.

Macros

#define G4PROFILE_INSTANTIATION(TYPE)
 
#define TIMEMORY_WEAK_POSTFIX
 
#define TIMEMORY_WEAK_PREFIX
 

Typedefs

using EventProfConfig = G4ProfilerConfig< G4ProfType::Event >
 
using G4ProfType = G4ProfileType
 
using RunProfConfig = G4ProfilerConfig< G4ProfType::Run >
 
using StepProfConfig = G4ProfilerConfig< G4ProfType::Step >
 
using TrackProfConfig = G4ProfilerConfig< G4ProfType::Track >
 
using UserProfConfig = G4ProfilerConfig< G4ProfType::User >
 

Functions

TIMEMORY_WEAK_PREFIX void G4ProfilerInit (void) TIMEMORY_WEAK_POSTFIX
 

Macro Definition Documentation

◆ G4PROFILE_INSTANTIATION

#define G4PROFILE_INSTANTIATION (   TYPE)
Value:
template TYPE::PersistentSettings<G4ProfileOp::Query>& \
TYPE::GetPersistentFallback<G4ProfileOp::Query>(); \
template TYPE::PersistentSettings<G4ProfileOp::Label>& \
TYPE::GetPersistentFallback<G4ProfileOp::Label>(); \
template TYPE::PersistentSettings<G4ProfileOp::Tool>& \
TYPE::GetPersistentFallback<G4ProfileOp::Tool>(); \
\
template TYPE::PersistentSettings<G4ProfileOp::Query>& \
TYPE::GetPersistent<G4ProfileOp::Query>(); \
template TYPE::PersistentSettings<G4ProfileOp::Label>& \
TYPE::GetPersistent<G4ProfileOp::Label>(); \
template TYPE::PersistentSettings<G4ProfileOp::Tool>& \
TYPE::GetPersistent<G4ProfileOp::Tool>();

Definition at line 500 of file G4Profiler.cc.

◆ TIMEMORY_WEAK_POSTFIX

#define TIMEMORY_WEAK_POSTFIX

Definition at line 525 of file G4Profiler.cc.

◆ TIMEMORY_WEAK_PREFIX

#define TIMEMORY_WEAK_PREFIX

Definition at line 524 of file G4Profiler.cc.

Typedef Documentation

◆ EventProfConfig

Definition at line 480 of file G4Profiler.cc.

◆ G4ProfType

Definition at line 478 of file G4Profiler.cc.

◆ RunProfConfig

Definition at line 479 of file G4Profiler.cc.

◆ StepProfConfig

Definition at line 482 of file G4Profiler.cc.

◆ TrackProfConfig

Definition at line 481 of file G4Profiler.cc.

◆ UserProfConfig

Definition at line 483 of file G4Profiler.cc.

Function Documentation

◆ G4ProfilerInit()

void G4ProfilerInit ( void  )

Definition at line 538 of file G4Profiler.cc.

539 {
540#ifdef GEANT4_USE_TIMEMORY
541
542 // guard against re-initialization
543 static bool _once = false;
544 if(_once)
545 return;
546 _once = true;
547
548 puts(">>> G4ProfilerInit <<<");
549
550 //
551 // the default settings
552 //
553 // large profiles can take a very long time to plot
554 tim::settings::plot_output() = false;
555 // large profiles can take quite a bit of console space
556 tim::settings::cout_output() = false;
557 // this creates a subdirectory with the timestamp of the run
558 tim::settings::time_output() = false;
559 // see `man 3 strftime` for formatting keys
560 tim::settings::time_format() = "%F_%I.%M_%p";
561 // set the default precision for timing
562 tim::settings::timing_precision() = 6;
563 // set the minimum width for outputs
564 tim::settings::width() = 12;
565 // set dart reports (when enabled) to only print the first entry
566 tim::settings::dart_count() = 1;
567 // set dart reports (when enabled) to use the component label
568 // instead of the string identifer of the entry, e.g.
569 // >>> G4Run/0 ... peak_rss ... 50 MB would report
570 // 'peak_rss 50 MB' not 'G4Run/0 50 MB'
571 tim::settings::dart_label() = true;
572
573 // allow environment overrides of the defaults
574 tim::settings::parse();
575#endif
576 }

Referenced by G4RunProfilerInit().