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