44{
46 profileDirectory->
SetGuidance(
"Profiler controls.");
47
48 profileOutputDirectory =
new G4UIdirectory(
"/profiler/output/");
49 profileOutputDirectory->
SetGuidance(
"Control the output modes of the profiler.");
50
51#define CREATE_DIR(IDX, DIR, GUIDANCE) \
52 profileTypeDirs.at(IDX) = new G4UIdirectory(DIR); \
53 profileTypeDirs.at(IDX)->SetGuidance(GUIDANCE)
54
60
61#define SET_ENABLED_CMD(IDX, CMD, CMDLINE, DEFAULT, GUIDANCE) \
62 profileEnableCmds.at(IDX).second = CMDLINE; \
63 profileEnableCmds.at(IDX).first = new G4UIcmdWithABool(CMD, this); \
64 profileEnableCmds.at(IDX).first->SetDefaultValue(DEFAULT); \
65 profileEnableCmds.at(IDX).first->SetGuidance(GUIDANCE); \
66 profileEnableCmds.at(IDX).first->AvailableForStates(G4State_PreInit, G4State_Idle)
67
70 "Record metrics for each G4Event");
72 "Record metrics for each G4Track");
74 "Record metrics for each G4Step");
76 "Record metrics for user specified profiling instances");
77
78#define SET_COMPONENTS_CMD(IDX, CMD, CMDLINE, DEFAULTS, GUIDANCE) \
79 profileCompCmds.at(IDX).second = CMDLINE; \
80 profileCompCmds.at(IDX).first = new G4UIcmdWithAString(CMD, this); \
81 profileCompCmds.at(IDX).first->SetDefaultValue(DEFAULTS); \
82 profileCompCmds.at(IDX).first->SetGuidance(GUIDANCE); \
83 profileCompCmds.at(IDX).first->AvailableForStates(G4State_PreInit, G4State_Idle)
84
85 G4String comps =
"wall_clock, cpu_clock, cpu_util, peak_rss";
86
88 "Measurment types to record for each G4Run (see `timemory-avail -s`)");
90 "Measurment types to record for each G4Event (see `timemory-avail -s`)");
92 "Measurment types to record for each G4Track (see `timemory-avail -s`)");
94 "Measurment types to record for each G4Step (see `timemory-avail -s`)");
96 "Measurment types to record for user specified profiling "
97 "instances (see `timemory-avail -s`)");
98
99#define SET_OUTPUT_CMD(CMD, CMDLINE, DEFAULT, GUIDANCE) \
100 profileGeneralCmds.push_back({new G4UIcmdWithABool(CMD, this), CMDLINE}); \
101 profileGeneralCmds.back().first->SetDefaultValue(DEFAULT); \
102 profileGeneralCmds.back().first->SetGuidance(GUIDANCE); \
103 profileGeneralCmds.back().first->AvailableForStates(G4State_PreInit, G4State_Idle)
104
106 "Enabled Dart output (CTest/CDash data tracking)");
107 SET_OUTPUT_CMD(
"/profiler/output/json",
"--json",
true,
"Enabled JSON output");
108 SET_OUTPUT_CMD(
"/profiler/output/text",
"--text",
true,
"Enabled text output");
109 SET_OUTPUT_CMD(
"/profiler/output/cout",
"--cout",
false,
"Enabled output to console");
110 SET_OUTPUT_CMD(
"/profiler/output/plot",
"--plot",
false,
"Enabled plotting JSON output");
111
113 "Display the results as a call-stack hierarchy.");
114 SET_OUTPUT_CMD(
"/profiler/flat",
"--flat",
false,
"Display the results as a flat call-stack");
116 "Do not merge duplicate entries at the same call-stack "
117 "position. May be combined with tree or flat profiles.");
119 "Display the results for each individual thread (default: aggregation)");
121 "Display the results for each individual G4event (default: aggregation)");
122}
#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)