Skip to content

Commit 2e02a9c

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 4060779 commit 2e02a9c

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

src/papi.c

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

10501050
int tmp = 0;
10511051

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

0 commit comments

Comments
 (0)