Преглед изворни кода

Prefixing of src/core/policies/sched_policy.h

find . -type f -not -name "*svn*"|xargs sed -i s/"\bsched_policy_s\b"/starpu_sched_policy_s/g
find . -type f -not -name "*svn*"|xargs sed -i s/"\bget_sched_policy\b"/_starpu_get_sched_policy/g
find . -type f -not -name "*svn*"|xargs sed -i s/"\binit_sched_policy\b"/_starpu_init_sched_policy/g
find . -type f -not -name "*svn*"|xargs sed -i s/"\bdeinit_sched_policy\b"/_starpu_deinit_sched_policy/g
find . -type f -not -name "*svn*"|xargs sed -i s/"\bpush_task\b"/_starpu_push_task/g
find . -type f -not -name "*svn*"|xargs sed -i s/"\bpop_task\b"/_starpu_pop_task/g
find . -type f -not -name "*svn*"|xargs sed -i s/"\bpop_task_from_queue\b"/_starpu_pop_task_from_queue/g
find . -type f -not -name "*svn*"|xargs sed -i s/"\bpop_every_task\b"/_starpu_pop_every_task/g
find . -type f -not -name "*svn*"|xargs sed -i s/"\bpop_every_task_from_queue\b"/_starpu_pop_every_task_from_queue/g
find . -type f -not -name "*svn*"|xargs sed -i s/"\bwait_on_sched_event\b"/_starpu_wait_on_sched_event/g
Nathalie Furmento пре 15 година
родитељ
комит
eb56dd016a

+ 1 - 1
include/starpu.h

@@ -40,7 +40,7 @@ extern "C" {
 struct starpu_conf {
 	/* which scheduling policy should be used ? (NULL for default) */
 	const char *sched_policy_name;
-	struct sched_policy_s *sched_policy;
+	struct starpu_sched_policy_s *sched_policy;
 
 	/* maximum number of CPUs (-1 for default) */
 	int ncpus;

+ 1 - 1
src/core/dependencies/data-concurrency.c

@@ -211,7 +211,7 @@ void notify_data_dependencies(starpu_data_handle handle)
 		if (r->is_requested_by_codelet)
 		{
 			if (!unlock_one_requester(r))
-				push_task(r->j);
+				_starpu_push_task(r->j);
 		}
 		else
 		{

+ 1 - 1
src/core/dependencies/tags.c

@@ -147,7 +147,7 @@ void _starpu_tag_set_ready(struct tag_s *tag)
 	struct starpu_job_s *j = tag->job;
 
 	/* In case the task job is going to be scheduled immediately, and if
-	 * the task is "empty", calling push_task would directly try to enforce
+	 * the task is "empty", calling _starpu_push_task would directly try to enforce
 	 * the dependencies of the task, and therefore it would try to grab the
 	 * lock again, resulting in a deadlock. */
 	starpu_spin_unlock(&tag->lock);

+ 3 - 3
src/core/jobs.c

@@ -224,7 +224,7 @@ unsigned _starpu_enforce_deps_and_schedule(starpu_job_t j)
 	if (_starpu_submit_job_enforce_data_deps(j))
 		return 0;
 
-	ret = push_task(j);
+	ret = _starpu_push_task(j);
 
 	return ret;
 }
@@ -242,7 +242,7 @@ unsigned _starpu_enforce_deps_starting_from_task(starpu_job_t j)
 	if (_starpu_submit_job_enforce_data_deps(j))
 		return 0;
 
-	ret = push_task(j);
+	ret = _starpu_push_task(j);
 
 	return ret;
 }
@@ -256,7 +256,7 @@ unsigned _starpu_enforce_deps_starting_from_data(starpu_job_t j)
 	if (_starpu_submit_job_enforce_data_deps(j))
 		return 0;
 
-	ret = push_task(j);
+	ret = _starpu_push_task(j);
 
 	return ret;
 }

+ 1 - 1
src/core/mechanisms/deque_queues.c

