Fix a pair of minor errors in the affinity MPI extension.
* Use the right length for memset/strncpy * Return the set return value (vs. unconditionally returning OMPI_SUCCESS) cmr=v1.7.4:reviewer=dgoodell:subject=Fix a pair of minor errors in the affinity MPI extension This commit was SVN r29427.
Этот коммит содержится в:
родитель
b5e2ae86ad
Коммит
eabbcd1157
@ -52,14 +52,14 @@ int OMPI_Affinity_str(ompi_affinity_fmt_t fmt_type,
|
|||||||
{
|
{
|
||||||
int ret;
|
int ret;
|
||||||
|
|
||||||
memset(ompi_bound, 0, sizeof(ompi_bound));
|
memset(ompi_bound, 0, OMPI_AFFINITY_STRING_MAX);
|
||||||
memset(current_binding, 0, sizeof(current_binding));
|
memset(current_binding, 0, OMPI_AFFINITY_STRING_MAX);
|
||||||
|
|
||||||
/* If we have no hwloc support, return nothing */
|
/* If we have no hwloc support, return nothing */
|
||||||
if (NULL == opal_hwloc_topology) {
|
if (NULL == opal_hwloc_topology) {
|
||||||
strncpy(ompi_bound, "Not supported", sizeof(ompi_bound));
|
strncpy(ompi_bound, "Not supported", OMPI_AFFINITY_STRING_MAX);
|
||||||
strncpy(current_binding, "Not supported", sizeof(current_binding));
|
strncpy(current_binding, "Not supported", OMPI_AFFINITY_STRING_MAX);
|
||||||
strncpy(exists, "Not supported", sizeof(exists));
|
strncpy(exists, "Not supported", OMPI_AFFINITY_STRING_MAX);
|
||||||
return MPI_SUCCESS;
|
return MPI_SUCCESS;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -153,7 +153,7 @@ static int get_rsrc_current_binding(char str[OMPI_AFFINITY_STRING_MAX])
|
|||||||
}
|
}
|
||||||
hwloc_bitmap_free(boundset);
|
hwloc_bitmap_free(boundset);
|
||||||
|
|
||||||
return OMPI_SUCCESS;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -333,7 +333,7 @@ static int get_layout_current_binding(char str[OMPI_AFFINITY_STRING_MAX])
|
|||||||
}
|
}
|
||||||
hwloc_bitmap_free(boundset);
|
hwloc_bitmap_free(boundset);
|
||||||
|
|
||||||
return OMPI_SUCCESS;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
Загрузка…
x
Ссылка в новой задаче
Block a user