Browse Source

hypervisor: fix use of unused variables

Samuel Pitoiset 9 years ago
parent
commit
bdae1fb9cb

+ 3 - 3
sc_hypervisor/examples/sched_ctx_utils/sched_ctx_utils.c

@@ -246,11 +246,11 @@ void construct_contexts(void (*bench)(float*, unsigned, unsigned))
 	void *perf_counters = sc_hypervisor_init(&policy);
 	int nworkers1 = cpu1 + gpu + gpu1;
 	int nworkers2 = cpu2 + gpu + gpu2;
-	unsigned n_all_gpus = gpu + gpu1 + gpu2;
+	/* unsigned n_all_gpus = gpu + gpu1 + gpu2; */
 
 
 	int i;
-	int k = 0;
+	/* int k = 0; */
 	nworkers1 = 12;
 	p1.workers = (int*)malloc(nworkers1*sizeof(int));
 
@@ -292,7 +292,7 @@ void construct_contexts(void (*bench)(float*, unsigned, unsigned))
 				   SC_HYPERVISOR_MAX_WORKERS, 12,
 				   NULL);
 
-	k = 0;
+	/* k = 0; */
 	p2.workers = (int*)malloc(nworkers2*sizeof(int));
 
 	/* for(i = 0; i < gpu; i++) */

+ 1 - 3
sc_hypervisor/src/hypervisor_policies/feft_lp_policy.c

@@ -40,7 +40,6 @@ static void _try_resizing(unsigned *sched_ctxs, int nsched_ctxs, int *workers, i
 
 	int total_nw[nw];
 	sc_hypervisor_group_workers_by_type(tw, total_nw);
-	unsigned can_redistrib = 0;
 
 	
 	struct timeval start_time;
@@ -175,7 +174,6 @@ static void _resize_if_speed_diff(unsigned sched_ctx, int worker)
 		unsigned *sched_ctxs_old = NULL;
 		int nsched_ctxs_old = 0;
 		unsigned is_speed_diff = 0;
-		unsigned last_level_diff = 0;
 
 		for(level = current_level ; level >= 0; level--)
 		{
@@ -297,7 +295,7 @@ static void feft_lp_size_ctxs(unsigned *sched_ctxs, int nsched_ctxs, int *worker
 
 static void _resize_leaves(int worker)
 {
-	unsigned s, s2;
+	unsigned s;
 	unsigned *sched_ctxs = NULL;
 	unsigned nsched_ctxs = starpu_worker_get_sched_ctx_list(worker, &sched_ctxs);
        	unsigned workers_sched_ctxs[nsched_ctxs];

+ 2 - 2
sc_hypervisor/src/hypervisor_policies/hard_coded_policy.c

@@ -63,7 +63,7 @@ void hard_coded_handle_idle_cycle(unsigned sched_ctx, int worker)
 					w_in_s[1][1] = 0;
 
 //				sc_hypervisor_lp_place_resources_in_ctx(ns, nw, w_in_s, sched_ctxs, NULL, 1, tw);
-					sc_hypervisor_lp_distribute_floating_no_resources_in_ctxs(sc_hypervisor_get_sched_ctxs(), ns, tw->nw, w_in_s, NULL, nworkers, tw);
+					sc_hypervisor_lp_distribute_floating_no_resources_in_ctxs(sched_ctxs, ns, tw->nw, w_in_s, NULL, nworkers, tw);
 					free(tw);
 				}
 			}	
@@ -97,7 +97,7 @@ static void hard_coded_handle_poped_task(unsigned sched_ctx, __attribute__((unus
 				w_in_s[1][0] = 8;
 				w_in_s[1][1] = 0;
 //				sc_hypervisor_lp_place_resources_in_ctx(ns, nw, w_in_s, sched_ctxs, NULL, 1, tw);
-				sc_hypervisor_lp_distribute_floating_no_resources_in_ctxs(sc_hypervisor_get_sched_ctxs(), ns, tw->nw, w_in_s, NULL, nworkers, tw);
+				sc_hypervisor_lp_distribute_floating_no_resources_in_ctxs(sched_ctxs, ns, tw->nw, w_in_s, NULL, nworkers, tw);
 				free(tw);
 			}
 			starpu_pthread_mutex_unlock(&act_hypervisor_mutex);

+ 0 - 4
sc_hypervisor/src/hypervisor_policies/teft_lp_policy.c

@@ -259,8 +259,6 @@ static void teft_lp_handle_poped_task(unsigned sched_ctx, int worker, struct sta
 {
 	if(worker > -2)
 	{
-		struct sc_hypervisor_wrapper* sc_w = sc_hypervisor_get_wrapper(sched_ctx);
-		
 		int ret = starpu_pthread_mutex_trylock(&act_hypervisor_mutex);
 		if(ret != EBUSY)
 		{
@@ -289,8 +287,6 @@ static void teft_lp_handle_idle_cycle(unsigned sched_ctx, int worker)
 	unsigned criteria = sc_hypervisor_get_resize_criteria();
 	if(criteria != SC_NOTHING)// && criteria == SC_IDLE)
 	{
-		struct sc_hypervisor_wrapper* sc_w = sc_hypervisor_get_wrapper(sched_ctx);
-		
 		int ret = starpu_pthread_mutex_trylock(&act_hypervisor_mutex);
 		if(ret != EBUSY)
 		{

+ 2 - 2
sc_hypervisor/src/policies_utils/lp_programs.c

@@ -285,10 +285,10 @@ double sc_hypervisor_lp_simulate_distrib_flops(int ns, int nw, double v[ns][nw],
 	   and another column corresponding to the 1/tmax bound (bc 1/tmax is a variable too)*/
 	glp_add_cols(lp, nw*ns+1);
 
-	struct sc_hypervisor_wrapper *sc_w = NULL;
+	/* struct sc_hypervisor_wrapper *sc_w = NULL; */
 	for(s = 0; s < ns; s++)
 	{
-		sc_w = sc_hypervisor_get_wrapper(sched_ctxs[s]);
+		/* sc_w = sc_hypervisor_get_wrapper(sched_ctxs[s]); */
 		struct sc_hypervisor_policy_config *config = sc_hypervisor_get_config(sched_ctxs[s]);
 		for(w = 0; w < nw; w++)
 		{

+ 1 - 1
sc_hypervisor/src/policies_utils/policy_tools.c

@@ -510,7 +510,7 @@ unsigned sc_hypervisor_check_speed_gap_btw_ctxs(unsigned *sched_ctxs_in, int ns_
 		int total_nw[nw];
 		sc_hypervisor_group_workers_by_type(tw, total_nw);
 
-		double vmax = sc_hypervisor_lp_get_nworkers_per_ctx(ns, nw, nworkers_per_ctx, total_nw, tw, sched_ctxs);
+//		double vmax = sc_hypervisor_lp_get_nworkers_per_ctx(ns, nw, nworkers_per_ctx, total_nw, tw, sched_ctxs);
 
 		
 //		if(vmax != 0.0)

+ 1 - 1
sc_hypervisor/src/sc_hypervisor.c

@@ -891,7 +891,7 @@ void _sc_hypervisor_allow_compute_idle(unsigned sched_ctx, int worker, unsigned
 
 int _update_max_hierarchically(unsigned *sched_ctxs, int nsched_ctxs)
 {
-	int s, i;
+	int s;
 	unsigned leaves[hypervisor.nsched_ctxs];
 	int nleaves = 0;
 	sc_hypervisor_get_leaves(hypervisor.sched_ctxs, hypervisor.nsched_ctxs, leaves, &nleaves);