@@ -29,7 +29,7 @@ void init_deque_queues_mechanisms(void)
 {
 	total_number_of_jobs = 0;
 
-	struct sched_policy_s *sched = get_sched_policy();
+	struct starpu_sched_policy_s *sched = _starpu_get_sched_policy();
 
 	/* to access them more easily, we keep their address in local variables */
 	sched_cond = &sched->sched_activity_cond;

+ 1 - 1
src/core/mechanisms/fifo_queues.c

@@ -29,7 +29,7 @@ void init_fifo_queues_mechanisms(void)
 {
 	total_number_of_jobs = 0;
 
-	struct sched_policy_s *sched = get_sched_policy();
+	struct starpu_sched_policy_s *sched = _starpu_get_sched_policy();
 
 	/* to access them more easily, we keep their address in local variables */
 	sched_cond = &sched->sched_activity_cond;

+ 1 - 1
src/core/mechanisms/priority_queues.c

@@ -30,7 +30,7 @@ static pthread_mutex_t *sched_mutex;
 
 void init_priority_queues_mechanisms(void)
 {
-	struct sched_policy_s *sched = get_sched_policy();
+	struct starpu_sched_policy_s *sched = _starpu_get_sched_policy();
 
 	/* to access them more easily, we keep their address in local variables */
 	sched_cond = &sched->sched_activity_cond;

+ 2 - 2
src/core/mechanisms/queues.c

@@ -42,7 +42,7 @@ void setup_queues(void (*init_queue_design)(void),
 /* this may return NULL for an "anonymous thread" */
 struct jobq_s *get_local_queue(void)
 {
-	struct sched_policy_s *policy = get_sched_policy();
+	struct starpu_sched_policy_s *policy = _starpu_get_sched_policy();
 
 	return pthread_getspecific(policy->local_queue_key);
 }
@@ -50,7 +50,7 @@ struct jobq_s *get_local_queue(void)
 /* XXX how to retrieve policy ? that may be given in the machine config ? */
 void set_local_queue(struct jobq_s *jobq)
 {
-	struct sched_policy_s *policy = get_sched_policy();
+	struct starpu_sched_policy_s *policy = _starpu_get_sched_policy();
 
 	pthread_setspecific(policy->local_queue_key, jobq);
 }

+ 3 - 3
src/core/mechanisms/queues.h

@@ -29,9 +29,9 @@ struct jobq_s {
 	void *queue; 
 
 	/* some methods to manipulate the previous queue */
-	int (*push_task)(struct jobq_s *, starpu_job_t);
+	int (*_starpu_push_task)(struct jobq_s *, starpu_job_t);
 	int (*push_prio_task)(struct jobq_s *, starpu_job_t);
-	struct starpu_job_s* (*pop_task)(struct jobq_s *);
+	struct starpu_job_s* (*_starpu_pop_task)(struct jobq_s *);
 
 	/* returns the number of tasks that were retrieved 
  	 * the function is reponsible for allocating the output but the driver
@@ -39,7 +39,7 @@ struct jobq_s {
  	 *
  	 * NB : this function is non blocking
  	 * */
-	struct starpu_job_list_s *(*pop_every_task)(struct jobq_s *, uint32_t);
+	struct starpu_job_list_s *(*_starpu_pop_every_task)(struct jobq_s *, uint32_t);
 
 	/* what are the driver that may pop job from that queue ? */
 	uint32_t who;

+ 1 - 1
src/core/mechanisms/stack_queues.c

@@ -29,7 +29,7 @@ void init_stack_queues_mechanisms(void)
 {
 	total_number_of_jobs = 0;
 
-	struct sched_policy_s *sched = get_sched_policy();
+	struct starpu_sched_policy_s *sched = _starpu_get_sched_policy();
 
 	/* to access them more easily, we keep their address in local variables */
 	sched_cond = &sched->sched_activity_cond;

+ 5 - 5
src/core/policies/deque-modeling-policy-data-aware.c

@@ -197,9 +197,9 @@ static struct jobq_s *init_dmda_fifo(void)
 
 	q = create_fifo();
 
-	q->push_task = dmda_push_task; 
+	q->_starpu_push_task = dmda_push_task; 
 	q->push_prio_task = dmda_push_prio_task; 
-	q->pop_task = dmda_pop_task;
+	q->_starpu_pop_task = dmda_pop_task;
 	q->who = 0;
 
 	queue_array[nworkers++] = q;
@@ -208,7 +208,7 @@ static struct jobq_s *init_dmda_fifo(void)
 }
 
 static void initialize_dmda_policy(struct starpu_machine_config_s *config, 
-	 __attribute__ ((unused)) struct sched_policy_s *_policy) 
+	 __attribute__ ((unused)) struct starpu_sched_policy_s *_policy) 
 {
 	nworkers = 0;
 
@@ -227,7 +227,7 @@ static void initialize_dmda_policy(struct starpu_machine_config_s *config,
 	setup_queues(init_fifo_queues_mechanisms, init_dmda_fifo, config);
 }
 
-static struct jobq_s *get_local_queue_dmda(struct sched_policy_s *policy __attribute__ ((unused)))
+static struct jobq_s *get_local_queue_dmda(struct starpu_sched_policy_s *policy __attribute__ ((unused)))
 {
 	struct jobq_s *queue;
 	queue = pthread_getspecific(policy->local_queue_key);
@@ -241,7 +241,7 @@ static struct jobq_s *get_local_queue_dmda(struct sched_policy_s *policy __attri
 	return queue;
 }
 
-struct sched_policy_s sched_dmda_policy = {
+struct starpu_sched_policy_s sched_dmda_policy = {
 	.init_sched = initialize_dmda_policy,
 	.deinit_sched = NULL,
 	.get_local_queue = get_local_queue_dmda,

+ 1 - 1
src/core/policies/deque-modeling-policy-data-aware.h

@@ -21,6 +21,6 @@
 #include <core/mechanisms/queues.h>
 #include <core/mechanisms/fifo_queues.h>
 
-extern struct sched_policy_s sched_dmda_policy;
+extern struct starpu_sched_policy_s sched_dmda_policy;
 
 #endif // __DEQUE_MODELING_POLICY_DATA_AWARE_H__

+ 6 - 6
src/core/policies/deque-modeling-policy.c

@@ -158,10 +158,10 @@ static struct jobq_s *init_dm_fifo(void)
 
 	q = create_fifo();
 
-	q->push_task = dm_push_task; 
+	q->_starpu_push_task = dm_push_task; 
 	q->push_prio_task = dm_push_prio_task; 
-	q->pop_task = dm_pop_task;
-	q->pop_every_task = dm_pop_every_task;
+	q->_starpu_pop_task = dm_pop_task;
+	q->_starpu_pop_every_task = dm_pop_every_task;
 	q->who = 0;
 
 	queue_array[nworkers++] = q;
@@ -170,7 +170,7 @@ static struct jobq_s *init_dm_fifo(void)
 }
 
 static void initialize_dm_policy(struct starpu_machine_config_s *config, 
-	 __attribute__ ((unused)) struct sched_policy_s *_policy) 
+	 __attribute__ ((unused)) struct starpu_sched_policy_s *_policy) 
 {
 	nworkers = 0;
 
@@ -185,7 +185,7 @@ static void initialize_dm_policy(struct starpu_machine_config_s *config,
 	setup_queues(init_fifo_queues_mechanisms, init_dm_fifo, config);
 }
 
-static struct jobq_s *get_local_queue_dm(struct sched_policy_s *policy __attribute__ ((unused)))
+static struct jobq_s *get_local_queue_dm(struct starpu_sched_policy_s *policy __attribute__ ((unused)))
 {
 	struct jobq_s *queue;
 	queue = pthread_getspecific(policy->local_queue_key);
@@ -199,7 +199,7 @@ static struct jobq_s *get_local_queue_dm(struct sched_policy_s *policy __attribu
 	return queue;
 }
 
-struct sched_policy_s sched_dm_policy = {
+struct starpu_sched_policy_s sched_dm_policy = {
 	.init_sched = initialize_dm_policy,
 	.deinit_sched = NULL,
 	.get_local_queue = get_local_queue_dm,

+ 1 - 1
src/core/policies/deque-modeling-policy.h

@@ -21,6 +21,6 @@
 #include <core/mechanisms/queues.h>
 #include <core/mechanisms/fifo_queues.h>
 
-extern struct sched_policy_s sched_dm_policy;
+extern struct starpu_sched_policy_s sched_dm_policy;
 
 #endif // __DEQUE_MODELING_POLICY_H__

+ 6 - 6
src/core/policies/eager-central-policy.c

@@ -31,11 +31,11 @@ static void init_central_queue_design(void)
 
 	init_fifo_queues_mechanisms();
 
-	jobq->push_task = fifo_push_task;
+	jobq->_starpu_push_task = fifo_push_task;
 	jobq->push_prio_task = fifo_push_prio_task;
-	jobq->pop_task = fifo_pop_task;
+	jobq->_starpu_pop_task = fifo_pop_task;
 
-	jobq->pop_every_task = fifo_pop_every_task;
+	jobq->_starpu_pop_every_task = fifo_pop_every_task;
 }
 
 static struct jobq_s *func_init_central_queue(void)
@@ -45,19 +45,19 @@ static struct jobq_s *func_init_central_queue(void)
 }
 
 static void initialize_eager_center_policy(struct starpu_machine_config_s *config, 
-		   __attribute__ ((unused)) struct sched_policy_s *_policy) 
+		   __attribute__ ((unused)) struct starpu_sched_policy_s *_policy) 
 {
 	setup_queues(init_central_queue_design, func_init_central_queue, config);
 }
 
-static struct jobq_s *get_local_queue_eager(struct sched_policy_s *policy 
+static struct jobq_s *get_local_queue_eager(struct starpu_sched_policy_s *policy 
 						__attribute__ ((unused)))
 {
 	/* this is trivial for that strategy :) */
 	return jobq;
 }
 
-struct sched_policy_s sched_eager_policy = {
+struct starpu_sched_policy_s sched_eager_policy = {
 	.init_sched = initialize_eager_center_policy,
 	.deinit_sched = NULL,
 	.get_local_queue = get_local_queue_eager,

+ 1 - 1
src/core/policies/eager-central-policy.h

@@ -20,6 +20,6 @@
 #include <core/workers.h>
 #include <core/mechanisms/fifo_queues.h>
 
-extern struct sched_policy_s sched_eager_policy;
+extern struct starpu_sched_policy_s sched_eager_policy;
 
 #endif // __EAGER_CENTRAL_POLICY_H__

+ 5 - 5
src/core/policies/eager-central-priority-policy.c

@@ -27,9 +27,9 @@ static void init_priority_queue_design(void)
 	init_priority_queues_mechanisms();
 
 	/* we always use priorities in that policy */
-	jobq->push_task = priority_push_task;
+	jobq->_starpu_push_task = priority_push_task;
 	jobq->push_prio_task = priority_push_task;
-	jobq->pop_task = priority_pop_task;
+	jobq->_starpu_pop_task = priority_pop_task;
 }
 
 static struct jobq_s *func_init_priority_queue(void)
@@ -38,18 +38,18 @@ static struct jobq_s *func_init_priority_queue(void)
 }
 
 static void initialize_eager_center_priority_policy(struct starpu_machine_config_s *config, 
-			__attribute__ ((unused))	struct sched_policy_s *_policy) 
+			__attribute__ ((unused))	struct starpu_sched_policy_s *_policy) 
 {
 	setup_queues(init_priority_queue_design, func_init_priority_queue, config);
 }
 
-static struct jobq_s *get_local_queue_eager_priority(struct sched_policy_s *policy __attribute__ ((unused)))
+static struct jobq_s *get_local_queue_eager_priority(struct starpu_sched_policy_s *policy __attribute__ ((unused)))
 {
 	/* this is trivial for that strategy */
 	return jobq;
 }
 
-struct sched_policy_s sched_prio_policy = {
+struct starpu_sched_policy_s sched_prio_policy = {
 	.init_sched = initialize_eager_center_priority_policy,
 	.deinit_sched = NULL,
 	.get_local_queue = get_local_queue_eager_priority,

+ 1 - 1
src/core/policies/eager-central-priority-policy.h

@@ -21,6 +21,6 @@
 #include <core/mechanisms/queues.h>
 #include <core/mechanisms/priority_queues.h>
 
-extern struct sched_policy_s sched_prio_policy;
+extern struct starpu_sched_policy_s sched_prio_policy;
 
 #endif // __EAGER_CENTRAL_PRIORITY_POLICY_H__

+ 5 - 5
src/core/policies/no-prio-policy.c

@@ -31,10 +31,10 @@ static void init_no_prio_design(void)
 
 	init_fifo_queues_mechanisms();
 
-	jobq->push_task = fifo_push_task;
+	jobq->_starpu_push_task = fifo_push_task;
 	/* no priority in that policy, let's be stupid here */
 	jobq->push_prio_task = fifo_push_task;
-	jobq->pop_task = fifo_pop_task;
+	jobq->_starpu_pop_task = fifo_pop_task;
 }
 
 static struct jobq_s *func_init_central_queue(void)
@@ -44,19 +44,19 @@ static struct jobq_s *func_init_central_queue(void)
 }
 
 void initialize_no_prio_policy(struct starpu_machine_config_s *config, 
-	   __attribute__ ((unused)) struct sched_policy_s *_policy) 
+	   __attribute__ ((unused)) struct starpu_sched_policy_s *_policy) 
 {
 	setup_queues(init_no_prio_design, func_init_central_queue, config);
 }
 
-struct jobq_s *get_local_queue_no_prio(struct sched_policy_s *policy 
+struct jobq_s *get_local_queue_no_prio(struct starpu_sched_policy_s *policy 
 					__attribute__ ((unused)))
 {
 	/* this is trivial for that strategy :) */
 	return jobq;
 }
 
-struct sched_policy_s sched_no_prio_policy = {
+struct starpu_sched_policy_s sched_no_prio_policy = {
 	.init_sched = initialize_no_prio_policy,
 	.deinit_sched = NULL,
 	.get_local_queue = get_local_queue_no_prio,

+ 1 - 1
src/core/policies/no-prio-policy.h

@@ -20,6 +20,6 @@
 #include <core/workers.h>
 #include <core/mechanisms/fifo_queues.h>
 
-extern struct sched_policy_s sched_no_prio_policy;
+extern struct starpu_sched_policy_s sched_no_prio_policy;
 
 #endif // __NO_PRIO_POLICY_H__

+ 5 - 5
src/core/policies/random-policy.c

@@ -85,9 +85,9 @@ static struct jobq_s *init_random_fifo(void)
 
 	q = create_fifo();
 
-	q->push_task = random_push_task; 
+	q->_starpu_push_task = random_push_task; 
 	q->push_prio_task = random_push_prio_task; 
-	q->pop_task = random_pop_task;
+	q->_starpu_pop_task = random_pop_task;
 	q->who = 0;
 
 	queue_array[nworkers++] = q;
@@ -96,7 +96,7 @@ static struct jobq_s *init_random_fifo(void)
 }
 
 static void initialize_random_policy(struct starpu_machine_config_s *config, 
-	 __attribute__ ((unused)) struct sched_policy_s *_policy) 
+	 __attribute__ ((unused)) struct starpu_sched_policy_s *_policy) 
 {
 	nworkers = 0;
 
@@ -105,7 +105,7 @@ static void initialize_random_policy(struct starpu_machine_config_s *config,
 	setup_queues(init_fifo_queues_mechanisms, init_random_fifo, config);
 }
 
-static struct jobq_s *get_local_queue_random(struct sched_policy_s *policy __attribute__ ((unused)))
+static struct jobq_s *get_local_queue_random(struct starpu_sched_policy_s *policy __attribute__ ((unused)))
 {
 	struct jobq_s *queue;
 	queue = pthread_getspecific(policy->local_queue_key);
@@ -119,7 +119,7 @@ static struct jobq_s *get_local_queue_random(struct sched_policy_s *policy __att
 	return queue;
 }
 
-struct sched_policy_s sched_random_policy = {
+struct starpu_sched_policy_s sched_random_policy = {
 	.init_sched = initialize_random_policy,
 	.deinit_sched = NULL,
 	.get_local_queue = get_local_queue_random,

+ 1 - 1
src/core/policies/random-policy.h

@@ -21,6 +21,6 @@
 #include <core/mechanisms/queues.h>
 #include <core/mechanisms/fifo_queues.h>
 
-extern struct sched_policy_s sched_random_policy;
+extern struct starpu_sched_policy_s sched_random_policy;
 
 #endif // __RANDOM_POLICY_H__

+ 26 - 26
src/core/policies/sched_policy.c

@@ -28,7 +28,7 @@
 #include <core/policies/random-policy.h>
 #include <core/policies/deque-modeling-policy-data-aware.h>
 
-static struct sched_policy_s policy;
+static struct starpu_sched_policy_s policy;
 
 static int use_prefetch = 0;
 
@@ -38,7 +38,7 @@ static int use_prefetch = 0;
 
 #define NPREDEFINED_POLICIES	7
 
-struct sched_policy_s *predefined_policies[NPREDEFINED_POLICIES] = {
+struct starpu_sched_policy_s *predefined_policies[NPREDEFINED_POLICIES] = {
 	&sched_ws_policy,
 	&sched_prio_policy,
 	&sched_no_prio_policy,
@@ -48,7 +48,7 @@ struct sched_policy_s *predefined_policies[NPREDEFINED_POLICIES] = {
 	&sched_eager_policy
 };
 
-struct sched_policy_s *get_sched_policy(void)
+struct starpu_sched_policy_s *_starpu_get_sched_policy(void)
 {
 	return &policy;
 }
@@ -57,7 +57,7 @@ struct sched_policy_s *get_sched_policy(void)
  *	Methods to initialize the scheduling policy
  */
 
-static void load_sched_policy(struct sched_policy_s *sched_policy)
+static void load_sched_policy(struct starpu_sched_policy_s *sched_policy)
 {
 	STARPU_ASSERT(sched_policy);
 
@@ -84,7 +84,7 @@ static void load_sched_policy(struct sched_policy_s *sched_policy)
 	pthread_key_create(&policy.local_queue_key, NULL);
 }
 
-static struct sched_policy_s *find_sched_policy_from_name(const char *policy_name)
+static struct starpu_sched_policy_s *find_sched_policy_from_name(const char *policy_name)
 {
 
 	if (!policy_name)
@@ -93,7 +93,7 @@ static struct sched_policy_s *find_sched_policy_from_name(const char *policy_nam
 	unsigned i;
 	for (i = 0; i < NPREDEFINED_POLICIES; i++)
 	{
-		struct sched_policy_s *p;
+		struct starpu_sched_policy_s *p;
 		p = predefined_policies[i];
 		if (p->policy_name)
 		{
@@ -118,16 +118,16 @@ static void display_sched_help_message(void)
 		unsigned i;
 		for (i = 0; i < NPREDEFINED_POLICIES; i++)
 		{
-			struct sched_policy_s *p;
+			struct starpu_sched_policy_s *p;
 			p = predefined_policies[i];
 			fprintf(stderr, "%s\t-> %s\n", p->policy_name, p->policy_description);
 		}
 	 }
 }
 
-static struct sched_policy_s *select_sched_policy(struct starpu_machine_config_s *config)
+static struct starpu_sched_policy_s *select_sched_policy(struct starpu_machine_config_s *config)
 {
-	struct sched_policy_s *selected_policy = NULL;
+	struct starpu_sched_policy_s *selected_policy = NULL;
 	struct starpu_conf *user_conf = config->user_conf;
 
 	/* First, we check whether the application explicitely gave a scheduling policy or not */
@@ -155,7 +155,7 @@ static struct sched_policy_s *select_sched_policy(struct starpu_machine_config_s
 	return &sched_eager_policy;
 }
 
-void init_sched_policy(struct starpu_machine_config_s *config)
+void _starpu_init_sched_policy(struct starpu_machine_config_s *config)
 {
 	/* Perhaps we have to display some help */
 	display_sched_help_message();
@@ -164,7 +164,7 @@ void init_sched_policy(struct starpu_machine_config_s *config)
 	if (use_prefetch == -1)
 		use_prefetch = 0;
 
-	struct sched_policy_s *selected_policy;
+	struct starpu_sched_policy_s *selected_policy;
 	selected_policy = select_sched_policy(config);
 
 	load_sched_policy(selected_policy);
@@ -172,7 +172,7 @@ void init_sched_policy(struct starpu_machine_config_s *config)
 	policy.init_sched(config, &policy);
 }
 
-void deinit_sched_policy(struct starpu_machine_config_s *config)
+void _starpu_deinit_sched_policy(struct starpu_machine_config_s *config)
 {
 	if (policy.deinit_sched)
 		policy.deinit_sched(config, &policy);
@@ -183,7 +183,7 @@ void deinit_sched_policy(struct starpu_machine_config_s *config)
 }
 
 /* the generic interface that call the proper underlying implementation */
-int push_task(starpu_job_t j)
+int _starpu_push_task(starpu_job_t j)
 {
 	struct jobq_s *queue = policy.get_local_queue(&policy);
 
@@ -211,46 +211,46 @@ int push_task(starpu_job_t j)
 		return _starpu_push_local_task(worker, j);
 	}
 	else {
-		STARPU_ASSERT(queue->push_task);
+		STARPU_ASSERT(queue->_starpu_push_task);
 
-		return queue->push_task(queue, j);
+		return queue->_starpu_push_task(queue, j);
 	}
 }
 
-struct starpu_job_s * pop_task_from_queue(struct jobq_s *queue)
+struct starpu_job_s * _starpu_pop_task_from_queue(struct jobq_s *queue)
 {
-	STARPU_ASSERT(queue->pop_task);
+	STARPU_ASSERT(queue->_starpu_pop_task);
 
-	struct starpu_job_s *j = queue->pop_task(queue);
+	struct starpu_job_s *j = queue->_starpu_pop_task(queue);
 
 	return j;
 }
 
-struct starpu_job_s * pop_task(void)
+struct starpu_job_s * _starpu_pop_task(void)
 {
 	struct jobq_s *queue = policy.get_local_queue(&policy);
 
-	return pop_task_from_queue(queue);
+	return _starpu_pop_task_from_queue(queue);
 }
 
-struct starpu_job_list_s * pop_every_task_from_queue(struct jobq_s *queue, uint32_t where)
+struct starpu_job_list_s * _starpu_pop_every_task_from_queue(struct jobq_s *queue, uint32_t where)
 {
-	STARPU_ASSERT(queue->pop_every_task);
+	STARPU_ASSERT(queue->_starpu_pop_every_task);
 
-	struct starpu_job_list_s *list = queue->pop_every_task(queue, where);
+	struct starpu_job_list_s *list = queue->_starpu_pop_every_task(queue, where);
 
 	return list;
 }
 
 /* pop every task that can be executed on "where" (eg. GORDON) */
-struct starpu_job_list_s *pop_every_task(uint32_t where)
+struct starpu_job_list_s *_starpu_pop_every_task(uint32_t where)
 {
 	struct jobq_s *queue = policy.get_local_queue(&policy);
 
-	return pop_every_task_from_queue(queue, where);
+	return _starpu_pop_every_task_from_queue(queue, where);
 }
 
-void wait_on_sched_event(void)
+void _starpu_wait_on_sched_event(void)
 {
 	struct jobq_s *q = policy.get_local_queue(&policy);
 

+ 13 - 13
src/core/policies/sched_policy.h

@@ -27,15 +27,15 @@
 
 struct starpu_machine_config_s;
 
-struct sched_policy_s {
+struct starpu_sched_policy_s {
 	/* create all the queues */
-	void (*init_sched)(struct starpu_machine_config_s *, struct sched_policy_s *);
+	void (*init_sched)(struct starpu_machine_config_s *, struct starpu_sched_policy_s *);
 
 	/* cleanup method at termination */
-	void (*deinit_sched)(struct starpu_machine_config_s *, struct sched_policy_s *);
+	void (*deinit_sched)(struct starpu_machine_config_s *, struct starpu_sched_policy_s *);
 
 	/* anyone can request which queue it is associated to */
-	struct jobq_s *(*get_local_queue)(struct sched_policy_s *);
+	struct jobq_s *(*get_local_queue)(struct starpu_sched_policy_s *);
 
 	/* name of the policy (optionnal) */
 	const char *policy_name;
@@ -50,18 +50,18 @@ struct sched_policy_s {
 	pthread_key_t local_queue_key;
 };
 
-struct sched_policy_s *get_sched_policy(void);
+struct starpu_sched_policy_s *_starpu_get_sched_policy(void);
 
-void init_sched_policy(struct starpu_machine_config_s *config);
-void deinit_sched_policy(struct starpu_machine_config_s *config);
+void _starpu_init_sched_policy(struct starpu_machine_config_s *config);
+void _starpu_deinit_sched_policy(struct starpu_machine_config_s *config);
 //void set_local_queue(struct jobq_s *jobq);
 
-int push_task(starpu_job_t task);
-struct starpu_job_s *pop_task(void);
-struct starpu_job_s *pop_task_from_queue(struct jobq_s *queue);
-struct starpu_job_list_s *pop_every_task(uint32_t where);
-struct starpu_job_list_s * pop_every_task_from_queue(struct jobq_s *queue, uint32_t where);
+int _starpu_push_task(starpu_job_t task);
+struct starpu_job_s *_starpu_pop_task(void);
+struct starpu_job_s *_starpu_pop_task_from_queue(struct jobq_s *queue);
+struct starpu_job_list_s *_starpu_pop_every_task(uint32_t where);
+struct starpu_job_list_s * _starpu_pop_every_task_from_queue(struct jobq_s *queue, uint32_t where);
 
-void wait_on_sched_event(void);
+void _starpu_wait_on_sched_event(void);
 
 #endif // __SCHED_POLICY_H__

+ 5 - 5
src/core/policies/work-stealing-policy.c

@@ -164,9 +164,9 @@ static struct jobq_s *init_ws_deque(void)
 
 	q = create_deque();
 
-	q->push_task = deque_push_task; 
+	q->_starpu_push_task = deque_push_task; 
 	q->push_prio_task = deque_push_prio_task; 
-	q->pop_task = ws_pop_task;
+	q->_starpu_pop_task = ws_pop_task;
 	q->who = 0;
 
 	queue_array[nworkers++] = q;
@@ -175,7 +175,7 @@ static struct jobq_s *init_ws_deque(void)
 }
 
 static void initialize_ws_policy(struct starpu_machine_config_s *config, 
-				__attribute__ ((unused)) struct sched_policy_s *_policy) 
+				__attribute__ ((unused)) struct starpu_sched_policy_s *_policy) 
 {
 	nworkers = 0;
 	rr_worker = 0;
@@ -185,7 +185,7 @@ static void initialize_ws_policy(struct starpu_machine_config_s *config,
 	setup_queues(init_deque_queues_mechanisms, init_ws_deque, config);
 }
 
-static struct jobq_s *get_local_queue_ws(struct sched_policy_s *policy __attribute__ ((unused)))
+static struct jobq_s *get_local_queue_ws(struct starpu_sched_policy_s *policy __attribute__ ((unused)))
 {
 	struct jobq_s *queue;
 	queue = pthread_getspecific(policy->local_queue_key);
@@ -199,7 +199,7 @@ static struct jobq_s *get_local_queue_ws(struct sched_policy_s *policy __attribu
 	return queue;
 }
 
-struct sched_policy_s sched_ws_policy = {
+struct starpu_sched_policy_s sched_ws_policy = {
 	.init_sched = initialize_ws_policy,
 	.deinit_sched = NULL,
 	.get_local_queue = get_local_queue_ws,

+ 1 - 1
src/core/policies/work-stealing-policy.h

@@ -20,6 +20,6 @@
 #include <core/workers.h>
 #include <core/mechanisms/deque_queues.h>
 
-extern struct sched_policy_s sched_ws_policy;
+extern struct starpu_sched_policy_s sched_ws_policy;
 
 #endif // __WORK_STEALING_POLICY_H__

+ 3 - 3
src/core/workers.c

@@ -244,7 +244,7 @@ int starpu_init(struct starpu_conf *user_conf)
 	/* initialize the scheduler */
 
 	/* initialize the queue containing the jobs */
-	init_sched_policy(&config);
+	_starpu_init_sched_policy(&config);
 
 	_starpu_init_workers(&config);
 
@@ -412,7 +412,7 @@ static void _starpu_kill_all_workers(struct starpu_machine_config_s *config)
 	/* WARNING: here we make the asumption that a queue is not attached to
  	 * different memory nodes ! */
 
-	struct sched_policy_s *sched = get_sched_policy();
+	struct starpu_sched_policy_s *sched = _starpu_get_sched_policy();
 
 	_starpu_operate_on_all_queues(LOCK);
 	pthread_mutex_lock(&sched->sched_activity_mutex);
@@ -445,7 +445,7 @@ void starpu_shutdown(void)
 	/* wait for their termination */
 	_starpu_terminate_workers(&config);
 
-	deinit_sched_policy(&config);
+	_starpu_deinit_sched_policy(&config);
 
 	_starpu_destroy_topology(&config);
 

+ 1 - 1
src/datawizard/copy-driver.c

@@ -49,7 +49,7 @@ void _starpu_wake_all_blocked_workers_on_node(unsigned nodeid)
 void starpu_wake_all_blocked_workers(void)
 {
 	/* workers may be blocked on the policy's global condition */
-	struct sched_policy_s *sched = get_sched_policy();
+	struct starpu_sched_policy_s *sched = _starpu_get_sched_policy();
 	pthread_cond_t *sched_cond = &sched->sched_activity_cond;
 	pthread_mutex_t *sched_mutex = &sched->sched_activity_mutex;
 

+ 4 - 4
src/drivers/cpu/driver_cpu.c

@@ -139,7 +139,7 @@ void *_starpu_cpu_worker(void *arg)
         starpu_job_t j;
 	int res;
 
-	struct sched_policy_s *policy = get_sched_policy();
+	struct starpu_sched_policy_s *policy = _starpu_get_sched_policy();
 	struct jobq_s *queue = policy->get_local_queue(policy);
 	unsigned memnode = cpu_arg->memory_node;
 
@@ -158,7 +158,7 @@ void *_starpu_cpu_worker(void *arg)
 
 		/* otherwise ask a task to the scheduler */
 		if (!j)
-			j = pop_task();
+			j = _starpu_pop_task();
 
                 if (j == NULL) {
 			if (_starpu_worker_can_block(memnode))
@@ -173,7 +173,7 @@ void *_starpu_cpu_worker(void *arg)
 		if (!STARPU_CPU_MAY_PERFORM(j)) 
 		{
 			/* put it and the end of the queue ... XXX */
-			push_task(j);
+			_starpu_push_task(j);
 			continue;
 		}
 
@@ -181,7 +181,7 @@ void *_starpu_cpu_worker(void *arg)
 		if (res) {
 			switch (res) {
 				case -EAGAIN:
-					push_task(j);
+					_starpu_push_task(j);
 					continue;
 				default: 
 					assert(0);

+ 4 - 4
src/drivers/cuda/driver_cuda.c

@@ -221,7 +221,7 @@ void *_starpu_cuda_worker(void *arg)
 	struct starpu_job_s * j;
 	int res;
 
-	struct sched_policy_s *policy = get_sched_policy();
+	struct starpu_sched_policy_s *policy = _starpu_get_sched_policy();
 	struct jobq_s *queue = policy->get_local_queue(policy);
 	unsigned memnode = args->memory_node;
 	
@@ -240,7 +240,7 @@ void *_starpu_cuda_worker(void *arg)
 
 		/* otherwise ask a task to the scheduler */
 		if (!j)
-			j = pop_task();
+			j = _starpu_pop_task();
 
 		if (j == NULL) {
 			if (_starpu_worker_can_block(memnode))
@@ -255,7 +255,7 @@ void *_starpu_cuda_worker(void *arg)
 		if (!STARPU_CUDA_MAY_PERFORM(j))
 		{
 			/* this is neither a cuda or a cublas task */
-			push_task(j);
+			_starpu_push_task(j);
 			continue;
 		}
 
@@ -265,7 +265,7 @@ void *_starpu_cuda_worker(void *arg)
 			switch (res) {
 				case -EAGAIN:
 					fprintf(stderr, "ouch, put the codelet %p back ... \n", j);
-					push_task(j);
+					_starpu_push_task(j);
 					STARPU_ABORT();
 					continue;
 				default:

+ 5 - 5
src/drivers/gordon/driver_gordon.c

@@ -330,14 +330,14 @@ void *gordon_worker_inject(struct starpu_worker_set_s *arg)
 	while(_starpu_machine_is_running()) {
 		if (gordon_busy_enough()) {
 			/* gordon already has enough work, wait a little TODO */
-			wait_on_sched_event();
+			_starpu_wait_on_sched_event();
 		}
 		else {
 #ifndef NOCHAIN
 			int ret = 0;
 #warning we should look into the local job list here !
 
-			struct starpu_job_list_s *list = pop_every_task(STARPU_GORDON);
+			struct starpu_job_list_s *list = _starpu_pop_every_task(STARPU_GORDON);
 			/* XXX 0 is hardcoded */
 			if (list)
 			{
@@ -383,12 +383,12 @@ void *gordon_worker_inject(struct starpu_worker_set_s *arg)
 				}
 			}
 			else {
-				wait_on_sched_event();
+				_starpu_wait_on_sched_event();
 			}
 #else
 			/* gordon should accept a little more work */
 			starpu_job_t j;
-			j =  pop_task();
+			j =  _starpu_pop_task();
 	//		fprintf(stderr, "pop task %p\n", j);
 			if (j) {
 				if (STARPU_GORDON_MAY_PERFORM(j)) {
@@ -397,7 +397,7 @@ void *gordon_worker_inject(struct starpu_worker_set_s *arg)
 					inject_task(j, &arg->workers[0]);
 				}
 				else {
-					push_task(j);
+					_starpu_push_task(j);
 				}
 			}
 #endif