浏览代码

make sched_node.h public & rename functions

Simon Archipoff 12 年之前
父节点
当前提交
d539cfd17c

+ 2 - 2
doc/doxygen/Makefile.am

@@ -163,6 +163,7 @@ dox_inputs = $(DOX_CONFIG) 				\
 	$(top_srcdir)/include/starpu_profiling.h	\
 	$(top_srcdir)/include/starpu_profiling.h	\
 	$(top_srcdir)/include/starpu_bound.h		\
 	$(top_srcdir)/include/starpu_bound.h		\
 	$(top_srcdir)/include/starpu_scheduler.h	\
 	$(top_srcdir)/include/starpu_scheduler.h	\
+	$(top_srcdir)/include/starpu_sched_node.h	\
 	$(top_srcdir)/include/starpu_sched_ctx.h	\
 	$(top_srcdir)/include/starpu_sched_ctx.h	\
 	$(top_srcdir)/include/starpu_top.h		\
 	$(top_srcdir)/include/starpu_top.h		\
 	$(top_srcdir)/include/starpu_hash.h		\
 	$(top_srcdir)/include/starpu_hash.h		\
@@ -177,8 +178,7 @@ dox_inputs = $(DOX_CONFIG) 				\
 	$(top_srcdir)/sc_hypervisor/include/sc_hypervisor_config.h 	\
 	$(top_srcdir)/sc_hypervisor/include/sc_hypervisor_config.h 	\
 	$(top_srcdir)/sc_hypervisor/include/sc_hypervisor_lp.h		\
 	$(top_srcdir)/sc_hypervisor/include/sc_hypervisor_lp.h		\
 	$(top_srcdir)/sc_hypervisor/include/sc_hypervisor_monitoring.h	\
 	$(top_srcdir)/sc_hypervisor/include/sc_hypervisor_monitoring.h	\
-	$(top_srcdir)/sc_hypervisor/include/sc_hypervisor_policy.h	\
-	$(top_srcdir)/src/sched_policies/node_sched.h
+	$(top_srcdir)/sc_hypervisor/include/sc_hypervisor_policy.h
 
 
 $(DOX_TAG): $(dox_inputs)
 $(DOX_TAG): $(dox_inputs)
 	rm -fr $(DOX_HTML_DIR) $(DOX_LATEX_DIR)
 	rm -fr $(DOX_HTML_DIR) $(DOX_LATEX_DIR)

+ 34 - 34
doc/doxygen/chapters/api/modularized_scheduler.doxy

@@ -1,67 +1,67 @@
 /*! \defgroup API_Modularized_Scheduler Modularized scheduler interface
 /*! \defgroup API_Modularized_Scheduler Modularized scheduler interface
 
 
-\struct _starpu_sched_node
+\struct starpu_sched_node
 \ingroup API_Modularized_Scheduler
 \ingroup API_Modularized_Scheduler
 This structure represent a scheduler module.
 This structure represent a scheduler module.
 
 
-\var _starpu_sched_node::push_task
+\var starpu_sched_node::push_task
 	push a task in the scheduler module.
 	push a task in the scheduler module.
-\var _starpu_sched_node::pop_task
+\var starpu_sched_node::pop_task
 	pop a task from the scheduler module, the task returned by this function is executable by the caller if its a worker
 	pop a task from the scheduler module, the task returned by this function is executable by the caller if its a worker
-\var _starpu_sched_node::available
+\var starpu_sched_node::available
 	notify workers downstairs that a task is waiting for a pop
 	notify workers downstairs that a task is waiting for a pop
-\var _starpu_sched_node::estimated_load
+\var starpu_sched_node::estimated_load
 	is an heuristic to compute load of scheduler module
 	is an heuristic to compute load of scheduler module
-\var _starpu_sched_node::estimated_execute_preds
+\var starpu_sched_node::estimated_execute_preds
 	compute executions prediction for a task
 	compute executions prediction for a task
-\var _starpu_sched_node::nchilds
+\var starpu_sched_node::nchilds
 	the number of modules downstairs
 	the number of modules downstairs
-\var _starpu_sched_node::childs
+\var starpu_sched_node::childs
 	modules downstairs
 	modules downstairs
-\var _starpu_sched_node::workers
+\var starpu_sched_node::workers
 	this member contain the set of underlaying workers
 	this member contain the set of underlaying workers
-\var _starpu_sched_node::is_homogeneous
+\var starpu_sched_node::is_homogeneous
 	this is set to true iff all underlaying workers are the same
 	this is set to true iff all underlaying workers are the same
-\var _starpu_sched_node::data
+\var starpu_sched_node::data
 	data used by the scheduler module
 	data used by the scheduler module
-\var _starpu_sched_node::fathers
+\var starpu_sched_node::fathers
 	the array of scheduler module above indexed by scheduling context index
 	the array of scheduler module above indexed by scheduling context index
-\var _starpu_sched_node::init_data
+\var starpu_sched_node::init_data
 	is called after all the scheduler is created and should init data member
 	is called after all the scheduler is created and should init data member
 	you can store things in node->data while calling _sched_node_create(arg)
 	you can store things in node->data while calling _sched_node_create(arg)
 	and use it with init_data
 	and use it with init_data
-\var _starpu_sched_node::deinit_data
-	is called just before _starpu_sched_node_destroy
-\var _starpu_sched_node::obj
+\var starpu_sched_node::deinit_data
+	is called just before starpu_sched_node_destroy
+\var starpu_sched_node::obj
 	the hwloc object associed to scheduler module
 	the hwloc object associed to scheduler module
 
 
-\struct _starpu_task_execute_preds
+\struct starpu_task_execute_preds
 \ingroup API_Modularized_Scheduler
 \ingroup API_Modularized_Scheduler
-this structure containt predictions for a task and is filled by _starpu_sched_node::estimated_execute_preds
-\var _starpu_task_execute_preds::state
+this structure containt predictions for a task and is filled by starpu_sched_node::estimated_execute_preds
+\var starpu_task_execute_preds::state
 	indicate status of prediction
 	indicate status of prediction
-\var _starpu_task_execute_preds::archtype
-\var _starpu_task_execute_preds::impl
+\var starpu_task_execute_preds::archtype
+\var starpu_task_execute_preds::impl
 	those members are revelant is state is PERF_MODEL or CALIBRATING and is set to best or uncalibrated archtype and implementation, respectively, or suitable values if state is NO_PERF_MODEL
 	those members are revelant is state is PERF_MODEL or CALIBRATING and is set to best or uncalibrated archtype and implementation, respectively, or suitable values if state is NO_PERF_MODEL
-\var _starpu_task_execute_preds::expected_finish_time
+\var starpu_task_execute_preds::expected_finish_time
 	expected finish time of task
 	expected finish time of task
-\var _starpu_task_execute_preds::expected_length
+\var starpu_task_execute_preds::expected_length
 	expected compute time of task
 	expected compute time of task
-\var _starpu_task_execute_preds::expected_transfer_length
+\var starpu_task_execute_preds::expected_transfer_length
 	expected time for transfering data to worker's memory node
 	expected time for transfering data to worker's memory node
-\var _starpu_task_execute_preds::expected_power
+\var starpu_task_execute_preds::expected_power
 	expected power consumption for task
 	expected power consumption for task
 
 
-\struct _starpu_sched_tree
+\struct starpu_sched_tree
 \ingroup API_Modularized_Scheduler
 \ingroup API_Modularized_Scheduler
-\var _starpu_sched_tree::root
+\var starpu_sched_tree::root
 	this is the entry module of the scheduler
 	this is the entry module of the scheduler
-\var _starpu_sched_tree::workers
+\var starpu_sched_tree::workers
 	this is the set of workers available in this context, this value is used to mask workers in modules
 	this is the set of workers available in this context, this value is used to mask workers in modules
 \var lock
 \var lock
 	this lock protect the worker member
 	this lock protect the worker member
 
 
-\fn struct _starpu_sched_node * _starpu_sched_node_create(void)
+\fn struct starpu_sched_node * starpu_sched_node_create(void)
 
 
         allocate and initalise node field with defaults values :
         allocate and initalise node field with defaults values :
 	.pop_task make recursive call on father
 	.pop_task make recursive call on father
@@ -70,14 +70,14 @@ this structure containt predictions for a task and is filled by _starpu_sched_no
 	.estimated_execute_preds return the average of recursive call on childs
 	.estimated_execute_preds return the average of recursive call on childs
 
 
 
 
-\fn void _starpu_sched_node_destroy(struct _starpu_sched_node * node)
-    	 free data allocated by _starpu_sched_node_create, but dont call node->deinit_data(node)
-\fn void _starpu_sched_node_set_father(struct _starpu_sched_node * node, struct _starpu_sched_node * father_node, unsigned sched_ctx_id)
+\fn void starpu_sched_node_destroy(struct starpu_sched_node * node)
+    	 free data allocated by starpu_sched_node_create, but dont call node->deinit_data(node)
+\fn void starpu_sched_node_set_father(struct starpu_sched_node * node, struct starpu_sched_node * father_node, unsigned sched_ctx_id)
     	 set node->fathers[sched_ctx_id] to father_node
     	 set node->fathers[sched_ctx_id] to father_node
-\fn void _starpu_sched_node_add_child(struct _starpu_sched_node* node, struct _starpu_sched_node * child)
+\fn void starpu_sched_node_add_child(struct starpu_sched_node* node, struct starpu_sched_node * child)
     	 add child to node->childs and increment nchilds as well
     	 add child to node->childs and increment nchilds as well
 	 and dont modify child->fathers
 	 and dont modify child->fathers
-\fn void _starpu_sched_node_remove_child(struct _starpu_sched_node * node, struct _starpu_sched_node * child)
+\fn void starpu_sched_node_remove_child(struct starpu_sched_node * node, struct starpu_sched_node * child)
     	 remove child from node->childs and decrement nchilds
     	 remove child from node->childs and decrement nchilds
 
 
 
 

+ 1 - 1
doc/doxygen/doxygen-config.cfg.in

@@ -50,7 +50,7 @@ INPUT                  = @top_srcdir@/doc/doxygen/chapters \
 			 @top_srcdir@/include/starpu_top.h \
 			 @top_srcdir@/include/starpu_top.h \
 			 @top_srcdir@/include/starpu_util.h \
 			 @top_srcdir@/include/starpu_util.h \
 			 @top_srcdir@/include/starpu_worker.h \
 			 @top_srcdir@/include/starpu_worker.h \
-			 @top_srcdir@/src/sched_policies/node_sched.h \
+			 @top_srcdir@/include/starpu_sched_node.h \
 			 @top_srcdir@/mpi/include/ \
 			 @top_srcdir@/mpi/include/ \
 			 @top_srcdir@/starpufft/starpufft.h \
 			 @top_srcdir@/starpufft/starpufft.h \
 			 @top_srcdir@/sc_hypervisor/include
 			 @top_srcdir@/sc_hypervisor/include

+ 252 - 0
include/starpu_sched_node.h

@@ -0,0 +1,252 @@
+#ifndef __SCHED_NODE_H__
+#define __SCHED_NODE_H__
+#include <starpu.h>
+#include <common/starpu_spinlock.h>
+
+#ifdef STARPU_HAVE_HWLOC
+#include <hwloc.h>
+#endif
+
+/* struct starpu_sched_node are scheduler modules, a scheduler is a tree-like
+ * structure of them, some parts of scheduler can be shared by several contexes
+ * to perform some local optimisations, so, for all nodes, a list of father is
+ * defined indexed by sched_ctx_id
+ * 
+ * they embed there specialised method in a pseudo object-style, so calls are like node->push_task(node,task)
+ *
+ */
+struct starpu_sched_node
+{
+	/* node->push_task(node, task)
+	 * this function is called to push a task on node subtree, this can either
+	 * perform a recursive call on a child or store the task in the node, then
+	 * it will be returned by a further pop_task call
+	 *
+	 * the caller must ensure that node is able to execute task
+	 */
+	int (*push_task)(struct starpu_sched_node *,
+			 struct starpu_task *);
+	/* this function is called by workers to get a task on them fathers
+	 * this function should first return a localy stored task or perform
+	 * a recursive call on father
+	 *
+	 * a default implementation simply do a recursive call on father
+	 */
+	struct starpu_task * (*pop_task)(struct starpu_sched_node *,
+					 unsigned sched_ctx_id);
+
+	/* this function notify underlying worker that a task as been pushed
+	 * and would be returned by a pop_task call
+	 * it should be called each time a node localy store a task
+	 * 
+	 * default implementation simply perform a recursive call on childrens
+	 * this function can be called by a worker as it doesn't try to wake up himself
+	 */
+	void (*available)(struct starpu_sched_node *);
+	
+	/* this function is an heuristic that compute load of subtree, basicaly
+	 * it compute
+	 * estimated_load(node) = sum(estimated_load(node_childs)) +
+	 *          nb_local_tasks / average(relative_speedup(underlying_worker))
+	 */
+	double (*estimated_load)(struct starpu_sched_node * node);
+
+	/* this function return a struct starpu_task_execute_preds defined lower
+	 * wich basicaly give predictions for a task execution a call on 
+	 * homogeneous (with all workers of the same arch) node is optimised
+	 */
+	struct starpu_task_execute_preds (*estimated_execute_preds)(struct starpu_sched_node * node,
+								     struct starpu_task * task);
+	/* the numbers of node's childs
+	 */
+	int nchilds;
+	/* the vector of node's childs
+	 */
+	struct starpu_sched_node ** childs;
+	/* may be shared by several contexts
+	 * so we need several fathers
+	 */
+	struct starpu_sched_node * fathers[STARPU_NMAX_SCHED_CTXS];
+	/* the set of workers in the node's subtree
+	 */
+	struct starpu_bitmap * workers;
+	/* is_homogeneous is 0 iff workers in the node's subtree are heterogeneous,
+	 * this field is set and updated automaticaly, you shouldn't write on it
+	 */
+	int is_homogeneous;
+	/* node's private data, no restriction on use
+	 */
+	void * data;
+
+	/* this function is called after all childs has been set, and the
+	 * workers member was filled, can be used to init data, or anything you want
+	 */
+	void (*init_data)(struct starpu_sched_node *);
+	/* this function is called to free data allocated by init_data 
+	 * just before the call of starpu_sched_node_destroy(node)
+	 */
+	void (*deinit_data)(struct starpu_sched_node *);
+
+#ifdef STARPU_HAVE_HWLOC
+	/* in case of a hierarchical scheduler, this is set to the part of
+	 * topology that is binded to this node, eg: a numa node for a ws
+	 * node that would balance load between underlying sockets
+	 */
+	hwloc_obj_t obj;
+#endif
+};
+
+/* this structure is only returned by estimated_execute_preds and give
+ * predictions on task computations
+ */
+struct starpu_task_execute_preds
+{
+	/* if several value are possible for state member,
+	 * in order of priority :
+	 * CALIBRATING, PERF_MODEL, NO_PERF_MODEL, CANNOT_EXECUTE
+	 */
+	enum {CANNOT_EXECUTE = 0, CALIBRATING , NO_PERF_MODEL, PERF_MODEL} state;
+
+	/* archtype and nimpl is set to
+	 * best values if state is PERF_MODEL
+	 * values that needs to be calibrated if state is CALIBRATING
+	 * suitable values if NO_PERF_MODEL
+	 * irrevelant if CANNOT_EXECUTE
+	 */
+	enum starpu_perfmodel_archtype archtype;
+	int impl;
+
+	double expected_finish_time;
+	double expected_length;
+	double expected_transfer_length;
+	double expected_power;
+};
+
+
+struct starpu_sched_tree
+{
+	struct starpu_sched_node * root;
+	struct starpu_bitmap * workers;
+	/* this lock is used to protect the scheduler,
+	 * it is taken in read mode pushing a task
+	 * and in write mode for adding or removing workers
+	 */
+	starpu_pthread_rwlock_t lock;
+};
+
+
+
+struct starpu_sched_node * starpu_sched_node_create(void);
+
+void starpu_sched_node_destroy(struct starpu_sched_node * node);
+void starpu_sched_node_set_father(struct starpu_sched_node *node, struct starpu_sched_node *father_node, unsigned sched_ctx_id);
+void starpu_sched_node_add_child(struct starpu_sched_node * node, struct starpu_sched_node * child);
+void starpu_sched_node_remove_child(struct starpu_sched_node * node, struct starpu_sched_node * child);
+
+struct starpu_task_execute_preds starpu_sched_node_average_estimated_execute_preds(struct starpu_sched_node * node, struct starpu_task * task);
+
+int starpu_sched_node_can_execute_task(struct starpu_sched_node * node, struct starpu_task * task);
+int starpu_sched_node_can_execute_task_with_impl(struct starpu_sched_node * node, struct starpu_task * task, unsigned nimpl);
+
+/* no public create function for workers because we dont want to have several node_worker for a single workerid */
+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_combined_worker * starpu_sched_node_combined_worker_get_combined_worker(struct starpu_sched_node * combined_worker_node);
+void starpu_sched_node_worker_destroy(struct starpu_sched_node *);
+
+/* this function compare the available function of the node with the standard available for worker nodes*/
+int starpu_sched_node_is_worker(struct starpu_sched_node * node);
+int starpu_sched_node_is_simple_worker(struct starpu_sched_node * node);
+int starpu_sched_node_is_combined_worker(struct starpu_sched_node * node);
+int starpu_sched_node_worker_get_workerid(struct starpu_sched_node * worker_node);
+
+struct starpu_sched_node * starpu_sched_node_fifo_create(void * arg STARPU_ATTRIBUTE_UNUSED);
+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);
+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);
+int starpu_sched_node_is_random(struct starpu_sched_node *);
+struct starpu_sched_node * starpu_sched_node_eager_create(void * arg STARPU_ATTRIBUTE_UNUSED);
+
+struct starpu_sched_node * starpu_sched_node_heft_create(void * arg STARPU_ATTRIBUTE_UNUSED);
+/* this function is called to create the node wich will be used to push task when no perf model are available
+ * by default, a random node is created
+ */
+void starpu_sched_node_heft_set_no_model_node(struct starpu_sched_node * heft_node,
+					       struct starpu_sched_node * (*create_no_model_node)(void * arg), void * arg);
+
+int starpu_sched_node_is_heft(struct starpu_sched_node * node);
+
+/* compute predicted_end by taking in account the case of the predicted transfer and the predicted_end overlap
+ */
+double starpu_sched_compute_expected_time(double now, double predicted_end, double predicted_length, double predicted_transfer);
+
+/*create an empty tree
+ */
+struct starpu_sched_tree * starpu_sched_tree_create(void);
+void starpu_sched_tree_destroy(struct starpu_sched_tree * tree, unsigned sched_ctx_id);
+
+/* destroy node and all his child
+ * except if they are shared between several contexts
+ */
+void starpu_sched_node_destroy_rec(struct starpu_sched_node * node, unsigned sched_ctx_id);
+
+
+int starpu_sched_tree_push_task(struct starpu_task * task);
+struct starpu_task * starpu_sched_tree_pop_task(unsigned sched_ctx_id);
+void starpu_sched_tree_add_workers(unsigned sched_ctx_id, int *workerids, unsigned nworkers);
+void starpu_sched_tree_remove_workers(unsigned sched_ctx_id, int *workerids, unsigned nworkers);
+void starpu_sched_node_worker_pre_exec_hook(struct starpu_task * task);
+void starpu_sched_node_worker_post_exec_hook(struct starpu_task * task);
+
+/* return the bitmap of worker that are allowed to use in this scheduling context
+ */
+struct starpu_bitmap * _starpu_get_worker_mask(struct starpu_task * task);
+
+/* this function fill all the node->workers members
+ */
+void _starpu_set_workers_bitmaps(void);
+/* this function call init data on all nodes in postfix order
+ */
+void starpu_sched_tree_call_init_data(struct starpu_sched_tree * t);
+
+/* push task of list lower as possible in the tree, a non null value is returned if some task couldn't be pushed
+ */
+int starpu_sched_node_push_tasks_to_firsts_suitable_parent(struct starpu_sched_node * node, struct starpu_task_list * list, int sched_ctx_id);
+
+
+
+
+struct starpu_bitmap;
+
+struct starpu_bitmap * starpu_bitmap_create(void);
+void starpu_bitmap_destroy(struct starpu_bitmap *);
+
+void starpu_bitmap_set(struct starpu_bitmap *, int);
+void starpu_bitmap_unset(struct starpu_bitmap *, int);
+void starpu_bitmap_unset_all(struct starpu_bitmap *);
+
+int starpu_bitmap_get(struct starpu_bitmap *, int);
+
+//this is basically compute a |= b;
+void starpu_bitmap_or(struct starpu_bitmap * a,
+		       struct starpu_bitmap * b);
+
+//return 1 iff e set in b1 AND e set in b2
+int starpu_bitmap_and_get(struct starpu_bitmap * b1,
+			   struct starpu_bitmap * b2,
+			   int e);
+
+int starpu_bitmap_cardinal(struct starpu_bitmap *);
+
+//return the index of first bit, -1 if none
+int starpu_bitmap_first(struct starpu_bitmap *);
+int starpu_bitmap_last(struct starpu_bitmap *);
+//return the index of bit right after e, -1 if none
+int starpu_bitmap_next(struct starpu_bitmap *, int e);
+
+
+#endif

+ 0 - 2
src/Makefile.am

@@ -129,9 +129,7 @@ noinst_HEADERS = 						\
 	top/starpu_top_message_queue.h				\
 	top/starpu_top_message_queue.h				\
 	top/starpu_top_connection.h				\
 	top/starpu_top_connection.h				\
 	top/starpu_top_core.h					\
 	top/starpu_top_core.h					\
-	sched_policies/node_sched.h				\
 	sched_policies/prio_deque.h				\
 	sched_policies/prio_deque.h				\
-	sched_policies/bitmap.h					\
 	sched_policies/node_composed.h
 	sched_policies/node_composed.h
 #	sched_policies/scheduler_maker.h			
 #	sched_policies/scheduler_maker.h			
 
 

+ 23 - 23
src/sched_policies/bitmap.c

@@ -2,7 +2,7 @@
 #include <string.h>
 #include <string.h>
 #include <stdlib.h>
 #include <stdlib.h>
 #include <starpu.h>
 #include <starpu.h>
-#include "bitmap.h"
+#include <starpu_sched_node.h>
 
 
 #ifndef LONG_BIT
 #ifndef LONG_BIT
 #define LONG_BIT (sizeof(unsigned long) * 8)
 #define LONG_BIT (sizeof(unsigned long) * 8)
@@ -10,33 +10,33 @@
 
 
 
 
 
 
-struct _starpu_bitmap{
+struct starpu_bitmap{
 	unsigned long * bits;
 	unsigned long * bits;
 	int size;
 	int size;
 	int cardinal;
 	int cardinal;
 };
 };
 
 
 #ifndef STARPU_NO_ASSERT
 #ifndef STARPU_NO_ASSERT
-static int check_bitmap(struct _starpu_bitmap *b);
+static int check_bitmap(struct starpu_bitmap *b);
 #endif
 #endif
 
 
 
 
-struct _starpu_bitmap * _starpu_bitmap_create(void)
+struct starpu_bitmap * starpu_bitmap_create(void)
 {
 {
-	struct _starpu_bitmap * b = malloc(sizeof(*b));
+	struct starpu_bitmap * b = malloc(sizeof(*b));
 	memset(b,0,sizeof(*b));
 	memset(b,0,sizeof(*b));
 	return b;
 	return b;
 }
 }
-void _starpu_bitmap_destroy(struct _starpu_bitmap * b)
+void starpu_bitmap_destroy(struct starpu_bitmap * b)
 {
 {
 	free(b->bits);
 	free(b->bits);
 	free(b);
 	free(b);
 }
 }
 
 
