Hardware Locality (hwloc)
1.7.2
Main Page
Related Pages
Modules
Data Structures
include
hwloc
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
25
typedef
enum
hwloc_disc_component_type_e
{
28
HWLOC_DISC_COMPONENT_TYPE_CPU
= (1<<0),
29
35
HWLOC_DISC_COMPONENT_TYPE_GLOBAL
= (1<<1),
36
39
HWLOC_DISC_COMPONENT_TYPE_MISC
= (1<<2)
40
}
hwloc_disc_component_type_t
;
41
47
struct
hwloc_disc_component
{
49
hwloc_disc_component_type_t
type
;
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
111
struct
hwloc_backend
{
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
127
int
is_custom
;
128
132
int
is_thissystem
;
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
157
enum
hwloc_backend_flag_e
{
160
HWLOC_BACKEND_FLAG_NEED_LEVELS
= (1UL<<0)
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
199
typedef
enum
hwloc_component_type_e
{
201
HWLOC_COMPONENT_TYPE_DISC
,
202
204
HWLOC_COMPONENT_TYPE_XML
205
}
hwloc_component_type_t
;
206
212
struct
hwloc_component
{
214
unsigned
abi
;
215
217
hwloc_component_type_t
type
;
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
*
284
hwloc_alloc_setup_object
(
hwloc_obj_type_t
type
,
signed
os_index
)
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 */
Generated on Tue Sep 3 2013 10:24:21 for Hardware Locality (hwloc) by
1.8.4