Skip to content

Distrib #370

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 135 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
135 commits
Select commit Hold shift + click to select a range
41cb2b8
pci: make Gen5 link speed official
bgoglin May 22, 2019
d93548d
tests: add a x86+linux test
bgoglin May 23, 2019
7dfc677
contrib/ci.inria.fr: fix the retrieval of the current branch name
bgoglin May 23, 2019
c1d84c0
export LDFLAGS upstream in embedded builds.
pavanbalaji May 25, 2019
2cd3e9d
API: add a "dont_merge" group attribute
bgoglin Mar 13, 2019
f3ad5a4
x86: add HWLOC_DONT_MERGE_DIE_GROUPS env var to keep Die groups
bgoglin Mar 13, 2019
c300967
xml+synthetic/import: forward compatibility for possible future Die/T…
bgoglin Mar 14, 2019
3763844
linux/sysfs: abstract-out the functions to find the cpu/node sysfs di…
bgoglin Mar 31, 2019
93572b4
linux/sysfscpu: add support for new topology filenames
bgoglin Feb 25, 2019
5a38247
linux/sysfscpu: add support for dies (as a group for now)
bgoglin Feb 25, 2019
a54a088
linux/sysfscpu: remove the E5v3 CoD split-package kernel bug workaround
bgoglin Feb 25, 2019
4f2be1f
linux/sysfscpu: reduce the scope of some bitmap variables
bgoglin Feb 25, 2019
aa1b81e
API: add a new "Die" object
bgoglin Feb 25, 2019
b953f32
linux+x86: use the new Die object instead of Groups
bgoglin Feb 26, 2019
f4bbc5b
xml: import/export Die from/to v1 as "Group(Die)"
bgoglin Feb 26, 2019
6ac3a72
lstopo/draw: display die logical index by default
bgoglin Mar 21, 2019
9ccfefe
tests/linux: add a fake (Qemu-generated) case with CPUID.1f Dies
bgoglin May 3, 2019
14c2547
doxy: update groups vs v2 Extended Topology Enumeration
bgoglin May 3, 2019
829d3d7
linux: don't forget to insert the distance matrix when annotating
bgoglin May 30, 2019
6180d0e
linux: reoder annotated before parsing/inserting distances
bgoglin May 30, 2019
782e449
NEWS: die and new sysfs cpu filenames will be Linux 5.3, not 5.2
bgoglin May 30, 2019
2a5dccc
.github/issue_template.md: random improvements
bgoglin May 30, 2019
d2b7966
gather-cpuid: add -s --silent for removing verbose messages
bgoglin May 30, 2019
e2dd78b
gather-topology: include the output of gather-cpuid by default when a…
bgoglin May 30, 2019
6e2f5ca
NEWS: bring 1.11.13 and 2.0.4 bullets in master
bgoglin Jun 10, 2019
fe97bb7
contrib/dist/publish_doc: fix when not running from the tarball root
bgoglin Jun 10, 2019
9d6d660
pci: handle a malloc failure
bgoglin Jun 12, 2019
ec99b36
shmem: handle some malloc failures
bgoglin Jun 12, 2019
562d58e
xml/export: handle malloc failures in export_safestrdup()
bgoglin Jun 12, 2019
0652690
core: handle malloc failures when allocating objects
bgoglin Jun 12, 2019
d6d6e10
core: handle malloc failures when building normal levels
bgoglin Jun 12, 2019
2ff9e3d
core: handle malloc failures when building special levels
bgoglin Jun 12, 2019
1a0e956
hwloc-ps.www: bump dependency on "open" node package
bgoglin Jun 20, 2019
03669ea
contrib/ci.inria.fr: update sonarqube server
bgoglin Jun 20, 2019
2f577de
utils: don't force XML/SYNTHETIC_VERBOSE when already set to 0 in the…
bgoglin Jun 21, 2019
819c0cd
linux: don't leak the dax devices directory
bgoglin Jul 1, 2019
cc3dd60
distances: fix API comment indentation
bgoglin Jul 1, 2019
3b0efae
distances: add a hidden id field before public distances
bgoglin Nov 10, 2017
07e03ef
API: add hwloc_distances_release_remove()
bgoglin Jun 28, 2019
c3c2aa8
core: add a name to internal distances structure
bgoglin Jun 26, 2019
1c9ced4
API: add hwloc_distances_get_name() to retrieve the name of a distanc…
bgoglin Jun 26, 2019
fc603c9
API: add hwloc_distances_get_by_name()
bgoglin Jul 1, 2019
3e4bd65
xml/export/distances: abstract-out the function that exports a single…
bgoglin Jun 21, 2019
e98d365
xml/import/distances2: add a missing error message
bgoglin Jun 21, 2019
e8c2888
xml/import/distances2: fix some error messages
bgoglin Jun 21, 2019
7de88a5
components: find() doesn't need to support NULL name anymore
bgoglin Jul 4, 2019
fff3c5a
components: fix the forcing of the pre-v2.0 linuxpci component throug…
bgoglin Jul 4, 2019
6c2e914
components: use blacklisting for managing components excluded in HWLO…
bgoglin Jul 4, 2019
ff7b59a
doxy: remove the devel doc about adding components/plugins
bgoglin Jul 4, 2019
87daabc
distances: support distances between objects whose types are in multi…
bgoglin Jun 18, 2019
ccd84a3
distances: allow inserting distance matrices between objects of diffe…
bgoglin Mar 5, 2019
9946e54
xml/distances: add support for heterogeneous distances
bgoglin Jun 21, 2019
5b78932
tests: add a heterogeneous distances in tests/hwloc/hwloc_distances.c
bgoglin Jun 24, 2019
4f0ec48
tests/xml: add a test with heterogeneous distances
bgoglin Jun 24, 2019
b0a2e82
distances: hwloc_distances_get_by_type() isn't inline on top of by_de…
bgoglin Jun 30, 2019
29ec736
distances: fix some leaks of the array of heterogeneous types
bgoglin Jul 11, 2019
0ce91be
linux: fix a memory leak in the KNL case
bgoglin Jul 11, 2019
dc88241
xml/export/v1/memory: change a variable to signed int
bgoglin Jul 11, 2019
c287f5c
API: fix the doc of hwloc_topology_get_*set
bgoglin Jul 12, 2019
a37b191
internal+shmem: unbump the topology ABI
bgoglin Jul 15, 2019
7afed19
distances: reorganize and clarify internal structure fields
bgoglin Jul 15, 2019
1973068
distances: use a generic flag bitmask for internal distances flags
bgoglin Jul 15, 2019
0937067
utils: bring back tests under mingw32
bgoglin Jul 16, 2019
32992ad
tests/lstopo: fix some messages
bgoglin Jul 15, 2019
ac5ef05
lstopo: add (undocumented) shmem import/export
bgoglin Jul 15, 2019
0d3b01f
lstopo: add a shmem test
bgoglin Jul 16, 2019
7cf08d5
configure: reindent chmoding-scripts
bgoglin Jul 16, 2019
d68d127
lstopo/shmem: fix some printf format issues
bgoglin Jul 17, 2019
b056c66
tests+example: fix some printf format warnings
bgoglin Jul 28, 2019
07f9e9c
tests: add a basic test for static/dynamic api version
bgoglin Jul 29, 2019
c807a49
tests/api: fix a typo
bgoglin Jul 29, 2019
6357cdc
.github: add contributing.md
bgoglin Jul 30, 2019
e934640
linux: only close the root_fd if needed
bgoglin Jul 31, 2019
0f5a0cd
components: remove stringified component types
bgoglin Apr 17, 2019
f107fa8
core: move the discovery status to the caller
bgoglin Jul 4, 2019
0156c58
core: abstract-out the iterations over backends' discover() callbacks
bgoglin Apr 17, 2019
8e19b0b
core: use phases for component types and for splitting discovery steps
bgoglin Apr 17, 2019
e79c628
components: add many more phases
bgoglin May 4, 2019
65f2f9f
components: pass the mask of excluded_phases to the instantiate() cal…
bgoglin Jul 8, 2019
518c378
components: allow backends to dynamically disable some phases
bgoglin Jul 12, 2019
0772109
components: allow blacklisting of individual phases
bgoglin Jul 17, 2019
23ff4d7
linuxio: split in phases
bgoglin May 4, 2019
9ee8114
components: cleanup the managing of linuxpci->linuxio component renaming
bgoglin Aug 5, 2019
6c585b5
pci+linuxio: remove the PCI_DONE discovery status flag
bgoglin May 4, 2019
913d990
pci/names: use pci_get_strings() to get vendor/device names
bgoglin Apr 26, 2019
4a5bb53
pci: split a annotate discovery phase for vendor/device names
bgoglin May 4, 2019
ba40ddf
fsroot+pci: allow the pci backend to add vendor/device ids on modifie…
bgoglin May 4, 2019
e3c32f1
components: add envvar to annotate global components
bgoglin May 6, 2019
a95ee37
linux: merge the linuxio component back into the main linux component
bgoglin May 6, 2019
10e86cd
tests/fake: check a TWEAK phase in the fake component
bgoglin Jul 17, 2019
95e01aa
utils/calc+bind: add --no-smt to keep a single PU per core
bgoglin Aug 6, 2019
e06d3b6
lstopo: add --no-smt which just ignore PUs as existing filters
bgoglin Aug 6, 2019
77af96d
doxy: make a specific FAQ section about api/abi versions
bgoglin Aug 5, 2019
fce46ae
doxy: add entries about XML/synthetic/shmem compatibility between rev…
bgoglin Aug 6, 2019
82453e0
hwloc-calc.1: use "all" instead of "machine:0"
bgoglin Aug 7, 2019
3da00f6
hwloc-bind/calc.1: examples with --no-smt
bgoglin Aug 7, 2019
9fbab19
keep_structure: only merge levels which are actually parent/children
bgoglin Aug 9, 2019
b8001fb
tests/x86: add an intel cascadelake example
bgoglin Sep 5, 2019
5636b0b
nolibxml: fix a the exporting of content inside a xml node
bgoglin Sep 18, 2019
ef93108
linux: add HWLOC_USE_NUMA_DISTANCES envvar to disable new node locali…
bgoglin Sep 18, 2019
e2c0def
solaris: also support HWLOC_USE_NUMA_DISTANCES env var
bgoglin Sep 18, 2019
51ff3ed
linuxio: ude dev_port in favor of dev_id when available in net device…
bgoglin Sep 18, 2019
962225e
lstopo/draw: make sure we always remove the separator between PU boxes
bgoglin Sep 19, 2019
086382b
NEWS: cleanup for 2.1
bgoglin Sep 20, 2019
32a00af
.gitignore: update
bgoglin Sep 23, 2019
74d90f9
NEWS: missing line
bgoglin Sep 23, 2019
0b4be95
Revert the unrelated VERSION change in ".gitignore: update"
bgoglin Sep 23, 2019
2c5f277
VERSION: master is now 2.2.0
bgoglin Sep 23, 2019
23f6cf0
lstopo/draw: fix (again) the separator between boxes
bgoglin Sep 24, 2019
b42cfd7
contrib/windows: better build directories to avoid conflicts between …
bgoglin Sep 25, 2019
902b8e8
contrib/windows: move dependencies to each tool vcxproj file
bgoglin Sep 25, 2019
228d922
contrib/windows: add SolutionGuid
bgoglin Sep 25, 2019
1628524
contrib/windows: bump the default VS version to something recent
bgoglin Sep 25, 2019
9c63754
contrib/windows: build for Windows 10 by default
bgoglin Sep 25, 2019
245cab4
contrib/windows: update README
bgoglin Sep 25, 2019
a052465
contrib/ci.inria.fr: fix a typo in verbose messages
bgoglin Oct 1, 2019
788281b
contrib/ci.inria.fr: better names for sonarqube build parameters
bgoglin Oct 1, 2019
3f07103
contrib/ci.inria.fr: add a coverity job
bgoglin Oct 1, 2019
852bcb4
contrib/ci.inria.fr: fix quotes to avoid invalid error messages
bgoglin Oct 2, 2019
740c88e
linux+API: Remove support for Intel Xeon Phi (MIC, Knights Corner) co…
bgoglin Oct 4, 2019
ef32791
doxy: fix a typo
bgoglin Oct 16, 2019
81126f3
doxy+rename: clarify capital name renaming
bgoglin Oct 16, 2019
fb22c1c
Add functions for distributing objects of the topology
Oct 20, 2019
3bef693
xml/export: cleanup the exporting of allowed sets
bgoglin Oct 21, 2019
abfa3dd
core: AND allowed sets with normal sets in the allow(LOCAL) case
bgoglin Oct 21, 2019
e62d3d8
utils: fix --flags/--thissystem when using a fake fsroot or cpuid dir…
bgoglin Oct 21, 2019
84cf88f
linux: fix a mntent leak on failure to allocate a buffer
bgoglin Oct 21, 2019
4974f11
implement new policy in hwloc-distrib utility
Oct 21, 2019
b761026
update man page for new distrib command
Oct 21, 2019
5cf6a5a
Various fixes
Oct 21, 2019
51be27c
Various fixes
Oct 21, 2019
3f6eee3
distrib API renaming
Oct 22, 2019
2fd3172
remove compare fn cast
Oct 22, 2019
9533b3b
add distrib to hwloc build
Oct 22, 2019
cbb230a
fix visualstudio build
Oct 22, 2019
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
API: add a "dont_merge" group attribute
This tells the code not to ever merge that group with structurally-identical
parent or children.

This is useful for Groups implementing new "types" that cannot be backported
to stable releases. New types won't be merged by default, but Groups would.

Requested by Intel for Die objects.

This doesn't break the ABI because the attribute structure has always been
calloc'ed, which means this attribute was "0", which matches the default
"merge group" behavior.

Signed-off-by: Brice Goglin <[email protected]>
  • Loading branch information
bgoglin authored and ndenoyelle committed Oct 22, 2019
commit 2cd3e9d0a770d75269975de001de259316a0646d
2 changes: 2 additions & 0 deletions NEWS
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,8 @@ Version 2.1.0
administrative restrictions such as Linux Cgroups.
- Add disallowed_pu and disallowed_numa bits to the discovery support
structure.
+ Group objects have a new "dont_merge" attribute to prevent them from
being automatically merged with identical parent or children.
* Backends
+ Add support for Intel v2 Extended Topology Enumeration in the x86 backend.
Tiles, Modules and Dies are exposed as Groups for now.
Expand Down
5 changes: 4 additions & 1 deletion doc/hwloc.doxy
Original file line number Diff line number Diff line change
Expand Up @@ -3106,9 +3106,12 @@ It means that a Group containing a single child is merged
into that child.
And a Group is merged into its parent if it is its only child.
For instance a Windows processor group containing a single NUMA node
would be merged with that NUMA node since it already contains the
would be merged with that NUMA node since it already contains the
relevant hierarchy information.

