瀏覽代碼

Prefixing of src/core/mechanisms/deque_queues.h

find . -type f -not -name "*svn*"|xargs sed -i s/"\bdeque_jobq_s\b"/starpu_deque_jobq_s/g
find . -type f -not -name "*svn*"|xargs sed -i s/"\bcreate_deque\b"/_starpu_create_deque/g
find . -type f -not -name "*svn*"|xargs sed -i s/"\bdeque_push_task\b"/_starpu_deque_push_task/g
find . -type f -not -name "*svn*"|xargs sed -i s/"\bdeque_push_prio_task\b"/_starpu_deque_push_prio_task/g
find . -type f -not -name "*svn*"|xargs sed -i s/"\bdeque_pop_task\b"/_starpu_deque_pop_task/g
find . -type f -not -name "*svn*"|xargs sed -i s/"\binit_deque_queues_mechanisms\b"/_starpu_init_deque_queues_mechanisms/g
find . -type f -not -name "*svn*"|xargs sed -i s/"\bget_total_njobs_deques\b"/_starpu_get_total_njobs_deques/g
find . -type f -not -name "*svn*"|xargs sed -i s/"\bget_deque_njobs\b"/_starpu_get_deque_njobs/g
find . -type f -not -name "*svn*"|xargs sed -i s/"\bget_deque_nprocessed\b"/_starpu_get_deque_nprocessed/g
Nathalie Furmento 15 年之前
父節點
當前提交
8658cb1862
共有 3 個文件被更改,包括 34 次插入34 次删除
  1. 16 16
      src/core/mechanisms/deque_queues.c
  2. 9 9
      src/core/mechanisms/deque_queues.h
  3. 9 9
      src/core/policies/work-stealing-policy.c

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

@@ -25,7 +25,7 @@ static unsigned total_number_of_jobs;
 static pthread_cond_t *sched_cond;
 static pthread_mutex_t *sched_mutex;
 
-void init_deque_queues_mechanisms(void)
+void _starpu_init_deque_queues_mechanisms(void)
 {
 	total_number_of_jobs = 0;
 
@@ -36,7 +36,7 @@ void init_deque_queues_mechanisms(void)
 	sched_mutex = &sched->sched_activity_mutex;
 }
 
-struct jobq_s *create_deque(void)
+struct jobq_s *_starpu_create_deque(void)
 {
 	struct jobq_s *jobq;
 	jobq = malloc(sizeof(struct jobq_s));
@@ -44,8 +44,8 @@ struct jobq_s *create_deque(void)
 	pthread_mutex_init(&jobq->activity_mutex, NULL);
 	pthread_cond_init(&jobq->activity_cond, NULL);
 
-	struct deque_jobq_s *deque;
-	deque = malloc(sizeof(struct deque_jobq_s));
+	struct starpu_deque_jobq_s *deque;
+	deque = malloc(sizeof(struct starpu_deque_jobq_s));
 
 	/* note that not all mechanisms (eg. the semaphore) have to be used */
 	deque->jobq = starpu_job_list_new();
@@ -61,38 +61,38 @@ struct jobq_s *create_deque(void)
 	return jobq;
 }
 
-unsigned get_total_njobs_deques(void)
+unsigned _starpu_get_total_njobs_deques(void)
 {
 	return total_number_of_jobs;
 }
 
-unsigned get_deque_njobs(struct jobq_s *q)
+unsigned _starpu_get_deque_njobs(struct jobq_s *q)
 {
 	STARPU_ASSERT(q);
 
-	struct deque_jobq_s *deque_queue = q->queue;
+	struct starpu_deque_jobq_s *deque_queue = q->queue;
 
 	return deque_queue->njobs;
 }
 
-unsigned get_deque_nprocessed(struct jobq_s *q)
+unsigned _starpu_get_deque_nprocessed(struct jobq_s *q)
 {
 	STARPU_ASSERT(q);
 
-	struct deque_jobq_s *deque_queue = q->queue;
+	struct starpu_deque_jobq_s *deque_queue = q->queue;
 
 	return deque_queue->nprocessed;
 }
 
-int deque_push_prio_task(struct jobq_s *q, starpu_job_t task)
+int _starpu_deque_push_prio_task(struct jobq_s *q, starpu_job_t task)
 {
-	return deque_push_task(q, task);
+	return _starpu_deque_push_task(q, task);
 }
 
-int deque_push_task(struct jobq_s *q, starpu_job_t task)
+int _starpu_deque_push_task(struct jobq_s *q, starpu_job_t task)
 {
 	STARPU_ASSERT(q);
-	struct deque_jobq_s *deque_queue = q->queue;
+	struct starpu_deque_jobq_s *deque_queue = q->queue;
 
 	/* if anyone is blocked on the entire machine, wake it up */
 	pthread_mutex_lock(sched_mutex);
@@ -114,12 +114,12 @@ int deque_push_task(struct jobq_s *q, starpu_job_t task)
 	return 0;
 }
 
