papi_native_avail filters by event name rather than component

Issue #108 resolved
Giuseppe Congiu created an issue

papi_native_avail can exclude the display of events that contain a substring through the -x option. For example, the prefix containing the component name. This is useful to filter out events that are not of interest if PAPI is configured with more components than actually needed (or useful for a particular application). However, the filtering is done on the event name and not on the component name. This means that if the nvidia component, for example, is configured in and the user is only interested in nvml events papi_native_avail will still go through all the cuda events before displaying the nvml events (depending on configure order). For cuda 11 there might be hundreds of thousands of events and the tool might run for an unreasonable amount of time. The tool should probably add an option for filtering out component altogether.

Comments (7)

  1. Steve Kaufmann

    We've added a

    PAPI_DISABLE_COMPONENTS

    environment variable to disable at runtime a given component (in papi.c):

    @@ -1043,6 +1047,20 @@ PAPI_library_init( int version ) { APIDBG( "Entry: version: %#x\n", version);

    +#if defined(_CRAY) + / Disable components early / + + char penv = getenv ("PAPI_DISABLE_COMPONENTS"); + + if (penv != NULL) { + char p; + + for (p = strtok (penv, ",:"); p != NULL; p = strtok (NULL, ",:")) { + (void) PAPI_disable_component_by_name (p); + } + } +#endif / _CRAY / +

  2. Giuseppe Congiu reporter

    There is also a PAPI_disable_component interface in PAPI. I don’t think this is used in papi_native_avail though.

  3. Steve Kaufmann

    This change effectively does a PAPI_disable_component for ANY command or use of PAPI_library_init and gives runtime control over disabling. I added support for this when running into component problems that interfered with PAPI being initialized (or worse yet faults in components to workaround).

  4. Giuseppe Congiu reporter

    I see, that sounds like a reasonable solution for a local installation. However, I would avoid adding an environment variable in papi.c to control component disable for the general case. It is probably best to have a command line option for the specific tool (papi_native_avail in this instance) and rely on explicit calls to papi_disable_component{by_name} in user code. This way the user always knows what is going on. Environment variables are easily overlooked and may end up creating confusion.

  5. Log in to comment