Skip to content

Commit 41e7d36

Browse files
committed
noos: add a Backend info attr
Signed-off-by: Brice Goglin <[email protected]>
1 parent a2784e5 commit 41e7d36

File tree

2 files changed

+5
-2
lines changed

2 files changed

+5
-2
lines changed

hwloc/topology-noos.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@ hwloc_look_noos(struct hwloc_backend *backend, struct hwloc_disc_status *dstatus
3535
nbprocs = 1;
3636
hwloc_alloc_root_sets(topology->levels[0][0]);
3737
hwloc_setup_pu_level(topology, nbprocs);
38+
hwloc_obj_add_info(topology->levels[0][0], "Backend", "noOS");
3839
}
3940

4041
memsize = hwloc_fallback_memsize();

tests/hwloc/hwloc_backends.c

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ int main(void)
7878
char xmlfile[] = "hwloc_backends.tmpxml.XXXXXX";
7979
char env[64];
8080
int xmlbufok = 0, xmlfileok = 0, xmlfilefd;
81-
const char *orig_backend_name;
81+
const char *orig_backend_name, *backend_name;
8282
int err;
8383

8484
putenv((char *) "HWLOC_LIBXML_CLEANUP=1");
@@ -257,7 +257,9 @@ int main(void)
257257
assert(!err);
258258
#endif
259259
hwloc_topology_load(topology1);
260-
assert(!get_backend_name(topology1)); /* noos doesn't put any Backend info attr */
260+
backend_name = get_backend_name(topology1);
261+
assert(backend_name);
262+
assert(!strcmp(backend_name, "noOS"));
261263
hwloc_topology_check(topology1);
262264
assert(hwloc_topology_is_thissystem(topology1));
263265
hwloc_topology_destroy(topology1);

0 commit comments

Comments
 (0)