浏览代码

fix warnings

Samuel Thibault 8 年之前
父节点
当前提交
235906e10d

+ 2 - 2
include/starpu_sched_component.h

@@ -112,8 +112,8 @@ int starpu_sched_component_worker_get_workerid(struct starpu_sched_component *wo
 int starpu_sched_component_is_worker(struct starpu_sched_component *component);
 int starpu_sched_component_is_worker(struct starpu_sched_component *component);
 int starpu_sched_component_is_simple_worker(struct starpu_sched_component *component);
 int starpu_sched_component_is_simple_worker(struct starpu_sched_component *component);
 int starpu_sched_component_is_combined_worker(struct starpu_sched_component *component);
 int starpu_sched_component_is_combined_worker(struct starpu_sched_component *component);
-void starpu_sched_component_worker_pre_exec_hook(struct starpu_task *task);
-void starpu_sched_component_worker_post_exec_hook(struct starpu_task *task);
+void starpu_sched_component_worker_pre_exec_hook(struct starpu_task *task, unsigned sched_ctx_id);
+void starpu_sched_component_worker_post_exec_hook(struct starpu_task *task, unsigned sched_ctx_id);
 
 
 struct starpu_sched_component_fifo_data
 struct starpu_sched_component_fifo_data
 {
 {

+ 3 - 3
include/starpu_worker.h

@@ -106,7 +106,7 @@ enum starpu_worker_archtype starpu_worker_get_type(int id);
 
 
 int starpu_worker_get_count_by_type(enum starpu_worker_archtype type);
 int starpu_worker_get_count_by_type(enum starpu_worker_archtype type);
 
 
-int starpu_worker_get_ids_by_type(enum starpu_worker_archtype type, int *workerids, int maxsize);
+unsigned starpu_worker_get_ids_by_type(enum starpu_worker_archtype type, int *workerids, unsigned maxsize);
 
 
 int starpu_worker_get_by_type(enum starpu_worker_archtype type, int num);
 int starpu_worker_get_by_type(enum starpu_worker_archtype type, int num);
 
 
@@ -132,9 +132,9 @@ int starpu_bindid_get_workerids(int bindid, int **workerids);
 
 
 int starpu_worker_get_devids(enum starpu_worker_archtype type, int *devids, int num);
 int starpu_worker_get_devids(enum starpu_worker_archtype type, int *devids, int num);
 
 
-int starpu_worker_get_stream_workerids(int devid, int *workerids, enum starpu_worker_archtype type);
+int starpu_worker_get_stream_workerids(unsigned devid, int *workerids, enum starpu_worker_archtype type);
 
 
-unsigned starpu_worker_get_sched_ctx_id_stream(int stream_workerid);
+unsigned starpu_worker_get_sched_ctx_id_stream(unsigned stream_workerid);
 #ifdef __cplusplus
 #ifdef __cplusplus
 }
 }
 #endif
 #endif

+ 8 - 8
src/core/workers.c

@@ -1800,11 +1800,11 @@ enum starpu_worker_archtype starpu_worker_get_type(int id)
 	return _starpu_config.workers[id].arch;
 	return _starpu_config.workers[id].arch;
 }
 }
 
 
