Geant4 11.1.1
Toolkit for the simulation of the passage of particles through matter
Loading...
Searching...
No Matches
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_PREFIX
 
#define TIMEMORY_WEAK_POSTFIX
 

Typedefs

using G4ProfType = G4ProfileType
 
using RunProfConfig = G4ProfilerConfig< G4ProfType::Run >
 
using EventProfConfig = G4ProfilerConfig< G4ProfType::Event >
 
using TrackProfConfig = G4ProfilerConfig< G4ProfType::Track >
 
using StepProfConfig = G4ProfilerConfig< G4ProfType::Step >
 
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 502 of file G4Profiler.cc.

◆ TIMEMORY_WEAK_POSTFIX

#define TIMEMORY_WEAK_POSTFIX

Definition at line 527 of file G4Profiler.cc.

◆ TIMEMORY_WEAK_PREFIX

#define TIMEMORY_WEAK_PREFIX

Definition at line 526 of file G4Profiler.cc.

Typedef Documentation

◆ EventProfConfig

using EventProfConfig = G4ProfilerConfig<G4ProfType::Event>

Definition at line 482 of file G4Profiler.cc.

◆ G4ProfType

Definition at line 480 of file G4Profiler.cc.

◆ RunProfConfig

using RunProfConfig = G4ProfilerConfig<G4ProfType::Run>

Definition at line 481 of file G4Profiler.cc.

◆ StepProfConfig

using StepProfConfig = G4ProfilerConfig<G4ProfType::Step>

Definition at line 484 of file G4Profiler.cc.

◆ TrackProfConfig

using TrackProfConfig = G4ProfilerConfig<G4ProfType::Track>

Definition at line 483 of file G4Profiler.cc.

◆ UserProfConfig

using UserProfConfig = G4ProfilerConfig<G4ProfType::User>

Definition at line 485 of file G4Profiler.cc.

Function Documentation

◆ G4ProfilerInit()

void G4ProfilerInit ( void  )

Definition at line 540 of file G4Profiler.cc.

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

Referenced by G4RunProfilerInit().