-starpu_job_t deque_pop_task(struct jobq_s *q)
+starpu_job_t _starpu_deque_pop_task(struct jobq_s *q)
 {
 	starpu_job_t j = NULL;
 
 	STARPU_ASSERT(q);
-	struct deque_jobq_s *deque_queue = q->queue;
+	struct starpu_deque_jobq_s *deque_queue = q->queue;
 
 	if ((deque_queue->njobs == 0) && _starpu_machine_is_running())
 	{
@@ -151,7 +151,7 @@ struct starpu_job_list_s * deque_pop_every_task(struct jobq_s *q, uint32_t where
 	struct starpu_job_list_s *new_list, *old_list;
 
 	STARPU_ASSERT(q);
-	struct deque_jobq_s *deque_queue = q->queue;
+	struct starpu_deque_jobq_s *deque_queue = q->queue;
 
 	/* block until some task is available in that queue */
 	pthread_mutex_lock(&q->activity_mutex);

+ 9 - 9
src/core/mechanisms/deque_queues.h

@@ -19,7 +19,7 @@
 
 #include <core/mechanisms/queues.h>
 
-struct deque_jobq_s {
+struct starpu_deque_jobq_s {
 	/* the actual list */
 	starpu_job_list_t jobq;
 
@@ -35,19 +35,19 @@ struct deque_jobq_s {
 	double exp_len;
 };
 
-struct jobq_s *create_deque(void);
+struct jobq_s *_starpu_create_deque(void);
 
-int deque_push_task(struct jobq_s *q, starpu_job_t task);
-int deque_push_prio_task(struct jobq_s *q, starpu_job_t task);
+int _starpu_deque_push_task(struct jobq_s *q, starpu_job_t task);
+int _starpu_deque_push_prio_task(struct jobq_s *q, starpu_job_t task);
 
-starpu_job_t deque_pop_task(struct jobq_s *q);
+starpu_job_t _starpu_deque_pop_task(struct jobq_s *q);
 
-void init_deque_queues_mechanisms(void);
+void _starpu_init_deque_queues_mechanisms(void);
 
-unsigned get_total_njobs_deques(void);
+unsigned _starpu_get_total_njobs_deques(void);
 
-unsigned get_deque_njobs(struct jobq_s *q);
-unsigned get_deque_nprocessed(struct jobq_s *q);
+unsigned _starpu_get_deque_njobs(struct jobq_s *q);
+unsigned _starpu_get_deque_nprocessed(struct jobq_s *q);
 
 
 #endif // __DEQUE_QUEUES_H__

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

@@ -34,15 +34,15 @@ static float overload_metric(unsigned id)
 {
 	float execution_ratio = 0.0f;
 	if (performed_total > 0) {
-		execution_ratio = get_deque_nprocessed(queue_array[id])/performed_total;
+		execution_ratio = _starpu_get_deque_nprocessed(queue_array[id])/performed_total;
 	}
 
 	unsigned performed_queue;
-	performed_queue = get_deque_nprocessed(queue_array[id]);
+	performed_queue = _starpu_get_deque_nprocessed(queue_array[id]);
 
 	float current_ratio = 0.0f;
 	if (performed_queue > 0) {
-		current_ratio = get_deque_njobs(queue_array[id])/performed_queue;
+		current_ratio = _starpu_get_deque_njobs(queue_array[id])/performed_queue;
 	}
 	
 	return (current_ratio - execution_ratio);
@@ -135,7 +135,7 @@ static starpu_job_t ws_pop_task(struct jobq_s *q)
 {
 	starpu_job_t j;
 
-	j = deque_pop_task(q);
+	j = _starpu_deque_pop_task(q);
 	if (j) {
 		/* there was a local task */
 		performed_total++;
@@ -148,7 +148,7 @@ static starpu_job_t ws_pop_task(struct jobq_s *q)
 
 	if (!jobq_trylock(victimq))
 	{
-		j = deque_pop_task(victimq);
+		j = _starpu_deque_pop_task(victimq);
 		jobq_unlock(victimq);
 
 		TRACE_WORK_STEALING(q, j);
@@ -162,10 +162,10 @@ static struct jobq_s *init_ws_deque(void)
 {
 	struct jobq_s *q;
 
-	q = create_deque();
+	q = _starpu_create_deque();
 
-	q->_starpu_push_task = deque_push_task; 
-	q->push_prio_task = deque_push_prio_task; 
+	q->_starpu_push_task = _starpu_deque_push_task; 
+	q->push_prio_task = _starpu_deque_push_prio_task; 
 	q->_starpu_pop_task = ws_pop_task;
 	q->who = 0;
 
@@ -182,7 +182,7 @@ static void initialize_ws_policy(struct starpu_machine_config_s *config,
 
 	//machineconfig = config;
 
-	setup_queues(init_deque_queues_mechanisms, init_ws_deque, config);
+	setup_queues(_starpu_init_deque_queues_mechanisms, init_ws_deque, config);
 }
 
 static struct jobq_s *get_local_queue_ws(struct starpu_sched_policy_s *policy __attribute__ ((unused)))