46{
48 profileDirectory->
SetGuidance(
"Profiler controls.");
49
50 profileOutputDirectory =
new G4UIdirectory(
"/profiler/output/");
52 "Control the output modes of the profiler.");
53
54#define CREATE_DIR(IDX, DIR, GUIDANCE) \
55 profileTypeDirs.at(IDX) = new G4UIdirectory(DIR); \
56 profileTypeDirs.at(IDX)->SetGuidance(GUIDANCE)
57
59 "Profiler controls at the G4Run level");
61 "Profiler controls at the G4Event level");
63 "Profiler controls at the G4Track level");
65 "Profiler controls at the G4Step level");
67 "Profiler controls within user code");
68
69#define SET_ENABLED_CMD(IDX, CMD, CMDLINE, DEFAULT, GUIDANCE) \
70 profileEnableCmds.at(IDX).second = CMDLINE; \
71 profileEnableCmds.at(IDX).first = new G4UIcmdWithABool(CMD, this); \
72 profileEnableCmds.at(IDX).first->SetDefaultValue(DEFAULT); \
73 profileEnableCmds.at(IDX).first->SetGuidance(GUIDANCE); \
74 profileEnableCmds.at(IDX).first->AvailableForStates(G4State_PreInit, \
75 G4State_Idle)
76
78 "Record metrics for each G4Run");
80 "Record metrics for each G4Event");
82 "Record metrics for each G4Track");
84 "Record metrics for each G4Step");
86 "Record metrics for user specified profiling instances");
87
88#define SET_COMPONENTS_CMD(IDX, CMD, CMDLINE, DEFAULTS, GUIDANCE) \
89 profileCompCmds.at(IDX).second = CMDLINE; \
90 profileCompCmds.at(IDX).first = new G4UIcmdWithAString(CMD, this); \
91 profileCompCmds.at(IDX).first->SetDefaultValue(DEFAULTS); \
92 profileCompCmds.at(IDX).first->SetGuidance(GUIDANCE); \
93 profileCompCmds.at(IDX).first->AvailableForStates(G4State_PreInit, \
94 G4State_Idle)
95
96 G4String comps =
"wall_clock, cpu_clock, cpu_util, peak_rss";
97
99 Type::Run,
"/profiler/run/components",
"--run-components", comps,
100 "Measurment types to record for each G4Run (see `timemory-avail -s`)");
102 Type::Event,
"/profiler/event/components",
"--event-components", comps,
103 "Measurment types to record for each G4Event (see `timemory-avail -s`)");
105 Type::Track,
"/profiler/track/components",
"--track-components", comps,
106 "Measurment types to record for each G4Track (see `timemory-avail -s`)");
108 Type::Step,
"/profiler/step/components",
"--step-components", comps,
109 "Measurment types to record for each G4Step (see `timemory-avail -s`)");
111 "--user-components", comps,
112 "Measurment types to record for user specified profiling "
113 "instances (see `timemory-avail -s`)");
114
115#define SET_OUTPUT_CMD(CMD, CMDLINE, DEFAULT, GUIDANCE) \
116 profileGeneralCmds.push_back({ new G4UIcmdWithABool(CMD, this), CMDLINE }); \
117 profileGeneralCmds.back().first->SetDefaultValue(DEFAULT); \
118 profileGeneralCmds.back().first->SetGuidance(GUIDANCE); \
119 profileGeneralCmds.back().first->AvailableForStates(G4State_PreInit, \
120 G4State_Idle)
121
123 "Enabled Dart output (CTest/CDash data tracking)");
125 "Enabled JSON output");
127 "Enabled text output");
129 "Enabled output to console");
131 "Enabled plotting JSON output");
132
134 "Display the results as a call-stack hierarchy.");
136 "Display the results as a flat call-stack");
138 "Do not merge duplicate entries at the same call-stack "
139 "position. May be combined with tree or flat profiles.");
141 "/profiler/per_thread", "--per-thread", false,
142 "Display the results for each individual thread (default: aggregation)");
144 "/profiler/per_event", "--per-event", false,
145 "Display the results for each individual G4event (default: aggregation)");
146}
#define SET_ENABLED_CMD(IDX, CMD, CMDLINE, DEFAULT, GUIDANCE)
#define SET_COMPONENTS_CMD(IDX, CMD, CMDLINE, DEFAULTS, GUIDANCE)
#define SET_OUTPUT_CMD(CMD, CMDLINE, DEFAULT, GUIDANCE)
#define CREATE_DIR(IDX, DIR, GUIDANCE)
void SetGuidance(const char *aGuidance)