Explorar o código

define deinit_data for more nodes
add a a function in nodes properly update nodes data when available worker changes
update dynamic scheduler builder to new interface (currently broken)
various bugfixes

Simon Archipoff %!s(int64=11) %!d(string=hai) anos
pai
achega
8f660533c2

+ 5 - 1
include/starpu_sched_node.h

@@ -83,6 +83,10 @@ struct starpu_sched_node
 	void (*add_child)(struct starpu_sched_node * node, struct starpu_sched_node * child);
 	void (*remove_child)(struct starpu_sched_node * node, struct starpu_sched_node * child);
 
+	/* this function is called for each node when workers are added or removed from a context
+	 */
+	void (*notify_change_workers)(struct starpu_sched_node * node);
+
 	/* this function is called by starpu_sched_node_destroy just before freeing node
 	 */
 	void (*deinit_data)(struct starpu_sched_node * node);
@@ -137,7 +141,7 @@ struct starpu_sched_node * starpu_sched_node_fifo_create(void * arg STARPU_ATTRI
 int starpu_sched_node_is_fifo(struct starpu_sched_node * node);
 //struct starpu_task_list  starpu_sched_node_fifo_get_non_executable_tasks(struct starpu_sched_node * fifo_node);
 
-struct starpu_sched_node * starpu_sched_node_work_stealing_create(void);
+struct starpu_sched_node * starpu_sched_node_work_stealing_create(void * arg STARPU_ATTRIBUTE_UNUSED);
 int starpu_sched_node_is_work_stealing(struct starpu_sched_node * node);
 
 struct starpu_sched_node * starpu_sched_node_random_create(void * arg STARPU_ATTRIBUTE_UNUSED);

+ 4 - 4
src/Makefile.am

@@ -135,8 +135,8 @@ noinst_HEADERS = 						\
 	top/starpu_top_core.h					\
 	sched_policies/prio_deque.h				\
 	sched_policies/sched_node.h				\
-	sched_policies/node_composed.h
-#	sched_policies/scheduler_maker.h			
+	sched_policies/node_composed.h				\
+	sched_policies/scheduler_maker.h			
 
 libstarpu_@STARPU_EFFECTIVE_VERSION@_la_SOURCES = 		\
 	common/barrier.c					\
@@ -252,8 +252,8 @@ libstarpu_@STARPU_EFFECTIVE_VERSION@_la_SOURCES = 		\
 	sched_policies/node_random.c				\
 	sched_policies/node_heft.c				\
 	sched_policies/node_composed.c				\
-	sched_policies/node_best_implementation.c
-#	sched_policies/hierarchical_heft.c			\
+	sched_policies/node_best_implementation.c		\
+	sched_policies/hierarchical_heft.c			\
 	sched_policies/scheduler_maker.c			
 
 if STARPU_USE_CPU

+ 1 - 0
src/core/sched_policy.c

@@ -37,6 +37,7 @@ static struct starpu_sched_policy *predefined_policies[] =
 	&_starpu_sched_tree_random_policy,
 	&_starpu_sched_tree_ws_policy,
 	&_starpu_sched_tree_heft_policy,
+//	&_starpu_sched_tree_heft_hierarchical_policy,
 	&_starpu_sched_eager_policy,
 	&_starpu_sched_prio_policy,
 	&_starpu_sched_random_policy,

+ 1 - 0
src/core/sched_policy.h

@@ -71,4 +71,5 @@ extern struct starpu_sched_policy _starpu_sched_tree_eager_policy;
 extern struct starpu_sched_policy _starpu_sched_tree_random_policy;
 extern struct starpu_sched_policy _starpu_sched_tree_ws_policy;
 extern struct starpu_sched_policy _starpu_sched_tree_heft_policy;
+//extern struct starpu_sched_policy _starpu_sched_tree_heft_hierarchical_policy;
 #endif // __SCHED_POLICY_H__

+ 34 - 21
src/sched_policies/hierarchical_heft.c

@@ -1,47 +1,60 @@
-#include <starpu_node_sched.h>
+#include <starpu_sched_node.h>
 #include <core/workers.h>
 #include "scheduler_maker.h"
 
 static struct  _starpu_composed_sched_node_recipe *  recipe_for_worker(enum starpu_worker_archtype a STARPU_ATTRIBUTE_UNUSED)
 {
 	struct _starpu_composed_sched_node_recipe * r = starpu_sched_node_create_recipe();
+	starpu_sched_recipe_add_node(r, starpu_sched_node_best_implementation_create, NULL);
 	starpu_sched_recipe_add_node(r, starpu_sched_node_fifo_create, NULL);
 	return r;
 }
 
+
+
+
 static void initialize_heft_center_policy(unsigned sched_ctx_id)
 {
 	starpu_sched_ctx_create_worker_collection(sched_ctx_id, STARPU_WORKER_LIST);
-	
+
 	struct starpu_sched_specs specs;
 	memset(&specs,0,sizeof(specs));
-	
-	specs.hwloc_machine_composed_sched_node = ({
-			struct _starpu_composed_sched_node_recipe * r = starpu_sched_node_create_recipe();
-			starpu_sched_recipe_add_node(r, starpu_sched_node_heft_create,NULL);
-			r;});
-
-	specs.hwloc_node_composed_sched_node = ({
-			struct _starpu_composed_sched_node_recipe * r = starpu_sched_node_create_recipe();
-			starpu_sched_recipe_add_node(r, starpu_sched_node_fifo_create,NULL);
-			r;});
-	specs.worker_composed_sched_node = recipe_for_worker;
 
-	struct starpu_sched_tree *data = _starpu_make_scheduler(sched_ctx_id, specs);
+	struct starpu_heft_data heft_data =
+	{
+		.alpha = 1.0,
+		.beta = 2.0,
+		.gamma = 0.0,
+		.idle_power = 0.0,
+		.no_perf_model_node_create = starpu_sched_node_random_create,
+		.arg_no_perf_model = NULL,
+		.calibrating_node_create = starpu_sched_node_random_create,
+		.arg_calibrating_node = NULL,
+	};
+	struct _starpu_composed_sched_node_recipe * r = starpu_sched_node_create_recipe();
+	starpu_sched_recipe_add_node(r,(struct starpu_sched_node * (*)(void*))starpu_sched_node_heft_create,&heft_data);
+	specs.hwloc_machine_composed_sched_node = r;
 
-	_starpu_destroy_composed_sched_node_recipe(specs.hwloc_machine_composed_sched_node);
+	r = starpu_sched_node_create_recipe();
+	starpu_sched_recipe_add_node(r, starpu_sched_node_best_implementation_create, NULL);
+	starpu_sched_recipe_add_node(r, starpu_sched_node_work_stealing_create ,NULL);
 
-	
+	specs.hwloc_node_composed_sched_node = r;
+	specs.worker_composed_sched_node = recipe_for_worker;
 
-	starpu_sched_ctx_set_policy_data(sched_ctx_id, (void*)data);
+	struct starpu_sched_tree *t = _starpu_make_scheduler(sched_ctx_id, specs);
 
+	_starpu_destroy_composed_sched_node_recipe(specs.hwloc_machine_composed_sched_node);
 
+
+	starpu_sched_tree_update_workers(t);
+	starpu_sched_ctx_set_policy_data(sched_ctx_id, (void*)t);
 }
 
 static void deinitialize_heft_center_policy(unsigned sched_ctx_id)
 {
 	struct starpu_sched_tree *t = (struct starpu_sched_tree*)starpu_sched_ctx_get_policy_data(sched_ctx_id);
-	starpu_bitmap_destroy(t->workers);
+
 	starpu_sched_tree_destroy(t, sched_ctx_id);
 	starpu_sched_ctx_delete_worker_collection(sched_ctx_id);
 }
@@ -50,7 +63,7 @@ static void deinitialize_heft_center_policy(unsigned sched_ctx_id)
 
 
 
-struct starpu_sched_policy starpu_sched_tree_heft_policy =
+struct starpu_sched_policy _starpu_sched_tree_heft_hierarchical_policy =
 {
 	.init_sched = initialize_heft_center_policy,
 	.deinit_sched = deinitialize_heft_center_policy,
@@ -61,6 +74,6 @@ struct starpu_sched_policy starpu_sched_tree_heft_policy =
 	.pre_exec_hook = NULL,
 	.post_exec_hook = NULL,
 	.pop_every_task = NULL,
-	.policy_name = "tree-heft",
-	.policy_description = "heft tree policy"
+	.policy_name = "tree-heft-hierarchical",
+	.policy_description = "hierarchical heft tree policy"
 };

+ 26 - 9
src/sched_policies/node_composed.c

@@ -46,9 +46,7 @@ struct composed_node
 {
 	struct starpu_sched_node *top,*bottom;
 };
-struct composed_node create_composed_node(struct starpu_bitmap * workers,
-					  struct starpu_bitmap * workers_in_ctx,
-					  struct _starpu_composed_sched_node_recipe * recipe
+struct composed_node create_composed_node(struct _starpu_composed_sched_node_recipe * recipe
 #ifdef STARPU_HAVE_HWLOC
 					  ,hwloc_obj_t obj
 #endif
@@ -82,10 +80,6 @@ struct composed_node create_composed_node(struct starpu_bitmap * workers,
 		int j;
 		for(j = 0; j < STARPU_NMAX_SCHED_CTXS; j++)
 			starpu_sched_node_set_father(node, c.bottom,(unsigned)j);
-		starpu_bitmap_destroy(node->workers);
-		node->workers = workers;
-		starpu_bitmap_destroy(node->workers_in_ctx);
-		node->workers = workers_in_ctx;
 		c.bottom = node;
 	}
 	STARPU_ASSERT(!starpu_sched_node_is_worker(c.bottom));
@@ -126,6 +120,7 @@ double composed_node_estimated_load(struct starpu_sched_node * node)
 static void composed_node_add_child(struct starpu_sched_node * node, struct starpu_sched_node * child)
 {
 	struct composed_node * c = node->data;
+	starpu_sched_node_add_child(node, child);
 	c->bottom->add_child(c->bottom, child);
 }
 static void composed_node_remove_child(struct starpu_sched_node * node, struct starpu_sched_node * child)
@@ -134,6 +129,27 @@ static void composed_node_remove_child(struct starpu_sched_node * node, struct s
 	c->bottom->remove_child(c->bottom, child);
 }
 
+static void composed_node_notify_change_workers(struct starpu_sched_node * node)
+{
+	struct composed_node * c = node->data;
+	struct starpu_bitmap * workers = node->workers;
+	struct starpu_bitmap * workers_in_ctx = node->workers_in_ctx;
+	int is_homogeneous = node->is_homogeneous;
+	struct starpu_sched_node * n;
+	for(n = c->top; ;n = n->childs[0])
+	{
+		starpu_bitmap_unset_all(n->workers);
+		starpu_bitmap_or(n->workers, workers);
+	       
+		starpu_bitmap_unset_all(n->workers_in_ctx);
+		starpu_bitmap_or(n->workers_in_ctx, workers_in_ctx);
+		
+		n->is_homogeneous = is_homogeneous;
+		if(n == c->bottom)
+			break;
+	}
+}
+
 void composed_node_deinit_data(struct starpu_sched_node * _node)
 {
 	struct composed_node *c = _node->data;
@@ -160,9 +176,9 @@ struct starpu_sched_node * starpu_sched_node_composed_node_create(struct _starpu
 	struct starpu_sched_node * node = starpu_sched_node_create();
 
 	struct composed_node * c = malloc(sizeof(struct composed_node));
-	*c = create_composed_node(node->workers, node->workers_in_ctx, recipe
+	*c = create_composed_node(recipe
 #ifdef STARPU_HAVE_HWLOC
-				   ,node->obj
+				  ,node->obj
 #endif 
 );
 	c->bottom->nchilds = node->nchilds;
@@ -175,5 +191,6 @@ struct starpu_sched_node * starpu_sched_node_composed_node_create(struct _starpu
 	node->estimated_load = composed_node_estimated_load;
 	node->add_child = composed_node_add_child;
 	node->remove_child = composed_node_remove_child;
+	node->notify_change_workers = composed_node_notify_change_workers;
 	return node;
 }

+ 1 - 1
src/sched_policies/node_composed.h

@@ -1,6 +1,6 @@
 #ifndef __NODE_COMPOSED_H__
 #define __NODE_COMPOSED_H__
-#include <starpu_node_sched.h>
+#include <starpu_sched_node.h>
 
 struct _starpu_composed_sched_node_recipe;
 

+ 8 - 1
src/sched_policies/node_fifo.c

@@ -9,7 +9,13 @@ struct _starpu_fifo_data
 	starpu_pthread_mutex_t mutex;
 };
 
-
+void _fifo_node_deinit_data(struct starpu_sched_node * node)
+{
+	struct _starpu_fifo_data * f = node->data;
+	_starpu_prio_deque_destroy(&f->fifo);
+	STARPU_PTHREAD_MUTEX_LOCK(&f->mutex);
+	free(f);
+}
 
 static double fifo_estimated_end(struct starpu_sched_node * node)
 {
@@ -140,5 +146,6 @@ struct starpu_sched_node * starpu_sched_node_fifo_create(void * arg STARPU_ATTRI
 	node->estimated_load = estimated_load;
 	node->push_task = push_task;
 	node->pop_task = pop_task;
+	node->deinit_data = _fifo_node_deinit_data;
 	return node;
 }

+ 29 - 8
src/sched_policies/node_heft.c

@@ -170,6 +170,33 @@ void _heft_remove_child(struct starpu_sched_node * node, struct starpu_sched_nod
 	starpu_sched_node_remove_child(data->calibrating_node, child);
 }
 
+static void _heft_notify_change_in_workers(struct starpu_sched_node * node)
+{
+	struct _starpu_heft_data * data = node->data;
+	starpu_bitmap_unset_all(data->no_perf_model_node->workers_in_ctx);
+	starpu_bitmap_unset_all(data->no_perf_model_node->workers);
+
+	starpu_bitmap_or(data->no_perf_model_node->workers_in_ctx, node->workers_in_ctx);
+	starpu_bitmap_or(data->no_perf_model_node->workers, node->workers);
+
+	data->no_perf_model_node->is_homogeneous = node->is_homogeneous;
+
+
+	starpu_bitmap_unset_all(data->calibrating_node->workers_in_ctx);
+	starpu_bitmap_unset_all(data->calibrating_node->workers);
+
+	starpu_bitmap_or(data->calibrating_node->workers_in_ctx, node->workers_in_ctx);
+	starpu_bitmap_or(data->calibrating_node->workers, node->workers);
+
+	data->calibrating_node->is_homogeneous = node->is_homogeneous;
+}
+void _heft_node_deinit_data(struct starpu_sched_node * node)
+{
+	struct _starpu_heft_data * d = node->data;
+	starpu_sched_node_destroy(d->no_perf_model_node);
+	starpu_sched_node_destroy(d->calibrating_node);
+	free(d);
+}
 struct starpu_sched_node * starpu_sched_node_heft_create(struct starpu_heft_data * params)
 {
 	struct starpu_sched_node * node = starpu_sched_node_create();
@@ -181,21 +208,15 @@ struct starpu_sched_node * starpu_sched_node_heft_create(struct starpu_heft_data
 	data->idle_power = params->idle_power;
 
 	data->no_perf_model_node = params->no_perf_model_node_create(params->arg_no_perf_model);
-	starpu_bitmap_destroy(data->no_perf_model_node->workers);
-	starpu_bitmap_destroy(data->no_perf_model_node->workers_in_ctx);
-	data->no_perf_model_node->workers = node->workers;
-	data->no_perf_model_node->workers_in_ctx = node->workers_in_ctx;
 
 	data->calibrating_node = params->calibrating_node_create(params->arg_calibrating_node);
-	starpu_bitmap_destroy(data->calibrating_node->workers);
-	starpu_bitmap_destroy(data->calibrating_node->workers_in_ctx);
-	data->calibrating_node->workers = node->workers;
-	data->calibrating_node->workers_in_ctx = node->workers_in_ctx;
 
 	node->push_task = push_task;
 	node->add_child = _heft_add_child;
 	node->remove_child = _heft_remove_child;
 	node->data = data;
+	node->deinit_data = _heft_node_deinit_data;
+	node->notify_change_workers = _heft_notify_change_in_workers;
 
 	return node;
 }

+ 5 - 0
src/sched_policies/node_sched.c

@@ -393,9 +393,11 @@ struct starpu_sched_node * starpu_sched_node_create(void)
 	node->available = available;
 	node->add_child = starpu_sched_node_add_child;
 	node->remove_child = starpu_sched_node_remove_child;
+	node->notify_change_workers = take_node_and_does_nothing;
 	node->pop_task = pop_task_node;
 	node->estimated_load = estimated_load;
 	node->estimated_end = _starpu_sched_node_estimated_end_min;
+	node->deinit_data = take_node_and_does_nothing;
 	return node;
 }
 void starpu_sched_node_destroy(struct starpu_sched_node *node)
@@ -411,6 +413,7 @@ void starpu_sched_node_destroy(struct starpu_sched_node *node)
 				child->fathers[i] = NULL;
 
 	}
+	node->deinit_data(node);
 	free(node->childs);
 	starpu_bitmap_destroy(node->workers);
 	starpu_bitmap_destroy(node->workers_in_ctx);
@@ -449,6 +452,7 @@ void _starpu_sched_node_update_workers(struct starpu_sched_node * node)
 	{
 		_starpu_sched_node_update_workers(node->childs[i]);
 		starpu_bitmap_or(node->workers, node->childs[i]->workers);
+		node->notify_change_workers(node);
 	}
 }
 
@@ -471,6 +475,7 @@ void _starpu_sched_node_update_workers_in_ctx(struct starpu_sched_node * node, u
 			}
 	}
 	set_is_homogeneous(node);
+	node->notify_change_workers(node);
 }
 
 void starpu_sched_tree_update_workers_in_ctx(struct starpu_sched_tree * t)

+ 8 - 2
src/sched_policies/node_work_stealing.c

@@ -234,7 +234,12 @@ void _ws_remove_child(struct starpu_sched_node * node, struct starpu_sched_node
 	free(tmp_fifo);
 }
 
-struct starpu_sched_node * starpu_sched_node_work_stealing_create(void)
+void _work_stealing_node_deinit_data(struct starpu_sched_node * node)
+{
+	free(node->data);
+}
+
+struct starpu_sched_node * starpu_sched_node_work_stealing_create(void * arg STARPU_ATTRIBUTE_UNUSED)
 {
 	struct starpu_sched_node * node = starpu_sched_node_create();
 	struct _starpu_work_stealing_data * wsd = malloc(sizeof(*wsd));
@@ -243,6 +248,7 @@ struct starpu_sched_node * starpu_sched_node_work_stealing_create(void)
 	node->push_task = push_task;
 	node->add_child = _ws_add_child;
 	node->remove_child = _ws_remove_child;
+	node->deinit_data = _work_stealing_node_deinit_data;
 	node->data = wsd;
 	return  node;
 }
@@ -259,7 +265,7 @@ static void initialize_ws_center_policy(unsigned sched_ctx_id)
 	starpu_sched_ctx_create_worker_collection(sched_ctx_id, STARPU_WORKER_LIST);
 	struct starpu_sched_tree *t = starpu_sched_tree_create(sched_ctx_id);
 	struct starpu_sched_node * ws;
- 	t->root = ws = starpu_sched_node_work_stealing_create();
+ 	t->root = ws = starpu_sched_node_work_stealing_create(NULL);
 	t->workers = starpu_bitmap_create();
 	unsigned i;
 	for(i = 0; i < starpu_worker_get_count(); i++)

+ 32 - 11
src/sched_policies/node_worker.c

@@ -87,6 +87,9 @@ struct _starpu_worker_node_data
 };
 
 
+
+	
+
 static struct _starpu_worker_task_list * _starpu_worker_task_list_create(void)
 {
 	struct _starpu_worker_task_list * l = malloc(sizeof(*l));
@@ -259,13 +262,13 @@ struct starpu_sched_node * starpu_sched_node_worker_get(int workerid)
 	}
 }
 
