Skip to content

Commit baf762d

Browse files
committed
rtc/hwloc/shmem: dump /proc/self/maps if failed to find a hole and verbosity > 4
Signed-off-by: Brice Goglin <[email protected]>
1 parent 8f6afbb commit baf762d

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

orte/mca/rtc/hwloc/rtc_hwloc.c

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -111,6 +111,22 @@ static int init(void)
111111
if (ORTE_SUCCESS != (rc = find_hole(mca_rtc_hwloc_component.kind,
112112
&shmemaddr, shmemsize))) {
113113
/* we couldn't find a hole, so don't use the shmem support */
114+
if (4 < opal_output_get_verbosity(orte_rtc_base_framework.framework_output)) {
115+
FILE *file = fopen("/proc/self/maps", "r");
116+
if (file) {
117+
char line[256];
118+
opal_output(0, orte_rtc_base_framework.framework_output,
119+
"%s Dumping /proc/self/maps", ORTE_NAME_PRINT(ORTE_PROC_MY_NAME));
120+
while (fgets(line, sizeof(line), file) != NULL) {
121+
char *end = strchr(line, '\n');
122+
if (end)
123+
*end = '\0';
124+
opal_output(0, orte_rtc_base_framework.framework_output,
125+
"%s", line);
126+
}
127+
fclose(file);
128+
}
129+
}
114130
return ORTE_SUCCESS;
115131
}
116132
/* create the shmem file in our session dir so it

0 commit comments

Comments
 (0)