Skip to content

Commit b140951

Browse files
sbkathpedbarry9
authored andcommitted
framework: PAPI_DISABLE_COMPONENTS env var
This change introduces an environment variable to allow the user to disable components at runtime. Example Usage: export PAPI_DISABLE_COMPONENTS=rocm,rocm_smi These changes have been tested using ROCm 7.0.2 on the Frontier supercomputer, which contains the AMD MI250X architecture. Signed-off-by: Daniel Barry <dbarry@vols.utk.edu>
1 parent 9b2dea7 commit b140951

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

src/papi.c

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1049,6 +1049,18 @@ PAPI_library_init( int version )
10491049

10501050
int tmp = 0;
10511051

1052+
char *disabledComps = getenv("PAPI_DISABLE_COMPONENTS");
1053+
if (disabledComps != NULL) {
1054+
char *penv = strdup(disabledComps);
1055+
char *p;
1056+
for (p = strtok (penv, ",:"); p != NULL; p = strtok (NULL, ",:")) {
1057+
(void) PAPI_disable_component_by_name(p);
1058+
}
1059+
free(penv);
1060+
} else {
1061+
SUBDBG("PAPI_library_init: getenv(PAPI_DISABLE_COMPONENTS) was not set.\n");
1062+
}
1063+
10521064
/* This is a poor attempt at a lock.
10531065
For 3.1 this should be replaced with a
10541066
true UNIX semaphore. We cannot use PAPI

0 commit comments

Comments
 (0)