Skip to content

Commit 120ee47

Browse files
Merge pull request #375 from Treece-Burgess/05-14-2025-debug-memory
Sysdetect/Topdown/Infiniband/NVML Components: Resolves Cases Where `Error! PAPI_library_init` Occurs with `--with-debug=memory`
2 parents ff78c67 + 86ab82d commit 120ee47

File tree

5 files changed

+17
-5
lines changed

5 files changed

+17
-5
lines changed

src/components/infiniband/linux-infiniband.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -983,7 +983,7 @@ papi_vector_t _infiniband_vector = {
983983
.context = sizeof (infiniband_context_t),
984984
.control_state = sizeof (infiniband_control_state_t),
985985
.reg_value = sizeof (infiniband_register_t),
986-
/* .reg_alloc = sizeof (infiniband_reg_alloc_t), */
986+
.reg_alloc = 1 /* unused */
987987
},
988988
/* function pointers in this component */
989989
.init_thread = _infiniband_init_thread,

src/components/nvml/linux-nvml.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1893,7 +1893,7 @@ papi_vector_t _nvml_vector = {
18931893
.context = sizeof(nvml_context_t),
18941894
.control_state = sizeof(nvml_control_state_t),
18951895
.reg_value = sizeof(nvml_register_t),
1896-
// .reg_alloc = sizeof ( nvml_reg_alloc_t ),
1896+
.reg_alloc = 1, /* unused */
18971897
},
18981898

18991899
/* function pointers */

src/components/sysdetect/sysdetect.c

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -475,6 +475,14 @@ papi_vector_t _sysdetect_vector = {
475475
.kernel_version = "n/a",
476476
},
477477

478+
/* Sizes of framework-opaque component-private structures */
479+
.size = {
480+
.context = 1, /* unused */
481+
.control_state = 1, /* unused */
482+
.reg_value = 1, /* unused */
483+
.reg_alloc = 1, /* unused */
484+
},
485+
478486
/* Used for general PAPI interactions */
479487
.init_component = _sysdetect_init_component,
480488
.init_thread = _sysdetect_init_thread,

src/components/topdown/topdown.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -909,6 +909,8 @@ papi_vector_t _topdown_vector = {
909909
.size = {
910910
.context = sizeof(_topdown_context_t),
911911
.control_state = sizeof(_topdown_control_state_t),
912+
.reg_value = 1, /* unused */
913+
.reg_alloc = 1, /* unused */
912914
},
913915

914916
/* Used for general PAPI interactions */
@@ -930,4 +932,4 @@ papi_vector_t _topdown_vector = {
930932
.ntv_code_to_name = _topdown_ntv_code_to_name,
931933
.ntv_code_to_descr = _topdown_ntv_code_to_descr,
932934
.ntv_code_to_info = _topdown_ntv_code_to_info,
933-
};
935+
};

src/components/topdown/topdown.h

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,9 @@ typedef struct topdown_control_state
7474
#define TOPDOWN_METRIC_IDX_FETCH_LAT 6
7575
#define TOPDOWN_METRIC_IDX_MEM_BOUND 7
7676

77-
/** Holds per thread information */
77+
/* Holds per thread information; however, we do not use this structure,
78+
but the framework still needs its size */
7879
typedef struct topdown_context
7980
{
80-
} _topdown_context_t;
81+
int junk;
82+
} _topdown_context_t;

0 commit comments

Comments
 (0)