- if (not smpi_cfg_papi_events_file().empty()) {
- if (PAPI_library_init(PAPI_VER_CURRENT) != PAPI_VER_CURRENT)
- XBT_ERROR("Could not initialize PAPI library; is it correctly installed and linked?"
- " Expected version is %u", PAPI_VER_CURRENT);
-
- using Tokenizer = boost::tokenizer<boost::char_separator<char>>;
- boost::char_separator<char> separator_units(";");
- std::string str = smpi_cfg_papi_events_file();
- Tokenizer tokens(str, separator_units);
-
- // Iterate over all the computational units. This could be processes, hosts, threads, ranks... You name it.
- // I'm not exactly sure what we will support eventually, so I'll leave it at the general term "units".
- for (auto const& unit_it : tokens) {
- boost::char_separator<char> separator_events(":");
- Tokenizer event_tokens(unit_it, separator_events);
-
- int event_set = PAPI_NULL;
- if (PAPI_create_eventset(&event_set) != PAPI_OK) {
- // TODO: Should this let the whole simulation die?
- XBT_CRITICAL("Could not create PAPI event set during init.");
- }