浏览代码

renaming ioctl -> ctl

Andra Hugo 12 年之前
父节点
当前提交
aef7c1a3f3

+ 10 - 10
doc/doxygen/chapters/api/scheduling_context_hypervisor.doxy

@@ -178,14 +178,14 @@ finished executing
 \ingroup API_Scheduling_Context_Hypervisor
 Requires reconsidering the distribution of ressources over the indicated scheduling contexts 
 
-\fn void sc_hypervisor_ioctl(unsigned sched_ctx, ...)
+\fn void sc_hypervisor_ctl(unsigned sched_ctx, ...)
 \ingroup API_Scheduling_Context_Hypervisor
 Inputs conditions to the context sched_ctx with the following
 arguments. The argument list must be zero-terminated.
 
 \def HYPERVISOR_MAX_IDLE
 \ingroup API_Scheduling_Context_Hypervisor
-This macro is used when calling sc_hypervisor_ioctl() and must be
+This macro is used when calling sc_hypervisor_ctl() and must be
 followed by 3 arguments: an array of int for the workerids to apply
 the condition, an int to indicate the size of the array, and a double
 value indicating the maximum idle time allowed for a worker before the
@@ -193,7 +193,7 @@ resizing process should be triggered
 
 \def HYPERVISOR_PRIORITY
 \ingroup API_Scheduling_Context_Hypervisor
-This macro is used when calling sc_hypervisor_ioctl() and must be
+This macro is used when calling sc_hypervisor_ctl() and must be
 followed by 3 arguments: an array of int for the workerids to apply
 the condition, an int to indicate the size of the array, and an int
 value indicating the priority of the workers previously mentioned. The
@@ -201,20 +201,20 @@ workers with the smallest priority are moved the first.
 
 \def HYPERVISOR_MIN_WORKERS
 \ingroup API_Scheduling_Context_Hypervisor
-This macro is used when calling sc_hypervisor_ioctl() and must be
+This macro is used when calling sc_hypervisor_ctl() and must be
 followed by 1 argument(int) indicating the minimum number of workers a
 context should have, underneath this limit the context cannot execute.
 
 \def HYPERVISOR_MAX_WORKERS
 \ingroup API_Scheduling_Context_Hypervisor
-This macro is used when calling sc_hypervisor_ioctl() and must be
+This macro is used when calling sc_hypervisor_ctl() and must be
 followed by 1 argument(int) indicating the maximum number of workers a
 context should have, above this limit the context would not be able to
 scale
 
 \def HYPERVISOR_GRANULARITY
 \ingroup API_Scheduling_Context_Hypervisor
-This macro is used when calling sc_hypervisor_ioctl() and must be
+This macro is used when calling sc_hypervisor_ctl() and must be
 followed by 1 argument(int) indicating the granularity of the resizing
 process (the number of workers should be moved from the context once
 it is resized) This parameter is ignore for the Gflops rate based
@@ -223,14 +223,14 @@ be moved is calculated by the strategy.
 
 \def HYPERVISOR_FIXED_WORKERS
 \ingroup API_Scheduling_Context_Hypervisor
-This macro is used when calling sc_hypervisor_ioctl() and must be
+This macro is used when calling sc_hypervisor_ctl() and must be
 followed by 2 arguments: an array of int for the workerids to apply
 the condition and an int to indicate the size of the array. These
 workers are not allowed to be moved from the context.
 
 \def HYPERVISOR_MIN_TASKS
 \ingroup API_Scheduling_Context_Hypervisor