-void _starpu_bitmap_set(struct _starpu_bitmap * b, int e)
+void starpu_bitmap_set(struct starpu_bitmap * b, int e)
 {
 {
 
 
-	if(!_starpu_bitmap_get(b, e))
+	if(!starpu_bitmap_get(b, e))
 		b->cardinal++;
 		b->cardinal++;
 	if((e/LONG_BIT) + 1 > b->size)
 	if((e/LONG_BIT) + 1 > b->size)
 	{
 	{
@@ -47,9 +47,9 @@ void _starpu_bitmap_set(struct _starpu_bitmap * b, int e)
 	b->bits[e/LONG_BIT] |= (1ul << (e%LONG_BIT));
 	b->bits[e/LONG_BIT] |= (1ul << (e%LONG_BIT));
 	STARPU_ASSERT(check_bitmap(b));
 	STARPU_ASSERT(check_bitmap(b));
 }
 }
-void _starpu_bitmap_unset(struct _starpu_bitmap *b, int e)
+void starpu_bitmap_unset(struct starpu_bitmap *b, int e)
 {
 {
-	if(_starpu_bitmap_get(b, e))
+	if(starpu_bitmap_get(b, e))
 		b->cardinal--;
 		b->cardinal--;
 	else
 	else
 		return;
 		return;
@@ -59,14 +59,14 @@ void _starpu_bitmap_unset(struct _starpu_bitmap *b, int e)
 	STARPU_ASSERT(check_bitmap(b));
 	STARPU_ASSERT(check_bitmap(b));
 }
 }
 
 
-void _starpu_bitmap_unset_all(struct _starpu_bitmap * b)
+void starpu_bitmap_unset_all(struct starpu_bitmap * b)
 {
 {
 	free(b->bits);
 	free(b->bits);
 	b->bits = NULL;
 	b->bits = NULL;
 	b->size = 0;
 	b->size = 0;
 }
 }
 
 
-int _starpu_bitmap_get(struct _starpu_bitmap * b, int e)
+int starpu_bitmap_get(struct starpu_bitmap * b, int e)
 {
 {
 	if(e / LONG_BIT >= b->size)
 	if(e / LONG_BIT >= b->size)
 		return 0;
 		return 0;
@@ -75,7 +75,7 @@ int _starpu_bitmap_get(struct _starpu_bitmap * b, int e)
 		0;
 		0;
 }
 }
 
 
-void _starpu_bitmap_or(struct _starpu_bitmap * a, struct _starpu_bitmap * b)
+void starpu_bitmap_or(struct starpu_bitmap * a, struct starpu_bitmap * b)
 {
 {
 	if(a->size < b->size)
 	if(a->size < b->size)
 	{
 	{
@@ -90,12 +90,12 @@ void _starpu_bitmap_or(struct _starpu_bitmap * a, struct _starpu_bitmap * b)
 }
 }
 
 
 
 
-int _starpu_bitmap_and_get(struct _starpu_bitmap * b1, struct _starpu_bitmap * b2, int e)
+int starpu_bitmap_and_get(struct starpu_bitmap * b1, struct starpu_bitmap * b2, int e)
 {
 {
-	return _starpu_bitmap_get(b1,e) && _starpu_bitmap_get(b2,e);
+	return starpu_bitmap_get(b1,e) && starpu_bitmap_get(b2,e);
 }
 }
 
 
-int _starpu_bitmap_cardinal(struct _starpu_bitmap * b)
+int starpu_bitmap_cardinal(struct starpu_bitmap * b)
 {
 {
 	return b->cardinal;
 	return b->cardinal;
 }
 }
@@ -112,7 +112,7 @@ static inline int get_first_bit_rank(unsigned long ms)
 }
 }
 
 
 
 
-int _starpu_bitmap_first(struct _starpu_bitmap * b)
+int starpu_bitmap_first(struct starpu_bitmap * b)
 {
 {
 	int i = 0;
 	int i = 0;
 	while(i < b->size && !b->bits[i])
 	while(i < b->size && !b->bits[i])
@@ -125,7 +125,7 @@ int _starpu_bitmap_first(struct _starpu_bitmap * b)
 	return (nb_long * LONG_BIT) + get_first_bit_rank(ms);
 	return (nb_long * LONG_BIT) + get_first_bit_rank(ms);
 }
 }
 
 
-int _starpu_bitmap_has_next(struct _starpu_bitmap * b, int e)
+int starpu_bitmap_has_next(struct starpu_bitmap * b, int e)
 {
 {
 	int nb_long = e / LONG_BIT;
 	int nb_long = e / LONG_BIT;
 	int nb_bit = e % LONG_BIT;
 	int nb_bit = e % LONG_BIT;
@@ -138,7 +138,7 @@ int _starpu_bitmap_has_next(struct _starpu_bitmap * b, int e)
 	return 0;
 	return 0;
 }
 }
 
 
-int _starpu_bitmap_last(struct _starpu_bitmap * b)
+int starpu_bitmap_last(struct starpu_bitmap * b)
 {
 {
 	if(b->cardinal == 0)
 	if(b->cardinal == 0)
 		return -1;
 		return -1;
@@ -157,7 +157,7 @@ int _starpu_bitmap_last(struct _starpu_bitmap * b)
 	return ilong * LONG_BIT + ibit;
 	return ilong * LONG_BIT + ibit;
 }
 }
 
 
-int _starpu_bitmap_next(struct _starpu_bitmap *b, int e)
+int starpu_bitmap_next(struct starpu_bitmap *b, int e)
 {
 {
 	int nb_long = e / LONG_BIT;
 	int nb_long = e / LONG_BIT;
 	int nb_bit = e % LONG_BIT;
 	int nb_bit = e % LONG_BIT;
@@ -176,16 +176,16 @@ int _starpu_bitmap_next(struct _starpu_bitmap *b, int e)
 }
 }
 
 
 #ifndef STARPU_NO_ASSERT
 #ifndef STARPU_NO_ASSERT
-static int check_bitmap(struct _starpu_bitmap *b)
+static int check_bitmap(struct starpu_bitmap *b)
 {
 {
 	int card = b->cardinal;
 	int card = b->cardinal;
-	int i = _starpu_bitmap_first(b);
+	int i = starpu_bitmap_first(b);
 	int j;
 	int j;
 	for(j = 0; j < card; j++)
 	for(j = 0; j < card; j++)
 	{
 	{
 		if(i == -1)
 		if(i == -1)
 			return 0;
 			return 0;
-		int tmp = _starpu_bitmap_next(b,i);
+		int tmp = starpu_bitmap_next(b,i);
 		if(tmp == i)
 		if(tmp == i)
 			return 0;
 			return 0;
 		i = tmp;
 		i = tmp;

+ 0 - 32
src/sched_policies/bitmap.h

@@ -1,32 +0,0 @@
-#ifndef __BITMAP_H__
-#define __BITMAP_H__
-
-struct _starpu_bitmap;
-
-struct _starpu_bitmap * _starpu_bitmap_create(void);
-void _starpu_bitmap_destroy(struct _starpu_bitmap *);
-
-void _starpu_bitmap_set(struct _starpu_bitmap *, int);
-void _starpu_bitmap_unset(struct _starpu_bitmap *, int);
-void _starpu_bitmap_unset_all(struct _starpu_bitmap *);
-
-int _starpu_bitmap_get(struct _starpu_bitmap *, int);
-
-//this is basically compute a |= b;
-void _starpu_bitmap_or(struct _starpu_bitmap * a,
-		       struct _starpu_bitmap * b);
-
-//return 1 iff e set in b1 AND e set in b2
-int _starpu_bitmap_and_get(struct _starpu_bitmap * b1,
-			   struct _starpu_bitmap * b2,
-			   int e);
-
-int _starpu_bitmap_cardinal(struct _starpu_bitmap *);
-
-//return the index of first bit, -1 if none
-int _starpu_bitmap_first(struct _starpu_bitmap *);
-int _starpu_bitmap_last(struct _starpu_bitmap *);
-//return the index of bit right after e, -1 if none
-int _starpu_bitmap_next(struct _starpu_bitmap *, int e);
-
-#endif

+ 17 - 17
src/sched_policies/hierarchical_heft.c

@@ -1,11 +1,11 @@
-#include "node_sched.h"
+#include <starpu_node_sched.h>
 #include <core/workers.h>
 #include <core/workers.h>
 #include "scheduler_maker.h"
 #include "scheduler_maker.h"
 
 
 static struct  _starpu_composed_sched_node_recipe *  recipe_for_worker(enum starpu_worker_archtype a STARPU_ATTRIBUTE_UNUSED)
 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_fifo_create, NULL);
+	struct _starpu_composed_sched_node_recipe * r = starpu_sched_node_create_recipe();
+	starpu_sched_recipe_add_node(r, starpu_sched_node_fifo_create, NULL);
 	return r;
 	return r;
 }
 }
 
 
@@ -13,21 +13,21 @@ static void initialize_heft_center_policy(unsigned sched_ctx_id)
 {
 {
 	starpu_sched_ctx_create_worker_collection(sched_ctx_id, STARPU_WORKER_LIST);
 	starpu_sched_ctx_create_worker_collection(sched_ctx_id, STARPU_WORKER_LIST);
 	
 	
-	struct _starpu_sched_specs specs;
+	struct starpu_sched_specs specs;
 	memset(&specs,0,sizeof(specs));
 	memset(&specs,0,sizeof(specs));
 	
 	
 	specs.hwloc_machine_composed_sched_node = ({
 	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);
+			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;});
 			r;});
 
 
 	specs.hwloc_node_composed_sched_node = ({
 	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);
+			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;});
 			r;});
 	specs.worker_composed_sched_node = recipe_for_worker;
 	specs.worker_composed_sched_node = recipe_for_worker;
 
 
-	struct _starpu_sched_tree *data = _starpu_make_scheduler(sched_ctx_id, specs);
+	struct starpu_sched_tree *data = _starpu_make_scheduler(sched_ctx_id, specs);
 
 
 	_starpu_destroy_composed_sched_node_recipe(specs.hwloc_machine_composed_sched_node);
 	_starpu_destroy_composed_sched_node_recipe(specs.hwloc_machine_composed_sched_node);
 
 
@@ -40,9 +40,9 @@ static void initialize_heft_center_policy(unsigned sched_ctx_id)
 
 
 static void deinitialize_heft_center_policy(unsigned sched_ctx_id)
 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_tree_destroy(t, 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);
 	starpu_sched_ctx_delete_worker_collection(sched_ctx_id);
 }
 }
 
 
@@ -50,14 +50,14 @@ 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_policy =
 {
 {
 	.init_sched = initialize_heft_center_policy,
 	.init_sched = initialize_heft_center_policy,
 	.deinit_sched = deinitialize_heft_center_policy,
 	.deinit_sched = deinitialize_heft_center_policy,
-	.add_workers = _starpu_tree_add_workers,
-	.remove_workers = _starpu_tree_remove_workers,
-	.push_task = _starpu_tree_push_task,
-	.pop_task = _starpu_tree_pop_task,
+	.add_workers = starpu_sched_tree_add_workers,
+	.remove_workers = starpu_sched_tree_remove_workers,
+	.push_task = starpu_sched_tree_push_task,
+	.pop_task = starpu_sched_tree_pop_task,
 	.pre_exec_hook = NULL,
 	.pre_exec_hook = NULL,
 	.post_exec_hook = NULL,
 	.post_exec_hook = NULL,
 	.pop_every_task = NULL,
 	.pop_every_task = NULL,

+ 26 - 26
src/sched_policies/node_composed.c

@@ -1,7 +1,7 @@
-#include "node_sched.h"
+#include <starpu_sched_node.h>
 #include <common/list.h>
 #include <common/list.h>
 LIST_TYPE(fun_create_node,
 LIST_TYPE(fun_create_node,
-	  struct _starpu_sched_node *(*create_node)(void * arg);
+	  struct starpu_sched_node *(*create_node)(void * arg);
 	  void * arg;
 	  void * arg;
 );
 );
 
 
@@ -12,24 +12,24 @@ struct _starpu_composed_sched_node_recipe
 };
 };
 
 
 
 
-struct _starpu_composed_sched_node_recipe * _starpu_sched_node_create_recipe(void)
+struct _starpu_composed_sched_node_recipe * starpu_sched_node_create_recipe(void)
 {
 {
 	struct _starpu_composed_sched_node_recipe * recipe = malloc(sizeof(*recipe));
 	struct _starpu_composed_sched_node_recipe * recipe = malloc(sizeof(*recipe));
 	recipe->list = fun_create_node_list_new();
 	recipe->list = fun_create_node_list_new();
 	return recipe;
 	return recipe;
 }
 }
 
 
-void _starpu_sched_recipe_add_node(struct _starpu_composed_sched_node_recipe * recipe, struct _starpu_sched_node *(*create_node)(void * arg), void * arg)
+void starpu_sched_recipe_add_node(struct _starpu_composed_sched_node_recipe * recipe, struct starpu_sched_node *(*create_node)(void * arg), void * arg)
 {
 {
 	struct fun_create_node * e = fun_create_node_new();
 	struct fun_create_node * e = fun_create_node_new();
 	e->create_node = create_node;
 	e->create_node = create_node;
 	e->arg = arg;
 	e->arg = arg;
 	fun_create_node_list_push_back(recipe->list, e);
 	fun_create_node_list_push_back(recipe->list, e);
 }
 }
-struct _starpu_composed_sched_node_recipe * _starpu_sched_node_create_recipe_singleton(struct _starpu_sched_node *(*create_node)(void * arg), void * arg)
+struct _starpu_composed_sched_node_recipe * starpu_sched_node_create_recipe_singleton(struct starpu_sched_node *(*create_node)(void * arg), void * arg)
 {
 {
-	struct _starpu_composed_sched_node_recipe * r = _starpu_sched_node_create_recipe();
-	_starpu_sched_recipe_add_node(r, create_node, arg);
+	struct _starpu_composed_sched_node_recipe * r = starpu_sched_node_create_recipe();
+	starpu_sched_recipe_add_node(r, create_node, arg);
 	return r;
 	return r;
 }
 }
 void _starpu_destroy_composed_sched_node_recipe(struct _starpu_composed_sched_node_recipe * recipe)
 void _starpu_destroy_composed_sched_node_recipe(struct _starpu_composed_sched_node_recipe * recipe)
@@ -44,9 +44,9 @@ void _starpu_destroy_composed_sched_node_recipe(struct _starpu_composed_sched_no
 
 
 struct composed_node
 struct composed_node
 {
 {
-	struct _starpu_sched_node *top,*bottom;
+	struct starpu_sched_node *top,*bottom;
 };
 };
-struct composed_node create_composed_node(struct _starpu_sched_node * sched_ctx_ids_father[STARPU_NMAX_SCHED_CTXS], struct _starpu_bitmap * workers, struct _starpu_composed_sched_node_recipe * recipe
+struct composed_node create_composed_node(struct starpu_sched_node * sched_ctx_ids_father[STARPU_NMAX_SCHED_CTXS], struct starpu_bitmap * workers, struct _starpu_composed_sched_node_recipe * recipe
 #ifdef STARPU_HAVE_HWLOC
 #ifdef STARPU_HAVE_HWLOC
 					    ,hwloc_obj_t obj
 					    ,hwloc_obj_t obj
 #endif
 #endif
@@ -73,60 +73,60 @@ struct composed_node create_composed_node(struct _starpu_sched_node * sched_ctx_
 	    i  = fun_create_node_list_next(i))
 	    i  = fun_create_node_list_next(i))
 	{
 	{
 		STARPU_ASSERT(i->create_node(i->arg));
 		STARPU_ASSERT(i->create_node(i->arg));
-		struct _starpu_sched_node * node = i->create_node(i->arg);
+		struct starpu_sched_node * node = i->create_node(i->arg);
 #ifdef STARPU_HAVE_HWLOC
 #ifdef STARPU_HAVE_HWLOC
 		node->obj = obj;
 		node->obj = obj;
 #endif
 #endif
-		_starpu_sched_node_add_child(c.bottom, node);
+		starpu_sched_node_add_child(c.bottom, node);
 //we want to be able to to traverse scheduler bottom up for all sched ctxs
 //we want to be able to to traverse scheduler bottom up for all sched ctxs
 		int j;
 		int j;
 		for(j = 0; j < STARPU_NMAX_SCHED_CTXS; j++)
 		for(j = 0; j < STARPU_NMAX_SCHED_CTXS; j++)
 			if(sched_ctx_ids_father[j])
 			if(sched_ctx_ids_father[j])
-				_starpu_sched_node_set_father(node, c.bottom,(unsigned)j);
+				starpu_sched_node_set_father(node, c.bottom,(unsigned)j);
 		node->workers = workers;
 		node->workers = workers;
 		c.bottom = node;
 		c.bottom = node;
 	}
 	}
-	STARPU_ASSERT(!_starpu_sched_node_is_worker(c.bottom));
+	STARPU_ASSERT(!starpu_sched_node_is_worker(c.bottom));
 	return c;
 	return c;
 }
 }
 		
 		
 
 
-static int composed_node_push_task(struct _starpu_sched_node * node, struct starpu_task * task)
+static int composed_node_push_task(struct starpu_sched_node * node, struct starpu_task * task)
 {
 {
 	struct composed_node *c = node->data;
 	struct composed_node *c = node->data;
 	return c->top->push_task(c->top,task);
 	return c->top->push_task(c->top,task);
 }
 }
-struct starpu_task * composed_node_pop_task(struct _starpu_sched_node *node,
+struct starpu_task * composed_node_pop_task(struct starpu_sched_node *node,
 					    unsigned sched_ctx_id)
 					    unsigned sched_ctx_id)
 {
 {
 	struct composed_node *c = node->data;
 	struct composed_node *c = node->data;
 	return c->bottom->pop_task(c->bottom, sched_ctx_id);
 	return c->bottom->pop_task(c->bottom, sched_ctx_id);
 }
 }
-void composed_node_available(struct _starpu_sched_node *node)
+void composed_node_available(struct starpu_sched_node *node)
 {
 {
 	struct composed_node * c = node->data;
 	struct composed_node * c = node->data;
 	c->top->available(c->top);
 	c->top->available(c->top);
 }
 }
 	
 	
-double composed_node_estimated_load(struct _starpu_sched_node * node)
+double composed_node_estimated_load(struct starpu_sched_node * node)
 {
 {
 	struct composed_node * c = node->data;
 	struct composed_node * c = node->data;
 	return c->top->estimated_load(c->top);
 	return c->top->estimated_load(c->top);
 }
 }
 
 
-struct _starpu_task_execute_preds composed_node_estimated_execute_preds(struct _starpu_sched_node * node,
+struct starpu_task_execute_preds composed_node_estimated_execute_preds(struct starpu_sched_node * node,
 									struct starpu_task * task)
 									struct starpu_task * task)
 {
 {
 	struct composed_node * c = node->data;
 	struct composed_node * c = node->data;
 	return c->top->estimated_execute_preds(c->top,task);
 	return c->top->estimated_execute_preds(c->top,task);
 }
 }
 
 
-static void invalid_second_init_data(struct _starpu_sched_node * node STARPU_ATTRIBUTE_UNUSED)
+static void invalid_second_init_data(struct starpu_sched_node * node STARPU_ATTRIBUTE_UNUSED)
 {
 {
 	STARPU_ABORT();
 	STARPU_ABORT();
 }
 }
 
 
-void composed_node_init_data(struct _starpu_sched_node *node)
+void composed_node_init_data(struct starpu_sched_node *node)
 {
 {
 	struct _starpu_composed_sched_node_recipe * recipe = node->data;
 	struct _starpu_composed_sched_node_recipe * recipe = node->data;
 	struct composed_node * c = malloc(sizeof(struct composed_node));
 	struct composed_node * c = malloc(sizeof(struct composed_node));
@@ -141,31 +141,31 @@ void composed_node_init_data(struct _starpu_sched_node *node)
 	node->init_data = invalid_second_init_data;
 	node->init_data = invalid_second_init_data;
 }
 }
 
 
-void composed_node_deinit_data(struct _starpu_sched_node * _node)
+void composed_node_deinit_data(struct starpu_sched_node * _node)
 {
 {
 	struct composed_node *c = _node->data;
 	struct composed_node *c = _node->data;
 	c->bottom->childs = NULL;
 	c->bottom->childs = NULL;
 	c->bottom->nchilds = 0;
 	c->bottom->nchilds = 0;
-	struct _starpu_sched_node * node = c->top;
-	struct _starpu_sched_node * next = NULL;
+	struct starpu_sched_node * node = c->top;
+	struct starpu_sched_node * next = NULL;
 	do
 	do
 	{
 	{
 		node->workers = NULL;
 		node->workers = NULL;
 		node->deinit_data(node);
 		node->deinit_data(node);
 		next = node->childs ? node->childs[0] : NULL;
 		next = node->childs ? node->childs[0] : NULL;
-		_starpu_sched_node_destroy(node);
+		starpu_sched_node_destroy(node);
 	}while(next);
 	}while(next);
 	free(c);
 	free(c);
 	_node->data = NULL;
 	_node->data = NULL;
 }
 }
 
 
