Browse Source

fix signedness

Samuel Thibault 7 years ago
parent
commit
83235802fc

+ 2 - 2
src/sched_policies/component_heft.c

@@ -78,7 +78,7 @@ static int heft_progress_one(struct starpu_sched_component *component)
 		/* Maximum transfer+task termination on all children */
 		/* Maximum transfer+task termination on all children */
 		double max_exp_end_with_task[ntasks];
 		double max_exp_end_with_task[ntasks];
 
 
-		int suitable_components[component->nchildren * ntasks];
+		unsigned suitable_components[component->nchildren * ntasks];
 
 
 		unsigned nsuitable_components[ntasks];
 		unsigned nsuitable_components[ntasks];
 
 
@@ -132,7 +132,7 @@ static int heft_progress_one(struct starpu_sched_component *component)
 		for(i = 0; i < nsuitable_components[best_task]; i++)
 		for(i = 0; i < nsuitable_components[best_task]; i++)
 		{
 		{
 			unsigned offset = component->nchildren * best_task;
 			unsigned offset = component->nchildren * best_task;
-			int icomponent = suitable_components[offset + i];
+			unsigned icomponent = suitable_components[offset + i];
 #ifdef STARPU_DEVEL
 #ifdef STARPU_DEVEL
 #warning FIXME: take energy consumption into account
 #warning FIXME: take energy consumption into account
 #endif
 #endif

+ 2 - 2
src/sched_policies/component_mct.c

@@ -50,8 +50,8 @@ static int mct_push_task(struct starpu_sched_component * component, struct starp
 	/* Maximum transfer+task termination on all children */
 	/* Maximum transfer+task termination on all children */
 	double max_exp_end_with_task = 0.0;
 	double max_exp_end_with_task = 0.0;
 
 
-	int suitable_components[component->nchildren];
-	int nsuitable_components = 0;
+	unsigned suitable_components[component->nchildren];
+	unsigned nsuitable_components = 0;
 
 
 	nsuitable_components = starpu_mct_compute_execution_times(component, task,
 	nsuitable_components = starpu_mct_compute_execution_times(component, task,
 								  estimated_lengths, estimated_transfer_length, suitable_components);
 								  estimated_lengths, estimated_transfer_length, suitable_components);

+ 6 - 6
src/sched_policies/helper_mct.c

@@ -119,10 +119,10 @@ double starpu_mct_compute_fitness(struct _starpu_mct_data * d, double exp_end, d
 		+ d->_gamma * d->idle_power * (exp_end - max_exp_end);
 		+ d->_gamma * d->idle_power * (exp_end - max_exp_end);
 }
 }
 
 
-int starpu_mct_compute_execution_times(struct starpu_sched_component *component, struct starpu_task *task,
-				       double *estimated_lengths, double *estimated_transfer_length, int *suitable_components) 
+unsigned starpu_mct_compute_execution_times(struct starpu_sched_component *component, struct starpu_task *task,
+				       double *estimated_lengths, double *estimated_transfer_length, unsigned *suitable_components) 
 {
 {
-	int nsuitable_components = 0;
+	unsigned nsuitable_components = 0;
 
 
 	unsigned i;
 	unsigned i;
 	for(i = 0; i < component->nchildren; i++)
 	for(i = 0; i < component->nchildren; i++)
@@ -145,13 +145,13 @@ int starpu_mct_compute_execution_times(struct starpu_sched_component *component,
 
 
 void starpu_mct_compute_expected_times(struct starpu_sched_component *component, struct starpu_task *task STARPU_ATTRIBUTE_UNUSED,
 void starpu_mct_compute_expected_times(struct starpu_sched_component *component, struct starpu_task *task STARPU_ATTRIBUTE_UNUSED,
 		double *estimated_lengths, double *estimated_transfer_length, double *estimated_ends_with_task,
 		double *estimated_lengths, double *estimated_transfer_length, double *estimated_ends_with_task,
-				       double *min_exp_end_with_task, double *max_exp_end_with_task, int *suitable_components, int nsuitable_components)
+				       double *min_exp_end_with_task, double *max_exp_end_with_task, unsigned *suitable_components, unsigned nsuitable_components)
 {
 {
-	int i;
+	unsigned i;
 	double now = starpu_timing_now();
 	double now = starpu_timing_now();
 	for(i = 0; i < nsuitable_components; i++)
 	for(i = 0; i < nsuitable_components; i++)
 	{
 	{
-		int icomponent = suitable_components[i];
+		unsigned icomponent = suitable_components[i];
 		struct starpu_sched_component * c = component->children[icomponent];
 		struct starpu_sched_component * c = component->children[icomponent];
 		/* Estimated availability of worker */
 		/* Estimated availability of worker */
 		double estimated_end = c->estimated_end(c);
 		double estimated_end = c->estimated_end(c);

+ 4 - 4
src/sched_policies/helper_mct.h

@@ -1,6 +1,6 @@
 /* StarPU --- Runtime system for heterogeneous multicore architectures.
 /* StarPU --- Runtime system for heterogeneous multicore architectures.
  *
  *
- * Copyright (C) 2013-2014, 2016  Université de Bordeaux
+ * Copyright (C) 2013-2014, 2016-2017  Université de Bordeaux
  *
  *
  * StarPU is free software; you can redistribute it and/or modify
  * 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
  * it under the terms of the GNU Lesser General Public License as published by
@@ -25,12 +25,12 @@ struct _starpu_mct_data
 
 
 struct _starpu_mct_data *starpu_mct_init_parameters(struct starpu_sched_component_mct_data *params);
 struct _starpu_mct_data *starpu_mct_init_parameters(struct starpu_sched_component_mct_data *params);
 
 
-int starpu_mct_compute_execution_times(struct starpu_sched_component *component, struct starpu_task *task,
-				       double *estimated_lengths, double *estimated_transfer_length, int *suitable_components);
+unsigned starpu_mct_compute_execution_times(struct starpu_sched_component *component, struct starpu_task *task,
+				       double *estimated_lengths, double *estimated_transfer_length, unsigned *suitable_components);
 
 
 
 
 void starpu_mct_compute_expected_times(struct starpu_sched_component *component, struct starpu_task *task,
 void starpu_mct_compute_expected_times(struct starpu_sched_component *component, struct starpu_task *task,
 		double *estimated_lengths, double *estimated_transfer_length, double *estimated_ends_with_task,
 		double *estimated_lengths, double *estimated_transfer_length, double *estimated_ends_with_task,
-				       double *min_exp_end_with_task, double *max_exp_end_with_task, int *suitable_components, int nsuitable_components);
+				       double *min_exp_end_with_task, double *max_exp_end_with_task, unsigned *suitable_components, unsigned nsuitable_components);
 
 
 double starpu_mct_compute_fitness(struct _starpu_mct_data * d, double exp_end, double min_exp_end, double max_exp_end, double transfer_len, double local_energy);
 double starpu_mct_compute_fitness(struct _starpu_mct_data * d, double exp_end, double min_exp_end, double max_exp_end, double transfer_len, double local_energy);