Selaa lähdekoodia

cleaned printfs

Andra Hugo 12 vuotta sitten
vanhempi
commit
9a8788623f

+ 4 - 4
sched_ctx_hypervisor/src/hypervisor_policies/lp2_policy.c

@@ -108,11 +108,11 @@ static unsigned _compute_task_distribution_over_ctxs(int ns, int nw, int nt, dou
 	gettimeofday(&end_time, NULL);
 	gettimeofday(&end_time, NULL);
 
 
 	long diff_s = end_time.tv_sec  - start_time.tv_sec;
 	long diff_s = end_time.tv_sec  - start_time.tv_sec;
-        long diff_us = end_time.tv_usec  - start_time.tv_usec;
-
-        float timing = (float)(diff_s*1000000 + diff_us)/1000;
+	long diff_us = end_time.tv_usec  - start_time.tv_usec;
+	
+	float timing = (float)(diff_s*1000000 + diff_us)/1000;
 
 
-        fprintf(stdout, "nd = %d total time: %f ms \n", nd, timing);
+//        fprintf(stdout, "nd = %d total time: %f ms \n", nd, timing);
 
 
 	return found_sol;
 	return found_sol;
 }
 }

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

@@ -44,24 +44,10 @@ static void lp_handle_poped_task(unsigned sched_ctx, int worker)
 
 
 			float timing = (float)(diff_s*1000000 + diff_us)/1000;
 			float timing = (float)(diff_s*1000000 + diff_us)/1000;
 
 
-			fprintf(stdout, "total time: %f ms \n", timing);
-
 			if(vmax != 0.0)
 			if(vmax != 0.0)
 			{
 			{
-//				printf("********resize\n");
-/* 			for( i = 0; i < nsched_ctxs; i++) */
-/* 			{ */
-/* 				printf("ctx %d/worker type %d: n = %lf \n", i, 0, res[i][0]); */
-/* 				printf("ctx %d/worker type %d: n = %lf \n", i, 1, res[i][1]); */
-/* 			} */
 				int nworkers_rounded[nsched_ctxs][2];
 				int nworkers_rounded[nsched_ctxs][2];
-				_lp_round_double_to_int(nsched_ctxs, 2, nworkers, nworkers_rounded);
-  /*     		for( i = 0; i < nsched_ctxs; i++) */
-/* 			{ */
-/* 				printf("ctx %d/worker type %d: n = %d \n", i, 0, res_rounded[i][0]); */
-/* 				printf("ctx %d/worker type %d: n = %d \n", i, 1, res_rounded[i][1]); */
-/* 			} */
-				
+				_lp_round_double_to_int(nsched_ctxs, 2, nworkers, nworkers_rounded);				
 				_lp_redistribute_resources_in_ctxs(nsched_ctxs, 2, nworkers_rounded, nworkers);
 				_lp_redistribute_resources_in_ctxs(nsched_ctxs, 2, nworkers_rounded, nworkers);
 			}
 			}
 			pthread_mutex_unlock(&act_hypervisor_mutex);
 			pthread_mutex_unlock(&act_hypervisor_mutex);

+ 24 - 24
sched_ctx_hypervisor/src/sched_ctx_hypervisor.c

