From: Arnaud Giersch Date: Fri, 11 Jan 2019 12:32:10 +0000 (+0100) Subject: Slightly simplify logic. X-Git-Tag: v3_22~590 X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/commitdiff_plain/4f71cacf02b2aedd0d6c546f908f48a71014913d Slightly simplify logic. --- diff --git a/src/smpi/internals/smpi_global.cpp b/src/smpi/internals/smpi_global.cpp index c337d3e9d5..3eca3f2fad 100644 --- a/src/smpi/internals/smpi_global.cpp +++ b/src/smpi/internals/smpi_global.cpp @@ -323,17 +323,15 @@ void smpi_global_init() int event_code = PAPI_NULL; char* event_name = const_cast((*events_it).c_str()); - if (PAPI_event_name_to_code(event_name, &event_code) == PAPI_OK) { - if (PAPI_add_event(event_set, event_code) != PAPI_OK) { - XBT_ERROR("Could not add PAPI event '%s'. Skipping.", event_name); - continue; - } else { - XBT_DEBUG("Successfully added PAPI event '%s' to the event set.", event_name); - } - } else { + if (PAPI_event_name_to_code(event_name, &event_code) != PAPI_OK) { XBT_CRITICAL("Could not find PAPI event '%s'. Skipping.", event_name); continue; } + if (PAPI_add_event(event_set, event_code) != PAPI_OK) { + XBT_ERROR("Could not add PAPI event '%s'. Skipping.", event_name); + continue; + } + XBT_DEBUG("Successfully added PAPI event '%s' to the event set.", event_name); counters2values.push_back( // We cannot just pass *events_it, as this is of type const basic_string