17 #ifndef __STARPU_CLUSTERS_CREATE_H__
18 #define __STARPU_CLUSTERS_CREATE_H__
23 #include <core/workers.h>
28 #include <mkl_service.h>
37 struct starpu_cluster_machine
40 hwloc_topology_t topology;
43 struct _starpu_cluster_group_list* groups;
44 struct _starpu_cluster_parameters* params;
47 struct _starpu_cluster_parameters
52 char* sched_policy_name;
53 struct starpu_sched_policy* sched_policy_struct;
54 unsigned keep_homogeneous;
56 void (*create_func)(
void*);
57 void* create_func_arg;
59 unsigned awake_workers;
62 LIST_TYPE(_starpu_cluster_group,
64 hwloc_obj_t group_obj;
66 struct _starpu_cluster_list* clusters;
67 struct starpu_cluster_machine* father;
68 struct _starpu_cluster_parameters* params;
71 LIST_TYPE(_starpu_cluster,
73 hwloc_cpuset_t cpuset;
77 struct _starpu_cluster_group* father;
78 struct _starpu_cluster_parameters* params;
83 int _starpu_cluster_machine(hwloc_obj_type_t cluster_level,
84 struct starpu_cluster_machine* machine);
85 int _starpu_cluster_topology(hwloc_obj_type_t cluster_level,
86 struct starpu_cluster_machine* machine);
87 void _starpu_cluster_group(hwloc_obj_type_t cluster_level,
88 struct starpu_cluster_machine* machine);
89 void _starpu_cluster(
struct _starpu_cluster_group* group);
92 void _starpu_cluster_init_parameters(
struct _starpu_cluster_parameters* globals);
93 void _starpu_cluster_copy_parameters(
struct _starpu_cluster_parameters* src,
94 struct _starpu_cluster_parameters* dst);
95 int _starpu_cluster_analyze_parameters(
struct _starpu_cluster_parameters* params,
int npus);
98 void _starpu_cluster_init(
struct _starpu_cluster* cluster,
struct _starpu_cluster_group* father);
99 void _starpu_cluster_create(
struct _starpu_cluster* cluster);
101 int _starpu_cluster_bind(
struct _starpu_cluster* cluster);
102 int _starpu_cluster_remove(
struct _starpu_cluster_list* cluster_list,
103 struct _starpu_cluster* cluster);
106 void _starpu_cluster_group_init(
struct _starpu_cluster_group* group,
107 struct starpu_cluster_machine* father);
108 void _starpu_cluster_group_create(
struct _starpu_cluster_group* group);
109 int _starpu_cluster_group_remove(
struct _starpu_cluster_group_list* group_list,
110 struct _starpu_cluster_group* group);
113 void _starpu_cluster_noop(
void* buffers[],
void* cl_arg)
119 static struct starpu_codelet _starpu_cluster_bind_cl=
121 .cpu_funcs = {_starpu_cluster_noop},
123 .name =
"cluster_internal_runtime_init"
126 typedef void (*starpu_binding_function)(
void*);
127 starpu_binding_function _starpu_cluster_type_get_func(
enum starpu_cluster_types type);