1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259
|
.TH "hwlocality_diff" 3 "Version 2.12.0" "Hardware Locality (hwloc)" \" -*- nroff -*-
.ad l
.nh
.SH NAME
hwlocality_diff \- Topology differences
.SH SYNOPSIS
.br
.PP
.SS "Data Structures"
.in +1c
.ti -1c
.RI "union \fBhwloc_topology_diff_obj_attr_u\fP"
.br
.ti -1c
.RI "union \fBhwloc_topology_diff_u\fP"
.br
.in -1c
.SS "Typedefs"
.in +1c
.ti -1c
.RI "typedef enum \fBhwloc_topology_diff_obj_attr_type_e\fP \fBhwloc_topology_diff_obj_attr_type_t\fP"
.br
.ti -1c
.RI "typedef enum \fBhwloc_topology_diff_type_e\fP \fBhwloc_topology_diff_type_t\fP"
.br
.ti -1c
.RI "typedef union \fBhwloc_topology_diff_u\fP * \fBhwloc_topology_diff_t\fP"
.br
.in -1c
.SS "Enumerations"
.in +1c
.ti -1c
.RI "enum \fBhwloc_topology_diff_obj_attr_type_e\fP { \fBHWLOC_TOPOLOGY_DIFF_OBJ_ATTR_SIZE\fP, \fBHWLOC_TOPOLOGY_DIFF_OBJ_ATTR_NAME\fP, \fBHWLOC_TOPOLOGY_DIFF_OBJ_ATTR_INFO\fP }"
.br
.ti -1c
.RI "enum \fBhwloc_topology_diff_type_e\fP { \fBHWLOC_TOPOLOGY_DIFF_OBJ_ATTR\fP, \fBHWLOC_TOPOLOGY_DIFF_TOO_COMPLEX\fP }"
.br
.ti -1c
.RI "enum \fBhwloc_topology_diff_apply_flags_e\fP { \fBHWLOC_TOPOLOGY_DIFF_APPLY_REVERSE\fP }"
.br
.in -1c
.SS "Functions"
.in +1c
.ti -1c
.RI "int \fBhwloc_topology_diff_build\fP (\fBhwloc_topology_t\fP topology, \fBhwloc_topology_t\fP newtopology, unsigned long flags, \fBhwloc_topology_diff_t\fP *diff)"
.br
.ti -1c
.RI "int \fBhwloc_topology_diff_apply\fP (\fBhwloc_topology_t\fP topology, \fBhwloc_topology_diff_t\fP diff, unsigned long flags)"
.br
.ti -1c
.RI "int \fBhwloc_topology_diff_destroy\fP (\fBhwloc_topology_diff_t\fP diff)"
.br
.ti -1c
.RI "int \fBhwloc_topology_diff_load_xml\fP (const char *xmlpath, \fBhwloc_topology_diff_t\fP *diff, char **refname)"
.br
.ti -1c
.RI "int \fBhwloc_topology_diff_export_xml\fP (\fBhwloc_topology_diff_t\fP diff, const char *refname, const char *xmlpath)"
.br
.ti -1c
.RI "int \fBhwloc_topology_diff_load_xmlbuffer\fP (const char *xmlbuffer, int buflen, \fBhwloc_topology_diff_t\fP *diff, char **refname)"
.br
.ti -1c
.RI "int \fBhwloc_topology_diff_export_xmlbuffer\fP (\fBhwloc_topology_diff_t\fP diff, const char *refname, char **xmlbuffer, int *buflen)"
.br
.in -1c
.SH "Detailed Description"
.PP
Applications that manipulate many similar topologies, for instance one for each node of a homogeneous cluster, may want to compress topologies to reduce the memory footprint\&.
.PP
This file offers a way to manipulate the difference between topologies and export/import it to/from XML\&. Compression may therefore be achieved by storing one topology entirely while the others are only described by their differences with the former\&. The actual topology can be reconstructed when actually needed by applying the precomputed difference to the reference topology\&.
.PP
This interface targets very similar nodes\&. Only very simple differences between topologies are actually supported, for instance a change in the memory size, the name of the object, or some info attribute\&. More complex differences such as adding or removing objects cannot be represented in the difference structures and therefore return errors\&. Differences between object sets or topology-wide allowed sets, cannot be represented either\&.
.PP
It means that there is no need to apply the difference when looking at the tree organization (how many levels, how many objects per level, what kind of objects, CPU and node sets, etc) and when binding to objects\&. However the difference must be applied when looking at object attributes such as the name, the memory size or info attributes\&.
.SH "Typedef Documentation"
.PP
.SS "typedef enum \fBhwloc_topology_diff_obj_attr_type_e\fP \fBhwloc_topology_diff_obj_attr_type_t\fP"
.PP
Type of one object attribute difference\&.
.SS "typedef union \fBhwloc_topology_diff_u\fP * \fBhwloc_topology_diff_t\fP"
.PP
One element of a difference list between two topologies\&.
.SS "typedef enum \fBhwloc_topology_diff_type_e\fP \fBhwloc_topology_diff_type_t\fP"
.PP
Type of one element of a difference list\&.
.SH "Enumeration Type Documentation"
.PP
.SS "enum \fBhwloc_topology_diff_apply_flags_e\fP"
.PP
Flags to be given to \fBhwloc_topology_diff_apply()\fP\&.
.PP
\fBEnumerator\fP
.in +1c
.TP
\fB\fIHWLOC_TOPOLOGY_DIFF_APPLY_REVERSE \fP\fP
Apply topology diff in reverse direction\&.
.SS "enum \fBhwloc_topology_diff_obj_attr_type_e\fP"
.PP
Type of one object attribute difference\&.
.PP
\fBEnumerator\fP
.in +1c
.TP
\fB\fIHWLOC_TOPOLOGY_DIFF_OBJ_ATTR_SIZE \fP\fP
The object local memory is modified\&. The union is a \fBhwloc_topology_diff_obj_attr_u::hwloc_topology_diff_obj_attr_uint64_s\fP (and the index field is ignored)\&.
.TP
\fB\fIHWLOC_TOPOLOGY_DIFF_OBJ_ATTR_NAME \fP\fP
The object name is modified\&. The union is a \fBhwloc_topology_diff_obj_attr_u::hwloc_topology_diff_obj_attr_string_s\fP (and the name field is ignored)\&.
.TP
\fB\fIHWLOC_TOPOLOGY_DIFF_OBJ_ATTR_INFO \fP\fP
the value of an info attribute is modified\&. The union is a \fBhwloc_topology_diff_obj_attr_u::hwloc_topology_diff_obj_attr_string_s\fP\&.
.SS "enum \fBhwloc_topology_diff_type_e\fP"
.PP
Type of one element of a difference list\&.
.PP
\fBEnumerator\fP
.in +1c
.TP
\fB\fIHWLOC_TOPOLOGY_DIFF_OBJ_ATTR \fP\fP
An object attribute was changed\&. The union is a \fBhwloc_topology_diff_u::hwloc_topology_diff_obj_attr_s\fP\&.
.TP
\fB\fIHWLOC_TOPOLOGY_DIFF_TOO_COMPLEX \fP\fP
The difference is too complex, it cannot be represented\&. The difference below this object has not been checked\&. \fBhwloc_topology_diff_build()\fP will return 1\&. The union is a \fBhwloc_topology_diff_u::hwloc_topology_diff_too_complex_s\fP\&.
.SH "Function Documentation"
.PP
.SS "int hwloc_topology_diff_apply (\fBhwloc_topology_t\fP topology, \fBhwloc_topology_diff_t\fP diff, unsigned long flags)"
.PP
Apply a topology diff to an existing topology\&. \fCflags\fP is an OR'ed set of \fBhwloc_topology_diff_apply_flags_e\fP\&.
.PP
The new topology is modified in place\&. \fBhwloc_topology_dup()\fP may be used to duplicate it before patching\&.
.PP
If the difference cannot be applied entirely, all previous applied elements are unapplied before returning\&.
.PP
\fBReturns\fP
.RS 4
0 on success\&.
.PP
-N if applying the difference failed while trying to apply the N-th part of the difference\&. For instance -1 is returned if the very first difference element could not be applied\&.
.RE
.PP
.SS "int hwloc_topology_diff_build (\fBhwloc_topology_t\fP topology, \fBhwloc_topology_t\fP newtopology, unsigned long flags, \fBhwloc_topology_diff_t\fP * diff)"
.PP
Compute the difference between 2 topologies\&. The difference is stored as a list of \fBhwloc_topology_diff_t\fP entries starting at \fCdiff\fP\&. It is computed by doing a depth-first traversal of both topology trees simultaneously\&.
.PP
If the difference between 2 objects is too complex to be represented (for instance if some objects have different types, or different numbers of children), a special diff entry of type \fBHWLOC_TOPOLOGY_DIFF_TOO_COMPLEX\fP is queued\&. The computation of the diff does not continue below these objects\&. So each such diff entry means that the difference between two subtrees could not be computed\&.
.PP
\fBReturns\fP
.RS 4
0 if the difference can be represented properly\&.
.PP
0 with \fCdiff\fP pointing to NULL if there is no difference between the topologies\&.
.PP
1 if the difference is too complex (see above)\&. Some entries in the list will be of type \fBHWLOC_TOPOLOGY_DIFF_TOO_COMPLEX\fP\&.
.PP
-1 on any other error\&.
.RE
.PP
\fBNote\fP
.RS 4
\fCflags\fP is currently not used\&. It should be 0\&.
.PP
The output diff has to be freed with \fBhwloc_topology_diff_destroy()\fP\&.
.PP
The output diff can only be exported to XML or passed to \fBhwloc_topology_diff_apply()\fP if 0 was returned, i\&.e\&. if no entry of type \fBHWLOC_TOPOLOGY_DIFF_TOO_COMPLEX\fP is listed\&.
.PP
The output diff may be modified by removing some entries from the list\&. The removed entries should be freed by passing them to to \fBhwloc_topology_diff_destroy()\fP (possible as another list)\&.
.RE
.PP
.SS "int hwloc_topology_diff_destroy (\fBhwloc_topology_diff_t\fP diff)"
.PP
Destroy a list of topology differences\&.
.PP
\fBReturns\fP
.RS 4
0\&.
.RE
.PP
.SS "int hwloc_topology_diff_export_xml (\fBhwloc_topology_diff_t\fP diff, const char * refname, const char * xmlpath)"
.PP
Export a list of topology differences to a XML file\&. If not \fCNULL\fP, \fCrefname\fP defines an identifier string for the reference topology which was used as a base when computing this difference\&. This identifier is usually the name of the other XML file that contains the reference topology\&. This attribute is given back when reading the diff from XML\&.
.PP
\fBReturns\fP
.RS 4
0 on success, -1 on error\&.
.RE
.PP
.SS "int hwloc_topology_diff_export_xmlbuffer (\fBhwloc_topology_diff_t\fP diff, const char * refname, char ** xmlbuffer, int * buflen)"
.PP
Export a list of topology differences to a XML buffer\&. If not \fCNULL\fP, \fCrefname\fP defines an identifier string for the reference topology which was used as a base when computing this difference\&. This identifier is usually the name of the other XML file that contains the reference topology\&. This attribute is given back when reading the diff from XML\&.
.PP
The returned buffer ends with a \fC\\0\fP that is included in the returned length\&.
.PP
\fBReturns\fP
.RS 4
0 on success, -1 on error\&.
.RE
.PP
\fBNote\fP
.RS 4
The XML buffer should later be freed with \fBhwloc_free_xmlbuffer()\fP\&.
.RE
.PP
.SS "int hwloc_topology_diff_load_xml (const char * xmlpath, \fBhwloc_topology_diff_t\fP * diff, char ** refname)"
.PP
Load a list of topology differences from a XML file\&. If not \fCNULL\fP, \fCrefname\fP will be filled with the identifier string of the reference topology for the difference file, if any was specified in the XML file\&. This identifier is usually the name of the other XML file that contains the reference topology\&.
.PP
\fBReturns\fP
.RS 4
0 on success, -1 on error\&.
.RE
.PP
\fBNote\fP
.RS 4
the pointer returned in refname should later be freed by the caller\&.
.RE
.PP
.SS "int hwloc_topology_diff_load_xmlbuffer (const char * xmlbuffer, int buflen, \fBhwloc_topology_diff_t\fP * diff, char ** refname)"
.PP
Load a list of topology differences from a XML buffer\&. Build a list of differences from the XML memory buffer given at \fCxmlbuffer\fP and of length \fCbuflen\fP (including an ending \fC\\0\fP)\&. This buffer may have been filled earlier with \fBhwloc_topology_diff_export_xmlbuffer()\fP\&.
.PP
If not \fCNULL\fP, \fCrefname\fP will be filled with the identifier string of the reference topology for the difference file, if any was specified in the XML file\&. This identifier is usually the name of the other XML file that contains the reference topology\&.
.PP
\fBReturns\fP
.RS 4
0 on success, -1 on error\&.
.RE
.PP
\fBNote\fP
.RS 4
the pointer returned in refname should later be freed by the caller\&.
.RE
.PP
.SH "Author"
.PP
Generated automatically by Doxygen for Hardware Locality (hwloc) from the source code\&.
|