When inserting a custom Group with hwloc_hwloc_topology_insert_group_object(),
this merging may be disabled by setting its <tt>dont_merge</tt> attribute.


\subsection faq_asymmetric What happens if my topology is asymmetric?

Expand Down
1 change: 1 addition & 0 deletions hwloc/hwloc2.dtd
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@
<!ATTLIST object depth CDATA "-1" >
<!ATTLIST object kind CDATA "0" >
<!ATTLIST object subkind CDATA "0" >
<!ATTLIST object dont_merge CDATA "0" >
<!ATTLIST object bridge_type CDATA "" >
<!ATTLIST object bridge_pci CDATA "" >
<!ATTLIST object pci_busid CDATA "" >
Expand Down
13 changes: 13 additions & 0 deletions hwloc/topology-xml.c
Original file line number Diff line number Diff line change
Expand Up @@ -238,6 +238,15 @@ hwloc__xml_import_object_attr(struct hwloc_topology *topology,
state->global->msgprefix);
}

else if (!strcmp(name, "dont_merge")) {
unsigned long lvalue = strtoul(value, NULL, 10);
if (obj->type == HWLOC_OBJ_GROUP)
obj->attr->group.dont_merge = lvalue;
else if (hwloc__xml_verbose())
fprintf(stderr, "%s: ignoring dont_merge attribute for non-group object type\n",
state->global->msgprefix);
}