-struct _starpu_worker * starpu_sched_node_worker_get_worker(struct starpu_sched_node * worker_node)
+struct _starpu_worker * _starpu_sched_node_worker_get_worker(struct starpu_sched_node * worker_node)
 {
 	STARPU_ASSERT(starpu_sched_node_is_simple_worker(worker_node));
 	struct _starpu_worker_node_data * data = worker_node->data;
 	return data->worker;
 }
-struct _starpu_combined_worker * starpu_sched_node_combined_worker_get_combined_worker(struct starpu_sched_node * worker_node)
+struct _starpu_combined_worker * _starpu_sched_node_combined_worker_get_combined_worker(struct starpu_sched_node * worker_node)
 {
 	STARPU_ASSERT(starpu_sched_node_is_combined_worker(worker_node));
 	struct _starpu_worker_node_data * data = worker_node->data;
@@ -276,9 +279,9 @@ enum starpu_perfmodel_archtype starpu_sched_node_worker_get_perf_arch(struct sta
 {
 	STARPU_ASSERT(starpu_sched_node_is_worker(worker_node));
 	if(starpu_sched_node_is_simple_worker(worker_node))
-		return starpu_sched_node_worker_get_worker(worker_node)->perf_arch;
+		return _starpu_sched_node_worker_get_worker(worker_node)->perf_arch;
 	else
-		return starpu_sched_node_combined_worker_get_combined_worker(worker_node)->perf_arch;
+		return _starpu_sched_node_combined_worker_get_combined_worker(worker_node)->perf_arch;
 }
 
 
@@ -345,7 +348,7 @@ struct starpu_task * starpu_sched_node_worker_pop_task(struct starpu_sched_node
 }
 void starpu_sched_node_worker_destroy(struct starpu_sched_node *node)
 {
-	struct _starpu_worker * worker = starpu_sched_node_worker_get_worker(node);
+	struct _starpu_worker * worker = _starpu_sched_node_worker_get_worker(node);
 	unsigned id = worker->workerid;
 	assert(_worker_nodes[id] == node);
 	int i;
@@ -358,13 +361,13 @@ void starpu_sched_node_worker_destroy(struct starpu_sched_node *node)
 
 void _starpu_sched_node_block_worker(int workerid)
 {
-	STARPU_ASSERT(0 <= workerid && workerid < starpu_worker_get_count());
+	STARPU_ASSERT(0 <= workerid && workerid < (int) starpu_worker_get_count());
 	struct _starpu_worker_node_data * data = starpu_sched_node_worker_create(workerid)->data;
 	STARPU_PTHREAD_MUTEX_LOCK(&data->lock);
 }
 void _starpu_sched_node_unblock_worker(int workerid)
 {
-	STARPU_ASSERT(0 <= workerid && workerid < starpu_worker_get_count());
+	STARPU_ASSERT(0 <= workerid && workerid < (int)starpu_worker_get_count());
 	struct _starpu_worker_node_data * data = starpu_sched_node_worker_create(workerid)->data;
 	STARPU_PTHREAD_MUTEX_UNLOCK(&data->lock);
 }
@@ -390,7 +393,7 @@ static void simple_worker_available(struct starpu_sched_node * worker_node)
 	(void) worker_node;
 
 #ifndef STARPU_NON_BLOCKING_DRIVERS
-	struct _starpu_worker * w = starpu_sched_node_worker_get_worker(worker_node);
+	struct _starpu_worker * w = _starpu_sched_node_worker_get_worker(worker_node);
 	if(w->workerid == starpu_worker_get_id())
 		return;
 	starpu_pthread_mutex_t *sched_mutex = &w->sched_mutex;
@@ -488,7 +491,7 @@ static double simple_worker_estimated_end(struct starpu_sched_node * node)
 
 static double simple_worker_estimated_load(struct starpu_sched_node * node)
 {
-	struct _starpu_worker * worker = starpu_sched_node_worker_get_worker(node);
+	struct _starpu_worker * worker = _starpu_sched_node_worker_get_worker(node);
 	int nb_task = 0;
 	STARPU_PTHREAD_MUTEX_LOCK(&worker->mutex);
 	struct starpu_task_list list = worker->local_tasks;
@@ -589,6 +592,22 @@ static int starpu_sched_node_combined_worker_push_task(struct starpu_sched_node
 	return 0;
 }
 
+void _worker_node_deinit_data(struct starpu_sched_node * node)
+{
+	struct _starpu_worker_node_data * d = node->data;
+	_starpu_worker_task_list_destroy(d->list);
+	if(starpu_sched_node_is_simple_worker(node))
+		STARPU_PTHREAD_MUTEX_DESTROY(&d->lock);
+	int i;
+	for(i = 0; i < STARPU_NMAXWORKERS; i++)
+		if(_worker_nodes[i] == node)
+		{
+			_worker_nodes[i] = NULL;
+			return;
+		}
+	free(d);
+}
+
 static struct starpu_sched_node * starpu_sched_node_worker_create(int workerid)
 {
 	STARPU_ASSERT(0 <=  workerid && workerid < (int) starpu_worker_get_count());
@@ -613,6 +632,7 @@ static struct starpu_sched_node * starpu_sched_node_worker_create(int workerid)
 	node->estimated_end = simple_worker_estimated_end;
 	node->estimated_load = simple_worker_estimated_load;
 	node->available = simple_worker_available;
+	node->deinit_data = _worker_node_deinit_data;
 	starpu_bitmap_set(node->workers, workerid);
 	starpu_bitmap_or(node->workers_in_ctx, node->workers);
 	_worker_nodes[workerid] = node;
@@ -650,6 +670,7 @@ static struct starpu_sched_node  * starpu_sched_node_combined_worker_create(int
 	node->estimated_end = combined_worker_estimated_end;
 	node->estimated_load = combined_worker_estimated_load;
 	node->available = combined_worker_available;
+	node->deinit_data = _worker_node_deinit_data;
 	starpu_bitmap_set(node->workers, workerid);
 	starpu_bitmap_or(node->workers_in_ctx, node->workers);
 	_worker_nodes[workerid] = node;
@@ -702,7 +723,7 @@ static int _worker_consistant(struct starpu_sched_node * node)
 }
 #endif
 
-int starpu_sched_node_worker_get_workerid(struct starpu_sched_node * worker_node)
+int _starpu_sched_node_worker_get_workerid(struct starpu_sched_node * worker_node)
 {
 #ifndef STARPU_NO_ASSERT
 	STARPU_ASSERT(_worker_consistant(worker_node));
@@ -756,7 +777,7 @@ void starpu_sched_node_worker_post_exec_hook(struct starpu_task * task)
 	STARPU_PTHREAD_MUTEX_UNLOCK(&list->mutex);
 }
 
-static void starpu_sched_node_worker_push_task_notify(struct starpu_task *task, int workerid, unsigned sched_ctx_id STARPU_ATTRIBUTE_UNUSED)
+static void starpu_sched_node_worker_push_task_notify(struct starpu_task * task, int workerid, unsigned sched_ctx_id STARPU_ATTRIBUTE_UNUSED)
 {
 
 #if 0

+ 3 - 0
src/sched_policies/sched_node.h

@@ -6,4 +6,7 @@ void _starpu_sched_node_unlock_all_workers(void);
 void _starpu_sched_node_block_worker(int workerid);
 void _starpu_sched_node_unblock_worker(int workerid);
 
+struct _starpu_worker * _starpu_sched_node_worker_get_worker(struct starpu_sched_node *);
+struct _starpu_combined_worker * _starpu_sched_node_combined_worker_get_combined_worker(struct starpu_sched_node * worker_node);
+
 #endif

+ 8 - 7
src/sched_policies/scheduler_maker.c

@@ -1,5 +1,6 @@
 #include "scheduler_maker.h"
-#include <starpu_node_sched.h>
+#include "sched_node.h"
+#include <starpu_sched_node.h>
 #include "node_composed.h"
 #include <common/list.h>
 #include <stdarg.h>
@@ -74,7 +75,7 @@ static struct sched_node_list helper_make_scheduler(hwloc_obj_t obj, struct star
 		return l;
 	for(i = 0; i < l.size; i++)
 	{
-		starpu_sched_node_add_child(node, l.arr[i]);
+		node->add_child(node, l.arr[i]);
 		starpu_sched_node_set_father(l.arr[i],node,sched_ctx_id);
 	}
 	destroy_list(&l);
@@ -152,7 +153,7 @@ static struct starpu_sched_node * where_should_we_plug_this(struct starpu_sched_
 	{	
 		struct starpu_sched_node * node = starpu_sched_node_composed_node_create(specs.hwloc_node_composed_sched_node);
 		node->obj = obj;
-		starpu_sched_node_add_child(father, node);
+		father->add_child(father, node);
 		starpu_sched_node_set_father(node, father, sched_ctx_id);
 		return node;
 	}
@@ -175,13 +176,13 @@ static void set_worker_leaf(struct starpu_sched_node * root, struct starpu_sched
 #endif
 		tmp->obj = worker_node->obj;
 		starpu_sched_node_set_father(tmp, node, sched_ctx_id);
-		starpu_sched_node_add_child(node, tmp);
+		node->add_child(node, tmp);
 		node = tmp;
 		
 	}
 	_starpu_destroy_composed_sched_node_recipe(recipe);
 	starpu_sched_node_set_father(worker_node, node, sched_ctx_id);
-	starpu_sched_node_add_child(node, worker_node);
+	node->add_child(node, worker_node);
 }
 
 #ifdef STARPU_DEVEL
@@ -199,7 +200,7 @@ static const char * name_sched_node(struct starpu_sched_node * node)
 		return "random node";
 	if(starpu_sched_node_is_worker(node))
 	{
-		struct _starpu_worker * w = starpu_sched_node_worker_get_worker(node);
+		struct _starpu_worker * w = _starpu_sched_node_worker_get_worker(node);
 #define SIZE 256
 		static char output[SIZE];
 		snprintf(output, SIZE,"node worker %d %s",w->workerid,w->name);
@@ -243,7 +244,7 @@ struct starpu_sched_tree * _starpu_make_scheduler(unsigned sched_ctx_id, struct
 	}
 
 
-	starpu_sched_tree_update_workers(t);
+	starpu_sched_tree_update_workers(tree);
 #ifdef STARPU_DEVEL
 	fprintf(stderr, "scheduler created :\n");
 	helper_display_scheduler(stderr, 0, tree->root);

+ 1 - 1
src/sched_policies/scheduler_maker.h

@@ -2,7 +2,7 @@
 #ifdef STARPU_HAVE_HWLOC
 #ifndef __SCHEDULER_MAKER_H__
 #define __SCHEDULER_MAKER_H__
-#include <starpu_node_sched.h>
+#include <starpu_sched_node.h>
 #include "node_composed.h"
 #include <common/list.h>