Skip to content

Commit 45f5e07

Browse files
committed
core: move some root info attrs to topology infos
Topology discovery and backend information: * Backend * SyntheticDescription * hwlocVersion * ProcessName OS information: * uname stuff (OSName, OSRelease, OSVersion, HostName, Architecture) * LinuxCgroup * WindowsBuildEnvironment Hardware info (DMI, CPU when in root because Package locality is missing, etc) remains in root. Signed-off-by: Brice Goglin <[email protected]>
1 parent 290a313 commit 45f5e07

File tree

145 files changed

+389
-374
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

145 files changed

+389
-374
lines changed

NEWS

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,10 @@ Version 3.0.0
3939
- hwloc_infos_s structures may be modified with hwloc_modify_infos().
4040
- hwloc_topology_get_infos() returns the new topology-global array
4141
of info attributes.
42+
. Several info attributes previously stored in the root object are
43+
now topology attributes (e.g. information about hwloc, about the
44+
discovery, operating system information returned by uname).
45+
See "Custom string infos" in the documentation for details.
4246
- hwloc_cpukinds_get_info() and hwloc_cpukinds_register() now manipulate
4347
infos as such a structure.
4448
* Tools

doc/hwloc.doxy

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2023,7 +2023,7 @@ See doc/examples/get-knl-modes.c in the source directory for an example of retri
20232023
\endhtmlonly
20242024
\subsection attributes_info_os Operating System Information
20252025

2026-
These info attributes are attached to the root object (Machine).
2026+
These info attributes are attached to the topology itself.
20272027

20282028
<dl>
20292029
<dt>OSName, OSRelease, OSVersion, HostName, Architecture</dt>
@@ -2043,12 +2043,12 @@ placed.
20432043
\htmlonly
20442044
</div><div class="subsection" id="attributes_info_hwloc">
20452045
\endhtmlonly
2046-
\subsection attributes_info_hwloc hwloc Information
2046+
\subsection attributes_info_hwloc hwloc Topology Information
20472047

2048-
Unless specified, these info attributes are attached to the root object (Machine).
2048+
These info attributes are attached to the topology itself.
20492049

20502050
<dl>
2051-
<dt>Backend (topology root object)</dt>
2051+
<dt>Backend</dt>
20522052
<dd>The name of a hwloc backend/component that added objects in the topology.
20532053
If several components were combined, multiple Backend pairs may exist,
20542054
with different values, for instance <tt>x86</tt>, <tt>Linux</tt> and

hwloc/misc.c

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/*
22
* Copyright © 2009 CNRS
3-
* Copyright © 2009-2022 Inria. All rights reserved.
3+
* Copyright © 2009-2023 Inria. All rights reserved.
44
* Copyright © 2009-2010 Université Bordeaux
55
* Copyright © 2009-2018 Cisco Systems, Inc. All rights reserved.
66
* See COPYING in top-level directory.
@@ -86,7 +86,7 @@ void hwloc_add_uname_info(struct hwloc_topology *topology __hwloc_attribute_unus
8686
#ifdef HAVE_UNAME
8787
struct utsname _utsname, *utsname;
8888

89-
if (hwloc_obj_get_info_by_name(topology->levels[0][0], "OSName"))
89+
if (hwloc_get_info_by_name(&topology->infos, "OSName"))
9090
/* don't annotate twice */
9191
return;
9292

@@ -99,15 +99,15 @@ void hwloc_add_uname_info(struct hwloc_topology *topology __hwloc_attribute_unus
9999
}
100100

101101
if (*utsname->sysname)
102-
hwloc_obj_add_info(topology->levels[0][0], "OSName", utsname->sysname);
102+
hwloc__add_info(&topology->infos, "OSName", utsname->sysname);
103103
if (*utsname->release)
104-
hwloc_obj_add_info(topology->levels[0][0], "OSRelease", utsname->release);
104+
hwloc__add_info(&topology->infos, "OSRelease", utsname->release);
105105
if (*utsname->version)
106-
hwloc_obj_add_info(topology->levels[0][0], "OSVersion", utsname->version);
106+
hwloc__add_info(&topology->infos, "OSVersion", utsname->version);
107107
if (*utsname->nodename)
108-
hwloc_obj_add_info(topology->levels[0][0], "HostName", utsname->nodename);
108+
hwloc__add_info(&topology->infos, "HostName", utsname->nodename);
109109
if (*utsname->machine)
110-
hwloc_obj_add_info(topology->levels[0][0], "Architecture", utsname->machine);
110+
hwloc__add_info(&topology->infos, "Architecture", utsname->machine);
111111
#endif /* HAVE_UNAME */
112112
}
113113

