Skip to content

Commit ab8f1f5

Browse files
Merge pull request #276 from bratpiorka/rrudnick_hwloc_err
return error when hwloc_get_nbobjs_by_type fails
2 parents 80c2e6d + 0d287d8 commit ab8f1f5

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/memspaces/memspace_host_all.c

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,10 @@ static umf_result_t umfMemspaceHostAllCreate(umf_memspace_handle_t *hMemspace) {
4040
// object that can be present on multiple levels.
4141
// Source: https://www.open-mpi.org/projects/hwloc/doc/hwloc-v2.10.0-letter.pdf
4242
int nNodes = hwloc_get_nbobjs_by_type(topology, HWLOC_OBJ_NUMANODE);
43-
assert(nNodes != -1);
43+
if (nNodes < 0) {
44+
umf_ret = UMF_RESULT_ERROR_UNKNOWN;
45+
goto err_topology_destroy;
46+
}
4447

4548
size_t *nodeIds = umf_ba_global_alloc(nNodes * sizeof(size_t));
4649
if (!nodeIds) {

0 commit comments

Comments
 (0)