@@ -347,11 +347,11 @@ void sched_ctx_hypervisor_move_workers(unsigned sender_sched_ctx, unsigned recei
 {
 {
 	if(nworkers_to_move > 0 && hypervisor.resize[sender_sched_ctx])// && hypervisor.resize[receiver_sched_ctx])
 	if(nworkers_to_move > 0 && hypervisor.resize[sender_sched_ctx])// && hypervisor.resize[receiver_sched_ctx])
 	{
 	{
-		int j;
-		printf("resize ctx %d with", sender_sched_ctx);
-		for(j = 0; j < nworkers_to_move; j++)
-			printf(" %d", workers_to_move[j]);
-		printf("\n");
+/* 		int j; */
+/* 		printf("resize ctx %d with", sender_sched_ctx); */
+/* 		for(j = 0; j < nworkers_to_move; j++) */
+/* 			printf(" %d", workers_to_move[j]); */
+/* 		printf("\n"); */
 		
 		
 		int *cpus = (int*) malloc(nworkers_to_move * sizeof(int));
 		int *cpus = (int*) malloc(nworkers_to_move * sizeof(int));
 		int ncpus;
 		int ncpus;
@@ -365,11 +365,11 @@ void sched_ctx_hypervisor_move_workers(unsigned sender_sched_ctx, unsigned recei
 
 
 		if(now)
 		if(now)
 		{
 		{
-			int j;
-			printf("remove from ctx %d:", sender_sched_ctx);
-			for(j = 0; j < nworkers_to_move; j++)
-				printf(" %d", workers_to_move[j]);
-			printf("\n");
+/* 			int j; */
+/* 			printf("remove from ctx %d:", sender_sched_ctx); */
+/* 			for(j = 0; j < nworkers_to_move; j++) */
+/* 				printf(" %d", workers_to_move[j]); */
+/* 			printf("\n"); */
 			
 			
 			starpu_remove_workers_from_sched_ctx(workers_to_move, nworkers_to_move, sender_sched_ctx);
 			starpu_remove_workers_from_sched_ctx(workers_to_move, nworkers_to_move, sender_sched_ctx);
 		}
 		}
@@ -411,10 +411,10 @@ void sched_ctx_hypervisor_add_workers_to_sched_ctx(int* workers_to_add, unsigned
 	if(nworkers_to_add > 0 && hypervisor.resize[sched_ctx])
 	if(nworkers_to_add > 0 && hypervisor.resize[sched_ctx])
 	{
 	{
 		int j;
 		int j;
-		printf("add to ctx %d:", sched_ctx);
-		for(j = 0; j < nworkers_to_add; j++)
-			printf(" %d", workers_to_add[j]);
-		printf("\n");
+/* 		printf("add to ctx %d:", sched_ctx); */
+/* 		for(j = 0; j < nworkers_to_add; j++) */
+/* 			printf(" %d", workers_to_add[j]); */
+/* 		printf("\n"); */
 		starpu_add_workers_to_sched_ctx(workers_to_add, nworkers_to_add, sched_ctx);
 		starpu_add_workers_to_sched_ctx(workers_to_add, nworkers_to_add, sched_ctx);
 		struct policy_config *new_config = sched_ctx_hypervisor_get_config(sched_ctx);
 		struct policy_config *new_config = sched_ctx_hypervisor_get_config(sched_ctx);
 		int i;
 		int i;
@@ -439,11 +439,11 @@ void sched_ctx_hypervisor_remove_workers_from_sched_ctx(int* workers_to_remove,
 	
 	
 		if(now)
 		if(now)
 		{
 		{
-				int j;
-				printf("remove from ctx %d:", sched_ctx);
-				for(j = 0; j < nworkers_to_remove; j++)
-					printf(" %d", workers_to_remove[j]);
-				printf("\n");
+/* 				int j; */
+/* 				printf("remove from ctx %d:", sched_ctx); */
+/* 				for(j = 0; j < nworkers_to_remove; j++) */
+/* 					printf(" %d", workers_to_remove[j]); */
+/* 				printf("\n"); */
 				
 				
 				starpu_remove_workers_from_sched_ctx(workers_to_remove, nworkers_to_remove, sched_ctx);
 				starpu_remove_workers_from_sched_ctx(workers_to_remove, nworkers_to_remove, sched_ctx);
 		}
 		}
@@ -580,11 +580,11 @@ static unsigned _ack_resize_completed(unsigned sched_ctx, int worker)
 			   whatever the application says */
 			   whatever the application says */
 			if(!((hypervisor.resize[sender_sched_ctx] == 0 || hypervisor.resize[receiver_sched_ctx] == 0) && imposed_resize))
 			if(!((hypervisor.resize[sender_sched_ctx] == 0 || hypervisor.resize[receiver_sched_ctx] == 0) && imposed_resize))
 			{				
 			{				
-				int j;
-				printf("remove from ctx %d:", sender_sched_ctx);
-				for(j = 0; j < nmoved_workers; j++)
-					printf(" %d", moved_workers[j]);
-				printf("\n");
+/* 				int j; */
+/* 				printf("remove from ctx %d:", sender_sched_ctx); */
+/* 				for(j = 0; j < nmoved_workers; j++) */
+/* 					printf(" %d", moved_workers[j]); */
+/* 				printf("\n"); */
 				
 				
 				starpu_remove_workers_from_sched_ctx(moved_workers, nmoved_workers, sender_sched_ctx);
 				starpu_remove_workers_from_sched_ctx(moved_workers, nmoved_workers, sender_sched_ctx);