-This macro is used when calling sc_hypervisor_ioctl() and must be
+This macro is used when calling sc_hypervisor_ctl() and must be
 followed by 1 argument (int) that indicated the minimum number of
 tasks that have to be executed before the context could be resized.
 This parameter is ignored for the Application Driven strategy (see \ref 
@@ -239,14 +239,14 @@ should be done.
 
 \def HYPERVISOR_NEW_WORKERS_MAX_IDLE
 \ingroup API_Scheduling_Context_Hypervisor
-This macro is used when calling sc_hypervisor_ioctl() and must be
+This macro is used when calling sc_hypervisor_ctl() and must be
 followed by 1 argument, a double value indicating the maximum idle
 time allowed for workers that have just been moved from other contexts
 in the current context.
 
 \def HYPERVISOR_TIME_TO_APPLY
 \ingroup API_Scheduling_Context_Hypervisor
-This macro is used when calling sc_hypervisor_ioctl() and must be
+This macro is used when calling sc_hypervisor_ctl() and must be
 followed by 1 argument (int) indicating the tag an executed task
 should have such that this configuration should be taken into account.
 

+ 2 - 2
doc/doxygen/chapters/scheduling_context_hypervisor.doxy

@@ -92,7 +92,7 @@ sc_hypervisor_resize(sched_ctx, 2);
 The user can use the same tag to change the resizing configuration of the contexts if he considers it necessary.
 
 \code{.c}
-sc_hypervisor_ioctl(sched_ctx,
+sc_hypervisor_ctl(sched_ctx,
                     HYPERVISOR_MIN_WORKERS, 6,
                     HYPERVISOR_MAX_WORKERS, 12,
                     HYPERVISOR_TIME_TO_APPLY, 2,
@@ -107,7 +107,7 @@ for a period longer than the one imposed by the user
 \code{.c}
 int workerids[3] = {1, 3, 10};
 int workerids2[9] = {0, 2, 4, 5, 6, 7, 8, 9, 11};
-sc_hypervisor_ioctl(sched_ctx_id,
+sc_hypervisor_ctl(sched_ctx_id,
             HYPERVISOR_MAX_IDLE, workerids, 3, 10000.0,
             HYPERVISOR_MAX_IDLE, workerids2, 9, 50000.0,
             NULL);

+ 1 - 1
sc_hypervisor/examples/app_driven_test/app_driven_test.c

@@ -80,7 +80,7 @@ void* submit_tasks_thread(void *arg)
 			task[i]->hypervisor_tag = tag;
 			/* indicate particular settings the context should have when the 
 			   resizing will be done */
-			sc_hypervisor_ioctl(sched_ctx,
+			sc_hypervisor_ctl(sched_ctx,
 						   HYPERVISOR_TIME_TO_APPLY, tag,
 						   HYPERVISOR_MIN_WORKERS, 2,
 						   HYPERVISOR_MAX_WORKERS, 12,

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

@@ -272,7 +272,7 @@ void construct_contexts(void (*bench)(float*, unsigned, unsigned))
 	p1.nworkers = nworkers1;
 	sc_hypervisor_register_ctx(p1.ctx, 0.0);
 
-	/* sc_hypervisor_ioctl(p1.ctx, */
+	/* sc_hypervisor_ctl(p1.ctx, */
 	/* 			   HYPERVISOR_MAX_IDLE, p1.workers, p1.nworkers, 5000.0, */
 	/* 			   HYPERVISOR_MAX_IDLE, p1.workers, gpu+gpu1, 100000.0, */
 	/* 			   HYPERVISOR_EMPTY_CTX_MAX_IDLE, p1.workers, p1.nworkers, 500000.0, */
@@ -283,7 +283,7 @@ void construct_contexts(void (*bench)(float*, unsigned, unsigned))
 	/* 			   HYPERVISOR_MAX_WORKERS, 12, */
 	/* 			   NULL); */
 
-	sc_hypervisor_ioctl(p1.ctx,
+	sc_hypervisor_ctl(p1.ctx,
 				   HYPERVISOR_GRANULARITY, 2,
 				   HYPERVISOR_MIN_TASKS, 1000,
 				   HYPERVISOR_MIN_WORKERS, 6,
@@ -308,7 +308,7 @@ void construct_contexts(void (*bench)(float*, unsigned, unsigned))
 	p2.nworkers = 0;
 	sc_hypervisor_register_ctx(p2.ctx, 0.0);
 
-	/* sc_hypervisor_ioctl(p2.ctx, */
+	/* sc_hypervisor_ctl(p2.ctx, */
 	/* 			   HYPERVISOR_MAX_IDLE, p2.workers, p2.nworkers, 2000.0, */
 	/* 			   HYPERVISOR_MAX_IDLE, p2.workers, gpu+gpu2, 5000.0, */
 	/* 			   HYPERVISOR_EMPTY_CTX_MAX_IDLE, p1.workers, p1.nworkers, 500000.0, */
@@ -319,7 +319,7 @@ void construct_contexts(void (*bench)(float*, unsigned, unsigned))
 	/* 			   HYPERVISOR_MAX_WORKERS, 8, */
 	/* 			   NULL); */
 
-	sc_hypervisor_ioctl(p2.ctx,
+	sc_hypervisor_ctl(p2.ctx,
 				   HYPERVISOR_GRANULARITY, 2,
 				   HYPERVISOR_MIN_TASKS, 500,
 				   HYPERVISOR_MIN_WORKERS, 0,
@@ -337,14 +337,14 @@ void set_hypervisor_conf(int event, int task_tag)
 /* 		{ */
 /* 			if(it < 2) */
 /* 			{ */
-/* 				sc_hypervisor_ioctl(p2.ctx, */
+/* 				sc_hypervisor_ctl(p2.ctx, */
 /* 							   HYPERVISOR_MIN_WORKERS, 2, */
 /* 							   HYPERVISOR_MAX_WORKERS, 4, */
 /* 							   HYPERVISOR_TIME_TO_APPLY, task_tag, */
 /* 							   NULL); */
 
 /* 				printf("%d: set max %d for tag %d\n", p2.ctx, 4, task_tag); */
-/* 				sc_hypervisor_ioctl(p1.ctx, */
+/* 				sc_hypervisor_ctl(p1.ctx, */
 /* 							   HYPERVISOR_MIN_WORKERS, 6, */
 /* 							   HYPERVISOR_MAX_WORKERS, 8, */
 /* 							   HYPERVISOR_TIME_TO_APPLY, task_tag, */
@@ -354,13 +354,13 @@ void set_hypervisor_conf(int event, int task_tag)
 /* 			} */
 /* 			if(it == 2) */
 /* 			{ */
-/* 				sc_hypervisor_ioctl(p2.ctx, */
+/* 				sc_hypervisor_ctl(p2.ctx, */
 /* 							   HYPERVISOR_MIN_WORKERS, 12, */
 /* 							   HYPERVISOR_MAX_WORKERS, 12, */
 /* 							   HYPERVISOR_TIME_TO_APPLY, task_tag, */
 /* 							   NULL); */
 /* 				printf("%d: set max %d for tag %d\n", p2.ctx, 12, task_tag); */
-/* 				sc_hypervisor_ioctl(p1.ctx, */
+/* 				sc_hypervisor_ctl(p1.ctx, */
 /* 							   HYPERVISOR_MIN_WORKERS, 0, */
 /* 							   HYPERVISOR_MAX_WORKERS, 0, */
 /* 							   HYPERVISOR_TIME_TO_APPLY, task_tag, */
@@ -378,13 +378,13 @@ void set_hypervisor_conf(int event, int task_tag)
 /* 		{ */
 /* 			if(it2 < 3) */
 /* 			{ */
-/* 				sc_hypervisor_ioctl(p1.ctx, */
+/* 				sc_hypervisor_ctl(p1.ctx, */
 /* 							   HYPERVISOR_MIN_WORKERS, 6, */
 /* 							   HYPERVISOR_MAX_WORKERS, 12, */
 /* 							   HYPERVISOR_TIME_TO_APPLY, task_tag, */
 /* 							   NULL); */
 /* 				printf("%d: set max %d for tag %d\n", p1.ctx, 12, task_tag); */
-/* 				sc_hypervisor_ioctl(p2.ctx, */
+/* 				sc_hypervisor_ctl(p2.ctx, */
 /* 							   HYPERVISOR_MIN_WORKERS, 0, */
 /* 							   HYPERVISOR_MAX_WORKERS, 0, */
 /* 							   HYPERVISOR_TIME_TO_APPLY, task_tag, */
@@ -401,7 +401,7 @@ void set_hypervisor_conf(int event, int task_tag)
 	/* 	if(event == START_BENCH) */
 	/* 	{ */
 	/* 		int workers[12] = {0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11}; */
-	/* 		sc_hypervisor_ioctl(p1.ctx, */
+	/* 		sc_hypervisor_ctl(p1.ctx, */
 	/* 					   HYPERVISOR_MAX_IDLE, workers, 12, 800000.0, */
 	/* 					   HYPERVISOR_TIME_TO_APPLY, task_tag, */
 	/* 					   NULL); */
@@ -411,7 +411,7 @@ void set_hypervisor_conf(int event, int task_tag)
 	/* 		if(it2 < 2) */
 	/* 		{ */
 	/* 			int workers[12] = {0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11}; */
-	/* 			sc_hypervisor_ioctl(p2.ctx, */
+	/* 			sc_hypervisor_ctl(p2.ctx, */
 	/* 						   HYPERVISOR_MAX_IDLE, workers, 12, 500.0, */
 	/* 						   HYPERVISOR_MAX_IDLE, workers, 3, 200.0, */
 	/* 						   HYPERVISOR_TIME_TO_APPLY, task_tag, */
@@ -420,7 +420,7 @@ void set_hypervisor_conf(int event, int task_tag)
 	/* 		if(it2 == 2) */
 	/* 		{ */
 	/* 			int workers[12] = {0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11}; */
-	/* 			sc_hypervisor_ioctl(p2.ctx, */
+	/* 			sc_hypervisor_ctl(p2.ctx, */
 	/* 						   HYPERVISOR_MAX_IDLE, workers, 12, 1000.0, */
 	/* 						   HYPERVISOR_MAX_IDLE, workers, 3, 500.0, */
 	/* 						   HYPERVISOR_TIME_TO_APPLY, task_tag, */
@@ -434,7 +434,7 @@ void set_hypervisor_conf(int event, int task_tag)
 	/* 	if(event == START_BENCH) */
 	/* 	{ */
 	/* 		int workers[12] = {0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11}; */
-	/* 		sc_hypervisor_ioctl(p1.ctx, */
+	/* 		sc_hypervisor_ctl(p1.ctx, */
 	/* 					   HYPERVISOR_MAX_IDLE, workers, 12, 1500.0, */
 	/* 					   HYPERVISOR_MAX_IDLE, workers, 3, 4000.0, */
 	/* 					   HYPERVISOR_TIME_TO_APPLY, task_tag, */
@@ -445,7 +445,7 @@ void set_hypervisor_conf(int event, int task_tag)
 	/* 		if(it < 2) */
 	/* 		{ */
 	/* 			int workers[12] = {0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11}; */
-	/* 			sc_hypervisor_ioctl(p1.ctx, */
+	/* 			sc_hypervisor_ctl(p1.ctx, */
 	/* 						   HYPERVISOR_MAX_IDLE, workers, 12, 100.0, */
 	/* 						   HYPERVISOR_MAX_IDLE, workers, 3, 5000.0, */
 	/* 						   HYPERVISOR_TIME_TO_APPLY, task_tag, */
@@ -454,7 +454,7 @@ void set_hypervisor_conf(int event, int task_tag)
 	/* 		if(it == 2) */
 	/* 		{ */
 	/* 			int workers[12] = {0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11}; */
-	/* 			sc_hypervisor_ioctl(p1.ctx, */
+	/* 			sc_hypervisor_ctl(p1.ctx, */
 	/* 						   HYPERVISOR_MAX_IDLE, workers, 12, 5000.0, */
 	/* 						   HYPERVISOR_MAX_IDLE, workers, 3, 10000.0, */
 	/* 						   HYPERVISOR_TIME_TO_APPLY, task_tag, */

+ 2 - 2
sc_hypervisor/include/sc_hypervisor_config.h

@@ -24,7 +24,7 @@ extern "C"
 {
 #endif
 
-/* ioctl properties*/
+/* ctl properties*/
 #define HYPERVISOR_MAX_IDLE -1
 #define HYPERVISOR_MIN_WORKING -2
 #define HYPERVISOR_PRIORITY -3
@@ -90,7 +90,7 @@ void sc_hypervisor_set_config(unsigned sched_ctx, void *config);
 struct sc_hypervisor_policy_config *sc_hypervisor_get_config(unsigned sched_ctx);
 
 /* impose different parameters to a configuration of a context */
-void sc_hypervisor_ioctl(unsigned sched_ctx, ...);
+void sc_hypervisor_ctl(unsigned sched_ctx, ...);
 
 #ifdef __cplusplus
 }

+ 3 - 3
sc_hypervisor/src/sc_config.c

@@ -102,7 +102,7 @@ struct sc_hypervisor_policy_config* sc_hypervisor_get_config(unsigned sched_ctx)
 	return hypervisor.sched_ctx_w[sched_ctx].config;
 }
 
-static struct sc_hypervisor_policy_config* _ioctl(unsigned sched_ctx, va_list varg_list, unsigned later)
+static struct sc_hypervisor_policy_config* _ctl(unsigned sched_ctx, va_list varg_list, unsigned later)
 {
 	struct sc_hypervisor_policy_config *config = NULL;
 
@@ -215,7 +215,7 @@ static struct sc_hypervisor_policy_config* _ioctl(unsigned sched_ctx, va_list va
 }
 
 
-void sc_hypervisor_ioctl(unsigned sched_ctx, ...)
+void sc_hypervisor_ctl(unsigned sched_ctx, ...)
 {
 	va_list varg_list;
 	va_start(varg_list, sched_ctx);
@@ -246,7 +246,7 @@ void sc_hypervisor_ioctl(unsigned sched_ctx, ...)
 	va_start(varg_list, sched_ctx);
 
 	/* if config not null => save hypervisor configuration and consider it later */
-	struct sc_hypervisor_policy_config *config = _ioctl(sched_ctx, varg_list, (task_tag > 0));
+	struct sc_hypervisor_policy_config *config = _ctl(sched_ctx, varg_list, (task_tag > 0));
 	if(config != NULL)
 	{
 		struct configuration_entry *entry;