@@ -178,6 +178,23 @@ bool parse_arguments(int argc, char** argv, std::string& data_path, std::string&
178
178
return true ;
179
179
}
180
180
181
+ /* * Helper function to parse fragment mode and benchmarking settings from the configuration file */
182
+ void parse_config (const std::string& config_path, bool & benchmarking) {
183
+ auto config = holoscan::Config (config_path);
184
+ auto & yaml_nodes = config.yaml_nodes ();
185
+ for (const auto & yaml_node : yaml_nodes) {
186
+ try {
187
+ auto application = yaml_node[" application" ];
188
+ if (application.IsMap ()) {
189
+ benchmarking = application[" benchmarking" ].as <bool >();
190
+ }
191
+ } catch (std::exception& e) {
192
+ HOLOSCAN_LOG_ERROR (" Error parsing configuration file: {}" , e.what ());
193
+ benchmarking = false ;
194
+ }
195
+ }
196
+ }
197
+
181
198
/* * Main function */
182
199
int main (int argc, char ** argv) {
183
200
std::string config_path = " " ;
@@ -207,15 +224,25 @@ int main(int argc, char** argv) {
207
224
}
208
225
}
209
226
227
+ bool benchmarking = false ;
228
+ parse_config (config_path, benchmarking);
229
+
210
230
auto app = holoscan::make_application<App>();
211
231
app->config (config_path);
212
232
app->set_datapath (data_directory);
213
233
214
- auto trackers = app->track_distributed ();
234
+ std::unordered_map<std::string, DataFlowTracker*> trackers;
235
+ if (benchmarking) {
236
+ trackers = app->track_distributed ();
237
+ }
238
+
215
239
app->run ();
216
- for (const auto & [name, tracker] : trackers) {
217
- std::cout << " Fragment: " << name << std::endl;
218
- tracker->print ();
240
+
241
+ if (benchmarking) {
242
+ for (const auto & [name, tracker] : trackers) {
243
+ std::cout << " Fragment: " << name << std::endl;
244
+ tracker->print ();
245
+ }
219
246
}
220
247
return 0 ;
221
248
}
0 commit comments