Open MPI logo

Portable Hardware Locality (hwloc) Documentation: v1.8

  |   Home   |   Support   |   FAQ   |  
diff.h
1 /*
2  * Copyright © 2013 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 
59 
71 
76  /* each part of the union must start with these */
78  } generic;
79 
82  /* used for storing integer attributes */
84  hwloc_uint64_t index; /* not used for SIZE */
85  hwloc_uint64_t oldvalue;
86  hwloc_uint64_t newvalue;
87  } uint64;
88 
91  /* used for storing name and info pairs */
93  char *name; /* not used for NAME */
94  char *oldvalue;
95  char *newvalue;
96  } string;
97 };
98 
99 
103  /*< \brief An object attribute was changed.
104  * The union is a hwloc_topology_diff_obj_attr_s.
105  */
107 
108  /*< \brief The difference is too complex,
109  * it cannot be represented. The difference below
110  * this object has not been checked.
111  * hwloc_topology_diff_build() will return 1.
112  *
113  * The union is a hwloc_topology_diff_too_complex_s.
114  */
117 
120 typedef union hwloc_topology_diff_u {
122  /* each part of the union must start with these */
125  } generic;
126 
127  /* A difference in an object attribute. */
129  hwloc_topology_diff_type_t type; /* must be HWLOC_TOPOLOGY_DIFF_OBJ_ATTR */
131  /* List of attribute differences for a single object */
132  unsigned obj_depth;
133  unsigned obj_index;
135  } obj_attr;
136 
137  /* A difference that is too complex. */
139  hwloc_topology_diff_type_t type; /* must be HWLOC_TOPOLOGY_DIFF_TOO_COMPLEX */
141  /* Where we had to stop computing the diff in the first topology */
142  unsigned obj_depth;
143  unsigned obj_index;
144  } too_complex;
146 
147 
185 HWLOC_DECLSPEC int hwloc_topology_diff_build(hwloc_topology_t topology, hwloc_topology_t newtopology, unsigned long flags, hwloc_topology_diff_t *diff);
186 
194 };
195 
213 HWLOC_DECLSPEC int hwloc_topology_diff_apply(hwloc_topology_t topology, hwloc_topology_diff_t diff, unsigned long flags);
214 
220 HWLOC_DECLSPEC int hwloc_topology_diff_destroy(hwloc_topology_t topology, hwloc_topology_diff_t diff);
221 
236 HWLOC_DECLSPEC int hwloc_topology_diff_load_xml(hwloc_topology_t topology, const char *xmlpath, hwloc_topology_diff_t *diff, char **refname);
237 
250 HWLOC_DECLSPEC int hwloc_topology_diff_export_xml(hwloc_topology_t topology, hwloc_topology_diff_t diff, const char *refname, const char *xmlpath);
251 
266 HWLOC_DECLSPEC int hwloc_topology_diff_load_xmlbuffer(hwloc_topology_t topology, const char *xmlbuffer, int buflen, hwloc_topology_diff_t *diff, char **refname);
267 
282 HWLOC_DECLSPEC int hwloc_topology_diff_export_xmlbuffer(hwloc_topology_t topology, hwloc_topology_diff_t diff, const char *refname, char **xmlbuffer, int *buflen);
283 
287 #ifdef __cplusplus
288 } /* extern "C" */
289 #endif
290 
291 
292 #endif /* HWLOC_HELPER_H */
union hwloc_topology_diff_u * hwloc_topology_diff_t
One element of a difference list between two topologies.
hwloc_topology_diff_type_e
Type of one element of a difference list.
Definition: diff.h:102
struct hwloc_topology_diff_obj_attr_u::hwloc_topology_diff_obj_attr_uint64_s uint64
One object attribute difference.
Definition: diff.h:74
Integer attribute modification with an optional index.
Definition: diff.h:81
The object local memory is modified. The union is a hwloc_topology_diff_obj_attr_uint64_s (and the in...
Definition: diff.h:58
hwloc_topology_diff_obj_attr_type_t type
Definition: diff.h:92
HWLOC_DECLSPEC 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.
union hwloc_topology_diff_u * next
Definition: diff.h:140
Apply topology diff in reverse direction.
Definition: diff.h:193
hwloc_topology_diff_obj_attr_type_t type
Definition: diff.h:83
hwloc_topology_diff_obj_attr_type_t type
Definition: diff.h:77
union hwloc_topology_diff_u * next
Definition: diff.h:124
hwloc_topology_diff_type_t type
Definition: diff.h:129
Definition: diff.h:106
HWLOC_DECLSPEC 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_apply_flags_e
Flags to be given to hwloc_topology_diff_apply().
Definition: diff.h:189
struct hwloc_topology_diff_obj_attr_u::hwloc_topology_diff_obj_attr_string_s string
hwloc_topology_diff_type_t type
Definition: diff.h:123
Definition: diff.h:115
hwloc_topology_diff_obj_attr_type_e
Type of one object attribute difference.
Definition: diff.h:53
enum hwloc_topology_diff_obj_attr_type_e hwloc_topology_diff_obj_attr_type_t
Type of one object attribute difference.
the value of an info attribute is modified. The union is a hwloc_topology_diff_obj_attr_string_s.
Definition: diff.h:69
String attribute modification with an optional name.
Definition: diff.h:90
struct hwloc_topology * hwloc_topology_t
Topology context.
Definition: hwloc.h:577
enum hwloc_topology_diff_type_e hwloc_topology_diff_type_t
Type of one element of a difference list.
HWLOC_DECLSPEC 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_DECLSPEC 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.
union hwloc_topology_diff_u * next
Definition: diff.h:130
The object name is modified. The union is a hwloc_topology_diff_obj_attr_string_s (and the name field...
Definition: diff.h:65
HWLOC_DECLSPEC int hwloc_topology_diff_destroy(hwloc_topology_t topology, hwloc_topology_diff_t diff)
Destroy a list of topology differences.
hwloc_topology_diff_type_t type
Definition: diff.h:139
HWLOC_DECLSPEC 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_DECLSPEC 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.
One element of a difference list between two topologies.
Definition: diff.h:120