ソースを参照

src: fixes for minor warnings

Nathalie Furmento 9 年 前
コミット
477cb1f811

+ 4 - 0
src/core/sched_ctx.c

@@ -1064,6 +1064,10 @@ void _starpu_push_task_to_waiting_list(struct _starpu_sched_ctx *sched_ctx, stru
 
 void starpu_sched_ctx_set_priority_on_level(int* workers_to_add, unsigned nworkers_to_add, unsigned sched_ctx, unsigned priority)
 {
+	(void) workers_to_add;
+	(void) nworkers_to_add;
+	(void) sched_ctx;
+	(void) priority;
 /* 	int w; */
 /* 	struct _starpu_worker *worker = NULL; */
 /* 	for(w = 0; w < nworkers_to_add; w++) */

+ 3 - 1
src/core/workers.c

@@ -1,7 +1,7 @@
 /* StarPU --- Runtime system for heterogeneous multicore architectures.
  *
  * Copyright (C) 2009-2016  Université de Bordeaux
- * Copyright (C) 2010, 2011, 2012, 2013, 2014, 2015  CNRS
+ * Copyright (C) 2010, 2011, 2012, 2013, 2014, 2015, 2016  CNRS
  * Copyright (C) 2010, 2011  INRIA
  * Copyright (C) 2011  Télécom-SudParis
  * Copyright (C) 2011-2012  INRIA
@@ -561,6 +561,8 @@ static void _starpu_worker_init(struct _starpu_worker *workerarg, struct _starpu
 
 static void _starpu_worker_deinit(struct _starpu_worker *workerarg)
 {
+	(void) workerarg;
+
 #ifdef STARPU_SIMGRID
 	starpu_pthread_queue_unregister(&workerarg->wait, &_starpu_simgrid_task_queue[workerarg->workerid]);
 	starpu_pthread_wait_destroy(&workerarg->wait);

+ 14 - 14
src/sched_policies/component_worker.c

@@ -1,7 +1,7 @@
 /* StarPU --- Runtime system for heterogeneous multicore architectures.
  *
  * Copyright (C) 2010-2016  Université de Bordeaux
- * Copyright (C) 2010, 2011, 2012, 2014, 2015  CNRS
+ * Copyright (C) 2010, 2011, 2012, 2014, 2015, 2016  CNRS
  * Copyright (C) 2011  Télécom-SudParis
  * Copyright (C) 2011-2013  INRIA
  * Copyright (C) 2013  Simon Archipoff
@@ -108,13 +108,13 @@ enum _starpu_worker_component_status
 
 struct _starpu_worker_component_data
 {
-	union 
+	union
 	{
 		struct
 		{
 			struct _starpu_worker * worker;
 			starpu_pthread_mutex_t lock;
-		};	
+		};
 		struct _starpu_combined_worker * combined_worker;
 	};
 	struct _starpu_worker_task_list * list;
@@ -273,9 +273,9 @@ static inline struct starpu_task * _starpu_worker_task_list_pop(struct _starpu_w
 			t->task = NULL;
 			/* the leftist thing hold the number of tasks, other have a pointer to it */
 			int * p = t->left ? t->pntasks : &t->ntasks;
-			
+
 			/* the worker who pop the last task allow the rope to be freed */
-			if(STARPU_ATOMIC_ADD(p, -1) == 0) 
+			if(STARPU_ATOMIC_ADD(p, -1) == 0)
 				_starpu_task_grid_unset_left_right_member(t);
 
 			l->ntasks--;
@@ -336,9 +336,9 @@ void _starpu_sched_component_unlock_worker(unsigned sched_ctx_id, int workerid)
 
 
 
-/* Allows a worker to lock/unlock scheduling mutexes. Currently used in 
- * self-defined can_push calls to allow can_pull calls to take those mutexes while the 
- * current worker is pushing tasks on other workers (or itself). 
+/* Allows a worker to lock/unlock scheduling mutexes. Currently used in
+ * self-defined can_push calls to allow can_pull calls to take those mutexes while the
+ * current worker is pushing tasks on other workers (or itself).
  */
 static void _starpu_sched_component_worker_lock_scheduling(unsigned sched_ctx_id)
 {
@@ -346,7 +346,7 @@ static void _starpu_sched_component_worker_lock_scheduling(unsigned sched_ctx_id
 	starpu_pthread_mutex_t *sched_mutex;
 	starpu_pthread_cond_t *sched_cond;
 	starpu_worker_get_sched_condition(workerid, &sched_mutex, &sched_cond);
-	_starpu_sched_component_lock_worker(sched_ctx_id, workerid);	
+	_starpu_sched_component_lock_worker(sched_ctx_id, workerid);
 #ifdef STARPU_DEVEL
 #warning Reverses locking order between worker lock and worker component lock!
 #warning See helgrind suppression file for the details
@@ -361,7 +361,7 @@ static void _starpu_sched_component_worker_unlock_scheduling(unsigned sched_ctx_
 	starpu_pthread_cond_t *sched_cond;
 	starpu_worker_get_sched_condition(workerid, &sched_mutex, &sched_cond);
 	STARPU_PTHREAD_MUTEX_UNLOCK_SCHED(sched_mutex);
-	_starpu_sched_component_unlock_worker(sched_ctx_id, workerid);	
+	_starpu_sched_component_unlock_worker(sched_ctx_id, workerid);
 }
 
 static void _starpu_sched_component_worker_set_sleep_status(struct starpu_sched_component * worker_component)
@@ -476,7 +476,7 @@ static int simple_worker_push_task(struct starpu_sched_component * component, st
 	STARPU_PTHREAD_MUTEX_LOCK(&data->list->mutex);
 	_starpu_worker_task_list_push(data->list, t);
 	STARPU_PTHREAD_MUTEX_UNLOCK(&data->list->mutex);
-	simple_worker_can_pull(component);	
+	simple_worker_can_pull(component);
 	return 0;
 }
 
@@ -493,7 +493,7 @@ static struct starpu_task * simple_worker_pull_task(struct starpu_sched_componen
 		starpu_push_task_end(task);
 		return task;
 	}
-	_starpu_sched_component_lock_worker(component->tree->sched_ctx_id, workerid);	
+	_starpu_sched_component_lock_worker(component->tree->sched_ctx_id, workerid);
 	int i;
 	do
 	{
@@ -514,7 +514,7 @@ static struct starpu_task * simple_worker_pull_task(struct starpu_sched_componen
 	}
 	while((!task) && _starpu_sched_component_worker_is_changed_status(component));
 	_starpu_sched_component_worker_set_sleep_status(component);
-	_starpu_sched_component_unlock_worker(component->tree->sched_ctx_id, workerid);	
+	_starpu_sched_component_unlock_worker(component->tree->sched_ctx_id, workerid);
 	if(!task)
 		return NULL;
 	if(task->cl->type == STARPU_SPMD)
@@ -705,7 +705,7 @@ static int combined_worker_push_task(struct starpu_sched_component * component,
 		i++;
 	}
 	while(i < combined_worker->worker_size);
-	
+
 	STARPU_PTHREAD_MUTEX_UNLOCK(mutex_to_unlock);
 
 	int workerid = starpu_worker_get_id();

+ 3 - 1
src/sched_policies/random_policy.c

@@ -1,7 +1,7 @@
 /* StarPU --- Runtime system for heterogeneous multicore architectures.
  *
  * Copyright (C) 2010-2014  Université de Bordeaux
- * Copyright (C) 2010, 2011, 2012, 2013, 2014  CNRS
+ * Copyright (C) 2010, 2011, 2012, 2013, 2014, 2016  CNRS
  *
  * StarPU is free software; you can redistribute it and/or modify
  * it under the terms of the GNU Lesser General Public License as published by
@@ -99,11 +99,13 @@ static int random_push_task(struct starpu_task *task)
 
 static void initialize_random_policy(unsigned sched_ctx_id)
 {
+	(void) sched_ctx_id;
 	starpu_srand48(time(NULL));
 }
 
 static void deinitialize_random_policy(unsigned sched_ctx_id)
 {
+	(void) sched_ctx_id;
 }
 
 struct starpu_sched_policy _starpu_sched_random_policy =

+ 2 - 3
src/util/openmp_runtime_support.c

@@ -1154,7 +1154,6 @@ void starpu_omp_parallel_region(const struct starpu_omp_parallel_region_attr *at
 		implicit_task->starpu_task = starpu_task_create();
 		implicit_task->starpu_task->cl = &implicit_task->cl;
 		{
-			int i;
 			for (i = 0; i < implicit_task->cl.nbuffers; i++)
 			{
 				implicit_task->starpu_task->handles[i] = attr->handles[i];
@@ -1219,8 +1218,8 @@ void starpu_omp_parallel_region(const struct starpu_omp_parallel_region_attr *at
 			/* TODO: cleanup unused threads */
 		}
 		new_region->nb_threads--;
-		struct starpu_omp_task *implicit_task = starpu_omp_task_list_pop_front(&new_region->implicit_task_list);
-		destroy_omp_task_struct(implicit_task);
+		struct starpu_omp_task *implicit_task_p = starpu_omp_task_list_pop_front(&new_region->implicit_task_list);
+		destroy_omp_task_struct(implicit_task_p);
 	}
 	STARPU_ASSERT(new_region->nb_threads == 0);
 	task->nested_region = NULL;

+ 2 - 2
src/util/starpu_clusters_create.c

@@ -2,7 +2,7 @@
  *
  * Copyright (C) 2015-2016  Université de Bordeaux
  * Copyright (C) 2015  INRIA
- * Copyright (C) 2015  CNRS
+ * Copyright (C) 2015, 2016  CNRS
  *
  * StarPU is free software; you can redistribute it and/or modify
  * it under the terms of the GNU Lesser General Public License as published by
@@ -573,7 +573,7 @@ void _starpu_cluster_group(hwloc_obj_type_t cluster_level,
 			   struct starpu_cluster_machine *machine)
 {
 	unsigned nb_objects;
-	int i;
+	unsigned i;
 	struct _starpu_cluster_group *group = NULL;
 
 	if (machine->groups == NULL)

+ 6 - 5
src/util/starpu_clusters_create.h

@@ -2,7 +2,7 @@
  *
  * Copyright (C) 2015  Université de Bordeaux
  * Copyright (C) 2015  INRIA
- * Copyright (C) 2015  CNRS
+ * Copyright (C) 2015, 2016  CNRS
  *
  * StarPU is free software; you can redistribute it and/or modify
  * it under the terms of the GNU Lesser General Public License as published by
@@ -100,16 +100,17 @@ int _starpu_cluster_group_remove(struct _starpu_cluster_group_list* group_list,
 /* Binding helpers */
 void _starpu_cluster_noop(void* buffers[], void* cl_arg)
 {
+	(void) buffers;
+	(void) cl_arg;
 }
 
 static struct starpu_codelet _starpu_cluster_bind_cl=
 {
-		.cpu_funcs = {_starpu_cluster_noop},
-		.nbuffers = 0,
-		.name = "cluster_internal_runtime_init"
+	.cpu_funcs = {_starpu_cluster_noop},
+	.nbuffers = 0,
+	.name = "cluster_internal_runtime_init"
 };
 
-
 typedef void (*starpu_binding_function)(void*);
 starpu_binding_function _starpu_cluster_type_get_func(starpu_cluster_types type);
 

+ 2 - 1
src/worker_collection/worker_list.c

@@ -1,7 +1,7 @@
 /* StarPU --- Runtime system for heterogeneous multicore architectures.
  *
  * Copyright (C) 2013-2014, 2016  Université de Bordeaux
- * Copyright (C) 2012-2013  CNRS
+ * Copyright (C) 2012-2013, 2016  CNRS
  * Copyright (C) 2011-2013  INRIA
  *
  * StarPU is free software; you can redistribute it and/or modify
@@ -260,6 +260,7 @@ static void list_deinit(struct starpu_worker_collection *workers)
 
 static void list_init_iterator(struct starpu_worker_collection *workers, struct starpu_sched_ctx_iterator *it)
 {
+	(void) workers;
 	it->cursor = 0;
 	it->possibly_parallel = -1; /* -1 => we don't care about this field */
 

+ 3 - 1
src/worker_collection/worker_tree.c

@@ -1,7 +1,7 @@
 /* StarPU --- Runtime system for heterogeneous multicore architectures.
  *
  * Copyright (C) 2013, 2016  Université de Bordeaux
- * Copyright (C) 2012-2014  CNRS
+ * Copyright (C) 2012-2014, 2016  CNRS
  * Copyright (C) 2011-2013  INRIA
  *
  * StarPU is free software; you can redistribute it and/or modify
@@ -296,11 +296,13 @@ static void tree_init(struct starpu_worker_collection *workers)
 
 static void tree_deinit(struct starpu_worker_collection *workers)
 {
+	(void) workers;
 //	free(workers->workerids);
 }
 
 static void tree_init_iterator(struct starpu_worker_collection *workers, struct starpu_sched_ctx_iterator *it)
 {
+	(void) workers;
 	it->value = NULL;
 	it->possible_value = NULL;
 	it->possibly_parallel = -1;