Hardware Locality (hwloc) 1.10.0

- Main Page
- Related Pages
- Modules
- Data Structures

diff.h
1 /*
2 * Copyright © 2013-2014 Inria. All rights reserved.
3 * See COPYING in top-level directory.
4 */
5
10 #ifndef HWLOC_DIFF_H
11 #define HWLOC_DIFF_H
12
13 #ifndef HWLOC_H
14 #error Please include the main hwloc.h instead
15 #endif
16
17
18 #ifdef __cplusplus
19 extern "C" {
20 #elif 0
21 }
22 #endif
23
24
60 typedef enum hwloc_topology_diff_obj_attr_type_e {
65 HWLOC_TOPOLOGY_DIFF_OBJ_ATTR_SIZE,
66
72 HWLOC_TOPOLOGY_DIFF_OBJ_ATTR_NAME,
76 HWLOC_TOPOLOGY_DIFF_OBJ_ATTR_INFO
77 } hwloc_topology_diff_obj_attr_type_t;
78
81 union hwloc_topology_diff_obj_attr_u {
82 struct hwloc_topology_diff_obj_attr_generic_s {
83 /* each part of the union must start with these */
84 hwloc_topology_diff_obj_attr_type_t type;
85 } generic;
86
88 struct hwloc_topology_diff_obj_attr_uint64_s {
89 /* used for storing integer attributes */
90 hwloc_topology_diff_obj_attr_type_t type;
91 hwloc_uint64_t index; /* not used for SIZE */
92 hwloc_uint64_t oldvalue;
93 hwloc_uint64_t newvalue;
94 } uint64;
95
97 struct hwloc_topology_diff_obj_attr_string_s {
98 /* used for storing name and info pairs */
99 hwloc_topology_diff_obj_attr_type_t type;
100 char *name; /* not used for NAME */
101 char *oldvalue;
102 char *newvalue;
103 } string;
104 };
105
106
109 typedef enum hwloc_topology_diff_type_e {
110 /*< \brief An object attribute was changed.
111 * The union is a hwloc_topology_diff_obj_attr_s.
112 */
113 HWLOC_TOPOLOGY_DIFF_OBJ_ATTR,
114
115 /*< \brief The difference is too complex,
116 * it cannot be represented. The difference below
117 * this object has not been checked.
118 * hwloc_topology_diff_build() will return 1.
119 *
120 * The union is a hwloc_topology_diff_too_complex_s.
121 */
122 HWLOC_TOPOLOGY_DIFF_TOO_COMPLEX
123 } hwloc_topology_diff_type_t;
124
127 typedef union hwloc_topology_diff_u {
128 struct hwloc_topology_diff_generic_s {
129 /* each part of the union must start with these */
130 hwloc_topology_diff_type_t type;
131 union hwloc_topology_diff_u * next; /* pointer to the next element of the list, or NULL */
132 } generic;
133
134 /* A difference in an object attribute. */
135 struct hwloc_topology_diff_obj_attr_s {
136 hwloc_topology_diff_type_t type; /* must be HWLOC_TOPOLOGY_DIFF_OBJ_ATTR */
137 union hwloc_topology_diff_u * next;
138 /* List of attribute differences for a single object */
139 unsigned obj_depth;
140 unsigned obj_index;
141 union hwloc_topology_diff_obj_attr_u diff;
142 } obj_attr;
143
144 /* A difference that is too complex. */
145 struct hwloc_topology_diff_too_complex_s {
146 hwloc_topology_diff_type_t type; /* must be HWLOC_TOPOLOGY_DIFF_TOO_COMPLEX */
147 union hwloc_topology_diff_u * next;
148 /* Where we had to stop computing the diff in the first topology */
149 unsigned obj_depth;
150 unsigned obj_index;
151 } too_complex;
152 } * hwloc_topology_diff_t;
153
154
192 HWLOC_DECLSPEC int hwloc_topology_diff_build(hwloc_topology_t topology, hwloc_topology_t newtopology, unsigned long flags, hwloc_topology_diff_t *diff);
193
196 enum hwloc_topology_diff_apply_flags_e {
200 HWLOC_TOPOLOGY_DIFF_APPLY_REVERSE = (1UL<<0)
201 };
202
220 HWLOC_DECLSPEC int hwloc_topology_diff_apply(hwloc_topology_t topology, hwloc_topology_diff_t diff, unsigned long flags);
221
227 HWLOC_DECLSPEC int hwloc_topology_diff_destroy(hwloc_topology_t topology, hwloc_topology_diff_t diff);
228
243 HWLOC_DECLSPEC int hwloc_topology_diff_load_xml(hwloc_topology_t topology, const char *xmlpath, hwloc_topology_diff_t *diff, char **refname);
244
257 HWLOC_DECLSPEC int hwloc_topology_diff_export_xml(hwloc_topology_t topology, hwloc_topology_diff_t diff, const char *refname, const char *xmlpath);
258
273 HWLOC_DECLSPEC int hwloc_topology_diff_load_xmlbuffer(hwloc_topology_t topology, const char *xmlbuffer, int buflen, hwloc_topology_diff_t *diff, char **refname);
274
289 HWLOC_DECLSPEC int hwloc_topology_diff_export_xmlbuffer(hwloc_topology_t topology, hwloc_topology_diff_t diff, const char *refname, char **xmlbuffer, int *buflen);
290
294 #ifdef __cplusplus
295 } /* extern "C" */
296 #endif
297
298
299 #endif /* HWLOC_HELPER_H */
hwloc_topology_diff_build
int hwloc_topology_diff_build(hwloc_topology_t topology, hwloc_topology_t newtopology, unsigned long flags, hwloc_topology_diff_t *diff)
Compute the difference between 2 topologies.
hwloc_topology_diff_obj_attr_u::hwloc_topology_diff_obj_attr_string_s::oldvalue
char * oldvalue
Definition: diff.h:101
hwloc_topology_diff_u::hwloc_topology_diff_generic_s
Definition: diff.h:128
hwloc_topology_diff_u::hwloc_topology_diff_too_complex_s::obj_index
unsigned obj_index
Definition: diff.h:150
hwloc_topology_diff_u::hwloc_topology_diff_generic_s::next
union hwloc_topology_diff_u * next
Definition: diff.h:131
hwloc_topology_diff_obj_attr_u::string
struct hwloc_topology_diff_obj_attr_u::hwloc_topology_diff_obj_attr_string_s string
hwloc_topology_diff_obj_attr_u::hwloc_topology_diff_obj_attr_string_s::type
hwloc_topology_diff_obj_attr_type_t type
Definition: diff.h:99
hwloc_topology_diff_export_xmlbuffer
int hwloc_topology_diff_export_xmlbuffer(hwloc_topology_t topology, hwloc_topology_diff_t diff, const char *refname, char **xmlbuffer, int *buflen)
Export a list of topology differences to a XML buffer.
hwloc_topology_diff_obj_attr_u::hwloc_topology_diff_obj_attr_string_s
String attribute modification with an optional name.
Definition: diff.h:97
hwloc_topology_diff_apply_flags_e
hwloc_topology_diff_apply_flags_e
Flags to be given to hwloc_topology_diff_apply().
Definition: diff.h:196
hwloc_topology_diff_load_xmlbuffer
int hwloc_topology_diff_load_xmlbuffer(hwloc_topology_t topology, const char *xmlbuffer, int buflen, hwloc_topology_diff_t *diff, char **refname)
Load a list of topology differences from a XML buffer.
hwloc_topology_diff_u::hwloc_topology_diff_too_complex_s::type
hwloc_topology_diff_type_t type
Definition: diff.h:146
hwloc_topology_diff_u::hwloc_topology_diff_too_complex_s
Definition: diff.h:145
hwloc_topology_diff_obj_attr_u::hwloc_topology_diff_obj_attr_uint64_s::type
hwloc_topology_diff_obj_attr_type_t type
Definition: diff.h:90
hwloc_topology_diff_export_xml
int hwloc_topology_diff_export_xml(hwloc_topology_t topology, hwloc_topology_diff_t diff, const char *refname, const char *xmlpath)
Export a list of topology differences to a XML file.
hwloc_topology_diff_u::hwloc_topology_diff_obj_attr_s::type
hwloc_topology_diff_type_t type
Definition: diff.h:136
hwloc_topology_diff_obj_attr_u::hwloc_topology_diff_obj_attr_string_s::newvalue
char * newvalue
Definition: diff.h:102
hwloc_topology_diff_obj_attr_type_e
hwloc_topology_diff_obj_attr_type_e
Type of one object attribute difference.
Definition: diff.h:60
hwloc_topology_diff_destroy
int hwloc_topology_diff_destroy(hwloc_topology_t topology, hwloc_topology_diff_t diff)
Destroy a list of topology differences.
hwloc_topology_diff_u::hwloc_topology_diff_generic_s::type
hwloc_topology_diff_type_t type
Definition: diff.h:130
HWLOC_TOPOLOGY_DIFF_OBJ_ATTR_INFO
the value of an info attribute is modified. The union is a hwloc_topology_diff_obj_attr_string_s.
Definition: diff.h:76
hwloc_topology_diff_u::hwloc_topology_diff_obj_attr_s::next
union hwloc_topology_diff_u * next
Definition: diff.h:137
HWLOC_TOPOLOGY_DIFF_OBJ_ATTR_SIZE
The object local memory is modified. The union is a hwloc_topology_diff_obj_attr_uint64_s (and the in...
Definition: diff.h:65
hwloc_topology_diff_u::hwloc_topology_diff_too_complex_s::obj_depth
unsigned obj_depth
Definition: diff.h:149
hwloc_topology_diff_u::hwloc_topology_diff_obj_attr_s::obj_index
unsigned obj_index
Definition: diff.h:140
hwloc_topology_diff_obj_attr_u::hwloc_topology_diff_obj_attr_string_s::name
char * name
Definition: diff.h:100
hwloc_topology_diff_u::hwloc_topology_diff_obj_attr_s
Definition: diff.h:135
hwloc_topology_diff_t
union hwloc_topology_diff_u * hwloc_topology_diff_t
One element of a difference list between two topologies.
hwloc_topology_diff_type_t
enum hwloc_topology_diff_type_e hwloc_topology_diff_type_t
Type of one element of a difference list.
hwloc_topology_diff_obj_attr_u::hwloc_topology_diff_obj_attr_uint64_s
Integer attribute modification with an optional index.
Definition: diff.h:88
hwloc_topology_diff_obj_attr_u::hwloc_topology_diff_obj_attr_uint64_s::index
hwloc_uint64_t index
Definition: diff.h:91
hwloc_topology_diff_u::hwloc_topology_diff_obj_attr_s::obj_depth
unsigned obj_depth
Definition: diff.h:139
hwloc_topology_diff_apply
int hwloc_topology_diff_apply(hwloc_topology_t topology, hwloc_topology_diff_t diff, unsigned long flags)
Apply a topology diff to an existing topology.
hwloc_topology_diff_obj_attr_u::hwloc_topology_diff_obj_attr_uint64_s::newvalue
hwloc_uint64_t newvalue
Definition: diff.h:93
HWLOC_TOPOLOGY_DIFF_APPLY_REVERSE
Apply topology diff in reverse direction.
Definition: diff.h:200
hwloc_topology_diff_obj_attr_u::hwloc_topology_diff_obj_attr_generic_s
Definition: diff.h:82
hwloc_topology_diff_obj_attr_u::uint64
struct hwloc_topology_diff_obj_attr_u::hwloc_topology_diff_obj_attr_uint64_s uint64
hwloc_topology_diff_type_e
hwloc_topology_diff_type_e
Type of one element of a difference list.
Definition: diff.h:109
HWLOC_TOPOLOGY_DIFF_OBJ_ATTR
Definition: diff.h:113
hwloc_topology_diff_obj_attr_u::hwloc_topology_diff_obj_attr_uint64_s::oldvalue
hwloc_uint64_t oldvalue
Definition: diff.h:92
hwloc_topology_diff_obj_attr_u::hwloc_topology_diff_obj_attr_generic_s::type
hwloc_topology_diff_obj_attr_type_t type
Definition: diff.h:84
hwloc_topology_diff_u
One element of a difference list between two topologies.
Definition: diff.h:127
HWLOC_TOPOLOGY_DIFF_OBJ_ATTR_NAME
The object name is modified. The union is a hwloc_topology_diff_obj_attr_string_s (and the name field...
Definition: diff.h:72
hwloc_topology_diff_obj_attr_type_t
enum hwloc_topology_diff_obj_attr_type_e hwloc_topology_diff_obj_attr_type_t
Type of one object attribute difference.
hwloc_topology_t
struct hwloc_topology * hwloc_topology_t
Topology context.
Definition: hwloc.h:585
hwloc_topology_diff_obj_attr_u
One object attribute difference.
Definition: diff.h:81
hwloc_topology_diff_load_xml
int hwloc_topology_diff_load_xml(hwloc_topology_t topology, const char *xmlpath, hwloc_topology_diff_t *diff, char **refname)
Load a list of topology differences from a XML file.
hwloc_topology_diff_u::hwloc_topology_diff_too_complex_s::next
union hwloc_topology_diff_u * next
Definition: diff.h:147
HWLOC_TOPOLOGY_DIFF_TOO_COMPLEX
Definition: diff.h:122