hwloc/topology-aix.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -817,7 +817,7 @@ hwloc_look_aix(struct hwloc_backend *backend, struct hwloc_disc_status *dstatus)
817817
}
818818
}
819819

820-
hwloc_obj_add_info(topology->levels[0][0], "Backend", "AIX");
820+
hwloc__add_info(&topology->infos, "Backend", "AIX");
821821
hwloc_add_uname_info(topology, NULL);
822822
return 0;
823823
}

hwloc/topology-cuda.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -142,7 +142,7 @@ hwloc_cuda_discover(struct hwloc_backend *backend, struct hwloc_disc_status *dst
142142
}
143143

144144
if (added > 0)
145-
hwloc_obj_add_info(hwloc_get_root_obj(topology), "Backend", "CUDA");
145+
hwloc_modify_infos(hwloc_topology_get_infos(topology), HWLOC_MODIFY_INFOS_OP_ADD, "Backend", "CUDA");
146146
return 0;
147147
}
148148

hwloc/topology-darwin.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -903,7 +903,7 @@ hwloc_look_darwin(struct hwloc_backend *backend, struct hwloc_disc_status *dstat
903903
else
904904
hwloc__darwin_cpukinds_register(topology, &kinds);
905905

906-
hwloc_obj_add_info(topology->levels[0][0], "Backend", "Darwin");
906+
hwloc__add_info(&topology->infos, "Backend", "Darwin");
907907
hwloc_add_uname_info(topology, NULL);
908908
return 0;
909909
}

hwloc/topology-freebsd.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -553,7 +553,7 @@ hwloc_look_freebsd(struct hwloc_backend *backend, struct hwloc_disc_status *dsta
553553
}
554554

555555
if (data->need_global_infos) {
556-
hwloc_obj_add_info(topology->levels[0][0], "Backend", "FreeBSD");
556+
hwloc__add_info(&topology->infos, "Backend", "FreeBSD");
557557
hwloc_add_uname_info(topology, NULL);
558558
data->need_global_infos = 0;
559559
}

hwloc/topology-gl.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -142,7 +142,7 @@ hwloc_gl_discover(struct hwloc_backend *backend, struct hwloc_disc_status *dstat
142142
}
143143

144144
if (added)
145-
hwloc_obj_add_info(hwloc_get_root_obj(topology), "Backend", "GL");
145+
hwloc_modify_infos(hwloc_topology_get_infos(topology), HWLOC_MODIFY_INFOS_OP_ADD, "Backend", "GL");
146146
return 0;
147147
}
148148

hwloc/topology-hardwired.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ int hwloc_look_hardwired_fujitsu_k(struct hwloc_topology *topology)
7373
topology->support.discovery->pu = 1;
7474
hwloc_setup_pu_level(topology, 8);
7575

76-
hwloc_obj_add_info(topology->levels[0][0], "Backend", "hardwired:K-computer");
76+
hwloc__add_info(&topology->infos, "Backend", "hardwired:K-computer");
7777
return 0;
7878
}
7979

@@ -143,7 +143,7 @@ int hwloc_look_hardwired_fujitsu_fx10(struct hwloc_topology *topology)
143143
topology->support.discovery->pu = 1;
144144
hwloc_setup_pu_level(topology, 16);
145145

146-
hwloc_obj_add_info(topology->levels[0][0], "Backend", "hardwired:FX10");
146+
hwloc__add_info(&topology->infos, "Backend", "hardwired:FX10");
147147
return 0;
148148
}
149149

@@ -223,6 +223,6 @@ int hwloc_look_hardwired_fujitsu_fx100(struct hwloc_topology *topology)
223223
topology->support.discovery->pu = 1;
224224
hwloc_setup_pu_level(topology, 34);
225225

226-
hwloc_obj_add_info(topology->levels[0][0], "Backend", "hardwired:FX100");
226+
hwloc__add_info(&topology->infos, "Backend", "hardwired:FX100");
227227
return 0;
228228
}

hwloc/topology-hpux.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -271,7 +271,7 @@ hwloc_look_hpux(struct hwloc_backend *backend, struct hwloc_disc_status *dstatus
271271
topology->support.discovery->numa = 1;
272272
/* don't set disallowed_{pu,numa} since we don't set the allowed sets */
273273

274-
hwloc_obj_add_info(topology->levels[0][0], "Backend", "HP-UX");
274+
hwloc__add_info(&topology->infos, "Backend", "HP-UX");
275275
hwloc_add_uname_info(topology, NULL);
276276

277277
free(nodes);

0 commit comments

Comments
 (0)