Skip to content
This repository was archived by the owner on Sep 30, 2022. It is now read-only.

Commit 37fc38f

Browse files
committed
Merge pull request #494 from hppritcha/topic/cherry_pick_db3c59b9
Silence a warning by converting the bitmap to a string prior to print…
2 parents e120ddc + bae87db commit 37fc38f

File tree

1 file changed

+4
-10
lines changed

1 file changed

+4
-10
lines changed

orte/mca/rtc/hwloc/rtc_hwloc.c

Lines changed: 4 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -103,14 +103,16 @@ static void set(orte_job_t *jobdat,
103103
rc = hwloc_set_cpubind(opal_hwloc_topology, sum->available, 0);
104104
/* if we got an error and this wasn't a default binding policy, then report it */
105105
if (rc < 0 && OPAL_BINDING_POLICY_IS_SET(jobdat->map->binding)) {
106-
char *tmp = NULL;
107106
if (errno == ENOSYS) {
108107
msg = "hwloc indicates cpu binding not supported";
109108
} else if (errno == EXDEV) {
110109
msg = "hwloc indicates cpu binding cannot be enforced";
111110
} else {
111+
char *tmp;
112+
(void)hwloc_bitmap_list_asprintf(&tmp, sum->available);
112113
asprintf(&msg, "hwloc_set_cpubind returned \"%s\" for bitmap \"%s\"",
113-
opal_strerror(rc), sum->available);
114+
opal_strerror(rc), tmp);
115+
free(tmp);
114116
}
115117
if (OPAL_BINDING_REQUIRED(jobdat->map->binding)) {
116118
/* If binding is required, send an error up the pipe (which exits
@@ -124,16 +126,8 @@ static void set(orte_job_t *jobdat,
124126
"help-orte-odls-default.txt", "not bound",
125127
orte_process_info.nodename, context->app, msg,
126128
__FILE__, __LINE__);
127-
if (NULL != tmp) {
128-
free(tmp);
129-
free(msg);
130-
}
131129
return;
132130
}
133-
if (NULL != tmp) {
134-
free(tmp);
135-
free(msg);
136-
}
137131
}
138132
}
139133
if (0 == rc && opal_hwloc_report_bindings) {

0 commit comments

Comments
 (0)