瀏覽代碼

hypervisor: Remove unused variables; fix statement with no effects.

Ludovic Courtès 12 年之前
父節點
當前提交
7809dee708

+ 1 - 1
sched_ctx_hypervisor/src/hypervisor_policies/gflops_rate_policy.c

@@ -243,7 +243,7 @@ static int _find_slowest_available_sched_ctx(unsigned sched_ctx)
 
 static void gflops_rate_resize(unsigned sched_ctx)
 {
-	double exp_end = _get_exp_end(sched_ctx);
+	_get_exp_end(sched_ctx);
 	double flops_left_pct = _get_flops_left_pct(sched_ctx);
 
 	/* if the context finished all the instructions it had to execute 

+ 2 - 3
sched_ctx_hypervisor/src/hypervisor_policies/lp2_policy.c

@@ -32,7 +32,7 @@ static unsigned _compute_task_distribution_over_ctxs(int ns, int nw, int nt, dou
 		for(t = 0; t < nt; t++)
 		{
 			tasks[w][t] = 0.0;
-			draft_tasks[w][t] == 0.0;
+			draft_tasks[w][t] = 0.0;
 		}
 	
 	for(s = 0; s < ns; s++)
@@ -120,8 +120,7 @@ static unsigned _compute_task_distribution_over_ctxs(int ns, int nw, int nt, dou
 static void _redistribute_resources_in_ctxs(int ns, int nw, int nt, double w_in_s[ns][nw], unsigned first_time, int *in_sched_ctxs, int *workers)
 {
 	int *sched_ctxs = in_sched_ctxs == NULL ? sched_ctx_hypervisor_get_sched_ctxs() : in_sched_ctxs;
-        struct bound_task_pool * tp;
-	int s, s2, w, t;
+	int s, s2, w;
 
 	for(s = 0; s < ns; s++)
 	{

+ 0 - 1
sched_ctx_hypervisor/src/hypervisor_policies/lp_policy.c

@@ -79,7 +79,6 @@ static void lp_size_ctxs(int *sched_ctxs, int ns, int *workers, int nworkers)
 	double vmax = _lp_get_nworkers_per_ctx(nsched_ctxs, 2, nworkers_per_type, total_nw);
 	if(vmax != 0.0)
 	{
-		int i;
 		printf("********size\n");
 /* 		for( i = 0; i < nsched_ctxs; i++) */
 /* 		{ */

+ 6 - 1
sched_ctx_hypervisor/src/hypervisor_policies/lp_tools.c

@@ -1,3 +1,4 @@
+#include <math.h>
 #include "lp_tools.h"
 
 #ifdef HAVE_GLPK_H
@@ -159,17 +160,21 @@ static double _glp_get_nworkers_per_ctx(int ns, int nw, double v[ns][nw], double
 double _lp_get_nworkers_per_ctx(int nsched_ctxs, int ntypes_of_workers, double res[nsched_ctxs][ntypes_of_workers], int total_nw[ntypes_of_workers])
 {
 	int *sched_ctxs = sched_ctx_hypervisor_get_sched_ctxs();
+#ifdef HAVE_GLPK_H
 	double v[nsched_ctxs][ntypes_of_workers];
 	double flops[nsched_ctxs];
+#endif
 	int i = 0;
 	struct sched_ctx_wrapper* sc_w;
 	for(i = 0; i < nsched_ctxs; i++)
 	{
 		sc_w = sched_ctx_hypervisor_get_wrapper(sched_ctxs[i]);
+#ifdef HAVE_GLPK_H
 		v[i][0] = 200.0;//_get_velocity_per_worker_type(sc_w, STARPU_CUDA_WORKER);
 		v[i][1] = 20.0;//_get_velocity_per_worker_type(sc_w, STARPU_CPU_WORKER);
 		flops[i] = sc_w->remaining_flops/1000000000; //sc_w->total_flops/1000000000; /* in gflops*/
 //			printf("%d: flops %lf\n", sched_ctxs[i], flops[i]);
+#endif
 	}
 
 #ifdef HAVE_GLPK_H	
@@ -352,7 +357,7 @@ void _lp_distribute_resources_in_ctxs(int* sched_ctxs, int ns, int nw, int res_r
 	int current_nworkers = workers == NULL ? starpu_worker_get_count() : nworkers;
 	int *current_sched_ctxs = sched_ctxs == NULL ? sched_ctx_hypervisor_get_sched_ctxs() : sched_ctxs;
 
-	int s, s2, w;
+	int s, w;
 	for(s = 0; s < ns; s++)
 	{
 		for(w = 0; w < nw; w++)