Skip to content

Support a PAPI_DISABLE_COMPONENTS environment variable #478

@sbkathpe

Description

@sbkathpe

Description of Feature Request

Sometimes a PAPI component configured for the PAPI library can exhibit unexpected behavior or else otherwise not execute properly. This usually is during initialization. There is currently no way to disable a configured component outside of using the API. Locally we have enhance PAPI with a PAPI_DISABLE_COMPONENTS environment variable to disable selected components from being activated at runtime. This is particularly helpful for PAPI utilities papi_component_avail, papi_avail, etc.

Below is a GIT diff of how we implemented this environment variable. It has proven useful on a number of occasions where issues in a component prevented the successful execution of a PAPI utility, or even a program using PAPI.

Thanks for the consideration.

@@ -1047,6 +1051,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 */
+
        int tmp = 0;
 
        /* This is a poor attempt at a lock. 

Component

No response

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions