Skip to content

Commit 860afe4

Browse files
committed
utils: warn if a cmdline location was translated into no actual object
Signed-off-by: Brice Goglin <[email protected]>
1 parent 4939550 commit 860afe4

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

utils/hwloc/hwloc-calc.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -303,6 +303,7 @@ hwloc_calc_append_object_range(struct hwloc_calc_location_context_s *lcontext,
303303
int nextdepth = -1;
304304
int first, wrap, amount, step;
305305
unsigned i,j;
306+
int found = 0;
306307
int err;
307308

308309
err = hwloc_calc_parse_range(string,
@@ -373,6 +374,7 @@ hwloc_calc_append_object_range(struct hwloc_calc_location_context_s *lcontext,
373374
free(sn);
374375
}
375376
if (obj) {
377+
found++;
376378
if (dot) {
377379
hwloc_calc_append_object_range(lcontext, obj->cpuset, obj->nodeset, nextdepth, nextsep+1, cbfunc, cbdata);
378380
} else {
@@ -383,6 +385,8 @@ hwloc_calc_append_object_range(struct hwloc_calc_location_context_s *lcontext,
383385
}
384386
}
385387
}
388+
if (!found && verbose >= 0)
389+
fprintf(stderr, "failed to use any single object in index range %s\n", string);
386390

387391
return 0;
388392
}

0 commit comments

Comments
 (0)