-struct _starpu_sched_node * _starpu_sched_node_composed_node_create(struct _starpu_composed_sched_node_recipe * recipe)
+struct starpu_sched_node * starpu_sched_node_composed_node_create(struct _starpu_composed_sched_node_recipe * recipe)
 {
 {
 	STARPU_ASSERT(!fun_create_node_list_empty(recipe->list));
 	STARPU_ASSERT(!fun_create_node_list_empty(recipe->list));
 	struct fun_create_node_list * l = recipe->list;
 	struct fun_create_node_list * l = recipe->list;
 	if(l->_head == l->_tail)
 	if(l->_head == l->_tail)
 		return l->_head->create_node(l->_head->arg);
 		return l->_head->create_node(l->_head->arg);
-	struct _starpu_sched_node * node = _starpu_sched_node_create();
+	struct starpu_sched_node * node = starpu_sched_node_create();
 
 
 	node->data = recipe;
 	node->data = recipe;
 	node->push_task = composed_node_push_task;
 	node->push_task = composed_node_push_task;

+ 5 - 5
src/sched_policies/node_composed.h

@@ -1,17 +1,17 @@
 #ifndef __NODE_COMPOSED_H__
 #ifndef __NODE_COMPOSED_H__
 #define __NODE_COMPOSED_H__
 #define __NODE_COMPOSED_H__
-#include "node_sched.h"
+#include <starpu_node_sched.h>
 
 
 struct _starpu_composed_sched_node_recipe;
 struct _starpu_composed_sched_node_recipe;
 
 
 //create empty recipe
 //create empty recipe
-struct _starpu_composed_sched_node_recipe * _starpu_sched_node_create_recipe(void);
-struct _starpu_composed_sched_node_recipe * _starpu_sched_node_create_recipe_singleton(struct _starpu_sched_node *(*create_node)(void * arg), void * arg);
+struct _starpu_composed_sched_node_recipe * starpu_sched_node_create_recipe(void);
+struct _starpu_composed_sched_node_recipe * starpu_sched_node_create_recipe_singleton(struct starpu_sched_node *(*create_node)(void * arg), void * arg);
 
 
 //add a function creation node to recipe
 //add a function creation node to recipe
-void _starpu_sched_recipe_add_node(struct _starpu_composed_sched_node_recipe * recipe, struct _starpu_sched_node *(*create_node)(void * arg), void * arg);
+void starpu_sched_recipe_add_node(struct _starpu_composed_sched_node_recipe * recipe, struct starpu_sched_node *(*create_node)(void * arg), void * arg);
 
 
 void _starpu_destroy_composed_sched_node_recipe(struct _starpu_composed_sched_node_recipe *);
 void _starpu_destroy_composed_sched_node_recipe(struct _starpu_composed_sched_node_recipe *);
 
 
-struct _starpu_sched_node * _starpu_sched_node_composed_node_create(struct _starpu_composed_sched_node_recipe * recipe);
+struct starpu_sched_node * starpu_sched_node_composed_node_create(struct _starpu_composed_sched_node_recipe * recipe);
 #endif
 #endif

+ 15 - 15
src/sched_policies/node_eager.c

@@ -1,6 +1,6 @@
 #include <common/thread.h>
 #include <common/thread.h>
 #include <core/sched_policy.h>
 #include <core/sched_policy.h>
-#include "node_sched.h"
+#include <starpu_sched_node.h>
 #include "fifo_queues.h"
 #include "fifo_queues.h"
 
 
 
 
@@ -8,28 +8,28 @@
 static void initialize_eager_center_policy(unsigned sched_ctx_id)
 static void initialize_eager_center_policy(unsigned sched_ctx_id)
 {
 {
 	starpu_sched_ctx_create_worker_collection(sched_ctx_id, STARPU_WORKER_LIST);
 	starpu_sched_ctx_create_worker_collection(sched_ctx_id, STARPU_WORKER_LIST);
-	struct _starpu_sched_tree *data = malloc(sizeof(struct _starpu_sched_tree));
+	struct starpu_sched_tree *data = malloc(sizeof(struct starpu_sched_tree));
 	STARPU_PTHREAD_RWLOCK_INIT(&data->lock,NULL);
 	STARPU_PTHREAD_RWLOCK_INIT(&data->lock,NULL);
- 	data->root = _starpu_sched_node_fifo_create(NULL);
-	data->workers = _starpu_bitmap_create();
+ 	data->root = starpu_sched_node_fifo_create(NULL);
+	data->workers = starpu_bitmap_create();
 	unsigned i;
 	unsigned i;
 	for(i = 0; i < starpu_worker_get_count() + starpu_combined_worker_get_count(); i++)
 	for(i = 0; i < starpu_worker_get_count() + starpu_combined_worker_get_count(); i++)
 	{
 	{
-		struct _starpu_sched_node * node = _starpu_sched_node_worker_get(i);
+		struct starpu_sched_node * node = starpu_sched_node_worker_get(i);
 		if(!node)
 		if(!node)
 			continue;
 			continue;
 		node->fathers[sched_ctx_id] = data->root;
 		node->fathers[sched_ctx_id] = data->root;
-		_starpu_sched_node_add_child(data->root, node);
+		starpu_sched_node_add_child(data->root, node);
 	}
 	}
 	_starpu_set_workers_bitmaps();
 	_starpu_set_workers_bitmaps();
-	_starpu_tree_call_init_data(data);
+	starpu_sched_tree_call_init_data(data);
 	starpu_sched_ctx_set_policy_data(sched_ctx_id, (void*)data);
 	starpu_sched_ctx_set_policy_data(sched_ctx_id, (void*)data);
 }
 }
 
 
 static void deinitialize_eager_center_policy(unsigned sched_ctx_id)
 static void deinitialize_eager_center_policy(unsigned sched_ctx_id)
 {
 {
-	struct _starpu_sched_tree *tree = (struct _starpu_sched_tree*)starpu_sched_ctx_get_policy_data(sched_ctx_id);
-	_starpu_sched_tree_destroy(tree, sched_ctx_id);
+	struct starpu_sched_tree *tree = (struct starpu_sched_tree*)starpu_sched_ctx_get_policy_data(sched_ctx_id);
+	starpu_sched_tree_destroy(tree, sched_ctx_id);
 	starpu_sched_ctx_delete_worker_collection(sched_ctx_id);
 	starpu_sched_ctx_delete_worker_collection(sched_ctx_id);
 }
 }
 
 
@@ -37,12 +37,12 @@ struct starpu_sched_policy _starpu_sched_tree_eager_policy =
 {
 {
 	.init_sched = initialize_eager_center_policy,
 	.init_sched = initialize_eager_center_policy,
 	.deinit_sched = deinitialize_eager_center_policy,
 	.deinit_sched = deinitialize_eager_center_policy,
-	.add_workers = _starpu_tree_add_workers,
-	.remove_workers = _starpu_tree_remove_workers,
-	.push_task = _starpu_tree_push_task,
-	.pop_task = _starpu_tree_pop_task,
-	.pre_exec_hook = _starpu_sched_node_worker_pre_exec_hook,
-	.post_exec_hook = _starpu_sched_node_worker_post_exec_hook,
+	.add_workers = starpu_sched_tree_add_workers,
+	.remove_workers = starpu_sched_tree_remove_workers,
+	.push_task = starpu_sched_tree_push_task,
+	.pop_task = starpu_sched_tree_pop_task,
+	.pre_exec_hook = starpu_sched_node_worker_pre_exec_hook,
+	.post_exec_hook = starpu_sched_node_worker_post_exec_hook,
 	.pop_every_task = NULL,//pop_every_task_eager_policy,
 	.pop_every_task = NULL,//pop_every_task_eager_policy,
 	.policy_name = "tree",
 	.policy_name = "tree",
 	.policy_description = "test tree policy"
 	.policy_description = "test tree policy"

+ 27 - 27
src/sched_policies/node_fifo.c

@@ -1,4 +1,4 @@
-#include "node_sched.h"
+#include <starpu_sched_node.h>
 #include "prio_deque.h"
 #include "prio_deque.h"
 #include <starpu_scheduler.h>
 #include <starpu_scheduler.h>
 
 
@@ -10,7 +10,7 @@ struct _starpu_fifo_data
 };
 };
 
 
 
 
-static struct _starpu_task_execute_preds estimated_execute_preds(struct _starpu_sched_node * node,
+static struct starpu_task_execute_preds estimated_execute_preds(struct starpu_sched_node * node,
 								 struct starpu_task * task)
 								 struct starpu_task * task)
 {
 {
 	struct _starpu_fifo_data * data = node->data;
 	struct _starpu_fifo_data * data = node->data;
@@ -18,16 +18,16 @@ static struct _starpu_task_execute_preds estimated_execute_preds(struct _starpu_
 	starpu_pthread_mutex_t * mutex = &data->mutex;
 	starpu_pthread_mutex_t * mutex = &data->mutex;
 	if(node->nchilds == 0)
 	if(node->nchilds == 0)
 	{
 	{
-		struct _starpu_task_execute_preds p = { CANNOT_EXECUTE };
+		struct starpu_task_execute_preds p = { CANNOT_EXECUTE };
 		return p;
 		return p;
 	}
 	}
 	
 	
 	if(!node->is_homogeneous)
 	if(!node->is_homogeneous)
 	{
 	{
-		struct _starpu_task_execute_preds preds = _starpu_sched_node_average_estimated_execute_preds(node, task);
+		struct starpu_task_execute_preds preds = starpu_sched_node_average_estimated_execute_preds(node, task);
 		STARPU_PTHREAD_MUTEX_LOCK(mutex);
 		STARPU_PTHREAD_MUTEX_LOCK(mutex);
-		double fifo_len = fifo->exp_len / _starpu_bitmap_cardinal(node->workers);
-		preds.expected_finish_time = _starpu_compute_expected_time(fifo->exp_start,
+		double fifo_len = fifo->exp_len / starpu_bitmap_cardinal(node->workers);
+		preds.expected_finish_time = starpu_sched_compute_expected_time(fifo->exp_start,
 									   preds.expected_finish_time + fifo_len,
 									   preds.expected_finish_time + fifo_len,
 									   preds.state == PERF_MODEL ? preds.expected_length + fifo_len : fifo_len,
 									   preds.state == PERF_MODEL ? preds.expected_length + fifo_len : fifo_len,
 									   preds.expected_transfer_length);
 									   preds.expected_transfer_length);
@@ -35,13 +35,13 @@ static struct _starpu_task_execute_preds estimated_execute_preds(struct _starpu_
 		return preds;
 		return preds;
 	}
 	}
 	
 	
-	struct _starpu_task_execute_preds preds = node->childs[0]->estimated_execute_preds(node->childs[0],task);
+	struct starpu_task_execute_preds preds = node->childs[0]->estimated_execute_preds(node->childs[0],task);
 
 
 	if(preds.state == PERF_MODEL)
 	if(preds.state == PERF_MODEL)
 	{
 	{
-		double fifo_len = fifo->exp_len / _starpu_bitmap_cardinal(node->workers);
+		double fifo_len = fifo->exp_len / starpu_bitmap_cardinal(node->workers);
 		STARPU_PTHREAD_MUTEX_LOCK(mutex);
 		STARPU_PTHREAD_MUTEX_LOCK(mutex);
-		preds.expected_finish_time = _starpu_compute_expected_time(fifo->exp_start,
+		preds.expected_finish_time = starpu_sched_compute_expected_time(fifo->exp_start,
 									   preds.expected_finish_time + fifo_len,
 									   preds.expected_finish_time + fifo_len,
 									   preds.expected_length + fifo_len,
 									   preds.expected_length + fifo_len,
 									   preds.expected_transfer_length);
 									   preds.expected_transfer_length);
@@ -50,7 +50,7 @@ static struct _starpu_task_execute_preds estimated_execute_preds(struct _starpu_
 	return preds;
 	return preds;
 }
 }
 
 
-static double estimated_load(struct _starpu_sched_node * node)
+static double estimated_load(struct starpu_sched_node * node)
 {
 {
 	struct _starpu_fifo_data * data = node->data;
 	struct _starpu_fifo_data * data = node->data;
 	struct _starpu_prio_deque * fifo = &data->fifo;
 	struct _starpu_prio_deque * fifo = &data->fifo;
@@ -60,7 +60,7 @@ static double estimated_load(struct _starpu_sched_node * node)
 
 
 	if(node->is_homogeneous)
 	if(node->is_homogeneous)
 	{
 	{
-		relative_speedup = starpu_worker_get_relative_speedup(starpu_worker_get_perf_archtype(_starpu_bitmap_first(node->workers)));
+		relative_speedup = starpu_worker_get_relative_speedup(starpu_worker_get_perf_archtype(starpu_bitmap_first(node->workers)));
 		STARPU_PTHREAD_MUTEX_LOCK(mutex);
 		STARPU_PTHREAD_MUTEX_LOCK(mutex);
 		load = fifo->ntasks / relative_speedup;
 		load = fifo->ntasks / relative_speedup;
 		STARPU_PTHREAD_MUTEX_UNLOCK(mutex);
 		STARPU_PTHREAD_MUTEX_UNLOCK(mutex);
@@ -69,11 +69,11 @@ static double estimated_load(struct _starpu_sched_node * node)
 	else
 	else
 	{
 	{
 		int i;
 		int i;
-		for(i = _starpu_bitmap_first(node->workers);
+		for(i = starpu_bitmap_first(node->workers);
 		    i != -1;
 		    i != -1;
-		    i = _starpu_bitmap_next(node->workers, i))
+		    i = starpu_bitmap_next(node->workers, i))
 			relative_speedup += starpu_worker_get_relative_speedup(starpu_worker_get_perf_archtype(i));
 			relative_speedup += starpu_worker_get_relative_speedup(starpu_worker_get_perf_archtype(i));
-		relative_speedup /= _starpu_bitmap_cardinal(node->workers);
+		relative_speedup /= starpu_bitmap_cardinal(node->workers);
 			STARPU_ASSERT(!_STARPU_IS_ZERO(relative_speedup));
 			STARPU_ASSERT(!_STARPU_IS_ZERO(relative_speedup));
 			STARPU_PTHREAD_MUTEX_LOCK(mutex);
 			STARPU_PTHREAD_MUTEX_LOCK(mutex);
 			load = fifo->ntasks / relative_speedup;
 			load = fifo->ntasks / relative_speedup;
@@ -82,15 +82,15 @@ static double estimated_load(struct _starpu_sched_node * node)
 	int i;
 	int i;
 	for(i = 0; i < node->nchilds; i++)
 	for(i = 0; i < node->nchilds; i++)
 	{
 	{
-		struct _starpu_sched_node * c = node->childs[i];
+		struct starpu_sched_node * c = node->childs[i];
 		load += c->estimated_load(c);
 		load += c->estimated_load(c);
 	}
 	}
 	return load;
 	return load;
 }
 }
 
 
-static int push_task(struct _starpu_sched_node * node, struct starpu_task * task)
+static int push_task(struct starpu_sched_node * node, struct starpu_task * task)
 {
 {
-	STARPU_ASSERT(_starpu_sched_node_can_execute_task(node,task));
+	STARPU_ASSERT(starpu_sched_node_can_execute_task(node,task));
 	struct _starpu_fifo_data * data = node->data;
 	struct _starpu_fifo_data * data = node->data;
 	struct _starpu_prio_deque * fifo = &data->fifo;
 	struct _starpu_prio_deque * fifo = &data->fifo;
 	starpu_pthread_mutex_t * mutex = &data->mutex;
 	starpu_pthread_mutex_t * mutex = &data->mutex;
@@ -113,7 +113,7 @@ static int push_task(struct _starpu_sched_node * node, struct starpu_task * task
 	return ret;
 	return ret;
 }
 }
 
 
-static struct starpu_task * pop_task(struct _starpu_sched_node * node, unsigned sched_ctx_id)
+static struct starpu_task * pop_task(struct starpu_sched_node * node, unsigned sched_ctx_id)
 {
 {
 	struct _starpu_fifo_data * data = node->data;
 	struct _starpu_fifo_data * data = node->data;
 	struct _starpu_prio_deque * fifo = &data->fifo;
 	struct _starpu_prio_deque * fifo = &data->fifo;
@@ -140,13 +140,13 @@ static struct starpu_task * pop_task(struct _starpu_sched_node * node, unsigned
 	STARPU_PTHREAD_MUTEX_UNLOCK(mutex);
 	STARPU_PTHREAD_MUTEX_UNLOCK(mutex);
 	if(task)
 	if(task)
 		return task;
 		return task;
-	struct _starpu_sched_node * father = node->fathers[sched_ctx_id];
+	struct starpu_sched_node * father = node->fathers[sched_ctx_id];
 	if(father)
 	if(father)
 		return father->pop_task(father,sched_ctx_id);
 		return father->pop_task(father,sched_ctx_id);
 	return NULL;
 	return NULL;
 }
 }
 /*
 /*
-struct starpu_task_list  _starpu_sched_node_fifo_get_non_executable_tasks(struct _starpu_sched_node * node)
+struct starpu_task_list  starpu_sched_node_fifo_get_non_executable_tasks(struct starpu_sched_node * node)
 {
 {
 	struct starpu_task_list list;
 	struct starpu_task_list list;
 	starpu_task_list_init(&list);
 	starpu_task_list_init(&list);
@@ -158,7 +158,7 @@ struct starpu_task_list  _starpu_sched_node_fifo_get_non_executable_tasks(struct
 	     task  = starpu_task_list_next(task))
 	     task  = starpu_task_list_next(task))
 	{
 	{
 		STARPU_ASSERT(task);
 		STARPU_ASSERT(task);
-		if(!_starpu_sched_node_can_execute_task(node, task))
+		if(!starpu_sched_node_can_execute_task(node, task))
 		{
 		{
 			starpu_task_list_erase(&fifo->taskq, task);
 			starpu_task_list_erase(&fifo->taskq, task);
 			starpu_task_list_push_front(&list, task);
 			starpu_task_list_push_front(&list, task);
@@ -168,15 +168,15 @@ struct starpu_task_list  _starpu_sched_node_fifo_get_non_executable_tasks(struct
 	return list;
 	return list;
 }
 }
 */
 */
-void init_fifo_data(struct _starpu_sched_node * node)
+void init_fifo_data(struct starpu_sched_node * node)
 {
 {
-	STARPU_ASSERT(_starpu_sched_node_is_fifo(node));
+	STARPU_ASSERT(starpu_sched_node_is_fifo(node));
 	struct _starpu_fifo_data * data = malloc(sizeof(*data));
 	struct _starpu_fifo_data * data = malloc(sizeof(*data));
 	_starpu_prio_deque_init(&data->fifo);
 	_starpu_prio_deque_init(&data->fifo);
 	STARPU_PTHREAD_MUTEX_INIT(&data->mutex,NULL);
 	STARPU_PTHREAD_MUTEX_INIT(&data->mutex,NULL);
 	node->data = data;
 	node->data = data;
 }
 }
-void deinit_fifo_data(struct _starpu_sched_node * node)
+void deinit_fifo_data(struct starpu_sched_node * node)
 {
 {
 	struct _starpu_fifo_data * data = node->data;
 	struct _starpu_fifo_data * data = node->data;
 	STARPU_PTHREAD_MUTEX_DESTROY(&data->mutex);
 	STARPU_PTHREAD_MUTEX_DESTROY(&data->mutex);
@@ -185,14 +185,14 @@ void deinit_fifo_data(struct _starpu_sched_node * node)
 }
 }
 
 
 
 
-int _starpu_sched_node_is_fifo(struct _starpu_sched_node * node)
+int starpu_sched_node_is_fifo(struct starpu_sched_node * node)
 {
 {
 	return node->init_data == init_fifo_data;
 	return node->init_data == init_fifo_data;
 }
 }
 
 
-struct _starpu_sched_node * _starpu_sched_node_fifo_create(void * arg STARPU_ATTRIBUTE_UNUSED)
+struct starpu_sched_node * starpu_sched_node_fifo_create(void * arg STARPU_ATTRIBUTE_UNUSED)
 {
 {
-	struct _starpu_sched_node * node = _starpu_sched_node_create();
+	struct starpu_sched_node * node = starpu_sched_node_create();
 	node->estimated_execute_preds = estimated_execute_preds;
 	node->estimated_execute_preds = estimated_execute_preds;
 	node->estimated_load = estimated_load;
 	node->estimated_load = estimated_load;
 	node->init_data = init_fifo_data;
 	node->init_data = init_fifo_data;

+ 42 - 42
src/sched_policies/node_heft.c

@@ -1,4 +1,4 @@
-#include "node_sched.h"
+#include <starpu_sched_node.h>
 #include "fifo_queues.h"
 #include "fifo_queues.h"
 #include <starpu_perfmodel.h>
 #include <starpu_perfmodel.h>
 #include <starpu_scheduler.h>
 #include <starpu_scheduler.h>
@@ -11,12 +11,12 @@ struct _starpu_dmda_data
 	double beta;
 	double beta;
 	double gamma;
 	double gamma;
 	double idle_power;
 	double idle_power;
-	struct _starpu_sched_node * no_model_node;
+	struct starpu_sched_node * no_model_node;
 };
 };
 
 
-static double compute_fitness_calibration(struct _starpu_sched_node * child,
+static double compute_fitness_calibration(struct starpu_sched_node * child,
 					  struct _starpu_dmda_data * data STARPU_ATTRIBUTE_UNUSED,
 					  struct _starpu_dmda_data * data STARPU_ATTRIBUTE_UNUSED,
-					  struct _starpu_task_execute_preds *pred,
+					  struct starpu_task_execute_preds *pred,
 					  double best_exp_end STARPU_ATTRIBUTE_UNUSED,
 					  double best_exp_end STARPU_ATTRIBUTE_UNUSED,
 					  double max_exp_end STARPU_ATTRIBUTE_UNUSED)
 					  double max_exp_end STARPU_ATTRIBUTE_UNUSED)
 {
 {
@@ -25,9 +25,9 @@ static double compute_fitness_calibration(struct _starpu_sched_node * child,
 	return DBL_MAX;
 	return DBL_MAX;
 }
 }
 
 
-static double compute_fitness_perf_model(struct _starpu_sched_node * child STARPU_ATTRIBUTE_UNUSED,
+static double compute_fitness_perf_model(struct starpu_sched_node * child STARPU_ATTRIBUTE_UNUSED,
 					 struct _starpu_dmda_data * data,
 					 struct _starpu_dmda_data * data,
-					 struct _starpu_task_execute_preds * preds,
+					 struct starpu_task_execute_preds * preds,
 					 double best_exp_end,
 					 double best_exp_end,
 					 double max_exp_end)
 					 double max_exp_end)
 {
 {
@@ -51,9 +51,9 @@ static double compute_fitness_perf_model(struct _starpu_sched_node * child STARP
 	}
 	}
 }
 }
 
 
-static int push_task(struct _starpu_sched_node * node, struct starpu_task * task)
+static int push_task(struct starpu_sched_node * node, struct starpu_task * task)
 {
 {
-	struct _starpu_task_execute_preds preds[node->nchilds];
+	struct starpu_task_execute_preds preds[node->nchilds];
 	int i;
 	int i;
 	int calibrating = 0;
 	int calibrating = 0;
 	int perf_model = 0;
 	int perf_model = 0;
@@ -98,9 +98,9 @@ static int push_task(struct _starpu_sched_node * node, struct starpu_task * task
 		return ret;
 		return ret;
 	}
 	}
 
 
-	double (*fitness_fun)(struct _starpu_sched_node *,
+	double (*fitness_fun)(struct starpu_sched_node *,
 			      struct _starpu_dmda_data *,
 			      struct _starpu_dmda_data *,
-			      struct _starpu_task_execute_preds*,
+			      struct starpu_task_execute_preds*,
 			      double,
 			      double,
 			      double) = compute_fitness_perf_model;
 			      double) = compute_fitness_perf_model;
 
 
@@ -128,20 +128,20 @@ static int push_task(struct _starpu_sched_node * node, struct starpu_task * task
 //	fprintf(stderr,"push on worker %d\n",index_best_fitness);
 //	fprintf(stderr,"push on worker %d\n",index_best_fitness);
 	STARPU_ASSERT(best_fitness != DBL_MAX);
 	STARPU_ASSERT(best_fitness != DBL_MAX);
 
 
-	struct _starpu_sched_node * c = node->childs[index_best_fitness];
+	struct starpu_sched_node * c = node->childs[index_best_fitness];
 	starpu_task_set_implementation(task, preds[index_best_fitness].impl);
 	starpu_task_set_implementation(task, preds[index_best_fitness].impl);
 	task->predicted = preds[index_best_fitness].expected_length;
 	task->predicted = preds[index_best_fitness].expected_length;
 	task->predicted_transfer = preds[index_best_fitness].expected_transfer_length;
 	task->predicted_transfer = preds[index_best_fitness].expected_transfer_length;
 	return c->push_task(c, task);
 	return c->push_task(c, task);
 }
 }
 /*
 /*
-static void update_helper_node(struct _starpu_sched_node * heft_node)
+static void update_helper_node(struct starpu_sched_node * heft_node)
 {
 {
 	struct _starpu_dmda_data * data = heft_node->data;
 	struct _starpu_dmda_data * data = heft_node->data;
-	struct _starpu_sched_node * node = data->no_model_node;
+	struct starpu_sched_node * node = data->no_model_node;
 	node->nchilds = heft_node->nchilds;
 	node->nchilds = heft_node->nchilds;
-	node->childs = realloc(node->childs, sizeof(struct _starpu_sched_node *) * node->nchilds);
-	memcpy(node->childs, heft_node->childs, sizeof(struct _starpu_sched_node*) * node->nchilds);
+	node->childs = realloc(node->childs, sizeof(struct starpu_sched_node *) * node->nchilds);
+	memcpy(node->childs, heft_node->childs, sizeof(struct starpu_sched_node*) * node->nchilds);
 	node->nworkers = heft_node->nworkers;
 	node->nworkers = heft_node->nworkers;
 	memcpy(node->workerids, heft_node->workerids, sizeof(int) * node->nworkers);
 	memcpy(node->workerids, heft_node->workerids, sizeof(int) * node->nworkers);
 }
 }
@@ -182,7 +182,7 @@ static void param_modified(struct starpu_top_param* d)
 }
 }
 #endif /* !STARPU_USE_TOP */
 #endif /* !STARPU_USE_TOP */
 
 
-void init_heft_data(struct _starpu_sched_node *node)
+void init_heft_data(struct starpu_sched_node *node)
 {
 {
 
 
 	const char *strval_alpha = getenv("STARPU_SCHED_ALPHA");
 	const char *strval_alpha = getenv("STARPU_SCHED_ALPHA");
@@ -222,31 +222,31 @@ void init_heft_data(struct _starpu_sched_node *node)
 
 
 	node->data = data;
 	node->data = data;
 
 
-	_starpu_sched_node_heft_set_no_model_node(node, _starpu_sched_node_random_create,NULL);
+	starpu_sched_node_heft_set_no_model_node(node, starpu_sched_node_random_create,NULL);
 }
 }
 
 
-static void destroy_no_model_node(struct _starpu_sched_node * heft_node)
+static void destroy_no_model_node(struct starpu_sched_node * heft_node)
 {
 {
 	struct _starpu_dmda_data * data = heft_node->data;
 	struct _starpu_dmda_data * data = heft_node->data;
 	if(data->no_model_node)
 	if(data->no_model_node)
 	{
 	{
-		_starpu_sched_node_destroy(data->no_model_node);
+		starpu_sched_node_destroy(data->no_model_node);
 	}
 	}
 }
 }
 
 
-void deinit_heft_data(struct _starpu_sched_node * node)
+void deinit_heft_data(struct starpu_sched_node * node)
 {
 {
 	destroy_no_model_node(node);
 	destroy_no_model_node(node);
 	free(node->data);
 	free(node->data);
 }
 }
 
 
-void _starpu_sched_node_heft_set_no_model_node(struct _starpu_sched_node * heft_node,
-					       struct _starpu_sched_node * (*create_no_model_node)(void *),void * arg)
+void starpu_sched_node_heft_set_no_model_node(struct starpu_sched_node * heft_node,
+					       struct starpu_sched_node * (*create_no_model_node)(void *),void * arg)
 {
 {
 	destroy_no_model_node(heft_node);
 	destroy_no_model_node(heft_node);
 	struct _starpu_dmda_data * data = heft_node->data;
 	struct _starpu_dmda_data * data = heft_node->data;
-	struct _starpu_sched_node * no_model_node = create_no_model_node(arg);
-	no_model_node->childs = malloc(heft_node->nchilds * sizeof(struct _starpu_sched_node *));
+	struct starpu_sched_node * no_model_node = create_no_model_node(arg);
+	no_model_node->childs = malloc(heft_node->nchilds * sizeof(struct starpu_sched_node *));
 	memcpy(no_model_node->childs, heft_node->childs, heft_node->nchilds * sizeof(struct _strapu_sched_node *));
 	memcpy(no_model_node->childs, heft_node->childs, heft_node->nchilds * sizeof(struct _strapu_sched_node *));
 
 
 	no_model_node->nchilds = heft_node->nchilds;
 	no_model_node->nchilds = heft_node->nchilds;
@@ -254,9 +254,9 @@ void _starpu_sched_node_heft_set_no_model_node(struct _starpu_sched_node * heft_
 	data->no_model_node = no_model_node;
 	data->no_model_node = no_model_node;
 }
 }
 
 
-struct _starpu_sched_node * _starpu_sched_node_heft_create(void * arg STARPU_ATTRIBUTE_UNUSED)
+struct starpu_sched_node * starpu_sched_node_heft_create(void * arg STARPU_ATTRIBUTE_UNUSED)
 {
 {
-	struct _starpu_sched_node * node = _starpu_sched_node_create();
+	struct starpu_sched_node * node = starpu_sched_node_create();
 
 
 	node->push_task = push_task;
 	node->push_task = push_task;
 	node->init_data = init_heft_data;
 	node->init_data = init_heft_data;
@@ -265,7 +265,7 @@ struct _starpu_sched_node * _starpu_sched_node_heft_create(void * arg STARPU_ATT
 	return node;
 	return node;
 }
 }
 
 
-int _starpu_sched_node_is_heft(struct _starpu_sched_node * node)
+int starpu_sched_node_is_heft(struct starpu_sched_node * node)
 {
 {
 	return node->init_data == init_heft_data;
 	return node->init_data == init_heft_data;
 }
 }
@@ -276,33 +276,33 @@ static void initialize_heft_center_policy(unsigned sched_ctx_id)
 {
 {
 	starpu_sched_ctx_create_worker_collection(sched_ctx_id, STARPU_WORKER_LIST);
 	starpu_sched_ctx_create_worker_collection(sched_ctx_id, STARPU_WORKER_LIST);
 	
 	
-	struct _starpu_sched_tree * t = _starpu_sched_tree_create();
-	t->root = _starpu_sched_node_heft_create(NULL);
+	struct starpu_sched_tree * t = starpu_sched_tree_create();
+	t->root = starpu_sched_node_heft_create(NULL);
 	
 	
 	unsigned i;
 	unsigned i;
 	for(i = 0; i < starpu_worker_get_count() + starpu_combined_worker_get_count(); i++)
 	for(i = 0; i < starpu_worker_get_count() + starpu_combined_worker_get_count(); i++)
 	{
 	{
-		struct _starpu_sched_node * worker_node = _starpu_sched_node_worker_get(i);
+		struct starpu_sched_node * worker_node = starpu_sched_node_worker_get(i);
 		STARPU_ASSERT(worker_node);
 		STARPU_ASSERT(worker_node);
 /*
 /*
-		struct _starpu_sched_node * fifo_node = _starpu_sched_node_fifo_create(NULL);
-		_starpu_sched_node_add_child(fifo_node, worker_node);
-		_starpu_sched_node_set_father(worker_node, fifo_node, sched_ctx_id);
+		struct starpu_sched_node * fifo_node = starpu_sched_node_fifo_create(NULL);
+		starpu_sched_node_add_child(fifo_node, worker_node);
+		starpu_sched_node_set_father(worker_node, fifo_node, sched_ctx_id);
 */
 */
-		_starpu_sched_node_add_child(t->root, worker_node);
-		_starpu_sched_node_set_father(worker_node, t->root, sched_ctx_id);
+		starpu_sched_node_add_child(t->root, worker_node);
+		starpu_sched_node_set_father(worker_node, t->root, sched_ctx_id);
 	}
 	}
 	
 	
 	_starpu_set_workers_bitmaps();
 	_starpu_set_workers_bitmaps();
-	_starpu_tree_call_init_data(t);
+	starpu_sched_tree_call_init_data(t);
 
 
 	starpu_sched_ctx_set_policy_data(sched_ctx_id, (void*)t);
 	starpu_sched_ctx_set_policy_data(sched_ctx_id, (void*)t);
 }
 }
 
 
 static void deinitialize_heft_center_policy(unsigned sched_ctx_id)
 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_sched_tree_destroy(t, sched_ctx_id);
+	struct starpu_sched_tree *t = (struct starpu_sched_tree*)starpu_sched_ctx_get_policy_data(sched_ctx_id);
+	starpu_sched_tree_destroy(t, sched_ctx_id);
 	starpu_sched_ctx_delete_worker_collection(sched_ctx_id);
 	starpu_sched_ctx_delete_worker_collection(sched_ctx_id);
 }
 }
 
 
@@ -314,10 +314,10 @@ struct starpu_sched_policy _starpu_sched_tree_heft_policy =
 {
 {
 	.init_sched = initialize_heft_center_policy,
 	.init_sched = initialize_heft_center_policy,
 	.deinit_sched = deinitialize_heft_center_policy,
 	.deinit_sched = deinitialize_heft_center_policy,
-	.add_workers = _starpu_tree_add_workers,
-	.remove_workers = _starpu_tree_remove_workers,
-	.push_task = _starpu_tree_push_task,
-	.pop_task = _starpu_tree_pop_task,
+	.add_workers = starpu_sched_tree_add_workers,
+	.remove_workers = starpu_sched_tree_remove_workers,
+	.push_task = starpu_sched_tree_push_task,
+	.pop_task = starpu_sched_tree_pop_task,
 	.pre_exec_hook = NULL,
 	.pre_exec_hook = NULL,
 	.post_exec_hook = NULL,
 	.post_exec_hook = NULL,
 	.pop_every_task = NULL,
 	.pop_every_task = NULL,

+ 26 - 26
src/sched_policies/node_random.c

@@ -1,5 +1,5 @@
 #include <core/workers.h>
 #include <core/workers.h>
-#include "node_sched.h"
+#include <starpu_sched_node.h>
 
 
 struct _starpu_random_data
 struct _starpu_random_data
 {
 {
@@ -7,17 +7,17 @@ struct _starpu_random_data
 };
 };
 
 
 
 
-static double compute_relative_speedup(struct _starpu_sched_node * node)
+static double compute_relative_speedup(struct starpu_sched_node * node)
 {
 {
-	if(_starpu_sched_node_is_simple_worker(node))
+	if(starpu_sched_node_is_simple_worker(node))
 	{
 	{
-		int id = _starpu_sched_node_worker_get_workerid(node);
+		int id = starpu_sched_node_worker_get_workerid(node);
 		enum starpu_perfmodel_archtype perf_arch = starpu_worker_get_perf_archtype(id);
 		enum starpu_perfmodel_archtype perf_arch = starpu_worker_get_perf_archtype(id);
 		return starpu_worker_get_relative_speedup(perf_arch);
 		return starpu_worker_get_relative_speedup(perf_arch);
 	}
 	}
-	if(_starpu_sched_node_is_combined_worker(node))
+	if(starpu_sched_node_is_combined_worker(node))
 	{
 	{
-		struct _starpu_combined_worker * c = _starpu_sched_node_combined_worker_get_combined_worker(node);
+		struct _starpu_combined_worker * c = starpu_sched_node_combined_worker_get_combined_worker(node);
 		return starpu_worker_get_relative_speedup(c->perf_arch);
 		return starpu_worker_get_relative_speedup(c->perf_arch);
 		
 		
 	}
 	}
@@ -28,7 +28,7 @@ static double compute_relative_speedup(struct _starpu_sched_node * node)
 	return sum;
 	return sum;
 }
 }
 
 
-static void init_data_random(struct _starpu_sched_node * node)
+static void init_data_random(struct starpu_sched_node * node)
 {
 {
 	struct _starpu_random_data * rd = malloc(sizeof(struct _starpu_random_data));
 	struct _starpu_random_data * rd = malloc(sizeof(struct _starpu_random_data));
 	node->data = rd;
 	node->data = rd;
@@ -38,7 +38,7 @@ static void init_data_random(struct _starpu_sched_node * node)
 		rd->relative_speedup[i] = compute_relative_speedup(node->childs[i]);
 		rd->relative_speedup[i] = compute_relative_speedup(node->childs[i]);
 }
 }
 
 
-static void deinit_data_random(struct _starpu_sched_node * node)
+static void deinit_data_random(struct starpu_sched_node * node)
 {
 {
 	struct _starpu_random_data * rd = node->data;
 	struct _starpu_random_data * rd = node->data;
 	free(rd->relative_speedup);
 	free(rd->relative_speedup);
@@ -46,7 +46,7 @@ static void deinit_data_random(struct _starpu_sched_node * node)
 	
 	
 }
 }
 
 
-static int push_task(struct _starpu_sched_node * node, struct starpu_task * task)
+static int push_task(struct starpu_sched_node * node, struct starpu_task * task)
 {
 {
 	struct _starpu_random_data * rd = node->data;
 	struct _starpu_random_data * rd = node->data;
 
 
@@ -55,7 +55,7 @@ static int push_task(struct _starpu_sched_node * node, struct starpu_task * task
 	double alpha_sum = 0.0;
 	double alpha_sum = 0.0;
 	for(i = 0; i < node->nchilds ; i++)
 	for(i = 0; i < node->nchilds ; i++)
 	{
 	{
-		if(_starpu_sched_node_can_execute_task(node->childs[i],task))
+		if(starpu_sched_node_can_execute_task(node->childs[i],task))
 		{
 		{
 			indexes_nodes[size++] = i;
 			indexes_nodes[size++] = i;
 			alpha_sum += rd->relative_speedup[i];
 			alpha_sum += rd->relative_speedup[i];
@@ -64,7 +64,7 @@ static int push_task(struct _starpu_sched_node * node, struct starpu_task * task
 
 
 	double random = starpu_drand48()*alpha_sum;
 	double random = starpu_drand48()*alpha_sum;
 	double alpha = 0.0;
 	double alpha = 0.0;
-	struct _starpu_sched_node * select  = NULL;
+	struct starpu_sched_node * select  = NULL;
 	
 	
 	for(i = 0; i < size ; i++)
 	for(i = 0; i < size ; i++)
 	{
 	{
@@ -84,9 +84,9 @@ static int push_task(struct _starpu_sched_node * node, struct starpu_task * task
 }
 }
 
 
 
 
-struct _starpu_sched_node * _starpu_sched_node_random_create(void * arg STARPU_ATTRIBUTE_UNUSED)
+struct starpu_sched_node * starpu_sched_node_random_create(void * arg STARPU_ATTRIBUTE_UNUSED)
 {
 {
-	struct _starpu_sched_node * node = _starpu_sched_node_create();
+	struct starpu_sched_node * node = starpu_sched_node_create();
 	node->data = NULL;
 	node->data = NULL;
 	node->init_data = init_data_random;
 	node->init_data = init_data_random;
 	node->deinit_data = deinit_data_random;
 	node->deinit_data = deinit_data_random;
@@ -95,7 +95,7 @@ struct _starpu_sched_node * _starpu_sched_node_random_create(void * arg STARPU_A
 	return node;
 	return node;
 }
 }
 
 
-int _starpu_sched_node_is_random(struct _starpu_sched_node *node)
+int starpu_sched_node_is_random(struct starpu_sched_node *node)
 {
 {
 	return node->init_data == init_data_random;
 	return node->init_data == init_data_random;
 }
 }
@@ -103,28 +103,28 @@ int _starpu_sched_node_is_random(struct _starpu_sched_node *node)
 static void initialize_random_center_policy(unsigned sched_ctx_id)
 static void initialize_random_center_policy(unsigned sched_ctx_id)
 {
 {
 	starpu_sched_ctx_create_worker_collection(sched_ctx_id, STARPU_WORKER_LIST);
 	starpu_sched_ctx_create_worker_collection(sched_ctx_id, STARPU_WORKER_LIST);
-	struct _starpu_sched_tree *data = malloc(sizeof(struct _starpu_sched_tree));
+	struct starpu_sched_tree *data = malloc(sizeof(struct starpu_sched_tree));
 	STARPU_PTHREAD_RWLOCK_INIT(&data->lock,NULL);
 	STARPU_PTHREAD_RWLOCK_INIT(&data->lock,NULL);
- 	data->root = _starpu_sched_node_random_create(NULL);
-	data->workers = _starpu_bitmap_create();
+ 	data->root = starpu_sched_node_random_create(NULL);
+	data->workers = starpu_bitmap_create();
 
 
 	unsigned i;
 	unsigned i;
 	for(i = 0; i < starpu_worker_get_count() + starpu_combined_worker_get_count(); i++)
 	for(i = 0; i < starpu_worker_get_count() + starpu_combined_worker_get_count(); i++)
 	{
 	{
-		struct _starpu_sched_node * node = _starpu_sched_node_worker_get(i);
+		struct starpu_sched_node * node = starpu_sched_node_worker_get(i);
 		if(!node)
 		if(!node)
 			continue;
 			continue;
 		node->fathers[sched_ctx_id] = data->root;
 		node->fathers[sched_ctx_id] = data->root;
-		_starpu_sched_node_add_child(data->root, node);
+		starpu_sched_node_add_child(data->root, node);
 	}
 	}
 	_starpu_set_workers_bitmaps();
 	_starpu_set_workers_bitmaps();
-	_starpu_tree_call_init_data(data);
+	starpu_sched_tree_call_init_data(data);
 	starpu_sched_ctx_set_policy_data(sched_ctx_id, (void*)data);
 	starpu_sched_ctx_set_policy_data(sched_ctx_id, (void*)data);
 }
 }
 static void deinitialize_random_center_policy(unsigned sched_ctx_id)
 static void deinitialize_random_center_policy(unsigned sched_ctx_id)
 {
 {
-	struct _starpu_sched_tree *tree = (struct _starpu_sched_tree*)starpu_sched_ctx_get_policy_data(sched_ctx_id);
-	_starpu_sched_tree_destroy(tree, sched_ctx_id);
+	struct starpu_sched_tree *tree = (struct starpu_sched_tree*)starpu_sched_ctx_get_policy_data(sched_ctx_id);
+	starpu_sched_tree_destroy(tree, sched_ctx_id);
 	starpu_sched_ctx_delete_worker_collection(sched_ctx_id);
 	starpu_sched_ctx_delete_worker_collection(sched_ctx_id);
 }
 }
 
 
@@ -133,10 +133,10 @@ struct starpu_sched_policy _starpu_sched_tree_random_policy =
 {
 {
 	.init_sched = initialize_random_center_policy,
 	.init_sched = initialize_random_center_policy,
 	.deinit_sched = deinitialize_random_center_policy,
 	.deinit_sched = deinitialize_random_center_policy,
-	.add_workers = _starpu_tree_add_workers,
-	.remove_workers = _starpu_tree_remove_workers,
-	.push_task = _starpu_tree_push_task,
-	.pop_task = _starpu_tree_pop_task,
+	.add_workers = starpu_sched_tree_add_workers,
+	.remove_workers = starpu_sched_tree_remove_workers,
+	.push_task = starpu_sched_tree_push_task,
+	.pop_task = starpu_sched_tree_pop_task,
 	.pre_exec_hook = NULL,
 	.pre_exec_hook = NULL,
 	.post_exec_hook = NULL,
 	.post_exec_hook = NULL,
 	.pop_every_task = NULL,
 	.pop_every_task = NULL,

+ 80 - 80
src/sched_policies/node_sched.c

@@ -1,8 +1,8 @@
 #include <core/jobs.h>
 #include <core/jobs.h>
 #include <core/workers.h>
 #include <core/workers.h>
-#include "node_sched.h"
+#include <starpu_sched_node.h>
 #include <starpu_thread_util.h>
 #include <starpu_thread_util.h>
-double _starpu_compute_expected_time(double now, double predicted_end, double predicted_length, double predicted_transfer)
+double starpu_sched_compute_expected_time(double now, double predicted_end, double predicted_length, double predicted_transfer)
 {
 {
 
 
 	if (now + predicted_transfer < predicted_end)
 	if (now + predicted_transfer < predicted_end)
@@ -29,7 +29,7 @@ double _starpu_compute_expected_time(double now, double predicted_end, double pr
 	return predicted_end;
 	return predicted_end;
 }
 }
 
 
-static void available(struct _starpu_sched_node * node)
+static void available(struct starpu_sched_node * node)
 {
 {
 	(void)node;
 	(void)node;
 #ifndef STARPU_NON_BLOCKING_DRIVERS
 #ifndef STARPU_NON_BLOCKING_DRIVERS
@@ -38,7 +38,7 @@ static void available(struct _starpu_sched_node * node)
 		node->childs[i]->available(node->childs[i]);
 		node->childs[i]->available(node->childs[i]);
 #endif
 #endif
 }
 }
-static struct starpu_task * pop_task_node(struct _starpu_sched_node * node, unsigned sched_ctx_id)
+static struct starpu_task * pop_task_node(struct starpu_sched_node * node, unsigned sched_ctx_id)
 {
 {
 	if(node->fathers[sched_ctx_id] == NULL)
 	if(node->fathers[sched_ctx_id] == NULL)
 		return NULL;
 		return NULL;
@@ -47,8 +47,8 @@ static struct starpu_task * pop_task_node(struct _starpu_sched_node * node, unsi
 }
 }
 
 
 
 
-void _starpu_sched_node_set_father(struct _starpu_sched_node *node,
-				   struct _starpu_sched_node *father_node,
+void starpu_sched_node_set_father(struct starpu_sched_node *node,
+				   struct starpu_sched_node *father_node,
 				   unsigned sched_ctx_id)
 				   unsigned sched_ctx_id)
 {
 {
 	STARPU_ASSERT(sched_ctx_id < STARPU_NMAX_SCHED_CTXS);
 	STARPU_ASSERT(sched_ctx_id < STARPU_NMAX_SCHED_CTXS);
@@ -57,9 +57,9 @@ void _starpu_sched_node_set_father(struct _starpu_sched_node *node,
 
 
 struct starpu_task * pop_task(unsigned sched_ctx_id)
 struct starpu_task * pop_task(unsigned sched_ctx_id)
 {
 {
-	struct _starpu_sched_tree * t = starpu_sched_ctx_get_policy_data(sched_ctx_id);
+	struct starpu_sched_tree * t = starpu_sched_ctx_get_policy_data(sched_ctx_id);
 	int workerid = starpu_worker_get_id();
 	int workerid = starpu_worker_get_id();
-	struct _starpu_sched_node * wn = _starpu_sched_node_worker_get(workerid);
+	struct starpu_sched_node * wn = starpu_sched_node_worker_get(workerid);
 	STARPU_PTHREAD_RWLOCK_RDLOCK(&t->lock);
 	STARPU_PTHREAD_RWLOCK_RDLOCK(&t->lock);
 	struct starpu_task * task = wn->pop_task(wn, sched_ctx_id);
 	struct starpu_task * task = wn->pop_task(wn, sched_ctx_id);
 	STARPU_PTHREAD_RWLOCK_UNLOCK(&t->lock);
 	STARPU_PTHREAD_RWLOCK_UNLOCK(&t->lock);
@@ -69,39 +69,39 @@ struct starpu_task * pop_task(unsigned sched_ctx_id)
 int push_task(struct starpu_task * task)
 int push_task(struct starpu_task * task)
 {
 {
 	unsigned sched_ctx_id = task->sched_ctx;
 	unsigned sched_ctx_id = task->sched_ctx;
-	struct _starpu_sched_tree * t = starpu_sched_ctx_get_policy_data(sched_ctx_id);
+	struct starpu_sched_tree * t = starpu_sched_ctx_get_policy_data(sched_ctx_id);
 	STARPU_PTHREAD_RWLOCK_RDLOCK(&t->lock);
 	STARPU_PTHREAD_RWLOCK_RDLOCK(&t->lock);
 	int ret = t->root->push_task(t->root, task);
 	int ret = t->root->push_task(t->root, task);
 	STARPU_PTHREAD_RWLOCK_UNLOCK(&t->lock);
 	STARPU_PTHREAD_RWLOCK_UNLOCK(&t->lock);
 	return ret;
 	return ret;
 }
 }
 
 
-void _starpu_tree_add_workers(unsigned sched_ctx_id, int *workerids, unsigned nworkers)
+void starpu_sched_tree_add_workers(unsigned sched_ctx_id, int *workerids, unsigned nworkers)
 {
 {
-	struct _starpu_sched_tree * t = starpu_sched_ctx_get_policy_data(sched_ctx_id);
+	struct starpu_sched_tree * t = starpu_sched_ctx_get_policy_data(sched_ctx_id);
 	STARPU_PTHREAD_RWLOCK_WRLOCK(&t->lock);
 	STARPU_PTHREAD_RWLOCK_WRLOCK(&t->lock);
 	unsigned i;
 	unsigned i;
 	for(i = 0; i < nworkers; i++)
 	for(i = 0; i < nworkers; i++)
-		_starpu_bitmap_set(t->workers, workerids[i]);
+		starpu_bitmap_set(t->workers, workerids[i]);
 	STARPU_PTHREAD_RWLOCK_UNLOCK(&t->lock);
 	STARPU_PTHREAD_RWLOCK_UNLOCK(&t->lock);
 }
 }
 
 
-void _starpu_tree_remove_workers(unsigned sched_ctx_id, int *workerids, unsigned nworkers)
+void starpu_sched_tree_remove_workers(unsigned sched_ctx_id, int *workerids, unsigned nworkers)
 {
 {
-	struct _starpu_sched_tree * t = starpu_sched_ctx_get_policy_data(sched_ctx_id);
+	struct starpu_sched_tree * t = starpu_sched_ctx_get_policy_data(sched_ctx_id);
 	STARPU_PTHREAD_RWLOCK_WRLOCK(&t->lock);
 	STARPU_PTHREAD_RWLOCK_WRLOCK(&t->lock);
 	unsigned i;
 	unsigned i;
 	for(i = 0; i < nworkers; i++)
 	for(i = 0; i < nworkers; i++)
-		_starpu_bitmap_unset(t->workers, workerids[i]);
+		starpu_bitmap_unset(t->workers, workerids[i]);
 	STARPU_PTHREAD_RWLOCK_UNLOCK(&t->lock);
 	STARPU_PTHREAD_RWLOCK_UNLOCK(&t->lock);
 }
 }
 
 
 
 
-void _starpu_node_destroy_rec(struct _starpu_sched_node * node, unsigned sched_ctx_id)
+void starpu_sched_node_destroy_rec(struct starpu_sched_node * node, unsigned sched_ctx_id)
 {
 {
 	if(node == NULL)
 	if(node == NULL)
 		return;
 		return;
-	struct _starpu_sched_node ** stack = NULL;
+	struct starpu_sched_node ** stack = NULL;
 	int top = -1;
 	int top = -1;
 #define PUSH(n) do{							\
 #define PUSH(n) do{							\
 		stack = realloc(stack, sizeof(*stack) * (top + 2));	\
 		stack = realloc(stack, sizeof(*stack) * (top + 2));	\
@@ -123,11 +123,11 @@ void _starpu_node_destroy_rec(struct _starpu_sched_node * node, unsigned sched_c
 		PUSH(node);
 		PUSH(node);
 	while(!EMPTY())
 	while(!EMPTY())
 	{
 	{
-		struct _starpu_sched_node * n = POP();
+		struct starpu_sched_node * n = POP();
 		int i;
 		int i;
 		for(i = 0; i < n->nchilds; i++)
 		for(i = 0; i < n->nchilds; i++)
 		{
 		{
-			struct _starpu_sched_node * child = n->childs[i];
+			struct starpu_sched_node * child = n->childs[i];
 			int j;
 			int j;
 			shared = 0;
 			shared = 0;
 			STARPU_ASSERT(child->fathers[sched_ctx_id] == n);
 			STARPU_ASSERT(child->fathers[sched_ctx_id] == n);
@@ -140,41 +140,41 @@ void _starpu_node_destroy_rec(struct _starpu_sched_node * node, unsigned sched_c
 			if(!shared)//if not shared we want to destroy it and his childs
 			if(!shared)//if not shared we want to destroy it and his childs
 				PUSH(child);
 				PUSH(child);
 		}
 		}
-		_starpu_sched_node_destroy(n);
+		starpu_sched_node_destroy(n);
 	}
 	}
 	free(stack);
 	free(stack);
 }
 }
-struct _starpu_sched_tree * _starpu_sched_tree_create(void)
+struct starpu_sched_tree * starpu_sched_tree_create(void)
 {
 {
-	struct _starpu_sched_tree * t = malloc(sizeof(*t));
+	struct starpu_sched_tree * t = malloc(sizeof(*t));
 	memset(t, 0, sizeof(*t));
 	memset(t, 0, sizeof(*t));
-	t->workers = _starpu_bitmap_create();
+	t->workers = starpu_bitmap_create();
 	STARPU_PTHREAD_RWLOCK_INIT(&t->lock,NULL);
 	STARPU_PTHREAD_RWLOCK_INIT(&t->lock,NULL);
 	return t;
 	return t;
 }
 }
 
 
-void _starpu_sched_tree_destroy(struct _starpu_sched_tree * tree, unsigned sched_ctx_id)
+void starpu_sched_tree_destroy(struct starpu_sched_tree * tree, unsigned sched_ctx_id)
 {
 {
 	if(tree->root)
 	if(tree->root)
-		_starpu_node_destroy_rec(tree->root, sched_ctx_id);
-	_starpu_bitmap_destroy(tree->workers);
+		starpu_sched_node_destroy_rec(tree->root, sched_ctx_id);
+	starpu_bitmap_destroy(tree->workers);
 	STARPU_PTHREAD_RWLOCK_DESTROY(&tree->lock);
 	STARPU_PTHREAD_RWLOCK_DESTROY(&tree->lock);
 	free(tree);
 	free(tree);
 }
 }
-void _starpu_sched_node_add_child(struct _starpu_sched_node* node, struct _starpu_sched_node * child)
+void starpu_sched_node_add_child(struct starpu_sched_node* node, struct starpu_sched_node * child)
 {
 {
-	STARPU_ASSERT(!_starpu_sched_node_is_worker(node));
+	STARPU_ASSERT(!starpu_sched_node_is_worker(node));
 	int i;
 	int i;
 	for(i = 0; i < node->nchilds; i++){
 	for(i = 0; i < node->nchilds; i++){
 		STARPU_ASSERT(node->childs[i] != node);
 		STARPU_ASSERT(node->childs[i] != node);
 		STARPU_ASSERT(node->childs[i] != NULL);
 		STARPU_ASSERT(node->childs[i] != NULL);
 	}
 	}
 
 
-	node->childs = realloc(node->childs, sizeof(struct _starpu_sched_node *) * (node->nchilds + 1));
+	node->childs = realloc(node->childs, sizeof(struct starpu_sched_node *) * (node->nchilds + 1));
 	node->childs[node->nchilds] = child;
 	node->childs[node->nchilds] = child;
 	node->nchilds++;
 	node->nchilds++;
 }
 }
-void _starpu_sched_node_remove_child(struct _starpu_sched_node * node, struct _starpu_sched_node * child)
+void starpu_sched_node_remove_child(struct starpu_sched_node * node, struct starpu_sched_node * child)
 {
 {
 	int pos;
 	int pos;
 	for(pos = 0; pos < node->nchilds; pos++)
 	for(pos = 0; pos < node->nchilds; pos++)
@@ -184,39 +184,39 @@ void _starpu_sched_node_remove_child(struct _starpu_sched_node * node, struct _s
 	node->childs[pos] = node->childs[--node->nchilds];
 	node->childs[pos] = node->childs[--node->nchilds];
 }
 }
 
 
-struct _starpu_bitmap * _starpu_get_worker_mask(struct starpu_task * task)
+struct starpu_bitmap * _starpu_get_worker_mask(struct starpu_task * task)
 {
 {
-	struct _starpu_sched_tree * t = starpu_sched_ctx_get_policy_data(task->sched_ctx);
+	struct starpu_sched_tree * t = starpu_sched_ctx_get_policy_data(task->sched_ctx);
 	return t->workers;
 	return t->workers;
 }
 }
 
 
-int _starpu_tree_push_task(struct starpu_task * task)
+int starpu_sched_tree_push_task(struct starpu_task * task)
 {
 {
 	unsigned sched_ctx_id = task->sched_ctx;
 	unsigned sched_ctx_id = task->sched_ctx;
-	struct _starpu_sched_tree *tree = starpu_sched_ctx_get_policy_data(sched_ctx_id);
+	struct starpu_sched_tree *tree = starpu_sched_ctx_get_policy_data(sched_ctx_id);
 	STARPU_PTHREAD_RWLOCK_RDLOCK(&tree->lock);
 	STARPU_PTHREAD_RWLOCK_RDLOCK(&tree->lock);
 	int ret_val = tree->root->push_task(tree->root,task);
 	int ret_val = tree->root->push_task(tree->root,task);
 	STARPU_PTHREAD_RWLOCK_UNLOCK(&tree->lock);
 	STARPU_PTHREAD_RWLOCK_UNLOCK(&tree->lock);
 	return ret_val;
 	return ret_val;
 }
 }
-struct starpu_task * _starpu_tree_pop_task(unsigned sched_ctx_id)
+struct starpu_task * starpu_sched_tree_pop_task(unsigned sched_ctx_id)
 {
 {
-	struct _starpu_sched_tree *tree = starpu_sched_ctx_get_policy_data(sched_ctx_id);
+	struct starpu_sched_tree *tree = starpu_sched_ctx_get_policy_data(sched_ctx_id);
 	STARPU_PTHREAD_RWLOCK_RDLOCK(&tree->lock);
 	STARPU_PTHREAD_RWLOCK_RDLOCK(&tree->lock);
 	int workerid = starpu_worker_get_id();
 	int workerid = starpu_worker_get_id();
-	struct _starpu_sched_node * node = _starpu_sched_node_worker_get(workerid);
+	struct starpu_sched_node * node = starpu_sched_node_worker_get(workerid);
 	struct starpu_task * task = node->pop_task(node, sched_ctx_id);
 	struct starpu_task * task = node->pop_task(node, sched_ctx_id);
 	STARPU_PTHREAD_RWLOCK_UNLOCK(&tree->lock);
 	STARPU_PTHREAD_RWLOCK_UNLOCK(&tree->lock);
 	return task;
 	return task;
 }
 }
 /*
 /*
-static double estimated_finish_time(struct _starpu_sched_node * node)
+static double estimated_finish_time(struct starpu_sched_node * node)
 {
 {
 	double sum = 0.0;
 	double sum = 0.0;
 	int i;
 	int i;
 	for(i = 0; i < node->nchilds; i++)
 	for(i = 0; i < node->nchilds; i++)
 	{
 	{
-		struct _starpu_sched_node * c = node->childs[i];
+		struct starpu_sched_node * c = node->childs[i];
 		double tmp = c->estimated_finish_time(c);
 		double tmp = c->estimated_finish_time(c);
 		if( tmp > sum)
 		if( tmp > sum)
 			sum = tmp;
 			sum = tmp;
@@ -224,24 +224,24 @@ static double estimated_finish_time(struct _starpu_sched_node * node)
 	return sum;
 	return sum;
 }
 }
 */
 */
-static double estimated_load(struct _starpu_sched_node * node)
+static double estimated_load(struct starpu_sched_node * node)
 {
 {
 	double sum = 0.0;
 	double sum = 0.0;
 	int i;
 	int i;
 	for( i = 0; i < node->nchilds; i++)
 	for( i = 0; i < node->nchilds; i++)
 	{
 	{
-		struct _starpu_sched_node * c = node->childs[i];
+		struct starpu_sched_node * c = node->childs[i];
 		sum += c->estimated_load(c);
 		sum += c->estimated_load(c);
 	}
 	}
 	return sum;
 	return sum;
 }
 }
 
 
 
 
-struct _starpu_task_execute_preds _starpu_sched_node_average_estimated_execute_preds(struct _starpu_sched_node * node, struct starpu_task * task)
+struct starpu_task_execute_preds starpu_sched_node_average_estimated_execute_preds(struct starpu_sched_node * node, struct starpu_task * task)
 {
 {
 	if(node->is_homogeneous)
 	if(node->is_homogeneous)
 		return node->childs[0]->estimated_execute_preds(node->childs[0], task);
 		return node->childs[0]->estimated_execute_preds(node->childs[0], task);
-	struct _starpu_task_execute_preds pred =
+	struct starpu_task_execute_preds pred =
 		{ 
 		{ 
 			.state = CANNOT_EXECUTE,
 			.state = CANNOT_EXECUTE,
 			.expected_length = 0.0,
 			.expected_length = 0.0,
@@ -254,7 +254,7 @@ struct _starpu_task_execute_preds _starpu_sched_node_average_estimated_execute_p
 	int i;
 	int i;
 	for(i = 0; i < node->nchilds; i++)
 	for(i = 0; i < node->nchilds; i++)
 	{
 	{
-		struct _starpu_task_execute_preds tmp = node->childs[i]->estimated_execute_preds(node->childs[i], task);
+		struct starpu_task_execute_preds tmp = node->childs[i]->estimated_execute_preds(node->childs[i], task);
 		switch(tmp.state)
 		switch(tmp.state)
 		{
 		{
 		case CALIBRATING:
 		case CALIBRATING:
@@ -283,14 +283,14 @@ struct _starpu_task_execute_preds _starpu_sched_node_average_estimated_execute_p
 	return pred;
 	return pred;
 }
 }
 /*
 /*
-static double estimated_transfer_length(struct _starpu_sched_node * node, struct starpu_task * task)
+static double estimated_transfer_length(struct starpu_sched_node * node, struct starpu_task * task)
 {
 {
 	double sum = 0.0;
 	double sum = 0.0;
 	int nb = 0, i = 0;
 	int nb = 0, i = 0;
 	for(i = 0; i < node->nchilds; i++)
 	for(i = 0; i < node->nchilds; i++)
 	{
 	{
-		struct _starpu_sched_node * c = node->childs[i];
-		if(_starpu_sched_node_can_execute_task(c, task))
+		struct starpu_sched_node * c = node->childs[i];
+		if(starpu_sched_node_can_execute_task(c, task))
 		{
 		{
 			sum += c->estimated_transfer_length(c, task);
 			sum += c->estimated_transfer_length(c, task);
 			nb++;
 			nb++;
@@ -300,18 +300,18 @@ static double estimated_transfer_length(struct _starpu_sched_node * node, struct
 	return sum;
 	return sum;
 }
 }
 */
 */
-int _starpu_sched_node_can_execute_task(struct _starpu_sched_node * node, struct starpu_task * task)
+int starpu_sched_node_can_execute_task(struct starpu_sched_node * node, struct starpu_task * task)
 {
 {
 	unsigned nimpl;
 	unsigned nimpl;
 	int worker;
 	int worker;
-	struct _starpu_bitmap * worker_mask = _starpu_get_worker_mask(task);
+	struct starpu_bitmap * worker_mask = _starpu_get_worker_mask(task);
 	STARPU_ASSERT(task);
 	STARPU_ASSERT(task);
 	STARPU_ASSERT(node);
 	STARPU_ASSERT(node);
 	for (nimpl = 0; nimpl < STARPU_MAXIMPLEMENTATIONS; nimpl++)
 	for (nimpl = 0; nimpl < STARPU_MAXIMPLEMENTATIONS; nimpl++)
-		for(worker = _starpu_bitmap_first(node->workers);
+		for(worker = starpu_bitmap_first(node->workers);
 		    -1 != worker;
 		    -1 != worker;
-		    worker = _starpu_bitmap_next(node->workers, worker))
-			if (_starpu_bitmap_get(worker_mask, worker)
+		    worker = starpu_bitmap_next(node->workers, worker))
+			if (starpu_bitmap_get(worker_mask, worker)
 			    &&
 			    &&
 			    (starpu_worker_can_execute_task(worker, task, nimpl)
 			    (starpu_worker_can_execute_task(worker, task, nimpl)
 			     || starpu_combined_worker_can_execute_task(worker, task, nimpl)))
 			     || starpu_combined_worker_can_execute_task(worker, task, nimpl)))
@@ -319,69 +319,69 @@ int _starpu_sched_node_can_execute_task(struct _starpu_sched_node * node, struct
 	return 0;
 	return 0;
 }
 }
 
 
-int _starpu_sched_node_can_execute_task_with_impl(struct _starpu_sched_node * node, struct starpu_task * task, unsigned nimpl)
+int starpu_sched_node_can_execute_task_with_impl(struct starpu_sched_node * node, struct starpu_task * task, unsigned nimpl)
 {
 {
 
 
-	struct _starpu_bitmap * worker_mask = _starpu_get_worker_mask(task);
+	struct starpu_bitmap * worker_mask = _starpu_get_worker_mask(task);
 	int worker;
 	int worker;
 	STARPU_ASSERT(task);
 	STARPU_ASSERT(task);
 	STARPU_ASSERT(nimpl < STARPU_MAXIMPLEMENTATIONS);
 	STARPU_ASSERT(nimpl < STARPU_MAXIMPLEMENTATIONS);
-	for(worker = _starpu_bitmap_first(node->workers);
+	for(worker = starpu_bitmap_first(node->workers);
 	    worker != -1;
 	    worker != -1;
-	    worker = _starpu_bitmap_next(node->workers, worker))
-		if (_starpu_bitmap_get(worker_mask, worker)
+	    worker = starpu_bitmap_next(node->workers, worker))
+		if (starpu_bitmap_get(worker_mask, worker)
 		    && starpu_worker_can_execute_task(worker, task, nimpl))
 		    && starpu_worker_can_execute_task(worker, task, nimpl))
 			return 1;
 			return 1;
 	return 0;
 	return 0;
 
 
 }
 }
 
 
-void take_node_and_does_nothing(struct _starpu_sched_node * node STARPU_ATTRIBUTE_UNUSED)
+void take_node_and_does_nothing(struct starpu_sched_node * node STARPU_ATTRIBUTE_UNUSED)
 {
 {
 }
 }
 
 
-struct _starpu_sched_node * _starpu_sched_node_create(void)
+struct starpu_sched_node * starpu_sched_node_create(void)
 {
 {
-	struct _starpu_sched_node * node = malloc(sizeof(*node));
+	struct starpu_sched_node * node = malloc(sizeof(*node));
 	memset(node,0,sizeof(*node));
 	memset(node,0,sizeof(*node));
-	node->workers = _starpu_bitmap_create();
+	node->workers = starpu_bitmap_create();
 	node->available = available;
 	node->available = available;
 	node->init_data = take_node_and_does_nothing;
 	node->init_data = take_node_and_does_nothing;
 	node->deinit_data = take_node_and_does_nothing;
 	node->deinit_data = take_node_and_does_nothing;
 	node->pop_task = pop_task_node;
 	node->pop_task = pop_task_node;
 	node->estimated_load = estimated_load;
 	node->estimated_load = estimated_load;
-	node->estimated_execute_preds = _starpu_sched_node_average_estimated_execute_preds;
+	node->estimated_execute_preds = starpu_sched_node_average_estimated_execute_preds;
 
 
 	return node;
 	return node;
 }
 }
-void _starpu_sched_node_destroy(struct _starpu_sched_node *node)
+void starpu_sched_node_destroy(struct starpu_sched_node *node)
 {
 {
 	node->deinit_data(node);
 	node->deinit_data(node);
 	int i,j;
 	int i,j;
 	for(i = 0; i < node->nchilds; i++)
 	for(i = 0; i < node->nchilds; i++)
 	{
 	{
-		struct _starpu_sched_node * child = node->childs[i];
+		struct starpu_sched_node * child = node->childs[i];
 		for(j = 0; j < STARPU_NMAX_SCHED_CTXS; j++)
 		for(j = 0; j < STARPU_NMAX_SCHED_CTXS; j++)
 			if(child->fathers[i] == node)
 			if(child->fathers[i] == node)
 				child->fathers[i] = NULL;
 				child->fathers[i] = NULL;
 
 
 	}
 	}
 	free(node->childs);
 	free(node->childs);
-	_starpu_bitmap_destroy(node->workers);
+	starpu_bitmap_destroy(node->workers);
 	free(node);
 	free(node);
 }
 }
 
 
 
 
-static void set_is_homogeneous(struct _starpu_sched_node * node)
+static void set_is_homogeneous(struct starpu_sched_node * node)
 {
 {
-	STARPU_ASSERT(_starpu_bitmap_cardinal(node->workers) > 0);
-	if(_starpu_bitmap_cardinal(node->workers) == 1)
+	STARPU_ASSERT(starpu_bitmap_cardinal(node->workers) > 0);
+	if(starpu_bitmap_cardinal(node->workers) == 1)
 		node->is_homogeneous = 1;
 		node->is_homogeneous = 1;
-	int worker = _starpu_bitmap_first(node->workers);
+	int worker = starpu_bitmap_first(node->workers);
 	uint32_t last_worker = _starpu_get_worker_struct(worker)->worker_mask;
 	uint32_t last_worker = _starpu_get_worker_struct(worker)->worker_mask;
 	for(;
 	for(;
 	    worker != -1;
 	    worker != -1;
-	    worker = _starpu_bitmap_next(node->workers, worker))
+	    worker = starpu_bitmap_next(node->workers, worker))
 		
 		
 	{
 	{
 		if(last_worker != _starpu_get_worker_struct(worker)->worker_mask)
 		if(last_worker != _starpu_get_worker_struct(worker)->worker_mask)
@@ -395,10 +395,10 @@ static void set_is_homogeneous(struct _starpu_sched_node * node)
 }
 }
 
 
 
 
-static void add_worker_bit(struct _starpu_sched_node * node, int worker)
+static void add_worker_bit(struct starpu_sched_node * node, int worker)
 {
 {
 	STARPU_ASSERT(node);
 	STARPU_ASSERT(node);
-	_starpu_bitmap_set(node->workers, worker);
+	starpu_bitmap_set(node->workers, worker);
 	int i;
 	int i;
 	for(i = 0; i < STARPU_NMAX_SCHED_CTXS; i++)
 	for(i = 0; i < STARPU_NMAX_SCHED_CTXS; i++)
 		if(node->fathers[i])
 		if(node->fathers[i])
@@ -413,12 +413,12 @@ void _starpu_set_workers_bitmaps(void)
 	unsigned worker;	
 	unsigned worker;	
 	for(worker = 0; worker < starpu_worker_get_count() + starpu_combined_worker_get_count(); worker++)
 	for(worker = 0; worker < starpu_worker_get_count() + starpu_combined_worker_get_count(); worker++)
 	{
 	{
-		struct _starpu_sched_node * worker_node = _starpu_sched_node_worker_get(worker);
+		struct starpu_sched_node * worker_node = starpu_sched_node_worker_get(worker);
 		add_worker_bit(worker_node, worker);
 		add_worker_bit(worker_node, worker);
 	}
 	}
 }
 }
 
 
-static void helper_starpu_call_init_data(struct _starpu_sched_node *node)
+static void helper_starpu_call_init_data(struct starpu_sched_node *node)
 {
 {
 	int i;
 	int i;
 	for(i = 0; i < node->nchilds; i++)
 	for(i = 0; i < node->nchilds; i++)
@@ -427,29 +427,29 @@ static void helper_starpu_call_init_data(struct _starpu_sched_node *node)
 		node->init_data(node);
 		node->init_data(node);
 }
 }
 
 
-void _starpu_tree_call_init_data(struct _starpu_sched_tree * t)
+void starpu_sched_tree_call_init_data(struct starpu_sched_tree * t)
 {
 {
 	helper_starpu_call_init_data(t->root);
 	helper_starpu_call_init_data(t->root);
 }
 }
 
 
 
 
-static int push_task_to_first_suitable_parent(struct _starpu_sched_node * node, struct starpu_task * task, int sched_ctx_id)
+static int push_task_to_first_suitable_parent(struct starpu_sched_node * node, struct starpu_task * task, int sched_ctx_id)
 {
 {
 	if(node == NULL || node->fathers[sched_ctx_id] == NULL)
 	if(node == NULL || node->fathers[sched_ctx_id] == NULL)
 		return 1;
 		return 1;
 
 
-//	struct _starpu_sched_tree *t = starpu_sched_ctx_get_policy_data(sched_ctx_id);
+//	struct starpu_sched_tree *t = starpu_sched_ctx_get_policy_data(sched_ctx_id);
 
 
 	
 	
-	struct _starpu_sched_node * father = node->fathers[sched_ctx_id];
-	if(_starpu_sched_node_can_execute_task(father,task))
+	struct starpu_sched_node * father = node->fathers[sched_ctx_id];
+	if(starpu_sched_node_can_execute_task(father,task))
 		return father->push_task(father, task);
 		return father->push_task(father, task);
 	else
 	else
 		return push_task_to_first_suitable_parent(father, task, sched_ctx_id);
 		return push_task_to_first_suitable_parent(father, task, sched_ctx_id);
 }
 }
 
 
 
 
-int _starpu_sched_node_push_tasks_to_firsts_suitable_parent(struct _starpu_sched_node * node, struct starpu_task_list *list, int sched_ctx_id)
+int starpu_sched_node_push_tasks_to_firsts_suitable_parent(struct starpu_sched_node * node, struct starpu_task_list *list, int sched_ctx_id)
 {
 {
 	while(!starpu_task_list_empty(list))
 	while(!starpu_task_list_empty(list))
 	{
 	{

+ 0 - 226
src/sched_policies/node_sched.h

@@ -1,226 +0,0 @@
-#ifndef __SCHED_NODE_H__
-#define __SCHED_NODE_H__
-#include <starpu.h>
-#include <common/starpu_spinlock.h>
-#include "bitmap.h"
-
-#ifdef STARPU_HAVE_HWLOC
-#include <hwloc.h>
-#endif
-
-/* struct _starpu_sched_node are scheduler modules, a scheduler is a tree-like
- * structure of them, some parts of scheduler can be shared by several contexes
- * to perform some local optimisations, so, for all nodes, a list of father is
- * defined indexed by sched_ctx_id
- * 
- * they embed there specialised method in a pseudo object-style, so calls are like node->push_task(node,task)
- *
- */
-struct _starpu_sched_node
-{
-	/* node->push_task(node, task)
-	 * this function is called to push a task on node subtree, this can either
-	 * perform a recursive call on a child or store the task in the node, then
-	 * it will be returned by a further pop_task call
-	 *
-	 * the caller must ensure that node is able to execute task
-	 */
-	int (*push_task)(struct _starpu_sched_node *,
-			 struct starpu_task *);
-	/* this function is called by workers to get a task on them fathers
-	 * this function should first return a localy stored task or perform
-	 * a recursive call on father
-	 *
-	 * a default implementation simply do a recursive call on father
-	 */
-	struct starpu_task * (*pop_task)(struct _starpu_sched_node *,
-					 unsigned sched_ctx_id);
-
-	/* this function notify underlying worker that a task as been pushed
-	 * and would be returned by a pop_task call
-	 * it should be called each time a node localy store a task
-	 * 
-	 * default implementation simply perform a recursive call on childrens
-	 * this function can be called by a worker as it doesn't try to wake up himself
-	 */
-	void (*available)(struct _starpu_sched_node *);
-	
-	/* this function is an heuristic that compute load of subtree, basicaly
-	 * it compute
-	 * estimated_load(node) = sum(estimated_load(node_childs)) +
-	 *          nb_local_tasks / average(relative_speedup(underlying_worker))
-	 */
-	double (*estimated_load)(struct _starpu_sched_node * node);
-
-	/* this function return a struct _starpu_task_execute_preds defined lower
-	 * wich basicaly give predictions for a task execution a call on 
-	 * homogeneous (with all workers of the same arch) node is optimised
-	 */
-	struct _starpu_task_execute_preds (*estimated_execute_preds)(struct _starpu_sched_node * node,
-								     struct starpu_task * task);
-	/* the numbers of node's childs
-	 */
-	int nchilds;
-	/* the vector of node's childs
-	 */
-	struct _starpu_sched_node ** childs;
-	/* may be shared by several contexts
-	 * so we need several fathers
-	 */
-	struct _starpu_sched_node * fathers[STARPU_NMAX_SCHED_CTXS];
-	/* the set of workers in the node's subtree
-	 */
-	struct _starpu_bitmap * workers;
-	/* is_homogeneous is 0 iff workers in the node's subtree are heterogeneous,
-	 * this field is set and updated automaticaly, you shouldn't write on it
-	 */
-	int is_homogeneous;
-	/* node's private data, no restriction on use
-	 */
-	void * data;
-
-	/* this function is called after all childs has been set, and the
-	 * workers member was filled, can be used to init data, or anything you want
-	 */
-	void (*init_data)(struct _starpu_sched_node *);
-	/* this function is called to free data allocated by init_data 
-	 * just before the call of _starpu_sched_node_destroy(node)
-	 */
-	void (*deinit_data)(struct _starpu_sched_node *);
-
-#ifdef STARPU_HAVE_HWLOC
-	/* in case of a hierarchical scheduler, this is set to the part of
-	 * topology that is binded to this node, eg: a numa node for a ws
-	 * node that would balance load between underlying sockets
-	 */
-	hwloc_obj_t obj;
-#endif
-};
-
-/* this structure is only returned by estimated_execute_preds and give
- * predictions on task computations
- */
-struct _starpu_task_execute_preds
-{
-	/* if several value are possible for state member,
-	 * in order of priority :
-	 * CALIBRATING, PERF_MODEL, NO_PERF_MODEL, CANNOT_EXECUTE
-	 */
-	enum {CANNOT_EXECUTE = 0, CALIBRATING , NO_PERF_MODEL, PERF_MODEL} state;
-
-	/* archtype and nimpl is set to
-	 * best values if state is PERF_MODEL
-	 * values that needs to be calibrated if state is CALIBRATING
-	 * suitable values if NO_PERF_MODEL
-	 * irrevelant if CANNOT_EXECUTE
-	 */
-	enum starpu_perfmodel_archtype archtype;
-	int impl;
-
-	double expected_finish_time;
-	double expected_length;
-	double expected_transfer_length;
-	double expected_power;
-};
-
-
-struct _starpu_sched_tree
-{
-	struct _starpu_sched_node * root;
-	struct _starpu_bitmap * workers;
-	/* this lock is used to protect the scheduler,
-	 * it is taken in read mode pushing a task
-	 * and in write mode for adding or removing workers
-	 */
-	starpu_pthread_rwlock_t lock;
-};
-
-
-
-struct _starpu_sched_node * _starpu_sched_node_create(void);
-
-void _starpu_sched_node_destroy(struct _starpu_sched_node * node);
-void _starpu_sched_node_set_father(struct _starpu_sched_node *node, struct _starpu_sched_node *father_node, unsigned sched_ctx_id);
-void _starpu_sched_node_add_child(struct _starpu_sched_node * node, struct _starpu_sched_node * child);
-void _starpu_sched_node_remove_child(struct _starpu_sched_node * node, struct _starpu_sched_node * child);
-
-struct _starpu_task_execute_preds _starpu_sched_node_average_estimated_execute_preds(struct _starpu_sched_node * node, struct starpu_task * task);
-
-int _starpu_sched_node_can_execute_task(struct _starpu_sched_node * node, struct starpu_task * task);
-int _starpu_sched_node_can_execute_task_with_impl(struct _starpu_sched_node * node, struct starpu_task * task, unsigned nimpl);
-
-/* no public create function for workers because we dont want to have several node_worker for a single workerid */
-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_combined_worker * _starpu_sched_node_combined_worker_get_combined_worker(struct _starpu_sched_node * combined_worker_node);
-void _starpu_sched_node_worker_destroy(struct _starpu_sched_node *);
-
-/* this function compare the available function of the node with the standard available for worker nodes*/
-int _starpu_sched_node_is_worker(struct _starpu_sched_node * node);
-int _starpu_sched_node_is_simple_worker(struct _starpu_sched_node * node);
-int _starpu_sched_node_is_combined_worker(struct _starpu_sched_node * node);
-int _starpu_sched_node_worker_get_workerid(struct _starpu_sched_node * worker_node);
-
-struct _starpu_sched_node * _starpu_sched_node_fifo_create(void * arg STARPU_ATTRIBUTE_UNUSED);
-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);
-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);
-int _starpu_sched_node_is_random(struct _starpu_sched_node *);
-struct _starpu_sched_node * _starpu_sched_node_eager_create(void * arg STARPU_ATTRIBUTE_UNUSED);
-
-struct _starpu_sched_node * _starpu_sched_node_heft_create(void * arg STARPU_ATTRIBUTE_UNUSED);
-/* this function is called to create the node wich will be used to push task when no perf model are available
- * by default, a random node is created
- */
-void _starpu_sched_node_heft_set_no_model_node(struct _starpu_sched_node * heft_node,
-					       struct _starpu_sched_node * (*create_no_model_node)(void * arg), void * arg);
-
-int _starpu_sched_node_is_heft(struct _starpu_sched_node * node);
-
-/* compute predicted_end by taking in account the case of the predicted transfer and the predicted_end overlap
- */
-double _starpu_compute_expected_time(double now, double predicted_end, double predicted_length, double predicted_transfer);
-
-/*create an empty tree
- */
-struct _starpu_sched_tree * _starpu_sched_tree_create(void);
-void _starpu_sched_tree_destroy(struct _starpu_sched_tree * tree, unsigned sched_ctx_id);
-
-/* destroy node and all his child
- * except if they are shared between several contexts
- */
-void _starpu_node_destroy_rec(struct _starpu_sched_node * node, unsigned sched_ctx_id);
-
-int _starpu_tree_push_task(struct starpu_task * task);
-struct starpu_task * _starpu_tree_pop_task(unsigned sched_ctx_id);
-void _starpu_tree_add_workers(unsigned sched_ctx_id, int *workerids, unsigned nworkers);
-void _starpu_tree_remove_workers(unsigned sched_ctx_id, int *workerids, unsigned nworkers);
-void _starpu_sched_node_worker_pre_exec_hook(struct starpu_task * task);
-void _starpu_sched_node_worker_post_exec_hook(struct starpu_task * task);
-
-/* return the bitmap of worker that are allowed to use in this scheduling context
- */
-struct _starpu_bitmap * _starpu_get_worker_mask(struct starpu_task * task);
-
-/* this function fill all the node->workers member
- */
-void _starpu_set_workers_bitmaps(void);
-/* this function call init data on all nodes in postfix order
- */
-void _starpu_tree_call_init_data(struct _starpu_sched_tree * t);
-
-/* push task of list lower as possible in the tree, a non null value is returned if some task couldn't be pushed
- */
-int _starpu_sched_node_push_tasks_to_firsts_suitable_parent(struct _starpu_sched_node * node, struct starpu_task_list * list, int sched_ctx_id);
-
-
-
-
-
-
-
-#endif

+ 32 - 32
src/sched_policies/node_work_stealing.c

@@ -1,4 +1,4 @@
-#include "node_sched.h"
+#include <starpu_sched_node.h>
 #include "prio_deque.h"
 #include "prio_deque.h"
 #include <starpu_scheduler.h>
 #include <starpu_scheduler.h>
 #include <starpu.h>
 #include <starpu.h>
@@ -20,7 +20,7 @@ struct _starpu_work_stealing_data
  * steal a task in a round robin way
  * steal a task in a round robin way
  * return NULL if none available
  * return NULL if none available
  */
  */
-static struct starpu_task *  steal_task_round_robin(struct _starpu_sched_node *node, int workerid)
+static struct starpu_task *  steal_task_round_robin(struct starpu_sched_node *node, int workerid)
 {
 {
 	struct _starpu_work_stealing_data *wsd = node->data;
 	struct _starpu_work_stealing_data *wsd = node->data;
 	unsigned i = wsd->last_pop_child;
 	unsigned i = wsd->last_pop_child;
@@ -55,7 +55,7 @@ static struct starpu_task *  steal_task_round_robin(struct _starpu_sched_node *n
  * Return a worker to whom add a task.
  * Return a worker to whom add a task.
  * Selecting a worker is done in a round-robin fashion.
  * Selecting a worker is done in a round-robin fashion.
  */
  */
-static unsigned select_worker_round_robin(struct _starpu_sched_node * node)
+static unsigned select_worker_round_robin(struct starpu_sched_node * node)
 {
 {
 	struct _starpu_work_stealing_data *ws = (struct _starpu_work_stealing_data*)node->data;
 	struct _starpu_work_stealing_data *ws = (struct _starpu_work_stealing_data*)node->data;
 	unsigned i = (ws->last_push_child + 1) % node->nchilds ;
 	unsigned i = (ws->last_push_child + 1) % node->nchilds ;
@@ -69,7 +69,7 @@ static unsigned select_worker_round_robin(struct _starpu_sched_node * node)
  * This is a phony function used to call the right
  * This is a phony function used to call the right
  * function depending on the value of USE_OVERLOAD.
  * function depending on the value of USE_OVERLOAD.
  */
  */
-static inline struct starpu_task * steal_task(struct _starpu_sched_node * node, int workerid)
+static inline struct starpu_task * steal_task(struct starpu_sched_node * node, int workerid)
 {
 {
 	return steal_task_round_robin(node, workerid);
 	return steal_task_round_robin(node, workerid);
 }
 }
@@ -79,20 +79,20 @@ static inline struct starpu_task * steal_task(struct _starpu_sched_node * node,
  * This is a phony function used to call the right
  * This is a phony function used to call the right
  * function depending on the value of USE_OVERLOAD.
  * function depending on the value of USE_OVERLOAD.
  */
  */
-static inline unsigned select_worker(struct _starpu_sched_node * node)
+static inline unsigned select_worker(struct starpu_sched_node * node)
 {
 {
 	return select_worker_round_robin(node);
 	return select_worker_round_robin(node);
 }
 }
 
 
 
 
-static int is_worker_of_node(struct _starpu_sched_node * node, int workerid)
+static int is_worker_of_node(struct starpu_sched_node * node, int workerid)
 {
 {
-	return _starpu_bitmap_get(node->workers, workerid);
+	return starpu_bitmap_get(node->workers, workerid);
 }
 }
 
 
 
 
 
 
-static struct starpu_task * pop_task(struct _starpu_sched_node * node, unsigned sched_ctx_id)
+static struct starpu_task * pop_task(struct starpu_sched_node * node, unsigned sched_ctx_id)
 {
 {
 	int workerid = starpu_worker_get_id();
 	int workerid = starpu_worker_get_id();
 	int i;
 	int i;
@@ -124,7 +124,7 @@ static struct starpu_task * pop_task(struct _starpu_sched_node * node, unsigned
 
 
 
 
 
 
-static int push_task(struct _starpu_sched_node * node, struct starpu_task * task)
+static int push_task(struct starpu_sched_node * node, struct starpu_task * task)
 {
 {
 	struct _starpu_work_stealing_data * wsd = node->data;
 	struct _starpu_work_stealing_data * wsd = node->data;
 	int ret = -1;
 	int ret = -1;
@@ -133,8 +133,8 @@ static int push_task(struct _starpu_sched_node * node, struct starpu_task * task
 	do
 	do
 	{
 	{
 		i = (i+1)%node->nchilds;
 		i = (i+1)%node->nchilds;
-		struct _starpu_sched_node * child = node->childs[i];
-		if(_starpu_sched_node_can_execute_task(child,task))
+		struct starpu_sched_node * child = node->childs[i];
+		if(starpu_sched_node_can_execute_task(child,task))
 		{
 		{
 			STARPU_PTHREAD_MUTEX_LOCK(wsd->mutexes + i);
 			STARPU_PTHREAD_MUTEX_LOCK(wsd->mutexes + i);
 			ret = _starpu_prio_deque_push_task(wsd->fifos + i, task);
 			ret = _starpu_prio_deque_push_task(wsd->fifos + i, task);
@@ -154,14 +154,14 @@ int _starpu_ws_push_task(struct starpu_task *task)
 {
 {
 	int workerid = starpu_worker_get_id();
 	int workerid = starpu_worker_get_id();
 	if(workerid == -1)
 	if(workerid == -1)
-		return _starpu_tree_push_task(task);
+		return starpu_sched_tree_push_task(task);
 
 
 	unsigned sched_ctx_id = task->sched_ctx;
 	unsigned sched_ctx_id = task->sched_ctx;
-	struct _starpu_sched_node * node =_starpu_sched_node_worker_get(workerid);
+	struct starpu_sched_node * node =starpu_sched_node_worker_get(workerid);
 	while(node->fathers[sched_ctx_id] != NULL)
 	while(node->fathers[sched_ctx_id] != NULL)
 	{
 	{
 		node = node->fathers[sched_ctx_id];
 		node = node->fathers[sched_ctx_id];
-		if(_starpu_sched_node_is_work_stealing(node))
+		if(starpu_sched_node_is_work_stealing(node))
 		{
 		{
 			int i;
 			int i;
 			for(i = 0; i < node->nchilds; i++)
 			for(i = 0; i < node->nchilds; i++)
@@ -188,11 +188,11 @@ int _starpu_ws_push_task(struct starpu_task *task)
 	}
 	}
 
 
 	STARPU_ASSERT_MSG(0, "there were a problem here, dont know what to do");
 	STARPU_ASSERT_MSG(0, "there were a problem here, dont know what to do");
-	return _starpu_tree_push_task(task);
+	return starpu_sched_tree_push_task(task);
 }
 }
 
 
 
 
-static void init_ws_data(struct _starpu_sched_node *node)
+static void init_ws_data(struct starpu_sched_node *node)
 {
 {
 	struct _starpu_work_stealing_data * wsd = malloc(sizeof(*wsd));
 	struct _starpu_work_stealing_data * wsd = malloc(sizeof(*wsd));
 	memset(wsd, 0, sizeof(*wsd));
 	memset(wsd, 0, sizeof(*wsd));
@@ -213,7 +213,7 @@ static void init_ws_data(struct _starpu_sched_node *node)
 	}
 	}
 }
 }
 
 
-static void deinit_ws_data(struct _starpu_sched_node *node)
+static void deinit_ws_data(struct starpu_sched_node *node)
 {
 {
 	struct _starpu_work_stealing_data * wsd = node->data;
 	struct _starpu_work_stealing_data * wsd = node->data;
 	int i;
 	int i;
@@ -229,9 +229,9 @@ static void deinit_ws_data(struct _starpu_sched_node *node)
 }
 }
 
 
 
 
-struct _starpu_sched_node * _starpu_sched_node_work_stealing_create(void)
+struct starpu_sched_node * starpu_sched_node_work_stealing_create(void)
 {
 {
-	struct _starpu_sched_node * node = _starpu_sched_node_create();
+	struct starpu_sched_node * node = starpu_sched_node_create();
 	node->pop_task = pop_task;
 	node->pop_task = pop_task;
 	node->init_data = init_ws_data;
 	node->init_data = init_ws_data;
 	node->deinit_data = deinit_ws_data;
 	node->deinit_data = deinit_ws_data;
@@ -239,7 +239,7 @@ struct _starpu_sched_node * _starpu_sched_node_work_stealing_create(void)
 	return node;
 	return node;
 }
 }
 
 
-int _starpu_sched_node_is_work_stealing(struct _starpu_sched_node * node)
+int starpu_sched_node_is_work_stealing(struct starpu_sched_node * node)
 {
 {
 	return node->init_data == init_ws_data;
 	return node->init_data == init_ws_data;
 }
 }
@@ -249,29 +249,29 @@ int _starpu_sched_node_is_work_stealing(struct _starpu_sched_node * node)
 static void initialize_ws_center_policy(unsigned sched_ctx_id)
 static void initialize_ws_center_policy(unsigned sched_ctx_id)
 {
 {
 	starpu_sched_ctx_create_worker_collection(sched_ctx_id, STARPU_WORKER_LIST);
 	starpu_sched_ctx_create_worker_collection(sched_ctx_id, STARPU_WORKER_LIST);
-	struct _starpu_sched_tree *data = malloc(sizeof(struct _starpu_sched_tree));
+	struct starpu_sched_tree *data = malloc(sizeof(struct starpu_sched_tree));
 	STARPU_PTHREAD_RWLOCK_INIT(&data->lock,NULL);
 	STARPU_PTHREAD_RWLOCK_INIT(&data->lock,NULL);
-	struct _starpu_sched_node * ws;
- 	data->root = ws = _starpu_sched_node_work_stealing_create();
-	data->workers = _starpu_bitmap_create();
+	struct starpu_sched_node * ws;
+ 	data->root = ws = starpu_sched_node_work_stealing_create();
+	data->workers = starpu_bitmap_create();
 	unsigned i;
 	unsigned i;
 	for(i = 0; i < starpu_worker_get_count(); i++)
 	for(i = 0; i < starpu_worker_get_count(); i++)
 	{
 	{
-		struct _starpu_sched_node * node = _starpu_sched_node_worker_get(i);
+		struct starpu_sched_node * node = starpu_sched_node_worker_get(i);
 		if(!node)
 		if(!node)
 			continue;
 			continue;
 		node->fathers[sched_ctx_id] = ws;
 		node->fathers[sched_ctx_id] = ws;
-		_starpu_sched_node_add_child(ws, node);
+		starpu_sched_node_add_child(ws, node);
 	}
 	}
 	_starpu_set_workers_bitmaps();
 	_starpu_set_workers_bitmaps();
-	_starpu_tree_call_init_data(data);
+	starpu_sched_tree_call_init_data(data);
 	starpu_sched_ctx_set_policy_data(sched_ctx_id, (void*)data);
 	starpu_sched_ctx_set_policy_data(sched_ctx_id, (void*)data);
 }
 }
 
 
 static void deinitialize_ws_center_policy(unsigned sched_ctx_id)
 static void deinitialize_ws_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_sched_tree_destroy(t, sched_ctx_id);
+	struct starpu_sched_tree *t = (struct starpu_sched_tree*)starpu_sched_ctx_get_policy_data(sched_ctx_id);
+	starpu_sched_tree_destroy(t, sched_ctx_id);
 	starpu_sched_ctx_delete_worker_collection(sched_ctx_id);
 	starpu_sched_ctx_delete_worker_collection(sched_ctx_id);
 }
 }
 
 
@@ -280,10 +280,10 @@ struct starpu_sched_policy _starpu_sched_tree_ws_policy =
 {
 {
 	.init_sched = initialize_ws_center_policy,
 	.init_sched = initialize_ws_center_policy,
 	.deinit_sched = deinitialize_ws_center_policy,
 	.deinit_sched = deinitialize_ws_center_policy,
-	.add_workers = _starpu_tree_add_workers,
-	.remove_workers = _starpu_tree_remove_workers,
+	.add_workers = starpu_sched_tree_add_workers,
+	.remove_workers = starpu_sched_tree_remove_workers,
 	.push_task = _starpu_ws_push_task,
 	.push_task = _starpu_ws_push_task,
-	.pop_task = _starpu_tree_pop_task,
+	.pop_task = starpu_sched_tree_pop_task,
 	.pre_exec_hook = NULL,
 	.pre_exec_hook = NULL,
 	.post_exec_hook = NULL,
 	.post_exec_hook = NULL,
 	.pop_every_task = NULL,
 	.pop_every_task = NULL,

+ 84 - 84
src/sched_policies/node_worker.c

@@ -1,8 +1,8 @@
-#include "node_sched.h"
+#include <starpu_sched_node.h>
 #include <core/workers.h>
 #include <core/workers.h>
 #include <float.h>
 #include <float.h>
 
 
-static struct _starpu_sched_node * _worker_nodes[STARPU_NMAXWORKERS];
+static struct starpu_sched_node * _worker_nodes[STARPU_NMAXWORKERS];
 
 
 /* data structure for worker's queue look like this :
 /* data structure for worker's queue look like this :
  * W = worker
  * W = worker
@@ -61,7 +61,7 @@ struct _starpu_task_grid
 
 
 
 
 /* list->exp_start, list->exp_len, list-exp_end and list->ntasks
 /* list->exp_start, list->exp_len, list-exp_end and list->ntasks
- * are updated by _starpu_sched_node_worker_push_task(node, task) and pre_exec_hook
+ * are updated by starpu_sched_node_worker_push_task(node, task) and pre_exec_hook
  */
  */
 
 
 struct _starpu_worker_task_list
 struct _starpu_worker_task_list
@@ -231,9 +231,9 @@ static inline struct starpu_task * _starpu_worker_task_list_pop(struct _starpu_w
 
 
 
 
 
 
-static struct _starpu_sched_node * _starpu_sched_node_worker_create(int workerid);
-static struct _starpu_sched_node * _starpu_sched_node_combined_worker_create(int workerid);
-struct _starpu_sched_node * _starpu_sched_node_worker_get(int workerid)
+static struct starpu_sched_node * starpu_sched_node_worker_create(int workerid);
+static struct starpu_sched_node * starpu_sched_node_combined_worker_create(int workerid);
+struct starpu_sched_node * starpu_sched_node_worker_get(int workerid)
 {
 {
 	STARPU_ASSERT(workerid >= 0 && workerid < STARPU_NMAXWORKERS);
 	STARPU_ASSERT(workerid >= 0 && workerid < STARPU_NMAXWORKERS);
 	/* we may need to take a mutex here */
 	/* we may need to take a mutex here */
@@ -241,40 +241,40 @@ struct _starpu_sched_node * _starpu_sched_node_worker_get(int workerid)
 		return _worker_nodes[workerid];
 		return _worker_nodes[workerid];
 	else
 	else
 	{
 	{
-		struct _starpu_sched_node * node;
+		struct starpu_sched_node * node;
 		if(workerid < (int) starpu_worker_get_count())
 		if(workerid < (int) starpu_worker_get_count())
-			node = _starpu_sched_node_worker_create(workerid);
+			node = starpu_sched_node_worker_create(workerid);
 		else
 		else
-			node = _starpu_sched_node_combined_worker_create(workerid);
+			node = starpu_sched_node_combined_worker_create(workerid);
 		_worker_nodes[workerid] = node;
 		_worker_nodes[workerid] = node;
 		return node;
 		return node;
 	}
 	}
 }
 }
 
 
-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));
+	STARPU_ASSERT(starpu_sched_node_is_simple_worker(worker_node));
 	struct _starpu_worker_node_data * data = worker_node->data;
 	struct _starpu_worker_node_data * data = worker_node->data;
 	return data->worker;
 	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));
+	STARPU_ASSERT(starpu_sched_node_is_combined_worker(worker_node));
 	struct _starpu_worker_node_data * data = worker_node->data;
 	struct _starpu_worker_node_data * data = worker_node->data;
 	return data->combined_worker;
 	return data->combined_worker;
 }
 }
 
 
-enum starpu_perfmodel_archtype _starpu_sched_node_worker_get_perf_arch(struct _starpu_sched_node * worker_node)
+enum starpu_perfmodel_archtype starpu_sched_node_worker_get_perf_arch(struct starpu_sched_node * worker_node)
 {
 {
-	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;
+	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;
 	else
 	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;
 }
 }
 
 
 
 
-int _starpu_sched_node_worker_push_task(struct _starpu_sched_node * node, struct starpu_task *task)
+int starpu_sched_node_worker_push_task(struct starpu_sched_node * node, struct starpu_task *task)
 {
 {
 	/*this function take the worker's mutex */
 	/*this function take the worker's mutex */
 	struct _starpu_worker_node_data * data = node->data;
 	struct _starpu_worker_node_data * data = node->data;
@@ -282,7 +282,7 @@ int _starpu_sched_node_worker_push_task(struct _starpu_sched_node * node, struct
 	t->task = task;
 	t->task = task;
 	t->ntasks = 1;
 	t->ntasks = 1;
 
 
-	task->workerid = _starpu_bitmap_first(node->workers);
+	task->workerid = starpu_bitmap_first(node->workers);
 	if (starpu_get_prefetch_flag())
 	if (starpu_get_prefetch_flag())
 	{
 	{
 		unsigned memory_node = starpu_worker_get_memory_node(task->workerid);
 		unsigned memory_node = starpu_worker_get_memory_node(task->workerid);
@@ -295,7 +295,7 @@ int _starpu_sched_node_worker_push_task(struct _starpu_sched_node * node, struct
 	return 0;
 	return 0;
 }
 }
 
 
-struct starpu_task * _starpu_sched_node_worker_pop_task(struct _starpu_sched_node *node,unsigned sched_ctx_id)
+struct starpu_task * starpu_sched_node_worker_pop_task(struct starpu_sched_node *node,unsigned sched_ctx_id)
 {
 {
 	struct _starpu_worker_node_data * data = node->data;
 	struct _starpu_worker_node_data * data = node->data;
 	struct _starpu_worker_task_list * list = data->list;
 	struct _starpu_worker_task_list * list = data->list;
@@ -308,7 +308,7 @@ struct starpu_task * _starpu_sched_node_worker_pop_task(struct _starpu_sched_nod
 		return task;
 		return task;
 	}
 	}
 
 
-	struct _starpu_sched_node *father = node->fathers[sched_ctx_id];
+	struct starpu_sched_node *father = node->fathers[sched_ctx_id];
 	if(father == NULL)
 	if(father == NULL)
 		return NULL;
 		return NULL;
 	task = father->pop_task(father,sched_ctx_id);
 	task = father->pop_task(father,sched_ctx_id);
@@ -322,35 +322,35 @@ struct starpu_task * _starpu_sched_node_worker_pop_task(struct _starpu_sched_nod
 			starpu_push_task_end(task);
 			starpu_push_task_end(task);
 			return task;
 			return task;
 		}
 		}
-		struct _starpu_sched_node * combined_worker_node = _starpu_sched_node_worker_get(combined_workerid);
+		struct starpu_sched_node * combined_worker_node = starpu_sched_node_worker_get(combined_workerid);
 		(void)combined_worker_node->push_task(combined_worker_node, task);
 		(void)combined_worker_node->push_task(combined_worker_node, task);
 		//we have pushed a task in queue, so can make a recursive call
 		//we have pushed a task in queue, so can make a recursive call
-		return _starpu_sched_node_worker_pop_task(node, sched_ctx_id);
+		return starpu_sched_node_worker_pop_task(node, sched_ctx_id);
 
 
 	}
 	}
 	if(task)
 	if(task)
 		starpu_push_task_end(task);
 		starpu_push_task_end(task);
 	return task;
 	return task;
 }
 }
-void _starpu_sched_node_worker_destroy(struct _starpu_sched_node *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;
 	unsigned id = worker->workerid;
 	assert(_worker_nodes[id] == node);
 	assert(_worker_nodes[id] == node);
 	int i;
 	int i;
 	for(i = 0; i < STARPU_NMAX_SCHED_CTXS ; i++)
 	for(i = 0; i < STARPU_NMAX_SCHED_CTXS ; i++)
 		if(node->fathers[i] != NULL)
 		if(node->fathers[i] != NULL)
 			return;//this node is shared between several contexts
 			return;//this node is shared between several contexts
-	_starpu_sched_node_destroy(node);
+	starpu_sched_node_destroy(node);
 	_worker_nodes[id] = NULL;
 	_worker_nodes[id] = NULL;
 }
 }
 
 
-static void simple_worker_available(struct _starpu_sched_node * worker_node)
+static void simple_worker_available(struct starpu_sched_node * worker_node)
 {
 {
 	(void) worker_node;
 	(void) worker_node;
 
 
 #ifndef STARPU_NON_BLOCKING_DRIVERS
 #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())
 	if(w->workerid == starpu_worker_get_id())
 		return;
 		return;
 	starpu_pthread_mutex_t *sched_mutex = &w->sched_mutex;
 	starpu_pthread_mutex_t *sched_mutex = &w->sched_mutex;
@@ -361,11 +361,11 @@ static void simple_worker_available(struct _starpu_sched_node * worker_node)
 #endif
 #endif
 }
 }
 
 
-static void combined_worker_available(struct _starpu_sched_node * node)
+static void combined_worker_available(struct starpu_sched_node * node)
 {
 {
 	(void) node;
 	(void) node;
 #ifndef STARPU_NON_BLOCKING_DRIVERS
 #ifndef STARPU_NON_BLOCKING_DRIVERS
-	STARPU_ASSERT(_starpu_sched_node_is_combined_worker(node));
+	STARPU_ASSERT(starpu_sched_node_is_combined_worker(node));
 	struct _starpu_worker_node_data * data = node->data;
 	struct _starpu_worker_node_data * data = node->data;
 	int workerid = starpu_worker_get_id();
 	int workerid = starpu_worker_get_id();
 	int i;
 	int i;
@@ -384,10 +384,10 @@ static void combined_worker_available(struct _starpu_sched_node * node)
 #endif
 #endif
 }
 }
 
 
-static double estimated_transfer_length(struct _starpu_sched_node * node,
+static double estimated_transfer_length(struct starpu_sched_node * node,
 					struct starpu_task * task)
 					struct starpu_task * task)
 {
 {
-	STARPU_ASSERT(_starpu_sched_node_is_worker(node));
+	STARPU_ASSERT(starpu_sched_node_is_worker(node));
 	starpu_task_bundle_t bundle = task->bundle;
 	starpu_task_bundle_t bundle = task->bundle;
 	struct _starpu_worker_node_data * data = node->data;
 	struct _starpu_worker_node_data * data = node->data;
 	unsigned memory_node = data->worker ? data->worker->memory_node : data->combined_worker->memory_node;
 	unsigned memory_node = data->worker ? data->worker->memory_node : data->combined_worker->memory_node;
@@ -417,9 +417,9 @@ static double worker_estimated_finish_time(struct _starpu_worker * worker)
 	return sum + starpu_timing_now();
 	return sum + starpu_timing_now();
 }
 }
 
 
-static double combined_worker_expected_finish_time(struct _starpu_sched_node * node)
+static double combined_worker_expected_finish_time(struct starpu_sched_node * node)
 {
 {
-	STARPU_ASSERT(_starpu_sched_node_is_combined_worker(node));
+	STARPU_ASSERT(starpu_sched_node_is_combined_worker(node));
 	struct _starpu_worker_node_data * data = node->data;
 	struct _starpu_worker_node_data * data = node->data;
 	struct _starpu_combined_worker * combined_worker = data->combined_worker;
 	struct _starpu_combined_worker * combined_worker = data->combined_worker;
 	double max = 0.0;
 	double max = 0.0;
@@ -434,7 +434,7 @@ static double combined_worker_expected_finish_time(struct _starpu_sched_node * n
 	}
 	}
 	return max;
 	return max;
 }
 }
-static double simple_worker_expected_finish_time(struct _starpu_sched_node * node)
+static double simple_worker_expected_finish_time(struct starpu_sched_node * node)
 {
 {
 	struct _starpu_worker_node_data * data = node->data;
 	struct _starpu_worker_node_data * data = node->data;
 	STARPU_PTHREAD_MUTEX_LOCK(&data->list->mutex);
 	STARPU_PTHREAD_MUTEX_LOCK(&data->list->mutex);
@@ -443,17 +443,17 @@ static double simple_worker_expected_finish_time(struct _starpu_sched_node * nod
 	return tmp;
 	return tmp;
 }
 }
 
 
-static struct _starpu_task_execute_preds estimated_execute_preds(struct _starpu_sched_node * node, struct starpu_task * task,
-								 double (*estimated_finish_time)(struct _starpu_sched_node*))
+static struct starpu_task_execute_preds estimated_execute_preds(struct starpu_sched_node * node, struct starpu_task * task,
+								 double (*estimated_finish_time)(struct starpu_sched_node*))
 {
 {
-	STARPU_ASSERT(_starpu_sched_node_is_worker(node));
+	STARPU_ASSERT(starpu_sched_node_is_worker(node));
 	starpu_task_bundle_t bundle = task->bundle;
 	starpu_task_bundle_t bundle = task->bundle;
-	int workerid = _starpu_sched_node_worker_get_workerid(node);
+	int workerid = starpu_sched_node_worker_get_workerid(node);
 
 
-	struct _starpu_task_execute_preds preds =
+	struct starpu_task_execute_preds preds =
 		{
 		{
 			.state = CANNOT_EXECUTE,
 			.state = CANNOT_EXECUTE,
-			.archtype = _starpu_sched_node_worker_get_perf_arch(node),
+			.archtype = starpu_sched_node_worker_get_perf_arch(node),
 			.expected_length = DBL_MAX,
 			.expected_length = DBL_MAX,
 			.expected_finish_time = estimated_finish_time(node),
 			.expected_finish_time = estimated_finish_time(node),
 			.expected_transfer_length = estimated_transfer_length(node, task),
 			.expected_transfer_length = estimated_transfer_length(node, task),
@@ -494,7 +494,7 @@ static struct _starpu_task_execute_preds estimated_execute_preds(struct _starpu_
 
 
 	if(preds.state == PERF_MODEL)
 	if(preds.state == PERF_MODEL)
 	{
 	{
-		preds.expected_finish_time = _starpu_compute_expected_time(starpu_timing_now(),
+		preds.expected_finish_time = starpu_sched_compute_expected_time(starpu_timing_now(),
 									  preds.expected_finish_time,
 									  preds.expected_finish_time,
 									  preds.expected_length,
 									  preds.expected_length,
 									  preds.expected_transfer_length);
 									  preds.expected_transfer_length);
@@ -508,20 +508,20 @@ static struct _starpu_task_execute_preds estimated_execute_preds(struct _starpu_
 	return preds;
 	return preds;
 }
 }
 
 
-static struct _starpu_task_execute_preds combined_worker_estimated_execute_preds(struct _starpu_sched_node * node, struct starpu_task * task)
+static struct starpu_task_execute_preds combined_worker_estimated_execute_preds(struct starpu_sched_node * node, struct starpu_task * task)
 {
 {
 	return estimated_execute_preds(node,task,combined_worker_expected_finish_time);
 	return estimated_execute_preds(node,task,combined_worker_expected_finish_time);
 }
 }
 
 
-static struct _starpu_task_execute_preds simple_worker_estimated_execute_preds(struct _starpu_sched_node * node, struct starpu_task * task)
+static struct starpu_task_execute_preds simple_worker_estimated_execute_preds(struct starpu_sched_node * node, struct starpu_task * task)
 {
 {
 	return estimated_execute_preds(node,task,simple_worker_expected_finish_time);
 	return estimated_execute_preds(node,task,simple_worker_expected_finish_time);
 }
 }
 
 
 
 
-static double simple_worker_estimated_load(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;
 	int nb_task = 0;
 	STARPU_PTHREAD_MUTEX_LOCK(&worker->mutex);
 	STARPU_PTHREAD_MUTEX_LOCK(&worker->mutex);
 	struct starpu_task_list list = worker->local_tasks;
 	struct starpu_task_list list = worker->local_tasks;
@@ -535,10 +535,10 @@ static double simple_worker_estimated_load(struct _starpu_sched_node * node)
 	struct _starpu_worker_task_list * l = d->list;
 	struct _starpu_worker_task_list * l = d->list;
 	int ntasks_in_fifo = l ? l->ntasks : 0;
 	int ntasks_in_fifo = l ? l->ntasks : 0;
 	return (double) (nb_task + ntasks_in_fifo)
 	return (double) (nb_task + ntasks_in_fifo)
-		/ starpu_worker_get_relative_speedup(_starpu_bitmap_first(node->workers));
+		/ starpu_worker_get_relative_speedup(starpu_bitmap_first(node->workers));
 }
 }
 
 
-static double combined_worker_estimated_load(struct _starpu_sched_node * node)
+static double combined_worker_estimated_load(struct starpu_sched_node * node)
 {
 {
 	struct _starpu_worker_node_data * d = node->data;
 	struct _starpu_worker_node_data * d = node->data;
 	struct _starpu_combined_worker * c = d->combined_worker;
 	struct _starpu_combined_worker * c = d->combined_worker;
@@ -546,13 +546,13 @@ static double combined_worker_estimated_load(struct _starpu_sched_node * node)
 	int i;
 	int i;
 	for(i = 0; i < c->worker_size; i++)
 	for(i = 0; i < c->worker_size; i++)
 	{
 	{
-		struct _starpu_sched_node * n = _starpu_sched_node_worker_get(c->combined_workerid[i]);
+		struct starpu_sched_node * n = starpu_sched_node_worker_get(c->combined_workerid[i]);
 		load += n->estimated_load(n);
 		load += n->estimated_load(n);
 	}
 	}
 	return load;
 	return load;
 }
 }
 
 
-static void worker_deinit_data(struct _starpu_sched_node * node)
+static void worker_deinit_data(struct starpu_sched_node * node)
 {
 {
 	struct _starpu_worker_node_data * data = node->data;
 	struct _starpu_worker_node_data * data = node->data;
 	if(data->list)
 	if(data->list)
@@ -568,15 +568,15 @@ static void worker_deinit_data(struct _starpu_sched_node * node)
 }
 }
 
 
 
 
-static int _starpu_sched_node_combined_worker_push_task(struct _starpu_sched_node * node, struct starpu_task *task)
+static int starpu_sched_node_combined_worker_push_task(struct starpu_sched_node * node, struct starpu_task *task)
 {
 {
-	STARPU_ASSERT(_starpu_sched_node_is_combined_worker(node));
+	STARPU_ASSERT(starpu_sched_node_is_combined_worker(node));
 	struct _starpu_worker_node_data * data = node->data;
 	struct _starpu_worker_node_data * data = node->data;
 	STARPU_ASSERT(data->combined_worker && !data->worker);
 	STARPU_ASSERT(data->combined_worker && !data->worker);
 	struct _starpu_combined_worker  * combined_worker = data->combined_worker;
 	struct _starpu_combined_worker  * combined_worker = data->combined_worker;
 	STARPU_ASSERT(combined_worker->worker_size >= 1);
 	STARPU_ASSERT(combined_worker->worker_size >= 1);
 	struct _starpu_task_grid * task_alias[combined_worker->worker_size];
 	struct _starpu_task_grid * task_alias[combined_worker->worker_size];
-	starpu_parallel_task_barrier_init(task, _starpu_bitmap_first(node->workers));
+	starpu_parallel_task_barrier_init(task, starpu_bitmap_first(node->workers));
 	task_alias[0] = _starpu_task_grid_create();
 	task_alias[0] = _starpu_task_grid_create();
 	task_alias[0]->task = starpu_task_dup(task);
 	task_alias[0]->task = starpu_task_dup(task);
 	task_alias[0]->task->workerid = combined_worker->combined_workerid[0];
 	task_alias[0]->task->workerid = combined_worker->combined_workerid[0];
@@ -597,7 +597,7 @@ static int _starpu_sched_node_combined_worker_push_task(struct _starpu_sched_nod
 	i = 0;
 	i = 0;
 	do
 	do
 	{
 	{
-		struct _starpu_sched_node * worker_node = _starpu_sched_node_worker_get(combined_worker->combined_workerid[i]);
+		struct starpu_sched_node * worker_node = starpu_sched_node_worker_get(combined_worker->combined_workerid[i]);
 		struct _starpu_worker_node_data * worker_data = worker_node->data;
 		struct _starpu_worker_node_data * worker_data = worker_node->data;
 		struct _starpu_worker_task_list * list = worker_data->list;
 		struct _starpu_worker_task_list * list = worker_data->list;
 		STARPU_PTHREAD_MUTEX_LOCK(&list->mutex);
 		STARPU_PTHREAD_MUTEX_LOCK(&list->mutex);
@@ -627,7 +627,7 @@ static int _starpu_sched_node_combined_worker_push_task(struct _starpu_sched_nod
 		/* wake up all other workers of combined worker */
 		/* wake up all other workers of combined worker */
 		for(i = 0; i < combined_worker->worker_size; i++)
 		for(i = 0; i < combined_worker->worker_size; i++)
 		{
 		{
-			struct _starpu_sched_node * worker_node = _starpu_sched_node_worker_get(combined_worker->combined_workerid[i]);
+			struct starpu_sched_node * worker_node = starpu_sched_node_worker_get(combined_worker->combined_workerid[i]);
 			worker_node->available(worker_node);
 			worker_node->available(worker_node);
 		}
 		}
 
 
@@ -638,7 +638,7 @@ static int _starpu_sched_node_combined_worker_push_task(struct _starpu_sched_nod
 	return 0;
 	return 0;
 }
 }
 
 
-static struct _starpu_sched_node * _starpu_sched_node_worker_create(int workerid)
+static struct starpu_sched_node * starpu_sched_node_worker_create(int workerid)
 {
 {
 	STARPU_ASSERT(0 <=  workerid && workerid < (int) starpu_worker_get_count());
 	STARPU_ASSERT(0 <=  workerid && workerid < (int) starpu_worker_get_count());
 
 
@@ -648,20 +648,20 @@ static struct _starpu_sched_node * _starpu_sched_node_worker_create(int workerid
 	struct _starpu_worker * worker = _starpu_get_worker_struct(workerid);
 	struct _starpu_worker * worker = _starpu_get_worker_struct(workerid);
 	if(worker == NULL)
 	if(worker == NULL)
 		return NULL;
 		return NULL;
-	struct _starpu_sched_node * node = _starpu_sched_node_create();
+	struct starpu_sched_node * node = starpu_sched_node_create();
 	struct _starpu_worker_node_data * data = malloc(sizeof(*data));
 	struct _starpu_worker_node_data * data = malloc(sizeof(*data));
 	memset(data, 0, sizeof(*data));
 	memset(data, 0, sizeof(*data));
 	data->worker = worker;
 	data->worker = worker;
 	data->list = _starpu_worker_task_list_create();
 	data->list = _starpu_worker_task_list_create();
 	node->data = data;
 	node->data = data;
-	node->push_task = _starpu_sched_node_worker_push_task;
-	node->pop_task = _starpu_sched_node_worker_pop_task;
+	node->push_task = starpu_sched_node_worker_push_task;
+	node->pop_task = starpu_sched_node_worker_pop_task;
 	node->estimated_execute_preds = simple_worker_estimated_execute_preds;
 	node->estimated_execute_preds = simple_worker_estimated_execute_preds;
 	node->estimated_load = simple_worker_estimated_load;
 	node->estimated_load = simple_worker_estimated_load;
 	node->available = simple_worker_available;
 	node->available = simple_worker_available;
 	node->deinit_data = worker_deinit_data;
 	node->deinit_data = worker_deinit_data;
-	node->workers = _starpu_bitmap_create();
-	_starpu_bitmap_set(node->workers, workerid);
+	node->workers = starpu_bitmap_create();
+	starpu_bitmap_set(node->workers, workerid);
 	_worker_nodes[workerid] = node;
 	_worker_nodes[workerid] = node;
 
 
 #ifdef STARPU_HAVE_HWLOC
 #ifdef STARPU_HAVE_HWLOC
@@ -676,7 +676,7 @@ static struct _starpu_sched_node * _starpu_sched_node_worker_create(int workerid
 }
 }
 
 
 
 
-static struct _starpu_sched_node  * _starpu_sched_node_combined_worker_create(int workerid)
+static struct starpu_sched_node  * starpu_sched_node_combined_worker_create(int workerid)
 {
 {
 	STARPU_ASSERT(0 <= workerid && workerid <  STARPU_NMAXWORKERS);
 	STARPU_ASSERT(0 <= workerid && workerid <  STARPU_NMAXWORKERS);
 
 
@@ -686,20 +686,20 @@ static struct _starpu_sched_node  * _starpu_sched_node_combined_worker_create(in
 	struct _starpu_combined_worker * combined_worker = _starpu_get_combined_worker_struct(workerid);
 	struct _starpu_combined_worker * combined_worker = _starpu_get_combined_worker_struct(workerid);
 	if(combined_worker == NULL)
 	if(combined_worker == NULL)
 		return NULL;
 		return NULL;
-	struct _starpu_sched_node * node = _starpu_sched_node_create();
+	struct starpu_sched_node * node = starpu_sched_node_create();
 	struct _starpu_worker_node_data * data = malloc(sizeof(*data));
 	struct _starpu_worker_node_data * data = malloc(sizeof(*data));
 	memset(data, 0, sizeof(*data));
 	memset(data, 0, sizeof(*data));
 	data->combined_worker = combined_worker;
 	data->combined_worker = combined_worker;
 
 
 	node->data = data;
 	node->data = data;
-	node->push_task = _starpu_sched_node_combined_worker_push_task;
+	node->push_task = starpu_sched_node_combined_worker_push_task;
 	node->pop_task = NULL;
 	node->pop_task = NULL;
 	node->estimated_execute_preds = combined_worker_estimated_execute_preds;
 	node->estimated_execute_preds = combined_worker_estimated_execute_preds;
 	node->estimated_load = combined_worker_estimated_load;
 	node->estimated_load = combined_worker_estimated_load;
 	node->available = combined_worker_available;
 	node->available = combined_worker_available;
 	node->deinit_data = worker_deinit_data;
 	node->deinit_data = worker_deinit_data;
-	node->workers = _starpu_bitmap_create();
-	_starpu_bitmap_set(node->workers, workerid);
+	node->workers = starpu_bitmap_create();
+	starpu_bitmap_set(node->workers, workerid);
 	_worker_nodes[workerid] = node;
 	_worker_nodes[workerid] = node;
 
 
 #ifdef STARPU_HAVE_HWLOC
 #ifdef STARPU_HAVE_HWLOC
@@ -712,25 +712,25 @@ static struct _starpu_sched_node  * _starpu_sched_node_combined_worker_create(in
 	return node;
 	return node;
 }
 }
 
 
-int _starpu_sched_node_is_simple_worker(struct _starpu_sched_node * node)
+int starpu_sched_node_is_simple_worker(struct starpu_sched_node * node)
 {
 {
-	return node->push_task == _starpu_sched_node_worker_push_task;
+	return node->push_task == starpu_sched_node_worker_push_task;
 }
 }
-int _starpu_sched_node_is_combined_worker(struct _starpu_sched_node * node)
+int starpu_sched_node_is_combined_worker(struct starpu_sched_node * node)
 {
 {
-	return node->push_task == _starpu_sched_node_combined_worker_push_task;
+	return node->push_task == starpu_sched_node_combined_worker_push_task;
 }
 }
 
 
-int _starpu_sched_node_is_worker(struct _starpu_sched_node * node)
+int starpu_sched_node_is_worker(struct starpu_sched_node * node)
 {
 {
-	return _starpu_sched_node_is_simple_worker(node)
-		|| _starpu_sched_node_is_combined_worker(node);
+	return starpu_sched_node_is_simple_worker(node)
+		|| starpu_sched_node_is_combined_worker(node);
 }
 }
 
 
 
 
 
 
 #ifndef STARPU_NO_ASSERT
 #ifndef STARPU_NO_ASSERT
-static int _worker_consistant(struct _starpu_sched_node * node)
+static int _worker_consistant(struct starpu_sched_node * node)
 {
 {
 	int is_a_worker = 0;
 	int is_a_worker = 0;
 	int i;
 	int i;
@@ -750,13 +750,13 @@ static int _worker_consistant(struct _starpu_sched_node * node)
 }
 }
 #endif
 #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
 #ifndef STARPU_NO_ASSERT
 	STARPU_ASSERT(_worker_consistant(worker_node));
 	STARPU_ASSERT(_worker_consistant(worker_node));
 #endif
 #endif
-	STARPU_ASSERT(1 == _starpu_bitmap_cardinal(worker_node->workers));
-	return _starpu_bitmap_first(worker_node->workers);
+	STARPU_ASSERT(1 == starpu_bitmap_cardinal(worker_node->workers));
+	return starpu_bitmap_first(worker_node->workers);
 }
 }
 
 
 
 
@@ -764,12 +764,12 @@ static struct _starpu_worker_task_list * _worker_get_list(void)
 {
 {
 	int workerid = starpu_worker_get_id();
 	int workerid = starpu_worker_get_id();
 	STARPU_ASSERT(0 <= workerid && workerid < (int) starpu_worker_get_count());
 	STARPU_ASSERT(0 <= workerid && workerid < (int) starpu_worker_get_count());
-	struct _starpu_worker_node_data * d = _starpu_sched_node_worker_get(workerid)->data;
+	struct _starpu_worker_node_data * d = starpu_sched_node_worker_get(workerid)->data;
 	return d->list;
 	return d->list;
 }
 }
 
 
 
 
-void _starpu_sched_node_worker_pre_exec_hook(struct starpu_task * task)
+void starpu_sched_node_worker_pre_exec_hook(struct starpu_task * task)
 {
 {
 	if(!isnan(task->predicted))
 	if(!isnan(task->predicted))
 	{
 	{
@@ -791,7 +791,7 @@ void _starpu_sched_node_worker_pre_exec_hook(struct starpu_task * task)
 		STARPU_PTHREAD_MUTEX_UNLOCK(&list->mutex);
 		STARPU_PTHREAD_MUTEX_UNLOCK(&list->mutex);
 	}
 	}
 }
 }
-void _starpu_sched_node_worker_post_exec_hook(struct starpu_task * task)
+void starpu_sched_node_worker_post_exec_hook(struct starpu_task * task)
 {
 {
 	if(task->execute_on_a_specific_worker)
 	if(task->execute_on_a_specific_worker)
 		return;
 		return;
@@ -802,12 +802,12 @@ void _starpu_sched_node_worker_post_exec_hook(struct starpu_task * task)
 	STARPU_PTHREAD_MUTEX_UNLOCK(&list->mutex);
 	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)
+static void starpu_sched_node_worker_push_task_notify(struct starpu_task *task, int workerid, unsigned sched_ctx_id)
 {
 {
 
 
-	struct _starpu_sched_node * worker_node = _starpu_sched_node_worker_get(workerid);
+	struct starpu_sched_node * worker_node = starpu_sched_node_worker_get(workerid);
 	/* dont work with parallel tasks */
 	/* dont work with parallel tasks */
-	if(_starpu_sched_node_is_combined_worker(worker_node))
+	if(starpu_sched_node_is_combined_worker(worker_node))
 	   return;
 	   return;
 
 
 	struct _starpu_worker_node_data * d = worker_node->data;
 	struct _starpu_worker_node_data * d = worker_node->data;

+ 43 - 43
src/sched_policies/scheduler_maker.c

@@ -1,11 +1,11 @@
 #include "scheduler_maker.h"
 #include "scheduler_maker.h"
-#include "node_sched.h"
+#include <starpu_node_sched.h>
 #include "node_composed.h"
 #include "node_composed.h"
 #include <common/list.h>
 #include <common/list.h>
 #include <stdarg.h>
 #include <stdarg.h>
 #include <core/workers.h>
 #include <core/workers.h>
 
 
-static void set_all_data_to_null(struct _starpu_sched_node * node)
+static void set_all_data_to_null(struct starpu_sched_node * node)
 {
 {
 	if(node)
 	if(node)
 	{
 	{
@@ -18,7 +18,7 @@ static void set_all_data_to_null(struct _starpu_sched_node * node)
 
 
 struct sched_node_list
 struct sched_node_list
 {
 {
-	struct _starpu_sched_node ** arr;
+	struct starpu_sched_node ** arr;
 	unsigned size;
 	unsigned size;
 };
 };
 
 
@@ -30,23 +30,23 @@ static void destroy_list(struct sched_node_list * list)
 {
 {
 	free(list->arr);
 	free(list->arr);
 }
 }
-static void add_node(struct sched_node_list *list, struct _starpu_sched_node * node)
+static void add_node(struct sched_node_list *list, struct starpu_sched_node * node)
 {
 {
 	list->arr = realloc(list->arr,sizeof(*list->arr) * (list->size + 1));
 	list->arr = realloc(list->arr,sizeof(*list->arr) * (list->size + 1));
 	list->arr[list->size] = node;
 	list->arr[list->size] = node;
 	list->size++;
 	list->size++;
 }
 }
-static struct sched_node_list helper_make_scheduler(hwloc_obj_t obj, struct _starpu_sched_specs specs, unsigned sched_ctx_id)
+static struct sched_node_list helper_make_scheduler(hwloc_obj_t obj, struct starpu_sched_specs specs, unsigned sched_ctx_id)
 {
 {
 	STARPU_ASSERT(obj);
 	STARPU_ASSERT(obj);
 
 
-	struct _starpu_sched_node * node = NULL;
+	struct starpu_sched_node * node = NULL;
 
 
 	/*set nodes for this obj */
 	/*set nodes for this obj */
 #define CASE(ENUM,spec_member)						\
 #define CASE(ENUM,spec_member)						\
 		case ENUM:						\
 		case ENUM:						\
 			if(specs.spec_member)				\
 			if(specs.spec_member)				\
-				node = _starpu_sched_node_composed_node_create(specs.spec_member); \
+				node = starpu_sched_node_composed_node_create(specs.spec_member); \
 			break
 			break
 	switch(obj->type)
 	switch(obj->type)
 	{
 	{
@@ -74,8 +74,8 @@ static struct sched_node_list helper_make_scheduler(hwloc_obj_t obj, struct _sta
 		return l;
 		return l;
 	for(i = 0; i < l.size; i++)
 	for(i = 0; i < l.size; i++)
 	{
 	{
-		_starpu_sched_node_add_child(node, l.arr[i]);
-		_starpu_sched_node_set_father(l.arr[i],node,sched_ctx_id);
+		starpu_sched_node_add_child(node, l.arr[i]);
+		starpu_sched_node_set_father(l.arr[i],node,sched_ctx_id);
 	}
 	}
 	destroy_list(&l);
 	destroy_list(&l);
 	init_list(&l);
 	init_list(&l);
@@ -84,7 +84,7 @@ static struct sched_node_list helper_make_scheduler(hwloc_obj_t obj, struct _sta
 	return l;
 	return l;
 }
 }
 
 
-struct _starpu_sched_node * _find_sched_node_with_obj(struct _starpu_sched_node * node, hwloc_obj_t obj)
+struct starpu_sched_node * _find_sched_node_with_obj(struct starpu_sched_node * node, hwloc_obj_t obj)
 {
 {
 	if(node == NULL)
 	if(node == NULL)
 		return NULL;
 		return NULL;
@@ -93,7 +93,7 @@ struct _starpu_sched_node * _find_sched_node_with_obj(struct _starpu_sched_node
 	int i;
 	int i;
 	for(i = 0; i < node->nchilds; i++)
 	for(i = 0; i < node->nchilds; i++)
 	{
 	{
-		struct _starpu_sched_node * tmp = _find_sched_node_with_obj(node->childs[i], obj);
+		struct starpu_sched_node * tmp = _find_sched_node_with_obj(node->childs[i], obj);
 		if(tmp)
 		if(tmp)
 			return tmp;
 			return tmp;
 	}
 	}
@@ -101,9 +101,9 @@ struct _starpu_sched_node * _find_sched_node_with_obj(struct _starpu_sched_node
 }
 }
 
 
 
 
-static int is_same_kind_of_all(struct _starpu_sched_node * root, struct _starpu_worker * w)
+static int is_same_kind_of_all(struct starpu_sched_node * root, struct _starpu_worker * w)
 {
 {
-	if(_starpu_sched_node_is_worker(root))
+	if(starpu_sched_node_is_worker(root))
 	{
 	{
 		struct _starpu_worker * w_ = root->data;
 		struct _starpu_worker * w_ = root->data;
 		return w_->perf_arch == w->perf_arch;
 		return w_->perf_arch == w->perf_arch;
@@ -116,9 +116,9 @@ static int is_same_kind_of_all(struct _starpu_sched_node * root, struct _starpu_
 	return 1;
 	return 1;
 }
 }
 
 
-struct _starpu_sched_node * find_mem_node(struct _starpu_sched_node * root, struct _starpu_sched_node * worker_node, unsigned sched_ctx_id)
+struct starpu_sched_node * find_mem_node(struct starpu_sched_node * root, struct starpu_sched_node * worker_node, unsigned sched_ctx_id)
 {
 {
-	struct _starpu_sched_node * node = worker_node;
+	struct starpu_sched_node * node = worker_node;
 	while(node->obj->type != HWLOC_OBJ_NODE
 	while(node->obj->type != HWLOC_OBJ_NODE
 	      && node->obj->type != HWLOC_OBJ_MACHINE)
 	      && node->obj->type != HWLOC_OBJ_MACHINE)
 	{
 	{
@@ -134,13 +134,13 @@ struct _starpu_sched_node * find_mem_node(struct _starpu_sched_node * root, stru
 	return node;
 	return node;
 }
 }
 
 
-static struct _starpu_sched_node * where_should_we_plug_this(struct _starpu_sched_node *root, struct _starpu_sched_node * worker_node, struct _starpu_sched_specs specs, unsigned sched_ctx_id)
+static struct starpu_sched_node * where_should_we_plug_this(struct starpu_sched_node *root, struct starpu_sched_node * worker_node, struct starpu_sched_specs specs, unsigned sched_ctx_id)
 {
 {
-	struct _starpu_sched_node * mem = find_mem_node(root ,worker_node, sched_ctx_id);
+	struct starpu_sched_node * mem = find_mem_node(root ,worker_node, sched_ctx_id);
 	if(specs.mix_heterogeneous_workers || mem->fathers[sched_ctx_id] == NULL)
 	if(specs.mix_heterogeneous_workers || mem->fathers[sched_ctx_id] == NULL)
 		return mem;
 		return mem;
 	hwloc_obj_t obj = mem->obj;
 	hwloc_obj_t obj = mem->obj;
-	struct _starpu_sched_node * father = mem->fathers[sched_ctx_id];
+	struct starpu_sched_node * father = mem->fathers[sched_ctx_id];
 	int i;
 	int i;
 	for(i = 0; i < father->nchilds; i++)
 	for(i = 0; i < father->nchilds; i++)
 	{
 	{
@@ -150,67 +150,67 @@ static struct _starpu_sched_node * where_should_we_plug_this(struct _starpu_sche
 	}
 	}
 	if(obj->type == HWLOC_OBJ_NODE)
 	if(obj->type == HWLOC_OBJ_NODE)
 	{	
 	{	
-		struct _starpu_sched_node * node = _starpu_sched_node_composed_node_create(specs.hwloc_node_composed_sched_node);
+		struct starpu_sched_node * node = starpu_sched_node_composed_node_create(specs.hwloc_node_composed_sched_node);
 		node->obj = obj;
 		node->obj = obj;
-		_starpu_sched_node_add_child(father, node);
-		_starpu_sched_node_set_father(node, father, sched_ctx_id);
+		starpu_sched_node_add_child(father, node);
+		starpu_sched_node_set_father(node, father, sched_ctx_id);
 		return node;
 		return node;
 	}
 	}
 	return father;
 	return father;
 }
 }
 
 
-static void set_worker_leaf(struct _starpu_sched_node * root, struct _starpu_sched_node * worker_node, unsigned sched_ctx_id,
-			    struct _starpu_sched_specs specs)
+static void set_worker_leaf(struct starpu_sched_node * root, struct starpu_sched_node * worker_node, unsigned sched_ctx_id,
+			    struct starpu_sched_specs specs)
 {
 {
 	struct _starpu_worker * worker = worker_node->data;
 	struct _starpu_worker * worker = worker_node->data;
-	struct _starpu_sched_node * node = where_should_we_plug_this(root,worker_node,specs, sched_ctx_id);
+	struct starpu_sched_node * node = where_should_we_plug_this(root,worker_node,specs, sched_ctx_id);
 	struct _starpu_composed_sched_node_recipe * recipe = specs.worker_composed_sched_node ?
 	struct _starpu_composed_sched_node_recipe * recipe = specs.worker_composed_sched_node ?
 		specs.worker_composed_sched_node(worker->arch):NULL;
 		specs.worker_composed_sched_node(worker->arch):NULL;
 	STARPU_ASSERT(node);
 	STARPU_ASSERT(node);
 	if(recipe)
 	if(recipe)
 	{
 	{
-		struct _starpu_sched_node * tmp = _starpu_sched_node_composed_node_create(recipe);
+		struct starpu_sched_node * tmp = starpu_sched_node_composed_node_create(recipe);
 #ifdef STARPU_DEVEL
 #ifdef STARPU_DEVEL
 #warning FIXME node->obj is set to worker_node->obj even for accelerators workers
 #warning FIXME node->obj is set to worker_node->obj even for accelerators workers
 #endif
 #endif
 		tmp->obj = worker_node->obj;
 		tmp->obj = worker_node->obj;
-		_starpu_sched_node_set_father(tmp, node, sched_ctx_id);
-		_starpu_sched_node_add_child(node, tmp);
+		starpu_sched_node_set_father(tmp, node, sched_ctx_id);
+		starpu_sched_node_add_child(node, tmp);
 		node = tmp;
 		node = tmp;
 		
 		
 	}
 	}
 	_starpu_destroy_composed_sched_node_recipe(recipe);
 	_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);
+	starpu_sched_node_set_father(worker_node, node, sched_ctx_id);
+	starpu_sched_node_add_child(node, worker_node);
 }
 }
 
 
 #ifdef STARPU_DEVEL
 #ifdef STARPU_DEVEL
-static const char * name_hwloc_node(struct _starpu_sched_node * node)
+static const char * name_hwloc_node(struct starpu_sched_node * node)
 {
 {
 	return hwloc_obj_type_string(node->obj->type);
 	return hwloc_obj_type_string(node->obj->type);
 }
 }
-static const char * name_sched_node(struct _starpu_sched_node * node)
+static const char * name_sched_node(struct starpu_sched_node * node)
 {
 {
-	if(_starpu_sched_node_is_fifo(node))
+	if(starpu_sched_node_is_fifo(node))
 		return "fifo node";
 		return "fifo node";
-	if(_starpu_sched_node_is_heft(node))
+	if(starpu_sched_node_is_heft(node))
 		return "heft node";
 		return "heft node";
-	if(_starpu_sched_node_is_random(node))
+	if(starpu_sched_node_is_random(node))
 		return "random node";
 		return "random node";
-	if(_starpu_sched_node_is_worker(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
 #define SIZE 256
 		static char output[SIZE];
 		static char output[SIZE];
 		snprintf(output, SIZE,"node worker %d %s",w->workerid,w->name);
 		snprintf(output, SIZE,"node worker %d %s",w->workerid,w->name);
 		return output;
 		return output;
 	}
 	}
-	if(_starpu_sched_node_is_work_stealing(node))
+	if(starpu_sched_node_is_work_stealing(node))
 		return "work stealing node";
 		return "work stealing node";
 
 
 	return "unknown";
 	return "unknown";
 }
 }
-static void helper_display_scheduler(FILE* out, unsigned depth, struct _starpu_sched_node * node)
+static void helper_display_scheduler(FILE* out, unsigned depth, struct starpu_sched_node * node)
 {
 {
 	if(!node)
 	if(!node)
 		return;
 		return;
@@ -220,11 +220,11 @@ static void helper_display_scheduler(FILE* out, unsigned depth, struct _starpu_s
 		helper_display_scheduler(out, depth + 1, node->childs[i]);
 		helper_display_scheduler(out, depth + 1, node->childs[i]);
 }
 }
 #endif //STARPU_DEVEL
 #endif //STARPU_DEVEL
-struct _starpu_sched_tree * _starpu_make_scheduler(unsigned sched_ctx_id, struct _starpu_sched_specs specs)
+struct starpu_sched_tree * _starpu_make_scheduler(unsigned sched_ctx_id, struct starpu_sched_specs specs)
 {
 {
-	struct _starpu_sched_tree * tree = malloc(sizeof(*tree));
+	struct starpu_sched_tree * tree = malloc(sizeof(*tree));
 	STARPU_PTHREAD_RWLOCK_INIT(&tree->lock,NULL);
 	STARPU_PTHREAD_RWLOCK_INIT(&tree->lock,NULL);
-	tree->workers = _starpu_bitmap_create();
+	tree->workers = starpu_bitmap_create();
 	
 	
 	struct _starpu_machine_config *config = _starpu_get_machine_config();
 	struct _starpu_machine_config *config = _starpu_get_machine_config();
 	hwloc_topology_t topology = config->topology.hwtopology;
 	hwloc_topology_t topology = config->topology.hwtopology;
@@ -239,13 +239,13 @@ struct _starpu_sched_tree * _starpu_make_scheduler(unsigned sched_ctx_id, struct
 	for(i = 0; i < starpu_worker_get_count(); i++)
 	for(i = 0; i < starpu_worker_get_count(); i++)
 	{
 	{
 		struct _starpu_worker * worker = _starpu_get_worker_struct(i);
 		struct _starpu_worker * worker = _starpu_get_worker_struct(i);
-		struct _starpu_sched_node * worker_node = _starpu_sched_node_worker_get(i);
+		struct starpu_sched_node * worker_node = starpu_sched_node_worker_get(i);
 		STARPU_ASSERT(worker);
 		STARPU_ASSERT(worker);
 		set_worker_leaf(tree->root,worker_node, sched_ctx_id, specs);
 		set_worker_leaf(tree->root,worker_node, sched_ctx_id, specs);
 	}
 	}
 
 
 	_starpu_set_workers_bitmaps();
 	_starpu_set_workers_bitmaps();
-	_starpu_tree_call_init_data(tree);
+	starpu_sched_tree_call_init_data(tree);
 #ifdef STARPU_DEVEL
 #ifdef STARPU_DEVEL
 	fprintf(stderr, "scheduler created :\n");
 	fprintf(stderr, "scheduler created :\n");
 	helper_display_scheduler(stderr, 0, tree->root);
 	helper_display_scheduler(stderr, 0, tree->root);

+ 3 - 3
src/sched_policies/scheduler_maker.h

@@ -2,14 +2,14 @@
 #ifdef STARPU_HAVE_HWLOC
 #ifdef STARPU_HAVE_HWLOC
 #ifndef __SCHEDULER_MAKER_H__
 #ifndef __SCHEDULER_MAKER_H__
 #define __SCHEDULER_MAKER_H__
 #define __SCHEDULER_MAKER_H__
-#include "node_sched.h"
+#include <starpu_node_sched.h>
 #include "node_composed.h"
 #include "node_composed.h"
 #include <common/list.h>
 #include <common/list.h>
 
 
 
 
 
 
 //null pointer mean to ignore a level L of hierarchy, then nodes of levels > L become childs of level L - 1
 //null pointer mean to ignore a level L of hierarchy, then nodes of levels > L become childs of level L - 1
-struct _starpu_sched_specs
+struct starpu_sched_specs
 {
 {
 	//hw_loc_machine_composed_sched_node must be set as its the root of the topology
 	//hw_loc_machine_composed_sched_node must be set as its the root of the topology
 	struct _starpu_composed_sched_node_recipe * hwloc_machine_composed_sched_node;
 	struct _starpu_composed_sched_node_recipe * hwloc_machine_composed_sched_node;
@@ -28,7 +28,7 @@ struct _starpu_sched_specs
 	int mix_heterogeneous_workers;
 	int mix_heterogeneous_workers;
 };
 };
 
 
-struct _starpu_sched_tree * _starpu_make_scheduler(unsigned sched_ctx_id, struct _starpu_sched_specs);
+struct starpu_sched_tree * _starpu_make_scheduler(unsigned sched_ctx_id, struct starpu_sched_specs);
 
 
 #endif//#ifndef __SCHEDULER_MAKER_H__
 #endif//#ifndef __SCHEDULER_MAKER_H__
 #endif//#ifdef STARPU_HAVE_HWLOC
 #endif//#ifdef STARPU_HAVE_HWLOC