Selaa lähdekoodia

src: rename internal types following coding conventions

Nathalie Furmento 13 vuotta sitten
vanhempi
commit
f645e1d934

+ 9 - 9
src/sched_policies/deque_modeling_policy_data_aware.c

@@ -26,7 +26,7 @@
 #include <starpu_parameters.h>
 
 static unsigned nworkers;
-static struct starpu_fifo_taskq_s *queue_array[STARPU_NMAXWORKERS];
+static struct _starpu_fifo_taskq *queue_array[STARPU_NMAXWORKERS];
 
 static pthread_cond_t sched_cond[STARPU_NMAXWORKERS];
 static pthread_mutex_t sched_mutex[STARPU_NMAXWORKERS];
@@ -67,7 +67,7 @@ static int count_non_ready_buffers(struct starpu_task *task, uint32_t node)
 	return cnt;
 }
 
-static struct starpu_task *_starpu_fifo_pop_first_ready_task(struct starpu_fifo_taskq_s *fifo_queue, unsigned node)
+static struct starpu_task *_starpu_fifo_pop_first_ready_task(struct _starpu_fifo_taskq *fifo_queue, unsigned node)
 {
 	struct starpu_task *task = NULL, *current;
 
@@ -119,7 +119,7 @@ static struct starpu_task *dmda_pop_ready_task(void)
 	struct starpu_task *task;
 
 	int workerid = starpu_worker_get_id();
-	struct starpu_fifo_taskq_s *fifo = queue_array[workerid];
+	struct _starpu_fifo_taskq *fifo = queue_array[workerid];
 
 	unsigned node = starpu_worker_get_memory_node(workerid);
 
@@ -151,7 +151,7 @@ static struct starpu_task *dmda_pop_task(void)
 	struct starpu_task *task;
 
 	int workerid = starpu_worker_get_id();
-	struct starpu_fifo_taskq_s *fifo = queue_array[workerid];
+	struct _starpu_fifo_taskq *fifo = queue_array[workerid];
 
 	task = _starpu_fifo_pop_task(fifo, -1);
 	if (task) {
@@ -184,7 +184,7 @@ static struct starpu_task *dmda_pop_every_task(void)
 
 	int workerid = starpu_worker_get_id();
 
-	struct starpu_fifo_taskq_s *fifo = queue_array[workerid];
+	struct _starpu_fifo_taskq *fifo = queue_array[workerid];
 
 	new_list = _starpu_fifo_pop_every_task(fifo, &sched_mutex[workerid], workerid);
 
@@ -203,7 +203,7 @@ static struct starpu_task *dmda_pop_every_task(void)
 }
 
 static
-int _starpu_fifo_push_sorted_task(struct starpu_fifo_taskq_s *fifo_queue, pthread_mutex_t *sched_mutex, pthread_cond_t *sched_cond, struct starpu_task *task)
+int _starpu_fifo_push_sorted_task(struct _starpu_fifo_taskq *fifo_queue, pthread_mutex_t *sched_mutex, pthread_cond_t *sched_cond, struct starpu_task *task)
 {
 	struct starpu_task_list *list = &fifo_queue->taskq;
 
@@ -274,7 +274,7 @@ static int push_task_on_best_worker(struct starpu_task *task, int best_workerid,
 	/* make sure someone coule execute that task ! */
 	STARPU_ASSERT(best_workerid != -1);
 
-	struct starpu_fifo_taskq_s *fifo;
+	struct _starpu_fifo_taskq *fifo;
 	fifo = queue_array[best_workerid];
 
 	fifo->exp_end += predicted;
@@ -300,7 +300,7 @@ static int push_task_on_best_worker(struct starpu_task *task, int best_workerid,
 static int _dm_push_task(struct starpu_task *task, unsigned prio)
 {
 	/* find the queue */
-	struct starpu_fifo_taskq_s *fifo;
+	struct _starpu_fifo_taskq *fifo;
 	unsigned worker;
 	int best = -1;
 
@@ -392,7 +392,7 @@ static int _dm_push_task(struct starpu_task *task, unsigned prio)
 static int _dmda_push_task(struct starpu_task *task, unsigned prio)
 {
 	/* find the queue */
-	struct starpu_fifo_taskq_s *fifo;
+	struct _starpu_fifo_taskq *fifo;
 	unsigned worker;
 	int best = -1;
 	

+ 8 - 8
src/sched_policies/deque_queues.c

@@ -25,10 +25,10 @@
 #include <errno.h>
 #include <common/utils.h>
 
-struct starpu_deque_jobq_s *_starpu_create_deque(void)
+struct _starpu_deque_jobq *_starpu_create_deque(void)
 {
-	struct starpu_deque_jobq_s *deque;
-	deque = (struct starpu_deque_jobq_s *) malloc(sizeof(struct starpu_deque_jobq_s));
+	struct _starpu_deque_jobq *deque;
+	deque = (struct _starpu_deque_jobq *) malloc(sizeof(struct _starpu_deque_jobq));
 
 	/* note that not all mechanisms (eg. the semaphore) have to be used */
 	deque->jobq = starpu_job_list_new();
@@ -42,23 +42,23 @@ struct starpu_deque_jobq_s *_starpu_create_deque(void)
 	return deque;
 }
 
-void _starpu_destroy_deque(struct starpu_deque_jobq_s *deque)
+void _starpu_destroy_deque(struct _starpu_deque_jobq *deque)
 {
 	starpu_job_list_delete(deque->jobq);
 	free(deque);
 }
 
-unsigned _starpu_get_deque_njobs(struct starpu_deque_jobq_s *deque_queue)
+unsigned _starpu_get_deque_njobs(struct _starpu_deque_jobq *deque_queue)
 {
 	return deque_queue->njobs;
 }
 
-unsigned _starpu_get_deque_nprocessed(struct starpu_deque_jobq_s *deque_queue)
+unsigned _starpu_get_deque_nprocessed(struct _starpu_deque_jobq *deque_queue)
 {
 	return deque_queue->nprocessed;
 }
 
-struct starpu_task *_starpu_deque_pop_task(struct starpu_deque_jobq_s *deque_queue, int workerid __attribute__ ((unused)))
+struct starpu_task *_starpu_deque_pop_task(struct _starpu_deque_jobq *deque_queue, int workerid __attribute__ ((unused)))
 {
 	starpu_job_t j = NULL;
 
@@ -84,7 +84,7 @@ struct starpu_task *_starpu_deque_pop_task(struct starpu_deque_jobq_s *deque_que
 	return NULL;
 }
 
-struct starpu_job_list_s *_starpu_deque_pop_every_task(struct starpu_deque_jobq_s *deque_queue, pthread_mutex_t *sched_mutex, int workerid)
+struct starpu_job_list_s *_starpu_deque_pop_every_task(struct _starpu_deque_jobq *deque_queue, pthread_mutex_t *sched_mutex, int workerid)
 {
 	struct starpu_job_list_s *new_list, *old_list;
 

+ 7 - 7
src/sched_policies/deque_queues.h

@@ -23,7 +23,7 @@
 #include <common/config.h>
 #include <core/jobs.h>
 
-struct starpu_deque_jobq_s {
+struct _starpu_deque_jobq {
 	/* the actual list */
 	starpu_job_list_t jobq;
 
@@ -39,14 +39,14 @@ struct starpu_deque_jobq_s {
 	double exp_len; /* Expected duration of the set of tasks in the queue */
 };
 
-struct starpu_deque_jobq_s *_starpu_create_deque(void);
-void _starpu_destroy_deque(struct starpu_deque_jobq_s *deque);
+struct _starpu_deque_jobq *_starpu_create_deque(void);
+void _starpu_destroy_deque(struct _starpu_deque_jobq *deque);
 
-struct starpu_task *_starpu_deque_pop_task(struct starpu_deque_jobq_s *deque_queue, int workerid);
-struct starpu_job_list_s *_starpu_deque_pop_every_task(struct starpu_deque_jobq_s *deque_queue, pthread_mutex_t *sched_mutex, int workerid);
+struct starpu_task *_starpu_deque_pop_task(struct _starpu_deque_jobq *deque_queue, int workerid);
+struct starpu_job_list_s *_starpu_deque_pop_every_task(struct _starpu_deque_jobq *deque_queue, pthread_mutex_t *sched_mutex, int workerid);
 
-unsigned _starpu_get_deque_njobs(struct starpu_deque_jobq_s *deque_queue);
-unsigned _starpu_get_deque_nprocessed(struct starpu_deque_jobq_s *deque_queue);
+unsigned _starpu_get_deque_njobs(struct _starpu_deque_jobq *deque_queue);
+unsigned _starpu_get_deque_nprocessed(struct _starpu_deque_jobq *deque_queue);
 
 
 #endif // __DEQUE_QUEUES_H__

+ 1 - 1
src/sched_policies/eager_central_policy.c

@@ -24,7 +24,7 @@
 #include <sched_policies/fifo_queues.h>
 
 /* the former is the actual queue, the latter some container */
-static struct starpu_fifo_taskq_s *fifo;
+static struct _starpu_fifo_taskq *fifo;
 
 static pthread_cond_t sched_cond;
 static pthread_mutex_t sched_mutex;

+ 7 - 7
src/sched_policies/fifo_queues.c

@@ -25,10 +25,10 @@
 #include <core/task.h>
 #include <core/workers.h>
 
-struct starpu_fifo_taskq_s *_starpu_create_fifo(void)
+struct _starpu_fifo_taskq *_starpu_create_fifo(void)
 {
-	struct starpu_fifo_taskq_s *fifo;
-	fifo = (struct starpu_fifo_taskq_s *) malloc(sizeof(struct starpu_fifo_taskq_s));
+	struct _starpu_fifo_taskq *fifo;
+	fifo = (struct _starpu_fifo_taskq *) malloc(sizeof(struct _starpu_fifo_taskq));
 
 	/* note that not all mechanisms (eg. the semaphore) have to be used */
 	starpu_task_list_init(&fifo->taskq);
@@ -42,14 +42,14 @@ struct starpu_fifo_taskq_s *_starpu_create_fifo(void)
 	return fifo;
 }
 
-void _starpu_destroy_fifo(struct starpu_fifo_taskq_s *fifo)
+void _starpu_destroy_fifo(struct _starpu_fifo_taskq *fifo)
 {
 	free(fifo);
 }
 
 /* TODO: revert front/back? */
 
-int _starpu_fifo_push_task(struct starpu_fifo_taskq_s *fifo_queue, pthread_mutex_t *sched_mutex, pthread_cond_t *sched_cond, struct starpu_task *task)
+int _starpu_fifo_push_task(struct _starpu_fifo_taskq *fifo_queue, pthread_mutex_t *sched_mutex, pthread_cond_t *sched_cond, struct starpu_task *task)
 {
 	_STARPU_PTHREAD_MUTEX_LOCK(sched_mutex);
 
@@ -65,7 +65,7 @@ int _starpu_fifo_push_task(struct starpu_fifo_taskq_s *fifo_queue, pthread_mutex
 	return 0;
 }
 
-struct starpu_task *_starpu_fifo_pop_task(struct starpu_fifo_taskq_s *fifo_queue, int workerid __attribute__ ((unused)))
+struct starpu_task *_starpu_fifo_pop_task(struct _starpu_fifo_taskq *fifo_queue, int workerid __attribute__ ((unused)))
 {
 	struct starpu_task *task = NULL;
 
@@ -88,7 +88,7 @@ struct starpu_task *_starpu_fifo_pop_task(struct starpu_fifo_taskq_s *fifo_queue
 }
 
 /* pop every task that can be executed on the calling driver */
-struct starpu_task *_starpu_fifo_pop_every_task(struct starpu_fifo_taskq_s *fifo_queue, pthread_mutex_t *sched_mutex, int workerid)
+struct starpu_task *_starpu_fifo_pop_every_task(struct _starpu_fifo_taskq *fifo_queue, pthread_mutex_t *sched_mutex, int workerid)
 {
 	struct starpu_task_list *old_list;
 	unsigned size;

+ 6 - 6
src/sched_policies/fifo_queues.h

@@ -22,7 +22,7 @@
 #include <starpu.h>
 #include <common/config.h>
 
-struct starpu_fifo_taskq_s {
+struct _starpu_fifo_taskq {
 	/* the actual list */
 	struct starpu_task_list taskq;
 
@@ -38,12 +38,12 @@ struct starpu_fifo_taskq_s {
 	double exp_len; /* Expected duration of the set of tasks in the queue */
 };
 
-struct starpu_fifo_taskq_s*_starpu_create_fifo(void);
-void _starpu_destroy_fifo(struct starpu_fifo_taskq_s *fifo);
+struct _starpu_fifo_taskq*_starpu_create_fifo(void);
+void _starpu_destroy_fifo(struct _starpu_fifo_taskq *fifo);
 
-int _starpu_fifo_push_task(struct starpu_fifo_taskq_s *fifo, pthread_mutex_t *sched_mutex, pthread_cond_t *sched_cond, struct starpu_task *task);
+int _starpu_fifo_push_task(struct _starpu_fifo_taskq *fifo, pthread_mutex_t *sched_mutex, pthread_cond_t *sched_cond, struct starpu_task *task);
 
-struct starpu_task *_starpu_fifo_pop_task(struct starpu_fifo_taskq_s *fifo, int workerid);
-struct starpu_task *_starpu_fifo_pop_every_task(struct starpu_fifo_taskq_s *fifo, pthread_mutex_t *sched_mutex, int workerid);
+struct starpu_task *_starpu_fifo_pop_task(struct _starpu_fifo_taskq *fifo, int workerid);
+struct starpu_task *_starpu_fifo_pop_every_task(struct _starpu_fifo_taskq *fifo, pthread_mutex_t *sched_mutex, int workerid);
 
 #endif // __FIFO_QUEUES_H__

+ 2 - 2
src/sched_policies/parallel_greedy.c

@@ -21,8 +21,8 @@
 #include <sched_policies/detect_combined_workers.h>
 
 /* the former is the actual queue, the latter some container */
-static struct starpu_fifo_taskq_s *fifo;
-static struct starpu_fifo_taskq_s *local_fifo[STARPU_NMAXWORKERS];
+static struct _starpu_fifo_taskq *fifo;
+static struct _starpu_fifo_taskq *local_fifo[STARPU_NMAXWORKERS];
 
 static int master_id[STARPU_NMAXWORKERS];
 

+ 7 - 7
src/sched_policies/stack_queues.c

@@ -31,10 +31,10 @@ void _starpu_init_stack_queues_mechanisms(void)
 	total_number_of_jobs = 0;
 }
 
-struct starpu_stack_jobq_s *_starpu_create_stack(void)
+struct _starpu_stack_jobq *_starpu_create_stack(void)
 {
-	struct starpu_stack_jobq_s *stack;
-	stack = (struct starpu_stack_jobq_s *) malloc(sizeof(struct starpu_stack_jobq_s));
+	struct _starpu_stack_jobq *stack;
+	stack = (struct _starpu_stack_jobq *) malloc(sizeof(struct _starpu_stack_jobq));
 
 	stack->jobq = starpu_job_list_new();
 	stack->njobs = 0;
@@ -47,17 +47,17 @@ struct starpu_stack_jobq_s *_starpu_create_stack(void)
 	return stack;
 }
 
-unsigned _starpu_get_stack_njobs(struct starpu_stack_jobq_s *stack_queue)
+unsigned _starpu_get_stack_njobs(struct _starpu_stack_jobq *stack_queue)
 {
 	return stack_queue->njobs;
 }
 
-unsigned _starpu_get_stack_nprocessed(struct starpu_stack_jobq_s *stack_queue)
+unsigned _starpu_get_stack_nprocessed(struct _starpu_stack_jobq *stack_queue)
 {
 	return stack_queue->nprocessed;
 }
 
-void _starpu_stack_push_task(struct starpu_stack_jobq_s *stack_queue, pthread_mutex_t *sched_mutex, pthread_cond_t *sched_cond, starpu_job_t task)
+void _starpu_stack_push_task(struct _starpu_stack_jobq *stack_queue, pthread_mutex_t *sched_mutex, pthread_cond_t *sched_cond, starpu_job_t task)
 {
 	_STARPU_PTHREAD_MUTEX_LOCK(sched_mutex);
 	total_number_of_jobs++;
@@ -74,7 +74,7 @@ void _starpu_stack_push_task(struct starpu_stack_jobq_s *stack_queue, pthread_mu
 	_STARPU_PTHREAD_MUTEX_UNLOCK(sched_mutex);
 }
 
-starpu_job_t _starpu_stack_pop_task(struct starpu_stack_jobq_s *stack_queue, pthread_mutex_t *sched_mutex, int workerid __attribute__ ((unused)))
+starpu_job_t _starpu_stack_pop_task(struct _starpu_stack_jobq *stack_queue, pthread_mutex_t *sched_mutex, int workerid __attribute__ ((unused)))
 {
 	starpu_job_t j = NULL;
 

+ 6 - 6
src/sched_policies/stack_queues.h

@@ -23,7 +23,7 @@
 #include <common/config.h>
 #include <core/jobs.h>
 
-struct starpu_stack_jobq_s {
+struct _starpu_stack_jobq {
 	/* the actual list */
 	starpu_job_list_t jobq;
 
@@ -39,17 +39,17 @@ struct starpu_stack_jobq_s {
 	double exp_len; /* Expected duration of the set of tasks in the queue */
 };
 
-struct starpu_stack_jobq_s *_starpu_create_stack(void);
+struct _starpu_stack_jobq *_starpu_create_stack(void);
 
-void _starpu_stack_push_task(struct starpu_stack_jobq_s *stack, pthread_mutex_t *sched_mutex, pthread_cond_t *sched_cond, starpu_job_t task);
+void _starpu_stack_push_task(struct _starpu_stack_jobq *stack, pthread_mutex_t *sched_mutex, pthread_cond_t *sched_cond, starpu_job_t task);
 
-starpu_job_t _starpu_stack_pop_task(struct starpu_stack_jobq_s *stack, pthread_mutex_t *sched_mutex, int workerid);
+starpu_job_t _starpu_stack_pop_task(struct _starpu_stack_jobq *stack, pthread_mutex_t *sched_mutex, int workerid);
 
 void _starpu_init_stack_queues_mechanisms(void);
 
 
-unsigned _starpu_get_stack_njobs(struct starpu_stack_jobq_s *stack);
-unsigned _starpu_get_stack_nprocessed(struct starpu_stack_jobq_s *stack);
+unsigned _starpu_get_stack_njobs(struct _starpu_stack_jobq *stack);
+unsigned _starpu_get_stack_nprocessed(struct _starpu_stack_jobq *stack);
 
 
 #endif // __STACK_QUEUES_H__

+ 12 - 12
src/sched_policies/work_stealing_policy.c

@@ -22,7 +22,7 @@
 
 static unsigned nworkers;
 static unsigned rr_worker;
-static struct starpu_deque_jobq_s *queue_array[STARPU_NMAXWORKERS];
+static struct _starpu_deque_jobq *queue_array[STARPU_NMAXWORKERS];
 
 static pthread_mutex_t global_sched_mutex;
 static pthread_cond_t global_sched_cond;
@@ -52,9 +52,9 @@ static float overload_metric(unsigned id)
 }
 
 /* who to steal work to ? */
-static struct starpu_deque_jobq_s *select_victimq(void)
+static struct _starpu_deque_jobq *select_victimq(void)
 {
-	struct starpu_deque_jobq_s *q;
+	struct _starpu_deque_jobq *q;
 
 	unsigned attempts = nworkers;
 
@@ -77,9 +77,9 @@ static struct starpu_deque_jobq_s *select_victimq(void)
 	return q;
 }
 
-static struct starpu_deque_jobq_s *select_workerq(void)
+static struct _starpu_deque_jobq *select_workerq(void)
 {
-	struct starpu_deque_jobq_s *q;
+	struct _starpu_deque_jobq *q;
 
 	unsigned attempts = nworkers;
 
@@ -105,9 +105,9 @@ static struct starpu_deque_jobq_s *select_workerq(void)
 #else
 
 /* who to steal work to ? */
-static struct starpu_deque_jobq_s *select_victimq(void)
+static struct _starpu_deque_jobq *select_victimq(void)
 {
-	struct starpu_deque_jobq_s *q;
+	struct _starpu_deque_jobq *q;
 
 	q = queue_array[rr_worker];
 
@@ -119,9 +119,9 @@ static struct starpu_deque_jobq_s *select_victimq(void)
 
 /* when anonymous threads submit tasks, 
  * we need to select a queue where to dispose them */
-static struct starpu_deque_jobq_s *select_workerq(void)
+static struct _starpu_deque_jobq *select_workerq(void)
 {
-	struct starpu_deque_jobq_s *q;
+	struct _starpu_deque_jobq *q;
 
 	q = queue_array[rr_worker];
 
@@ -141,7 +141,7 @@ static struct starpu_task *ws_pop_task(void)
 
 	int workerid = starpu_worker_get_id();
 
-	struct starpu_deque_jobq_s *q;
+	struct _starpu_deque_jobq *q;
 
 	q = queue_array[workerid];
 
@@ -156,7 +156,7 @@ static struct starpu_task *ws_pop_task(void)
 	}
 	
 	/* we need to steal someone's job */
-	struct starpu_deque_jobq_s *victimq;
+	struct _starpu_deque_jobq *victimq;
 	victimq = select_victimq();
 
 	task = _starpu_deque_pop_task(victimq, workerid);
@@ -176,7 +176,7 @@ static int ws_push_task(struct starpu_task *task)
 
 	int workerid = starpu_worker_get_id();
 
-        struct starpu_deque_jobq_s *deque_queue;
+        struct _starpu_deque_jobq *deque_queue;
 	deque_queue = queue_array[workerid];
 
         _STARPU_PTHREAD_MUTEX_LOCK(&global_sched_mutex);