NERSC / timemory

Modular C++ Toolkit for Performance Analysis and Logging. Profiling API and Tools for C, C++, CUDA, Fortran, and Python. The C++ template API is essentially a framework to creating tools: it is designed to provide a unifying interface for recording various performance measurements alongside data logging and interfaces to other tools.
https://timemory.readthedocs.io/en/develop/
Other
352 stars 38 forks source link

Configuring papi events failed #252

Closed include-jacopo closed 2 months ago

include-jacopo commented 1 year ago

Hi, I'm interested in evaluating PAPI metrics using Timemory but values found are always zero. I've installed PAPI 6.0 so I'm wondering if this version is compatible with the last version of timemory or I should downgrade.

This is the output that I got when trying to execute the code:

Warning!! Failure to add events to evente set : PAPI_error 1: (null)
[pid=xxxx][tid=0][timemory/.../papi/papi_common.hpp:321@'initialize']> Warning! Configuring 2 papi events failed...
[pid=xxxx][tid=0][timemory/.../papi/papi_common.hpp:321@'initialize']> Warning! Configuring 2 papi events failed...

The code I would like to test looks like this:

include <timemory/library.h>
int main() {
    timemory_init_library(argc, argv);
    timemory_set_default("cpu_roofline");

    // some initialization code...

    timemory_push_region("main");
    myFunction(...)
    timemory_pop_region("main);
    timemory_finalize_library();

    return 0;
}

void myFunction(....) {
    uint64_t idx = timemory_get_begin_record("name");
    //Some code
    timemory_end_record(idx);
}

Thanks in advance.

jrmadsen commented 1 year ago

I don't think this is a timemory/PAPI compatibility issue.

What is the value of /proc/sys/kernel/perf_event_paranoid?

include-jacopo commented 1 year ago

The value of /proc/sys/kernel/perf_event_paranoid is 0

jrmadsen commented 1 year ago

Try setting TIMEMORY_PAPI_MULTIPLEXING=ON

Check with timemory-avail that is the right option name. And maybe run timemory-avail -H and verify that the hardware counters for single and double precision flops are available.

jrmadsen commented 1 year ago

If none of that helps, if you are building from source, checkout the omnitrace branch and try that. That's the most up-to-date branch.

If none of that works, let me know and I'll track this down and fix it -- probably won't be until next week though.