HWLOC-PATCH(1)
π HWLOC-PATCH π
okay so bestie, welcome to hwloc-patch β it lives over in the hwloc manual family, and it's the little utility that takes a topology difference and slaps it onto an existing XML topology. yes, it's giving β¨surgery for topology filesβ¨ and honestly? obsessed.
πΈ NAME πΈ
hwloc-patch β apply a topology difference to an existing XML topology. that's it, that's the whole vibe. π
π¦ SYNOPSIS π¦
hwloc-patch [options] [<topology.xml> | refname] [<diff.xml> | -]
[<output.xml> | -]
hwloc-patch [options] [<topology.xml> | refname] [<diff.xml> | -]
so there are literally two shapes you can call it in β one of them lets you also point at an output spot, the other one doesn't (and lowkey that means it patches in place, we'll get to that). π«Ά
β¨ OPTIONS β¨
-R,--reverseβ flip it π reverse the sense of the difference file. yes literally, the whole patch goes the other direction.--dry-runβ check whether the patch would apply, but do not actually write the result out anywhere. it's the "just looking π§" option, no cap.--versionβ report the version and exit. boom, done, bye π-h,--helpβ display the help message and exit. the classic, the icon, the main character π
π DESCRIPTION π
so like, hwloc-patch loads the difference between two topologies from an XML file (or from standard input, if you're being spicy) and applies it to an existing topology, generating a new, modified one. it's literally a glow-up for your topology file π
that XML difference may have been computed earlier with hwloc-diff or hwloc-compress-dir. iykyk.
here's how the output situation works, because this is the part that trips people up:
- if
<output.xml>is given, the new, modified topology gets stored in that new file π - if
-is given as an output, the modified topology is sent to stdout π - if no output is given,
<topology.xml>is modified in place π«£ (yes, in place. the original. gone. be sure bestie!!)
and then there's refname β if refname is given instead of <topology.xml>, the input topology filename is automatically guessed by reading the refname field of the XML diff file. so you don't have to type the filename at all, the diff file just knows. slay. β¨ by default, hwloc-diff generates XML diffs with the right reference topology filename (without any path prefix), so this Just Works.
if - is given instead of <diff.xml>, the topology difference is read from standard input π§
NOTE: if some application-specific userdata were been exported to the input XMLs, they will be ignored and discarded from the output, because hwloc has no way to understand and patch them π not its fault, it just can't read them, okay?
NOTE: it is highly recommended that you read thehwloc(7)overview page before reading this man page. most of the concepts described inhwloc(7)directly apply to thehwloc-patchutility. do your homework bestie, it's for your own good π
π EXAMPLES π
hwloc-patch's operation is best described through several examples. and honestly, examples are the moment, they ate. let's go π₯
apply a XML topology difference file to an existing topology:
$ hwloc-patch fourmi023.xml diff.xml fourmi023-new.xml
check if a XML topology difference file could apply to an existing topology but do not apply it:
$ hwloc-patch --dry-run fourmi023.xml diff.xml
apply a XML topology difference file whose refname field contains the right input topology:
$ hwloc-patch refname diff.xml fourmi023-new.xml
apply a XML topology from the standard intput:
$ cat diff.xml | hwloc-patch fourmi023.xml - fourmi023-new.xml
directly compute the difference between two topologies and apply it to another one, in place:
$ hwloc-diff fourmi023.xml fourmi024.xml | hwloc-patch fourmi025.xml -
β RETURN VALUE β
upon successful execution, hwloc-patch outputs the modified topology. the return value is 0 β
hwloc-patch also returns nonzero if any kind of error occurs, such as (but not limited to) failure to parse the command line π so like, always check your exit codes, bestie. fr fr.
π¦ SEE ALSO π¦
hwloc(7), lstopo(1), hwloc-diff(1), hwloc-compress-dir(1)
okay that's the whole page, you're officially a hwloc-patch girlie now π version 2.15.0, dated Sep 23, 2026 β go forth and patch responsibly, mwah πππ«Ά
π¦ where this page comes from
- arch rolling: hwloc 2.15.0-1 Β· BSD-3-Clause
- π the page's license: BSD-3-Clause
- Copyright Β© 2013-2025 Inria. All rights reserved
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms