Open MPI logo

Portable Hardware Locality (hwloc) Documentation: v1.7.1

  |   Home   |   Support   |   FAQ   |  
plugins.h
1 /*
2  * Copyright © 2013 Inria. All rights reserved.
3  * See COPYING in top-level directory.
4  */
5 
6 #ifndef HWLOC_PLUGINS_H
7 #define HWLOC_PLUGINS_H
8 
13 struct hwloc_backend;
14 
15 #include <hwloc.h>
16 
17 
18 
19 
29 
36 
41 
50 
54  const char *name;
55 
64  unsigned excludes;
65 
69  struct hwloc_backend * (*instantiate)(struct hwloc_disc_component *component, const void *data1, const void *data2, const void *data3);
70 
83  unsigned priority;
84 
89  struct hwloc_disc_component * next;
90 };
91 
113  struct hwloc_disc_component * component;
115  struct hwloc_topology * topology;
117  int envvar_forced;
119  struct hwloc_backend * next;
120 
122  unsigned long flags;
123 
128 
133 
135  void * private_data;
139  void (*disable)(struct hwloc_backend *backend);
140 
144  int (*discover)(struct hwloc_backend *backend);
145 
148  int (*get_obj_cpuset)(struct hwloc_backend *backend, struct hwloc_backend *caller, struct hwloc_obj *obj, hwloc_bitmap_t cpuset);
149 
153  int (*notify_new_object)(struct hwloc_backend *backend, struct hwloc_backend *caller, struct hwloc_obj *obj);
154 };
155 
161 };
162 
166  struct hwloc_backend * hwloc_backend_alloc(struct hwloc_disc_component *component);
167 
169  int hwloc_backend_enable(struct hwloc_topology *topology, struct hwloc_backend *backend);
170 
176  int hwloc_backends_get_obj_cpuset(struct hwloc_backend *caller, struct hwloc_obj *obj, hwloc_bitmap_t cpuset);
177 
187  int hwloc_backends_notify_new_object(struct hwloc_backend *caller, struct hwloc_obj *obj);
188 
202 
206 
214  unsigned abi;
215 
218 
220  unsigned long flags;
221 
223  void * data;
224 };
225 
255  struct hwloc_obj *hwloc_insert_object_by_cpuset(struct hwloc_topology *topology, hwloc_obj_t obj);
256 
258 typedef void (*hwloc_report_error_t)(const char * msg, int line);
260  void hwloc_report_os_error(const char * msg, int line);
262  int hwloc_hide_errors(void);
263 
268  struct hwloc_obj *hwloc__insert_object_by_cpuset(struct hwloc_topology *topology, hwloc_obj_t obj, hwloc_report_error_t report_error);
269 
280  void hwloc_insert_object_by_parent(struct hwloc_topology *topology, hwloc_obj_t parent, hwloc_obj_t obj);
281 
283 static inline struct hwloc_obj *
285 {
286  struct hwloc_obj *obj = malloc(sizeof(*obj));
287  memset(obj, 0, sizeof(*obj));
288  obj->type = type;
289  obj->os_index = os_index;
290  obj->os_level = -1;
291  obj->attr = malloc(sizeof(*obj->attr));
292  memset(obj->attr, 0, sizeof(*obj->attr));
293  /* do not allocate the cpuset here, let the caller do it */
294  return obj;
295 }
296 
302 #endif /* HWLOC_PLUGINS_H */