-int starpu_worker_get_ids_by_type(enum starpu_worker_archtype type, int *workerids, int maxsize)
+unsigned starpu_worker_get_ids_by_type(enum starpu_worker_archtype type, int *workerids, unsigned maxsize)
 {
 {
 	unsigned nworkers = starpu_worker_get_count();
 	unsigned nworkers = starpu_worker_get_count();
 
 
-	int cnt = 0;
+	unsigned cnt = 0;
 
 
 	unsigned id;
 	unsigned id;
 	for (id = 0; id < nworkers; id++)
 	for (id = 0; id < nworkers; id++)
@@ -1862,9 +1862,9 @@ int starpu_worker_get_devids(enum starpu_worker_archtype type, int *devids, int
 	unsigned nworkers = starpu_worker_get_count();
 	unsigned nworkers = starpu_worker_get_count();
 	int *workerids = (int *)malloc(nworkers*sizeof(int));
 	int *workerids = (int *)malloc(nworkers*sizeof(int));
 
 
-	int ndevice_workers = starpu_worker_get_ids_by_type(type, workerids, nworkers);
+	unsigned ndevice_workers = starpu_worker_get_ids_by_type(type, workerids, nworkers);
 
 
-	int ndevids = 0;
+	unsigned ndevids = 0;
 
 
 	if(ndevice_workers > 0)
 	if(ndevice_workers > 0)
 	{
 	{
@@ -1917,7 +1917,7 @@ int starpu_bindid_get_workerids(int bindid, int **workerids)
 	return _starpu_config.bindid_workers[bindid].nworkers;
 	return _starpu_config.bindid_workers[bindid].nworkers;
 }
 }
 
 
-int starpu_worker_get_stream_workerids(int devid, int *workerids, enum starpu_worker_archtype type)
+int starpu_worker_get_stream_workerids(unsigned devid, int *workerids, enum starpu_worker_archtype type)
 {
 {
 	unsigned nworkers = starpu_worker_get_count();
 	unsigned nworkers = starpu_worker_get_count();
 	int nw = 0;
 	int nw = 0;
@@ -2211,14 +2211,14 @@ char *starpu_worker_get_type_as_string(enum starpu_worker_archtype type)
 	return "STARPU_unknown_WORKER";
 	return "STARPU_unknown_WORKER";
 }
 }
 
 
-void _starpu_worker_set_stream_ctx(int workerid, struct _starpu_sched_ctx *sched_ctx)
+void _starpu_worker_set_stream_ctx(unsigned workerid, struct _starpu_sched_ctx *sched_ctx)
 {
 {
 	STARPU_ASSERT(workerid < starpu_worker_get_count());
 	STARPU_ASSERT(workerid < starpu_worker_get_count());
         struct _starpu_worker *w = _starpu_get_worker_struct(workerid);
         struct _starpu_worker *w = _starpu_get_worker_struct(workerid);
         w->stream_ctx = sched_ctx;
         w->stream_ctx = sched_ctx;
 }
 }
 
 
-struct _starpu_sched_ctx* _starpu_worker_get_ctx_stream(int stream_workerid)
+struct _starpu_sched_ctx* _starpu_worker_get_ctx_stream(unsigned stream_workerid)
 {
 {
 	if (stream_workerid >= starpu_worker_get_count())
 	if (stream_workerid >= starpu_worker_get_count())
 		return NULL;
 		return NULL;
@@ -2226,7 +2226,7 @@ struct _starpu_sched_ctx* _starpu_worker_get_ctx_stream(int stream_workerid)
         return w->stream_ctx;
         return w->stream_ctx;
 }
 }
 
 
-unsigned starpu_worker_get_sched_ctx_id_stream(int stream_workerid)
+unsigned starpu_worker_get_sched_ctx_id_stream(unsigned stream_workerid)
 {
 {
 	if (stream_workerid >= starpu_worker_get_count())
 	if (stream_workerid >= starpu_worker_get_count())
 		return STARPU_NMAX_SCHED_CTXS;
 		return STARPU_NMAX_SCHED_CTXS;

+ 2 - 2
src/core/workers.h

@@ -581,8 +581,8 @@ static inline unsigned __starpu_worker_get_id_check(const char *f, int l)
 }
 }
 #define _starpu_worker_get_id_check(f,l) __starpu_worker_get_id_check(f,l)
 #define _starpu_worker_get_id_check(f,l) __starpu_worker_get_id_check(f,l)
 
 
-void _starpu_worker_set_stream_ctx(int workerid, struct _starpu_sched_ctx *sched_ctx);
+void _starpu_worker_set_stream_ctx(unsigned workerid, struct _starpu_sched_ctx *sched_ctx);
 
 
-struct _starpu_sched_ctx* _starpu_worker_get_ctx_stream(int stream_workerid);
+struct _starpu_sched_ctx* _starpu_worker_get_ctx_stream(unsigned stream_workerid);
 
 
 #endif // __WORKERS_H__
 #endif // __WORKERS_H__

+ 2 - 4
src/sched_policies/component_worker.c

@@ -841,14 +841,13 @@ int starpu_sched_component_worker_get_workerid(struct starpu_sched_component * w
 	return starpu_bitmap_first(worker_component->workers);
 	return starpu_bitmap_first(worker_component->workers);
 }
 }
 
 
-void starpu_sched_component_worker_pre_exec_hook(struct starpu_task * task)
+void starpu_sched_component_worker_pre_exec_hook(struct starpu_task * task, unsigned sched_ctx_id STARPU_ATTRIBUTE_UNUSED)
 {
 {
 	double model = task->predicted;
 	double model = task->predicted;
 	double transfer_model = task->predicted_transfer;
 	double transfer_model = task->predicted_transfer;
 
 
 	if(!isnan(task->predicted) || !isnan(task->predicted_transfer))
 	if(!isnan(task->predicted) || !isnan(task->predicted_transfer))
 	{
 	{
-		unsigned sched_ctx_id = task->sched_ctx;
 		struct _starpu_worker_task_list * list = _worker_get_list(sched_ctx_id);
 		struct _starpu_worker_task_list * list = _worker_get_list(sched_ctx_id);
 		STARPU_PTHREAD_MUTEX_LOCK(&list->mutex);
 		STARPU_PTHREAD_MUTEX_LOCK(&list->mutex);
 
 
@@ -875,11 +874,10 @@ void starpu_sched_component_worker_pre_exec_hook(struct starpu_task * task)
 	}
 	}
 }
 }
 
 
-void starpu_sched_component_worker_post_exec_hook(struct starpu_task * task)
+void starpu_sched_component_worker_post_exec_hook(struct starpu_task * task, unsigned sched_ctx_id STARPU_ATTRIBUTE_UNUSED)
 {
 {
 	if(task->execute_on_a_specific_worker)
 	if(task->execute_on_a_specific_worker)
 		return;
 		return;
-	unsigned sched_ctx_id = task->sched_ctx;
 	struct _starpu_worker_task_list * list = _worker_get_list(sched_ctx_id);
 	struct _starpu_worker_task_list * list = _worker_get_list(sched_ctx_id);
 	STARPU_PTHREAD_MUTEX_LOCK(&list->mutex);
 	STARPU_PTHREAD_MUTEX_LOCK(&list->mutex);
 	list->exp_start = starpu_timing_now();
 	list->exp_start = starpu_timing_now();

+ 1 - 2
src/sched_policies/deque_modeling_policy_data_aware.c

@@ -1100,7 +1100,6 @@ static void dmda_pre_exec_hook(struct starpu_task *task, unsigned sched_ctx_id)
 	struct _starpu_dmda_data *dt = (struct _starpu_dmda_data*)starpu_sched_ctx_get_policy_data(sched_ctx_id);
 	struct _starpu_dmda_data *dt = (struct _starpu_dmda_data*)starpu_sched_ctx_get_policy_data(sched_ctx_id);
 	struct _starpu_fifo_taskq *fifo = dt->queue_array[workerid];
 	struct _starpu_fifo_taskq *fifo = dt->queue_array[workerid];
 	double model = task->predicted;
 	double model = task->predicted;
-	double transfer_model = task->predicted_transfer;
 
 
 	starpu_pthread_mutex_t *sched_mutex;
 	starpu_pthread_mutex_t *sched_mutex;
 	starpu_pthread_cond_t *sched_cond;
 	starpu_pthread_cond_t *sched_cond;
@@ -1222,7 +1221,7 @@ static void dmda_push_task_notify(struct starpu_task *task, int workerid, int pe
 	STARPU_PTHREAD_MUTEX_UNLOCK_SCHED(sched_mutex);
 	STARPU_PTHREAD_MUTEX_UNLOCK_SCHED(sched_mutex);
 }
 }
 
 
-static void dmda_post_exec_hook(struct starpu_task * task, unsigned sched_ctx_id)
+static void dmda_post_exec_hook(struct starpu_task * task STARPU_ATTRIBUTE_UNUSED, unsigned sched_ctx_id)
 {
 {
 	struct _starpu_dmda_data *dt = (struct _starpu_dmda_data*)starpu_sched_ctx_get_policy_data(sched_ctx_id);
 	struct _starpu_dmda_data *dt = (struct _starpu_dmda_data*)starpu_sched_ctx_get_policy_data(sched_ctx_id);
 	unsigned workerid = starpu_worker_get_id_check();
 	unsigned workerid = starpu_worker_get_id_check();

+ 1 - 1
src/sched_policies/parallel_heft.c

@@ -72,7 +72,7 @@ static int ntasks[STARPU_NMAXWORKERS];
   from the workers available to the program, and not to the context !!!!!!!!!!!!!!!!!!!!!!!
   from the workers available to the program, and not to the context !!!!!!!!!!!!!!!!!!!!!!!
 */
 */
 
 
-static void parallel_heft_pre_exec_hook(struct starpu_task *task)
+static void parallel_heft_pre_exec_hook(struct starpu_task *task, unsigned sched_ctx_id STARPU_ATTRIBUTE_UNUSED)
 {
 {
 	if (!task->cl || task->execute_on_a_specific_worker)
 	if (!task->cl || task->execute_on_a_specific_worker)
 		return;
 		return;

+ 1 - 1
src/util/fstarpu.c

@@ -521,7 +521,7 @@ int fstarpu_worker_get_count_by_type(intptr_t type)
 	return starpu_worker_get_count_by_type((enum starpu_worker_archtype)type);
 	return starpu_worker_get_count_by_type((enum starpu_worker_archtype)type);
 }
 }
 
 
-int fstarpu_worker_get_ids_by_type(intptr_t type, int *workerids, int maxsize)
+unsigned fstarpu_worker_get_ids_by_type(intptr_t type, int *workerids, unsigned maxsize)
 {
 {
 	return starpu_worker_get_ids_by_type((enum starpu_worker_archtype)type, workerids, maxsize);
 	return starpu_worker_get_ids_by_type((enum starpu_worker_archtype)type, workerids, maxsize);
 }
 }

+ 1 - 1
src/util/openmp_runtime_support.h

@@ -376,7 +376,7 @@ struct starpu_omp_global
 	struct starpu_omp_thread *hash_workers;
 	struct starpu_omp_thread *hash_workers;
 	struct _starpu_spinlock hash_workers_lock;
 	struct _starpu_spinlock hash_workers_lock;
 	struct starpu_arbiter *default_arbiter;
 	struct starpu_arbiter *default_arbiter;
-	int nb_starpu_cpu_workers;
+	unsigned nb_starpu_cpu_workers;
 	int *starpu_cpu_worker_ids;
 	int *starpu_cpu_worker_ids;
 };
 };