else if (!strcmp(name, "pci_busid")) {
switch (obj->type) {
case HWLOC_OBJ_PCI_DEVICE:
Expand Down Expand Up @@ -2058,11 +2067,15 @@ hwloc__xml_export_object_contents (hwloc__xml_export_state_t state, hwloc_topolo
if (v1export) {
sprintf(tmp, "%u", obj->attr->group.depth);
state->new_prop(state, "depth", tmp);
if (obj->attr->group.dont_merge)
state->new_prop(state, "dont_merge", "1");
} else {
sprintf(tmp, "%u", obj->attr->group.kind);
state->new_prop(state, "kind", tmp);
sprintf(tmp, "%u", obj->attr->group.subkind);
state->new_prop(state, "subkind", tmp);
if (obj->attr->group.dont_merge)
state->new_prop(state, "dont_merge", "1");
}
break;
case HWLOC_OBJ_BRIDGE:
Expand Down
66 changes: 50 additions & 16 deletions hwloc/topology.c
Original file line number Diff line number Diff line change
Expand Up @@ -1268,8 +1268,30 @@ merge_insert_equal(hwloc_obj_t new, hwloc_obj_t old)
static __hwloc_inline hwloc_obj_t
hwloc__insert_try_merge_group(hwloc_obj_t old, hwloc_obj_t new)
{
if (new->type == HWLOC_OBJ_GROUP) {
/* Groups are ignored keep_structure or always. Non-ignored Groups isn't possible (asserted in topology_check()). */
if (new->type == HWLOC_OBJ_GROUP && old->type == HWLOC_OBJ_GROUP) {
/* which group do we keep? */
if (new->attr->group.dont_merge) {
if (old->attr->group.dont_merge)
/* nobody wants to be merged */
return NULL;

/* keep the new one, it doesn't want to be merged */
hwloc_replace_linked_object(old, new);
return new;

} else {
if (old->attr->group.dont_merge)
/* keep the old one, it doesn't want to be merged */
return old;

/* compare subkinds to decice who to keep */
if (new->attr->group.kind < old->attr->group.kind)
hwloc_replace_linked_object(old, new);
return old;
}
}

if (new->type == HWLOC_OBJ_GROUP && !new->attr->group.dont_merge) {

if (old->type == HWLOC_OBJ_PU && new->attr->group.kind == HWLOC_GROUP_KIND_MEMORY)
/* Never merge Memory groups with PU, we don't want to attach Memory under PU */
Expand All @@ -1278,18 +1300,9 @@ hwloc__insert_try_merge_group(hwloc_obj_t old, hwloc_obj_t new)
/* Remove the Group now. The normal ignore code path wouldn't tell us whether the Group was removed or not,
* while some callers need to know (at least hwloc_topology_insert_group()).
*/

/* If merging two groups, keep the smallest kind.
* Replace the existing Group with the new Group contents
* and let the caller free the new Group.
*/
if (old->type == HWLOC_OBJ_GROUP
&& (new->attr->group.kind < old->attr->group.kind))
hwloc_replace_linked_object(old, new);

return old;

} else if (old->type == HWLOC_OBJ_GROUP) {
} else if (old->type == HWLOC_OBJ_GROUP && !old->attr->group.dont_merge) {

if (new->type == HWLOC_OBJ_PU && old->attr->group.kind == HWLOC_GROUP_KIND_MEMORY)
/* Never merge Memory groups with PU, we don't want to attach Memory under PU */
Expand All @@ -1300,9 +1313,11 @@ hwloc__insert_try_merge_group(hwloc_obj_t old, hwloc_obj_t new)
*/
hwloc_replace_linked_object(old, new);
return old;
}

return NULL;
} else {
/* cannot merge */
return NULL;
}
}

/*
Expand Down Expand Up @@ -2291,6 +2306,19 @@ hwloc_reset_normal_type_depths(hwloc_topology_t topology)
/* type contiguity is asserted in topology_check() */
}

static int
hwloc_dont_merge_group_level(hwloc_topology_t topology, unsigned i)
{
unsigned j;

/* Don't merge some groups in that level? */
for(j=0; j<topology->level_nbobjects[i]; j++)
if (topology->levels[i][j]->attr->group.dont_merge)
return 1;

return 0;
}

/* compare i-th and i-1-th levels structure */
static int
hwloc_compare_levels_structure(hwloc_topology_t topology, unsigned i)
Expand Down Expand Up @@ -2328,12 +2356,18 @@ hwloc_filter_levels_keep_structure(hwloc_topology_t topology)
hwloc_obj_type_t type2 = obj2->type;

/* Check whether parents and/or children can be replaced */
if (topology->type_filter[type1] == HWLOC_TYPE_FILTER_KEEP_STRUCTURE)
if (topology->type_filter[type1] == HWLOC_TYPE_FILTER_KEEP_STRUCTURE) {
/* Parents can be ignored in favor of children. */
replaceparent = 1;
if (topology->type_filter[type2] == HWLOC_TYPE_FILTER_KEEP_STRUCTURE)
if (type1 == HWLOC_OBJ_GROUP && hwloc_dont_merge_group_level(topology, i-1))
replaceparent = 0;
}
if (topology->type_filter[type2] == HWLOC_TYPE_FILTER_KEEP_STRUCTURE) {
/* Children can be ignored in favor of parents. */
replacechild = 1;
if (type1 == HWLOC_OBJ_GROUP && hwloc_dont_merge_group_level(topology, i))
replacechild = 0;
}
if (!replacechild && !replaceparent)
/* no ignoring */
continue;
Expand Down
4 changes: 4 additions & 0 deletions include/hwloc.h
Original file line number Diff line number Diff line change
Expand Up @@ -604,6 +604,7 @@ union hwloc_obj_attr_u {
* It may change if intermediate Group objects are added. */
unsigned kind; /**< \brief Internally-used kind of group. */
unsigned subkind; /**< \brief Internally-used subkind to distinguish different levels of groups with same kind */
unsigned char dont_merge; /**< \brief Flag preventing groups from being automatically merged with identical parent or children. */
} group;
/** \brief PCI Device specific Object Attributes */
struct hwloc_pcidev_attr_s {
Expand Down Expand Up @@ -2306,6 +2307,9 @@ HWLOC_DECLSPEC hwloc_obj_t hwloc_topology_alloc_group_object(hwloc_topology_t to
* the final location of the Group in the topology.
* Then the object can be passed to this function for actual insertion in the topology.
*
* The group \p dont_merge attribute may be set to prevent the core from
* ever merging this object with another object hierarchically-identical.
*
* Either the cpuset or nodeset field (or both, if compatible) must be set
* to a non-empty bitmap. The complete_cpuset or complete_nodeset may be set
* instead if inserting with respect to the complete topology
Expand Down