MCPcopy Create free account
hub / github.com/LBANN/lbann / initialize_caliper

Method initialize_caliper

src/utils/profiling.cpp:222–247  ·  view source on GitHub ↗

The rules for caliper: - If CALI_CONFIG is set and nonempty, initialize caliper but ignore "--caliper_config". - if "--caliper", setup with "--caliper_config". - Otherwise, do nothing.

Source from the content-addressed store, hash-verified

220// - if "--caliper", setup with "--caliper_config".
221// - Otherwise, do nothing.
222void lbann::initialize_caliper()
223{
224 auto const& arg_parser = global_argument_parser();
225 bool const cali_config_from_env = check_env_set_and_nonempty("CALI_CONFIG");
226 bool const use_caliper =
227 cali_config_from_env || arg_parser.get<bool>(LBANN_OPTION_USE_CALIPER);
228
229 if (!use_caliper)
230 return;
231
232 if (caliper_initialized) {
233 LBANN_ERROR("Cannot reinitialize Caliper");
234 }
235 do_adiak_init();
236
237 if (!cali_config_from_env) {
238 auto const config =
239 arg_parser.get<std::string>(LBANN_OPTION_CALIPER_CONFIG).c_str();
240 cali_mgr.add(config);
241 if (cali_mgr.error()) {
242 LBANN_ERROR("Caliper config parse error: ", cali_mgr.error_msg());
243 }
244 }
245 cali_mgr.start();
246 caliper_initialized = true;
247}
248
249void lbann::finalize_caliper()
250{

Callers

nothing calls this directly

Calls 4

do_adiak_initFunction · 0.85
addMethod · 0.45
startMethod · 0.45

Tested by

no test coverage detected