ソースを参照

rename hyp last step

Andra Hugo 12 年 前
コミット
545f5f5b3b

+ 5 - 5
sc_hypervisor/Makefile.am

@@ -17,11 +17,11 @@ SUBDIRS = src examples
 
 versincludedir = $(includedir)/starpu/$(STARPU_EFFECTIVE_VERSION)
 
-versinclude_HEADERS = 	include/sched_ctx_hypervisor.h 			\
-			include/sched_ctx_hypervisor_config.h 		\
-			include/sched_ctx_hypervisor_monitoring.h 	\
-			include/sched_ctx_hypervisor_policy.h 		\
-			include/sched_ctx_hypervisor_lp.h
+versinclude_HEADERS = 	include/sc_hypervisor.h 			\
+			include/sc_hypervisor_config.h 		\
+			include/sc_hypervisor_monitoring.h 	\
+			include/sc_hypervisor_policy.h 		\
+			include/sc_hypervisor_lp.h
 showcheck:
 	for i in $(SUBDIRS) ; do \
 		make -C $$i showcheck ; \

+ 4 - 4
sc_hypervisor/examples/Makefile.am

@@ -14,8 +14,8 @@
 # See the GNU Lesser General Public License in COPYING.LGPL for more details.
 
 AM_CFLAGS = -Wall $(STARPU_CUDA_CPPFLAGS) $(STARPU_OPENCL_CPPFLAGS) $(FXT_CFLAGS) $(MAGMA_CFLAGS) $(HWLOC_CFLAGS) $(GLOBAL_AM_CFLAGS)
-LIBS = $(top_builddir)/src/@LIBSTARPU_LINK@ @LIBS@ $(top_builddir)/sched_ctx_hypervisor/src/libsched_ctx_hypervisor.la
-AM_CPPFLAGS = -I$(top_srcdir)/include -I$(top_srcdir)/examples -I$(top_builddir)/include -I$(top_srcdir)/sched_ctx_hypervisor/include -I$(top_srcdir)/sched_ctx_hypervisor/examples
+LIBS = $(top_builddir)/src/@LIBSTARPU_LINK@ @LIBS@ $(top_builddir)/sc_hypervisor/src/libsc_hypervisor.la
+AM_CPPFLAGS = -I$(top_srcdir)/include -I$(top_srcdir)/examples -I$(top_builddir)/include -I$(top_srcdir)/sc_hypervisor/include -I$(top_srcdir)/sc_hypervisor/examples
 AM_LDFLAGS = $(STARPU_OPENCL_LDFLAGS) $(STARPU_CUDA_LDFLAGS) $(STARPU_GLPK_LDFLAGS)
 
 if !NO_BLAS_LIB
@@ -39,14 +39,14 @@ cholesky_cholesky_implicit_SOURCES =		\
 	$(top_srcdir)/examples/common/blas.c
 
 cholesky_cholesky_implicit_LDADD =		\
-	$(top_builddir)/sched_ctx_hypervisor/src/libsched_ctx_hypervisor.la \
+	$(top_builddir)/sc_hypervisor/src/libsc_hypervisor.la \
 	$(STARPU_BLAS_LDFLAGS)
 
 app_driven_test_app_driven_test_SOURCES =		\
 	app_driven_test/app_driven_test.c
 
 app_driven_test_app_driven_test_LDADD =		\
-	$(top_builddir)/sched_ctx_hypervisor/src/libsched_ctx_hypervisor.la
+	$(top_builddir)/sc_hypervisor/src/libsc_hypervisor.la
 
 endif
 

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

@@ -17,7 +17,7 @@
 #include <stdio.h>
 #include <stdint.h>
 #include <starpu.h>
-#include <sched_ctx_hypervisor.h>
+#include <sc_hypervisor.h>
 
 #define NTASKS 1000
 #define NINCR 10
@@ -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 */
-			sched_ctx_hypervisor_ioctl(sched_ctx,
+			sc_hypervisor_ioctl(sched_ctx,
 						   HYPERVISOR_TIME_TO_APPLY, tag,
 						   HYPERVISOR_MIN_WORKERS, 2,
 						   HYPERVISOR_MAX_WORKERS, 12,
@@ -88,7 +88,7 @@ void* submit_tasks_thread(void *arg)
 			printf("require resize for sched_ctx %d at tag %d\n", sched_ctx, tag);
 			/* specify that the contexts should be resized when the task having this
 			   particular tag will finish executing */
-			sched_ctx_hypervisor_resize(sched_ctx, tag);
+			sc_hypervisor_resize(sched_ctx, tag);
 		}
 
 		params[i].sched_ctx = sched_ctx;
@@ -127,13 +127,13 @@ int main()
 	unsigned sched_ctx2 = starpu_sched_ctx_create("dmda", ressources2, nres2, "sched_ctx2");
 
 	/* initialize the hypervisor */
-	struct sched_ctx_hypervisor_policy policy;
+	struct sc_hypervisor_policy policy;
 	policy.custom = 0;
 	/* indicate which strategy to use
 	   in this particular case we use app_driven which allows the user to resize 
 	   the ctxs dynamically at particular moments of the execution of the application */
 	policy.name = "app_driven";
-	void *perf_counters = sched_ctx_hypervisor_init(&policy);
+	void *perf_counters = sc_hypervisor_init(&policy);
 
 	/* let starpu know which performance counters should use 
 	   to inform the hypervisor how the application and the resources are executing */
@@ -143,8 +143,8 @@ int main()
 	/* register the contexts that should be managed by the hypervisor
 	   and indicate an approximate amount of workload if known;
 	   in this case we don't know it and we put 0 */
-	sched_ctx_hypervisor_register_ctx(sched_ctx1, 0.0);
-	sched_ctx_hypervisor_register_ctx(sched_ctx2, 0.0);
+	sc_hypervisor_register_ctx(sched_ctx1, 0.0);
+	sc_hypervisor_register_ctx(sched_ctx2, 0.0);
 
 	starpu_pthread_t tid[2];
 
@@ -162,7 +162,7 @@ int main()
 
 	/* free starpu and hypervisor data */
 	starpu_shutdown();
-	sched_ctx_hypervisor_shutdown();
+	sc_hypervisor_shutdown();
 
 	FPRINTF(stdout, "ctx = %d executed %d counter_tests out of %d \n", sched_ctx1, val[0], NTASKS*NINCR);
 	FPRINTF(stdout, "ctx = %d executed %d counter_tests out of %d \n", sched_ctx2, val[1], NTASKS*NINCR);

+ 7 - 7
sc_hypervisor/examples/lp_test/lp_test.c

@@ -17,7 +17,7 @@
 #include <stdio.h>
 #include <stdint.h>
 #include <starpu.h>
-#include <sched_ctx_hypervisor.h>
+#include <sc_hypervisor.h>
 
 #define NTASKS 1000
 #define NINCR 10
@@ -86,13 +86,13 @@ int main()
 	unsigned sched_ctx2 = starpu_sched_ctx_create("dmda", NULL, 0, "sched_ctx2");
 
 	/* initialize the hypervisor */
-	struct sched_ctx_hypervisor_policy policy;
+	struct sc_hypervisor_policy policy;
 	policy.custom = 0;
 	/* indicate which strategy to use
 	   in this particular case we use app_driven which allows the user to resize 
 	   the ctxs dynamically at particular moments of the execution of the application */
 	policy.name = "feft_lp";
-	void *perf_counters = sched_ctx_hypervisor_init(&policy);
+	void *perf_counters = sc_hypervisor_init(&policy);
 
 	/* let starpu know which performance counters should use 
 	   to inform the hypervisor how the application and the resources are executing */
@@ -104,11 +104,11 @@ int main()
 	/* register the contexts that should be managed by the hypervisor
 	   and indicate an approximate amount of workload if known;
 	   in this case we don't know it and we put 0 */
-	sched_ctx_hypervisor_register_ctx(sched_ctx1, flops1);
-	sched_ctx_hypervisor_register_ctx(sched_ctx2, flops2);
+	sc_hypervisor_register_ctx(sched_ctx1, flops1);
+	sc_hypervisor_register_ctx(sched_ctx2, flops2);
         /* lp strategy allows sizing the contexts because we know the total number of flops
 	   to be executed */
-	sched_ctx_hypervisor_size_ctxs(NULL, -1, NULL, -1);
+	sc_hypervisor_size_ctxs(NULL, -1, NULL, -1);
 
 	starpu_pthread_t tid[2];
 
@@ -126,7 +126,7 @@ int main()
 
 	/* free starpu and hypervisor data */
 	starpu_shutdown();
-	sched_ctx_hypervisor_shutdown();
+	sc_hypervisor_shutdown();
 
 	FPRINTF(stdout, "ctx = %d executed %d counter_tests out of %d \n", sched_ctx1, val[0], NTASKS*NINCR);
 	FPRINTF(stdout, "ctx = %d executed %d counter_tests out of %d \n", sched_ctx2, val[1], NTASKS*NINCR);

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

@@ -16,7 +16,7 @@
 
 #include "sched_ctx_utils.h"
 #include <starpu.h>
-#include "sched_ctx_hypervisor.h"
+#include "sc_hypervisor.h"
 #define NSAMPLES 3
 
 unsigned size1;
@@ -106,14 +106,14 @@ void* start_bench(void *val)
 	/* { */
 	/* 	starpu_pthread_mutex_lock(&mut); */
 	/* 	if(first){ */
-	/* 		sched_ctx_hypervisor_unregiser_ctx(p->ctx); */
+	/* 		sc_hypervisor_unregiser_ctx(p->ctx); */
 	/* 		starpu_sched_ctx_delete(p->ctx, p->the_other_ctx); */
 	/* 	} */
 
 	/* 	first = 0; */
 	/* 	starpu_pthread_mutex_unlock(&mut); */
 	/* } */
-	sched_ctx_hypervisor_stop_resize(p->the_other_ctx);
+	sc_hypervisor_stop_resize(p->the_other_ctx);
 	rv[p->id].flops /= NSAMPLES;
 	rv[p->id].avg_timing /= NSAMPLES;
 }
@@ -238,10 +238,10 @@ void start_2ndbench(void (*bench)(float*, unsigned, unsigned))
 
 void construct_contexts(void (*bench)(float*, unsigned, unsigned))
 {
-	struct sched_ctx_hypervisor_policy policy;
+	struct sc_hypervisor_policy policy;
 	policy.custom = 0;
 	policy.name = "idle";
-	struct starpu_sched_ctx_performance_counters *perf_counters = sched_ctx_hypervisor_init(&policy);
+	struct starpu_sched_ctx_performance_counters *perf_counters = sc_hypervisor_init(&policy);
 	int nworkers1 = cpu1 + gpu + gpu1;
 	int nworkers2 = cpu2 + gpu + gpu2;
 	unsigned n_all_gpus = gpu + gpu1 + gpu2;
@@ -270,9 +270,9 @@ void construct_contexts(void (*bench)(float*, unsigned, unsigned))
 	starpu_sched_ctx_set_perf_counters(p1.ctx, perf_counters);
 	p2.the_other_ctx = (int)p1.ctx;
 	p1.nworkers = nworkers1;
-	sched_ctx_hypervisor_register_ctx(p1.ctx, 0.0);
+	sc_hypervisor_register_ctx(p1.ctx, 0.0);
 
-	/* sched_ctx_hypervisor_ioctl(p1.ctx, */
+	/* sc_hypervisor_ioctl(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); */
 
-	sched_ctx_hypervisor_ioctl(p1.ctx,
+	sc_hypervisor_ioctl(p1.ctx,
 				   HYPERVISOR_GRANULARITY, 2,
 				   HYPERVISOR_MIN_TASKS, 1000,
 				   HYPERVISOR_MIN_WORKERS, 6,
@@ -306,9 +306,9 @@ void construct_contexts(void (*bench)(float*, unsigned, unsigned))
 	starpu_sched_ctx_set_perf_counters(p2.ctx, perf_counters);
 	p1.the_other_ctx = (int)p2.ctx;
 	p2.nworkers = 0;
-	sched_ctx_hypervisor_register_ctx(p2.ctx, 0.0);
+	sc_hypervisor_register_ctx(p2.ctx, 0.0);
 
-	/* sched_ctx_hypervisor_ioctl(p2.ctx, */
+	/* sc_hypervisor_ioctl(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); */
 
-	sched_ctx_hypervisor_ioctl(p2.ctx,
+	sc_hypervisor_ioctl(p2.ctx,
 				   HYPERVISOR_GRANULARITY, 2,
 				   HYPERVISOR_MIN_TASKS, 500,
 				   HYPERVISOR_MIN_WORKERS, 0,
@@ -337,36 +337,36 @@ void set_hypervisor_conf(int event, int task_tag)
 /* 		{ */
 /* 			if(it < 2) */
 /* 			{ */
-/* 				sched_ctx_hypervisor_ioctl(p2.ctx, */
+/* 				sc_hypervisor_ioctl(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); */
-/* 				sched_ctx_hypervisor_ioctl(p1.ctx, */
+/* 				sc_hypervisor_ioctl(p1.ctx, */
 /* 							   HYPERVISOR_MIN_WORKERS, 6, */
 /* 							   HYPERVISOR_MAX_WORKERS, 8, */
 /* 							   HYPERVISOR_TIME_TO_APPLY, task_tag, */
 /* 							   NULL); */
 /* 				printf("%d: set max %d for tag %d\n", p1.ctx, 8, task_tag); */
-/* 				sched_ctx_hypervisor_resize(p1.ctx, task_tag); */
+/* 				sc_hypervisor_resize(p1.ctx, task_tag); */
 /* 			} */
 /* 			if(it == 2) */
 /* 			{ */
-/* 				sched_ctx_hypervisor_ioctl(p2.ctx, */
+/* 				sc_hypervisor_ioctl(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); */
-/* 				sched_ctx_hypervisor_ioctl(p1.ctx, */
+/* 				sc_hypervisor_ioctl(p1.ctx, */
 /* 							   HYPERVISOR_MIN_WORKERS, 0, */
 /* 							   HYPERVISOR_MAX_WORKERS, 0, */
 /* 							   HYPERVISOR_TIME_TO_APPLY, task_tag, */
 /* 							   NULL); */
 /* 				printf("%d: set max %d for tag %d\n", p1.ctx, 0, task_tag); */
-/* 				sched_ctx_hypervisor_resize(p1.ctx, task_tag); */
+/* 				sc_hypervisor_resize(p1.ctx, task_tag); */
 /* 			} */
 /* 			it++; */
 
@@ -378,19 +378,19 @@ void set_hypervisor_conf(int event, int task_tag)
 /* 		{ */
 /* 			if(it2 < 3) */
 /* 			{ */
-/* 				sched_ctx_hypervisor_ioctl(p1.ctx, */
+/* 				sc_hypervisor_ioctl(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); */
-/* 				sched_ctx_hypervisor_ioctl(p2.ctx, */
+/* 				sc_hypervisor_ioctl(p2.ctx, */
 /* 							   HYPERVISOR_MIN_WORKERS, 0, */
 /* 							   HYPERVISOR_MAX_WORKERS, 0, */
 /* 							   HYPERVISOR_TIME_TO_APPLY, task_tag, */
 /* 							   NULL); */
 /* 				printf("%d: set max %d for tag %d\n", p2.ctx, 0, task_tag); */
-/* 				sched_ctx_hypervisor_resize(p2.ctx, task_tag); */
+/* 				sc_hypervisor_resize(p2.ctx, task_tag); */
 /* 			} */
 /* 			it2++; */
 /* 		} */
@@ -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}; */
-	/* 		sched_ctx_hypervisor_ioctl(p1.ctx, */
+	/* 		sc_hypervisor_ioctl(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}; */
-	/* 			sched_ctx_hypervisor_ioctl(p2.ctx, */
+	/* 			sc_hypervisor_ioctl(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}; */
-	/* 			sched_ctx_hypervisor_ioctl(p2.ctx, */
+	/* 			sc_hypervisor_ioctl(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}; */
-	/* 		sched_ctx_hypervisor_ioctl(p1.ctx, */
+	/* 		sc_hypervisor_ioctl(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}; */
-	/* 			sched_ctx_hypervisor_ioctl(p1.ctx, */
+	/* 			sc_hypervisor_ioctl(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}; */
-	/* 			sched_ctx_hypervisor_ioctl(p1.ctx, */
+	/* 			sc_hypervisor_ioctl(p1.ctx, */
 	/* 						   HYPERVISOR_MAX_IDLE, workers, 12, 5000.0, */
 	/* 						   HYPERVISOR_MAX_IDLE, workers, 3, 10000.0, */
 	/* 						   HYPERVISOR_TIME_TO_APPLY, task_tag, */
@@ -471,7 +471,7 @@ void end_contexts()
 {
 	free(p1.workers);
 	free(p2.workers);
-	sched_ctx_hypervisor_shutdown();
+	sc_hypervisor_shutdown();
 }
 
 void parse_args_ctx(int argc, char **argv)

+ 20 - 20
sc_hypervisor/include/sc_hypervisor.h

@@ -18,8 +18,8 @@
 #define SCHED_CTX_HYPERVISOR_H
 
 #include <starpu.h>
-#include <sched_ctx_hypervisor_config.h>
-#include <sched_ctx_hypervisor_monitoring.h>
+#include <sc_hypervisor_config.h>
+#include <sc_hypervisor_monitoring.h>
 
 #ifdef __cplusplus
 extern "C"
@@ -37,7 +37,7 @@ starpu_pthread_mutex_t act_hypervisor_mutex;
 struct resize_request_entry;
 
 /* platform of resizing contexts */
-struct sched_ctx_hypervisor_policy
+struct sc_hypervisor_policy
 {
 	/* name of the strategy */
 	const char* name;
@@ -72,55 +72,55 @@ struct sched_ctx_hypervisor_policy
 };
 
 /* start the hypervisor indicating the resizing policy to user */
-struct starpu_sched_ctx_performance_counters *sched_ctx_hypervisor_init(struct sched_ctx_hypervisor_policy *policy);
+struct starpu_sched_ctx_performance_counters *sc_hypervisor_init(struct sc_hypervisor_policy *policy);
 
 /* shutdown the hypervisor */
-void sched_ctx_hypervisor_shutdown(void);
+void sc_hypervisor_shutdown(void);
 
 /* only registered contexts are resized by the hypervisor */
-void sched_ctx_hypervisor_register_ctx(unsigned sched_ctx, double total_flops);
+void sc_hypervisor_register_ctx(unsigned sched_ctx, double total_flops);
 
 /* remove a worker from the hypervisor's list */
-void sched_ctx_hypervisor_unregister_ctx(unsigned sched_ctx);
+void sc_hypervisor_unregister_ctx(unsigned sched_ctx);
 
 /* submit a requirement of resizing when a task taged with task_tag is executed */
-void sched_ctx_hypervisor_resize(unsigned sched_ctx, int task_tag);
+void sc_hypervisor_resize(unsigned sched_ctx, int task_tag);
 
 /* don't allow the hypervisor to resize a context */
-void sched_ctx_hypervisor_stop_resize(unsigned sched_ctx);
+void sc_hypervisor_stop_resize(unsigned sched_ctx);
 
 /* allow the hypervisor to resize a context */
-void sched_ctx_hypervisor_start_resize(unsigned sched_ctx);
+void sc_hypervisor_start_resize(unsigned sched_ctx);
 
 /* check out the current policy of the hypervisor */
-const char *sched_ctx_hypervisor_get_policy();
+const char *sc_hypervisor_get_policy();
 
 /* ask the hypervisor to add workers to a sched_ctx */
-void sched_ctx_hypervisor_add_workers_to_sched_ctx(int* workers_to_add, unsigned nworkers_to_add, unsigned sched_ctx);
+void sc_hypervisor_add_workers_to_sched_ctx(int* workers_to_add, unsigned nworkers_to_add, unsigned sched_ctx);
 
 /* ask the hypervisor to remove workers from a sched_ctx */
-void sched_ctx_hypervisor_remove_workers_from_sched_ctx(int* workers_to_remove, unsigned nworkers_to_remove, unsigned sched_ctx, unsigned now);
+void sc_hypervisor_remove_workers_from_sched_ctx(int* workers_to_remove, unsigned nworkers_to_remove, unsigned sched_ctx, unsigned now);
 
 /* ask the hypervisor to move workers from one context to another */
-void sched_ctx_hypervisor_move_workers(unsigned sender_sched_ctx, unsigned receiver_sched_ctx, int *workers_to_move, unsigned nworkers_to_move, unsigned now);
+void sc_hypervisor_move_workers(unsigned sender_sched_ctx, unsigned receiver_sched_ctx, int *workers_to_move, unsigned nworkers_to_move, unsigned now);
 
 /* ask the hypervisor to chose a distribution of workers in the required contexts */
-void sched_ctx_hypervisor_size_ctxs(int *sched_ctxs, int nsched_ctxs, int *workers, int nworkers);
+void sc_hypervisor_size_ctxs(int *sched_ctxs, int nsched_ctxs, int *workers, int nworkers);
 
 /* check if there are pending demands of resizing */
-unsigned sched_ctx_hypervisor_get_size_req(int **sched_ctxs, int* nsched_ctxs, int **workers, int *nworkers);
+unsigned sc_hypervisor_get_size_req(int **sched_ctxs, int* nsched_ctxs, int **workers, int *nworkers);
 
 /* save a demand of resizing */
-void sched_ctx_hypervisor_save_size_req(int *sched_ctxs, int nsched_ctxs, int *workers, int nworkers);
+void sc_hypervisor_save_size_req(int *sched_ctxs, int nsched_ctxs, int *workers, int nworkers);
 
 /* clear the list of pending demands of resizing */
-void sched_ctx_hypervisor_free_size_req(void);
+void sc_hypervisor_free_size_req(void);
 
 /* check out if a context can be resized */
-unsigned sched_ctx_hypervisor_can_resize(unsigned sched_ctx);
+unsigned sc_hypervisor_can_resize(unsigned sched_ctx);
 
 /* indicate the types of tasks a context will execute in order to better decide the sizing of ctxs */
-void sched_ctx_hypervisor_set_type_of_task(struct starpu_codelet *cl, unsigned sched_ctx, uint32_t footprint);
+void sc_hypervisor_set_type_of_task(struct starpu_codelet *cl, unsigned sched_ctx, uint32_t footprint);
 
 #ifdef __cplusplus
 }

+ 5 - 5
sc_hypervisor/include/sc_hypervisor_config.h

@@ -17,7 +17,7 @@
 #ifndef SCHED_CTX_HYPERVISOR_CONFIG_H
 #define SCHED_CTX_HYPERVISOR_CONFIG_H
 
-#include <sched_ctx_hypervisor.h>
+#include <sc_hypervisor.h>
 
 #ifdef __cplusplus
 extern "C"
@@ -44,7 +44,7 @@ extern "C"
 #define MAX_IDLE_TIME 5000000000
 #define MIN_WORKING_TIME 500
 
-struct sched_ctx_hypervisor_policy_config
+struct sc_hypervisor_policy_config
 {
 	/* underneath this limit we cannot resize */
 	int min_nworkers;
@@ -84,13 +84,13 @@ struct sched_ctx_hypervisor_policy_config
 };
 
 /* set a certain configuration to a context */
-void sched_ctx_hypervisor_set_config(unsigned sched_ctx, void *config);
+void sc_hypervisor_set_config(unsigned sched_ctx, void *config);
 
 /* check out the configuration of a context */
-struct sched_ctx_hypervisor_policy_config *sched_ctx_hypervisor_get_config(unsigned sched_ctx);
+struct sc_hypervisor_policy_config *sc_hypervisor_get_config(unsigned sched_ctx);
 
 /* impose different parameters to a configuration of a context */
-void sched_ctx_hypervisor_ioctl(unsigned sched_ctx, ...);
+void sc_hypervisor_ioctl(unsigned sched_ctx, ...);
 
 #ifdef __cplusplus
 }

+ 1 - 1
sc_hypervisor/include/sc_hypervisor_lp.h

@@ -17,7 +17,7 @@
 #ifndef SCHED_CTX_HYPERVISOR_LP_H
 #define SCHED_CTX_HYPERVISOR_LP_H
 
-#include <sched_ctx_hypervisor.h>
+#include <sc_hypervisor.h>
 #include <starpu_config.h>
 
 #ifdef __cplusplus

+ 13 - 13
sc_hypervisor/include/sc_hypervisor_monitoring.h

@@ -17,7 +17,7 @@
 #ifndef SCHED_CTX_HYPERVISOR_MONITORING_H
 #define SCHED_CTX_HYPERVISOR_MONITORING_H
 
-#include <sched_ctx_hypervisor.h>
+#include <sc_hypervisor.h>
 
 #ifdef __cplusplus
 extern "C"
@@ -26,7 +26,7 @@ extern "C"
 
 /* structure to indicate when the moving of workers was actually done 
    (moved workers can be seen in the new ctx ) */
-struct sched_ctx_hypervisor_resize_ack
+struct sc_hypervisor_resize_ack
 {
 	/* receiver context */
 	int receiver_sched_ctx;
@@ -39,13 +39,13 @@ struct sched_ctx_hypervisor_resize_ack
 };
 
 /* wrapper attached to a sched_ctx storing monitoring information */
-struct sched_ctx_hypervisor_wrapper
+struct sc_hypervisor_wrapper
 {
 	/* the sched_ctx it monitors */
 	unsigned sched_ctx;
 
 	/* user configuration meant to limit resizing */
-	struct sched_ctx_hypervisor_policy_config *config;
+	struct sc_hypervisor_policy_config *config;
 
 	/* idle time of workers in this context */
 	double current_idle_time[STARPU_NMAXWORKERS];
@@ -91,35 +91,35 @@ struct sched_ctx_hypervisor_wrapper
 
 	/* the workers don't leave the current ctx until the receiver ctx 
 	   doesn't ack the receive of these workers */
-	struct sched_ctx_hypervisor_resize_ack resize_ack;
+	struct sc_hypervisor_resize_ack resize_ack;
 
 	/* mutex to protect the ack of workers */
 	starpu_pthread_mutex_t mutex;
 };
 
 /* return the wrapper of context that saves its monitoring information */
-struct sched_ctx_hypervisor_wrapper *sched_ctx_hypervisor_get_wrapper(unsigned sched_ctx);
+struct sc_hypervisor_wrapper *sc_hypervisor_get_wrapper(unsigned sched_ctx);
 
 /* get the list of registered contexts */
-int *sched_ctx_hypervisor_get_sched_ctxs();
+int *sc_hypervisor_get_sched_ctxs();
 
 /* get the number of registered contexts */
-int sched_ctx_hypervisor_get_nsched_ctxs();
+int sc_hypervisor_get_nsched_ctxs();
 
 /* get the number of workers of a certain architecture in a context */
-int sched_ctx_hypervisor_get_nworkers_ctx(unsigned sched_ctx, enum starpu_archtype arch);
+int sc_hypervisor_get_nworkers_ctx(unsigned sched_ctx, enum starpu_archtype arch);
 
 /* get the number of flops executed by a context since last resizing (reset to 0 when a resizing is done)*/
-double sched_ctx_hypervisor_get_elapsed_flops_per_sched_ctx(struct sched_ctx_hypervisor_wrapper *sc_w);
+double sc_hypervisor_get_elapsed_flops_per_sched_ctx(struct sc_hypervisor_wrapper *sc_w);
 
 /* get the number of flops executed by a context since the begining */
-double sched_ctx_hypervisor_get_total_elapsed_flops_per_sched_ctx(struct sched_ctx_hypervisor_wrapper* sc_w);
+double sc_hypervisor_get_total_elapsed_flops_per_sched_ctx(struct sc_hypervisor_wrapper* sc_w);
 
 /* compute an average value of the cpu/cuda velocity */
-double sched_ctx_hypervisor_get_velocity_per_worker_type(struct sched_ctx_hypervisor_wrapper* sc_w, enum starpu_archtype arch);
+double sc_hypervisor_get_velocity_per_worker_type(struct sc_hypervisor_wrapper* sc_w, enum starpu_archtype arch);
 
 /* compte the actual velocity of all workers of a specific type of worker */
-double sched_ctx_hypervisor_get_velocity(struct sched_ctx_hypervisor_wrapper *sc_w, enum starpu_archtype arch);
+double sc_hypervisor_get_velocity(struct sc_hypervisor_wrapper *sc_w, enum starpu_archtype arch);
 
 #ifdef __cplusplus
 }

+ 6 - 6
sc_hypervisor/include/sc_hypervisor_policy.h

@@ -17,7 +17,7 @@
 #ifndef SCHED_CTX_HYPERVISOR_POLICY_H
 #define SCHED_CTX_HYPERVISOR_POLICY_H
 
-#include <sched_ctx_hypervisor.h>
+#include <sc_hypervisor.h>
 
 #ifdef __cplusplus
 extern "C"
@@ -48,7 +48,7 @@ int* _get_first_workers(unsigned sched_ctx, int *nworkers, enum starpu_archtype
 
 int* _get_first_workers_in_list(int *start, int *workers, int nall_workers,  int *nworkers, enum starpu_archtype arch);
 
-unsigned _get_potential_nworkers(struct sched_ctx_hypervisor_policy_config *config, unsigned sched_ctx, enum starpu_archtype arch);
+unsigned _get_potential_nworkers(struct sc_hypervisor_policy_config *config, unsigned sched_ctx, enum starpu_archtype arch);
 
 int _get_nworkers_to_move(unsigned req_sched_ctx);
 
@@ -56,17 +56,17 @@ unsigned _resize(unsigned sender_sched_ctx, unsigned receiver_sched_ctx, unsigne
 
 unsigned _resize_to_unknown_receiver(unsigned sender_sched_ctx, unsigned now);
 
-double _get_ctx_velocity(struct sched_ctx_hypervisor_wrapper* sc_w);
+double _get_ctx_velocity(struct sc_hypervisor_wrapper* sc_w);
 
 double _get_slowest_ctx_exec_time(void);
 
 double _get_fastest_ctx_exec_time(void);
 
-double _get_velocity_per_worker(struct sched_ctx_hypervisor_wrapper *sc_w, unsigned worker); 
+double _get_velocity_per_worker(struct sc_hypervisor_wrapper *sc_w, unsigned worker); 
 
-double _get_velocity_per_worker_type(struct sched_ctx_hypervisor_wrapper* sc_w, enum starpu_archtype arch);
+double _get_velocity_per_worker_type(struct sc_hypervisor_wrapper* sc_w, enum starpu_archtype arch);
 
-double _get_ref_velocity_per_worker_type(struct sched_ctx_hypervisor_wrapper* sc_w, enum starpu_archtype arch);
+double _get_ref_velocity_per_worker_type(struct sc_hypervisor_wrapper* sc_w, enum starpu_archtype arch);
 
 int _velocity_gap_btw_ctxs(void);
 

+ 7 - 7
sc_hypervisor/src/Makefile.am

@@ -14,16 +14,16 @@
 
 AM_CFLAGS = -Wall $(STARPU_CUDA_CPPFLAGS) $(STARPU_OPENCL_CPPFLAGS) $(FXT_CFLAGS) $(MAGMA_CFLAGS) $(HWLOC_CFLAGS) $(GLOBAL_AM_CFLAGS)
 LIBS = $(top_builddir)/src/libstarpu-@STARPU_EFFECTIVE_VERSION@.la
-AM_CPPFLAGS = -I$(top_srcdir)/include/ -I$(top_srcdir)/src/ -I$(top_builddir)/src/ -I$(top_builddir)/include -I$(top_srcdir)/sched_ctx_hypervisor/include/ -I$(top_srcdir)/sched_ctx_hypervisor/src
+AM_CPPFLAGS = -I$(top_srcdir)/include/ -I$(top_srcdir)/src/ -I$(top_builddir)/src/ -I$(top_builddir)/include -I$(top_srcdir)/sc_hypervisor/include/ -I$(top_srcdir)/sc_hypervisor/src
 AM_LDFLAGS = $(STARPU_CUDA_LDFLAGS) $(STARPU_OPENCL_LDFLAGS)
 
-lib_LTLIBRARIES = libsched_ctx_hypervisor.la
+lib_LTLIBRARIES = libsc_hypervisor.la
 
-libsched_ctx_hypervisor_la_LIBADD = $(top_builddir)/src/libstarpu-@STARPU_EFFECTIVE_VERSION@.la
+libsc_hypervisor_la_LIBADD = $(top_builddir)/src/libstarpu-@STARPU_EFFECTIVE_VERSION@.la
 
-libsched_ctx_hypervisor_la_SOURCES = 			\
-	sched_ctx_hypervisor.c				\
-	sched_ctx_config.c				\
+libsc_hypervisor_la_SOURCES = 				\
+	sc_hypervisor.c					\
+	sc_config.c					\
 	policies_utils/policy_tools.c			\
 	policies_utils/lp_tools.c			\
 	hypervisor_policies/idle_policy.c		\
@@ -35,7 +35,7 @@ libsched_ctx_hypervisor_la_SOURCES = 			\
 	hypervisor_policies/ispeed_lp_policy.c		\
 	hypervisor_policies/debit_lp_policy.c
 
-noinst_HEADERS = sched_ctx_hypervisor_intern.h		
+noinst_HEADERS = sc_hypervisor_intern.h		
 
 showcheck:
 	-cat /dev/null

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

@@ -13,14 +13,14 @@
  *
  * See the GNU Lesser General Public License in COPYING.LGPL for more details.
  */
-#include <sched_ctx_hypervisor_policy.h>
+#include <sc_hypervisor_policy.h>
 
 static void app_driven_handle_post_exec_hook(unsigned sched_ctx, int task_tag)
 {
 	_resize_to_unknown_receiver(sched_ctx, 1);
 }
 
-struct sched_ctx_hypervisor_policy app_driven_policy =
+struct sc_hypervisor_policy app_driven_policy =
 {
 	.size_ctxs = NULL,
 	.handle_poped_task = NULL,

+ 10 - 10
sc_hypervisor/src/hypervisor_policies/debit_lp_policy.c

@@ -15,8 +15,8 @@
  */
 
 #include <starpu_config.h>
-#include "sched_ctx_hypervisor_lp.h"
-#include "sched_ctx_hypervisor_policy.h"
+#include "sc_hypervisor_lp.h"
+#include "sc_hypervisor_policy.h"
 #include <math.h>
 #include <sys/time.h>
 
@@ -27,21 +27,21 @@ static unsigned _compute_max_velocity(int ns, int nw, double w_in_s[ns][nw], int
 {
 	double velocity[ns][nw];
 
-	int *sched_ctxs = in_sched_ctxs == NULL ? sched_ctx_hypervisor_get_sched_ctxs() : in_sched_ctxs;
+	int *sched_ctxs = in_sched_ctxs == NULL ? sc_hypervisor_get_sched_ctxs() : in_sched_ctxs;
 	
 	int w,s;
 
-	struct sched_ctx_hypervisor_wrapper* sc_w = NULL;
+	struct sc_hypervisor_wrapper* sc_w = NULL;
 	for(s = 0; s < ns; s++)
 	{
-		sc_w = sched_ctx_hypervisor_get_wrapper(sched_ctxs[s]);
+		sc_w = sc_hypervisor_get_wrapper(sched_ctxs[s]);
 		for(w = 0; w < nw; w++)
 		{
 			w_in_s[s][w] = 0.0;
 			int worker = workers == NULL ? w : workers[w];
 
 			enum starpu_archtype arch = starpu_worker_get_type(worker);
-			velocity[s][w] = sched_ctx_hypervisor_get_velocity(sc_w, arch);
+			velocity[s][w] = sc_hypervisor_get_velocity(sc_w, arch);
 		}
 	}
 	
@@ -227,14 +227,14 @@ static double _glp_resolve(int ns, int nw, double velocity[ns][nw], double w_in_
 
 static void debit_lp_handle_poped_task(unsigned sched_ctx, int worker, struct starpu_task *task, uint32_t footprint)
 {
-	struct sched_ctx_hypervisor_wrapper* sc_w = sched_ctx_hypervisor_get_wrapper(sched_ctx);
+	struct sc_hypervisor_wrapper* sc_w = sc_hypervisor_get_wrapper(sched_ctx);
 	_get_velocity_per_worker(sc_w, worker);
 	int ret = starpu_pthread_mutex_trylock(&act_hypervisor_mutex);
 	if(ret != EBUSY)
 	{
 		if(_velocity_gap_btw_ctxs())
 		{
-			int ns = sched_ctx_hypervisor_get_nsched_ctxs();
+			int ns = sc_hypervisor_get_nsched_ctxs();
 			int nw = starpu_worker_get_count(); /* Number of different workers */
 
 			double w_in_s[ns][nw];
@@ -288,7 +288,7 @@ static void debit_lp_handle_poped_task(unsigned sched_ctx, int worker, struct st
 
 static void debit_lp_end_ctx(unsigned sched_ctx)
 {
-	struct sched_ctx_hypervisor_wrapper* sc_w = sched_ctx_hypervisor_get_wrapper(sched_ctx);
+	struct sc_hypervisor_wrapper* sc_w = sc_hypervisor_get_wrapper(sched_ctx);
 	int worker;
 /* 	for(worker = 0; worker < 12; worker++) */
 /* 		printf("%d/%d: speed %lf\n", worker, sched_ctx, sc_w->ref_velocity[worker]); */
@@ -296,7 +296,7 @@ static void debit_lp_end_ctx(unsigned sched_ctx)
 	return;
 }
 
-struct sched_ctx_hypervisor_policy debit_lp_policy = {
+struct sc_hypervisor_policy debit_lp_policy = {
 	.size_ctxs = NULL,
 	.handle_poped_task = debit_lp_handle_poped_task,
 	.handle_pushed_task = NULL,

+ 6 - 6
sc_hypervisor/src/hypervisor_policies/feft_lp_policy.c

@@ -14,7 +14,7 @@
  * See the GNU Lesser General Public License in COPYING.LGPL for more details.
  */
 
-#include "sched_ctx_hypervisor_lp.h"
+#include "sc_hypervisor_lp.h"
 #include <starpu_config.h>
 #include <sys/time.h>
 
@@ -23,7 +23,7 @@ static void feft_lp_handle_poped_task(unsigned sched_ctx, int worker, struct sta
 {
 	if(_velocity_gap_btw_ctxs())
 	{
-		int nsched_ctxs = sched_ctx_hypervisor_get_nsched_ctxs();
+		int nsched_ctxs = sc_hypervisor_get_nsched_ctxs();
 
 		double nworkers[nsched_ctxs][2];
 
@@ -63,7 +63,7 @@ static void feft_lp_handle_poped_task(unsigned sched_ctx, int worker, struct sta
 }
 static void feft_lp_size_ctxs(int *sched_ctxs, int ns, int *workers, int nworkers)
 {
-	int nsched_ctxs = sched_ctxs == NULL ? sched_ctx_hypervisor_get_nsched_ctxs() : ns;
+	int nsched_ctxs = sched_ctxs == NULL ? sc_hypervisor_get_nsched_ctxs() : ns;
 	int nw = 1;
 #ifdef STARPU_USE_CUDA
 	int ncuda = starpu_worker_get_count_by_type(STARPU_CUDA_WORKER);
@@ -99,14 +99,14 @@ static void feft_lp_size_ctxs(int *sched_ctxs, int ns, int *workers, int nworker
 /* 				printf("ctx %d/worker type %d: n = %d \n", i, 1, nworkers_per_type_rounded[i][1]); */
 /* #endif */
 /* 		} */
-		int *current_sched_ctxs = sched_ctxs == NULL ? sched_ctx_hypervisor_get_sched_ctxs() : 
+		int *current_sched_ctxs = sched_ctxs == NULL ? sc_hypervisor_get_sched_ctxs() : 
 			sched_ctxs;
 
 		unsigned has_workers = 0;
 		int s;
 		for(s = 0; s < ns; s++)
 		{
-			int nworkers_ctx = sched_ctx_hypervisor_get_nworkers_ctx(current_sched_ctxs[s], 
+			int nworkers_ctx = sc_hypervisor_get_nworkers_ctx(current_sched_ctxs[s], 
 									     STARPU_ANY_WORKER);
 			if(nworkers_ctx != 0)
 			{
@@ -122,7 +122,7 @@ static void feft_lp_size_ctxs(int *sched_ctxs, int ns, int *workers, int nworker
 	starpu_pthread_mutex_unlock(&act_hypervisor_mutex);
 }
 
-struct sched_ctx_hypervisor_policy feft_lp_policy = {
+struct sc_hypervisor_policy feft_lp_policy = {
 	.size_ctxs = feft_lp_size_ctxs,
 	.handle_poped_task = feft_lp_handle_poped_task,
 	.handle_pushed_task = NULL,

+ 22 - 22
sc_hypervisor/src/hypervisor_policies/gflops_rate_policy.c

@@ -14,11 +14,11 @@
  * See the GNU Lesser General Public License in COPYING.LGPL for more details.
  */
 
-#include "sched_ctx_hypervisor_policy.h"
+#include "sc_hypervisor_policy.h"
 
 static double _get_total_elapsed_flops_per_sched_ctx(unsigned sched_ctx)
 {
-	struct sched_ctx_hypervisor_wrapper* sc_w = sched_ctx_hypervisor_get_wrapper(sched_ctx);
+	struct sc_hypervisor_wrapper* sc_w = sc_hypervisor_get_wrapper(sched_ctx);
 	double ret_val = 0.0;
 	int i;
 	for(i = 0; i < STARPU_NMAXWORKERS; i++)
@@ -28,8 +28,8 @@ static double _get_total_elapsed_flops_per_sched_ctx(unsigned sched_ctx)
 
 double _get_exp_end(unsigned sched_ctx)
 {
-	struct sched_ctx_hypervisor_wrapper *sc_w = sched_ctx_hypervisor_get_wrapper(sched_ctx);
-	double elapsed_flops = sched_ctx_hypervisor_get_elapsed_flops_per_sched_ctx(sc_w);
+	struct sc_hypervisor_wrapper *sc_w = sc_hypervisor_get_wrapper(sched_ctx);
+	double elapsed_flops = sc_hypervisor_get_elapsed_flops_per_sched_ctx(sc_w);
 
 	if( elapsed_flops >= 1.0)
 	{
@@ -44,7 +44,7 @@ double _get_exp_end(unsigned sched_ctx)
 /* computes the instructions left to be executed out of the total instructions to execute */
 double _get_flops_left_pct(unsigned sched_ctx)
 {
-	struct sched_ctx_hypervisor_wrapper *wrapper = sched_ctx_hypervisor_get_wrapper(sched_ctx);
+	struct sc_hypervisor_wrapper *wrapper = sc_hypervisor_get_wrapper(sched_ctx);
 	double total_elapsed_flops = _get_total_elapsed_flops_per_sched_ctx(sched_ctx);
 	if(wrapper->total_flops == total_elapsed_flops || total_elapsed_flops > wrapper->total_flops)
 		return 0.0;
@@ -55,8 +55,8 @@ double _get_flops_left_pct(unsigned sched_ctx)
 /* select the workers needed to be moved in order to force the sender and the receiver context to finish simultaneously */
 static int* _get_workers_to_move(unsigned sender_sched_ctx, unsigned receiver_sched_ctx, int *nworkers)
 {
-	struct sched_ctx_hypervisor_wrapper* sender_sc_w = sched_ctx_hypervisor_get_wrapper(sender_sched_ctx);
-	struct sched_ctx_hypervisor_wrapper* receiver_sc_w = sched_ctx_hypervisor_get_wrapper(receiver_sched_ctx);
+	struct sc_hypervisor_wrapper* sender_sc_w = sc_hypervisor_get_wrapper(sender_sched_ctx);
+	struct sc_hypervisor_wrapper* receiver_sc_w = sc_hypervisor_get_wrapper(receiver_sched_ctx);
         int *workers = NULL;
         double v_receiver = _get_ctx_velocity(receiver_sc_w);
         double receiver_remainig_flops = receiver_sc_w->remaining_flops;
@@ -69,11 +69,11 @@ static int* _get_workers_to_move(unsigned sender_sched_ctx, unsigned receiver_sc
 /*             v_receiver, v_for_rctx, sender_v_cpu, nworkers_needed); */
         if(nworkers_needed > 0)
         {
-                struct sched_ctx_hypervisor_policy_config *sender_config = sched_ctx_hypervisor_get_config(sender_sched_ctx);
+                struct sc_hypervisor_policy_config *sender_config = sc_hypervisor_get_config(sender_sched_ctx);
                 unsigned potential_moving_cpus = _get_potential_nworkers(sender_config, sender_sched_ctx, STARPU_CPU_WORKER);
                 unsigned potential_moving_gpus = _get_potential_nworkers(sender_config, sender_sched_ctx, STARPU_CUDA_WORKER);
                 unsigned sender_nworkers = starpu_sched_ctx_get_nworkers(sender_sched_ctx);
-                struct sched_ctx_hypervisor_policy_config *config = sched_ctx_hypervisor_get_config(receiver_sched_ctx);
+                struct sc_hypervisor_policy_config *config = sc_hypervisor_get_config(receiver_sched_ctx);
                 unsigned nworkers_ctx = starpu_sched_ctx_get_nworkers(receiver_sched_ctx);
 
                 if(nworkers_needed < (potential_moving_cpus + 5 * potential_moving_gpus))
@@ -147,9 +147,9 @@ static unsigned _gflops_rate_resize(unsigned sender_sched_ctx, unsigned receiver
                 int *workers_to_move =  _get_workers_to_move(sender_sched_ctx, receiver_sched_ctx, &nworkers_to_move);
 		if(nworkers_to_move > 0)
                 {
-                        sched_ctx_hypervisor_move_workers(sender_sched_ctx, receiver_sched_ctx, workers_to_move, nworkers_to_move, 0);
+                        sc_hypervisor_move_workers(sender_sched_ctx, receiver_sched_ctx, workers_to_move, nworkers_to_move, 0);
 
-                        struct sched_ctx_hypervisor_policy_config *new_config = sched_ctx_hypervisor_get_config(receiver_sched_ctx);
+                        struct sc_hypervisor_policy_config *new_config = sc_hypervisor_get_config(receiver_sched_ctx);
                         int i;
                         for(i = 0; i < nworkers_to_move; i++)
                                 new_config->max_idle[workers_to_move[i]] = new_config->max_idle[workers_to_move[i]] !=MAX_IDLE_TIME ? new_config->max_idle[workers_to_move[i]] :  new_config->new_workers_max_idle;
@@ -165,8 +165,8 @@ static unsigned _gflops_rate_resize(unsigned sender_sched_ctx, unsigned receiver
 
 static int _find_fastest_sched_ctx()
 {
-	int *sched_ctxs = sched_ctx_hypervisor_get_sched_ctxs();
-	int nsched_ctxs = sched_ctx_hypervisor_get_nsched_ctxs();
+	int *sched_ctxs = sc_hypervisor_get_sched_ctxs();
+	int nsched_ctxs = sc_hypervisor_get_nsched_ctxs();
 
 	double first_exp_end = _get_exp_end(sched_ctxs[0]);
 	int fastest_sched_ctx = first_exp_end == -1.0  ? -1 : sched_ctxs[0];
@@ -188,8 +188,8 @@ static int _find_fastest_sched_ctx()
 
 static int _find_slowest_sched_ctx()
 {
-	int *sched_ctxs = sched_ctx_hypervisor_get_sched_ctxs();
-	int nsched_ctxs = sched_ctx_hypervisor_get_nsched_ctxs();
+	int *sched_ctxs = sc_hypervisor_get_sched_ctxs();
+	int nsched_ctxs = sc_hypervisor_get_nsched_ctxs();
 
 	int slowest_sched_ctx = -1;
 	double curr_exp_end = 0.0;
@@ -214,8 +214,8 @@ static int _find_slowest_sched_ctx()
 
 static int _find_slowest_available_sched_ctx(unsigned sched_ctx)
 {
-	int *sched_ctxs = sched_ctx_hypervisor_get_sched_ctxs();
-	int nsched_ctxs = sched_ctx_hypervisor_get_nsched_ctxs();
+	int *sched_ctxs = sc_hypervisor_get_sched_ctxs();
+	int nsched_ctxs = sc_hypervisor_get_nsched_ctxs();
 
 	int slowest_sched_ctx = -1;
 	double curr_exp_end = 0.0;
@@ -256,12 +256,12 @@ static void gflops_rate_resize(unsigned sched_ctx)
 			double slowest_flops_left_pct = _get_flops_left_pct(slowest_sched_ctx);
 			if(slowest_flops_left_pct != 0.0f)
 			{
-				struct sched_ctx_hypervisor_policy_config* config = sched_ctx_hypervisor_get_config(sched_ctx);
+				struct sc_hypervisor_policy_config* config = sc_hypervisor_get_config(sched_ctx);
 				config->min_nworkers = 0;
 				config->max_nworkers = 0;
 				printf("ctx %d finished & gives away the res to %d; slow_left %lf\n", sched_ctx, slowest_sched_ctx, slowest_flops_left_pct);
 				_resize(sched_ctx, slowest_sched_ctx, 1, 1);
-				sched_ctx_hypervisor_stop_resize(slowest_sched_ctx);
+				sc_hypervisor_stop_resize(slowest_sched_ctx);
 			}
 		}
 	}
@@ -280,8 +280,8 @@ static void gflops_rate_resize(unsigned sched_ctx)
 			if(fast_flops_left_pct < 0.8)
 			{
 
-				struct sched_ctx_hypervisor_wrapper *sc_w = sched_ctx_hypervisor_get_wrapper(slowest_sched_ctx);
-				double elapsed_flops = sched_ctx_hypervisor_get_elapsed_flops_per_sched_ctx(sc_w);
+				struct sc_hypervisor_wrapper *sc_w = sc_hypervisor_get_wrapper(slowest_sched_ctx);
+				double elapsed_flops = sc_hypervisor_get_elapsed_flops_per_sched_ctx(sc_w);
 				if((elapsed_flops/sc_w->total_flops) > 0.1)
 					_gflops_rate_resize(fastest_sched_ctx, slowest_sched_ctx, 0);
 			}
@@ -294,7 +294,7 @@ static void gflops_rate_handle_poped_task(unsigned sched_ctx, int worker)
 	gflops_rate_resize(sched_ctx);
 }
 
-struct sched_ctx_hypervisor_policy gflops_rate_policy = {
+struct sc_hypervisor_policy gflops_rate_policy = {
 	.size_ctxs = NULL,
 	.handle_poped_task = gflops_rate_handle_poped_task,
 	.handle_pushed_task = NULL,

+ 7 - 7
sc_hypervisor/src/hypervisor_policies/idle_policy.c

@@ -14,12 +14,12 @@
  * See the GNU Lesser General Public License in COPYING.LGPL for more details.
  */
 
-#include "sched_ctx_hypervisor_policy.h"
+#include "sc_hypervisor_policy.h"
 
 unsigned worker_belong_to_other_sched_ctx(unsigned sched_ctx, int worker)
 {
-	int *sched_ctxs = sched_ctx_hypervisor_get_sched_ctxs();
-	int nsched_ctxs = sched_ctx_hypervisor_get_nsched_ctxs();
+	int *sched_ctxs = sc_hypervisor_get_sched_ctxs();
+	int nsched_ctxs = sc_hypervisor_get_nsched_ctxs();
 
 	int i;
 	for(i = 0; i < nsched_ctxs; i++)
@@ -30,18 +30,18 @@ unsigned worker_belong_to_other_sched_ctx(unsigned sched_ctx, int worker)
 
 void idle_handle_idle_cycle(unsigned sched_ctx, int worker)
 {
-	struct sched_ctx_hypervisor_wrapper* sc_w = sched_ctx_hypervisor_get_wrapper(sched_ctx);
-	struct sched_ctx_hypervisor_policy_config *config = sc_w->config;
+	struct sc_hypervisor_wrapper* sc_w = sc_hypervisor_get_wrapper(sched_ctx);
+	struct sc_hypervisor_policy_config *config = sc_w->config;
 	if(config != NULL &&  sc_w->current_idle_time[worker] > config->max_idle[worker])
 	{
 		if(worker_belong_to_other_sched_ctx(sched_ctx, worker))
-			sched_ctx_hypervisor_remove_workers_from_sched_ctx(&worker, 1, sched_ctx, 1);
+			sc_hypervisor_remove_workers_from_sched_ctx(&worker, 1, sched_ctx, 1);
 		else
 			_resize_to_unknown_receiver(sched_ctx, 0);
 	}
 }
 
-struct sched_ctx_hypervisor_policy idle_policy =
+struct sc_hypervisor_policy idle_policy =
 {
 	.size_ctxs = NULL,
 	.handle_poped_task = NULL,

+ 11 - 11
sc_hypervisor/src/hypervisor_policies/ispeed_lp_policy.c

@@ -15,8 +15,8 @@
  */
 
 #include <starpu_config.h>
-#include "sched_ctx_hypervisor_lp.h"
-#include "sched_ctx_hypervisor_policy.h"
+#include "sc_hypervisor_lp.h"
+#include "sc_hypervisor_policy.h"
 #include <math.h>
 #include <sys/time.h>
 
@@ -29,15 +29,15 @@ static unsigned _compute_flops_distribution_over_ctxs(int ns, int nw, double w_i
 	double flops[ns];
 	double velocity[ns][nw];
 
-	int *sched_ctxs = in_sched_ctxs == NULL ? sched_ctx_hypervisor_get_sched_ctxs() : in_sched_ctxs;
+	int *sched_ctxs = in_sched_ctxs == NULL ? sc_hypervisor_get_sched_ctxs() : in_sched_ctxs;
 	
 	int w,s;
 
-	struct sched_ctx_hypervisor_wrapper* sc_w = NULL;
+	struct sc_hypervisor_wrapper* sc_w = NULL;
 	double total_flops = 0.0;
 	for(s = 0; s < ns; s++)
 	{
-		sc_w = sched_ctx_hypervisor_get_wrapper(sched_ctxs[s]);
+		sc_w = sc_hypervisor_get_wrapper(sched_ctxs[s]);
 		for(w = 0; w < nw; w++)
 		{
 			w_in_s[s][w] = 0.0;
@@ -50,7 +50,7 @@ static unsigned _compute_flops_distribution_over_ctxs(int ns, int nw, double w_i
 			if(velocity[s][w] == -1.0)
 			{
 				enum starpu_archtype arch = starpu_worker_get_type(worker);
-				velocity[s][w] = sched_ctx_hypervisor_get_velocity(sc_w, arch);
+				velocity[s][w] = sc_hypervisor_get_velocity(sc_w, arch);
 				if(arch == STARPU_CUDA_WORKER)
 				{
 					unsigned worker_in_ctx = starpu_sched_ctx_contains_worker(worker, sc_w->sched_ctx);
@@ -65,7 +65,7 @@ static unsigned _compute_flops_distribution_over_ctxs(int ns, int nw, double w_i
 			
 //			printf("v[w%d][s%d] = %lf\n",w, s, velocity[s][w]);
 		}
-		struct sched_ctx_hypervisor_policy_config *config = sched_ctx_hypervisor_get_config(sched_ctxs[s]);
+		struct sc_hypervisor_policy_config *config = sc_hypervisor_get_config(sched_ctxs[s]);
 		flops[s] = config->ispeed_ctx_sample/1000000000; /* in gflops */
 	}
 	
@@ -356,14 +356,14 @@ static double _glp_resolve(int ns, int nw, double velocity[ns][nw], double flops
 
 static void ispeed_lp_handle_poped_task(unsigned sched_ctx, int worker, struct starpu_task *task, uint32_t footprint)
 {
-	struct sched_ctx_hypervisor_wrapper* sc_w = sched_ctx_hypervisor_get_wrapper(sched_ctx);
+	struct sc_hypervisor_wrapper* sc_w = sc_hypervisor_get_wrapper(sched_ctx);
 	_get_velocity_per_worker(sc_w, worker);
 	int ret = starpu_pthread_mutex_trylock(&act_hypervisor_mutex);
 	if(ret != EBUSY)
 	{
 		if(_velocity_gap_btw_ctxs())
 		{
-			int ns = sched_ctx_hypervisor_get_nsched_ctxs();
+			int ns = sc_hypervisor_get_nsched_ctxs();
 			int nw = starpu_worker_get_count(); /* Number of different workers */
 
 			double w_in_s[ns][nw];
@@ -419,7 +419,7 @@ static void ispeed_lp_handle_poped_task(unsigned sched_ctx, int worker, struct s
 
 static void ispeed_lp_end_ctx(unsigned sched_ctx)
 {
-	struct sched_ctx_hypervisor_wrapper* sc_w = sched_ctx_hypervisor_get_wrapper(sched_ctx);
+	struct sc_hypervisor_wrapper* sc_w = sc_hypervisor_get_wrapper(sched_ctx);
 	int worker;
 /* 	for(worker = 0; worker < 12; worker++) */
 /* 		printf("%d/%d: speed %lf\n", worker, sched_ctx, sc_w->ref_velocity[worker]); */
@@ -427,7 +427,7 @@ static void ispeed_lp_end_ctx(unsigned sched_ctx)
 	return;
 }
 
-struct sched_ctx_hypervisor_policy ispeed_lp_policy = {
+struct sc_hypervisor_policy ispeed_lp_policy = {
 	.size_ctxs = NULL,
 	.handle_poped_task = ispeed_lp_handle_poped_task,
 	.handle_pushed_task = NULL,

+ 15 - 15
sc_hypervisor/src/hypervisor_policies/ispeed_policy.c

@@ -14,12 +14,12 @@
  * See the GNU Lesser General Public License in COPYING.LGPL for more details.
  */
 
-#include "sched_ctx_hypervisor_policy.h"
+#include "sc_hypervisor_policy.h"
 
 static unsigned _get_fastest_sched_ctx(void)
 {
-	int *sched_ctxs = sched_ctx_hypervisor_get_sched_ctxs();
-	int nsched_ctxs = sched_ctx_hypervisor_get_nsched_ctxs();
+	int *sched_ctxs = sc_hypervisor_get_sched_ctxs();
+	int nsched_ctxs = sc_hypervisor_get_nsched_ctxs();
 
 	int fastest_sched_ctx = STARPU_NMAX_SCHED_CTXS;
 	double curr_velocity = 0.0;
@@ -27,7 +27,7 @@ static unsigned _get_fastest_sched_ctx(void)
 	int i;
 	for(i = 0; i < nsched_ctxs; i++)
 	{
-		curr_velocity = _get_ctx_velocity(sched_ctx_hypervisor_get_wrapper(sched_ctxs[i]));
+		curr_velocity = _get_ctx_velocity(sc_hypervisor_get_wrapper(sched_ctxs[i]));
 		if( curr_velocity > biggest_velocity)
 		{
 			fastest_sched_ctx = sched_ctxs[i];
@@ -40,16 +40,16 @@ static unsigned _get_fastest_sched_ctx(void)
 
 static unsigned _get_slowest_sched_ctx(void)
 {
-	int *sched_ctxs = sched_ctx_hypervisor_get_sched_ctxs();
-	int nsched_ctxs = sched_ctx_hypervisor_get_nsched_ctxs();
+	int *sched_ctxs = sc_hypervisor_get_sched_ctxs();
+	int nsched_ctxs = sc_hypervisor_get_nsched_ctxs();
 
-	double smallest_velocity = _get_ctx_velocity(sched_ctx_hypervisor_get_wrapper(sched_ctxs[0]));
+	double smallest_velocity = _get_ctx_velocity(sc_hypervisor_get_wrapper(sched_ctxs[0]));
 	unsigned slowest_sched_ctx = smallest_velocity == -1.0  ? STARPU_NMAX_SCHED_CTXS : sched_ctxs[0];
 	double curr_velocity = 0.0;
 	int i;
 	for(i = 1; i < nsched_ctxs; i++)
 	{
-		curr_velocity = _get_ctx_velocity(sched_ctx_hypervisor_get_wrapper(sched_ctxs[i]));
+		curr_velocity = _get_ctx_velocity(sc_hypervisor_get_wrapper(sched_ctxs[i]));
 		if((curr_velocity < smallest_velocity || smallest_velocity == 0.0) && curr_velocity != -1.0)
 		{
 			smallest_velocity = curr_velocity;
@@ -64,8 +64,8 @@ static unsigned _get_slowest_sched_ctx(void)
 /* get first nworkers with the highest idle time in the context */
 static int* _get_slowest_workers(unsigned sched_ctx, int *nworkers, enum starpu_archtype arch)
 {
-	struct sched_ctx_hypervisor_wrapper* sc_w = sched_ctx_hypervisor_get_wrapper(sched_ctx);
-	struct sched_ctx_hypervisor_policy_config *config = sched_ctx_hypervisor_get_config(sched_ctx);
+	struct sc_hypervisor_wrapper* sc_w = sc_hypervisor_get_wrapper(sched_ctx);
+	struct sc_hypervisor_policy_config *config = sc_hypervisor_get_config(sched_ctx);
 
 	int *curr_workers = (int*)malloc((*nworkers) * sizeof(int));
 	int i;
@@ -161,14 +161,14 @@ static void ispeed_handle_poped_task(unsigned sched_ctx, int worker, struct star
 						double new_speed = 0.0;
 						int i;
 						for(i = 0; i < nworkers_to_move; i++)
-							new_speed += _get_velocity_per_worker(sched_ctx_hypervisor_get_wrapper(fastest_sched_ctx), workers_to_move[i]);
-						double fastest_speed = _get_ctx_velocity(sched_ctx_hypervisor_get_wrapper(fastest_sched_ctx));
-						double slowest_speed = _get_ctx_velocity(sched_ctx_hypervisor_get_wrapper(slowest_sched_ctx));
+							new_speed += _get_velocity_per_worker(sc_hypervisor_get_wrapper(fastest_sched_ctx), workers_to_move[i]);
+						double fastest_speed = _get_ctx_velocity(sc_hypervisor_get_wrapper(fastest_sched_ctx));
+						double slowest_speed = _get_ctx_velocity(sc_hypervisor_get_wrapper(slowest_sched_ctx));
 //						printf("fast_speed(%d) %lf slow_speed(%d) %lf new speed(%d) %lf \n", fastest_sched_ctx, fastest_speed, slowest_sched_ctx, 
 //						       slowest_speed, workers_to_move[0], new_speed);
 						if(fastest_speed != -1.0 && slowest_speed != -1.0 && (slowest_speed + new_speed) <= (fastest_speed - new_speed))
 						{
-							sched_ctx_hypervisor_move_workers(fastest_sched_ctx, slowest_sched_ctx, workers_to_move, nworkers_to_move, 0);
+							sc_hypervisor_move_workers(fastest_sched_ctx, slowest_sched_ctx, workers_to_move, nworkers_to_move, 0);
 						}
 					}
 					
@@ -181,7 +181,7 @@ static void ispeed_handle_poped_task(unsigned sched_ctx, int worker, struct star
 	}
 }
 
-struct sched_ctx_hypervisor_policy ispeed_policy = {
+struct sc_hypervisor_policy ispeed_policy = {
 	.size_ctxs = NULL,
 	.handle_poped_task = ispeed_handle_poped_task,
 	.handle_pushed_task = NULL,

+ 11 - 11
sc_hypervisor/src/hypervisor_policies/teft_lp_policy.c

@@ -15,8 +15,8 @@
  */
 
 #include <starpu_config.h>
-#include "sched_ctx_hypervisor_lp.h"
-#include "sched_ctx_hypervisor_policy.h"
+#include "sc_hypervisor_lp.h"
+#include "sc_hypervisor_policy.h"
 #include <math.h>
 #include <sys/time.h>
 
@@ -124,7 +124,7 @@ static unsigned _compute_task_distribution_over_ctxs(int ns, int nw, int nt, dou
 
 static void _size_ctxs(int *sched_ctxs, int nsched_ctxs , int *workers, int nworkers)
 {
-	int ns = sched_ctxs == NULL ? sched_ctx_hypervisor_get_nsched_ctxs() : nsched_ctxs;
+	int ns = sched_ctxs == NULL ? sc_hypervisor_get_nsched_ctxs() : nsched_ctxs;
 	int nw = workers == NULL ? (int)starpu_worker_get_count() : nworkers; /* Number of different workers */
 	int nt = 0; /* Number of different kinds of tasks */
 	starpu_pthread_mutex_lock(&mutex);
@@ -145,17 +145,17 @@ static void size_if_required()
 {
 	int nsched_ctxs, nworkers;
 	int *sched_ctxs, *workers;
-	unsigned has_req = sched_ctx_hypervisor_get_size_req(&sched_ctxs, &nsched_ctxs, &workers, &nworkers);
+	unsigned has_req = sc_hypervisor_get_size_req(&sched_ctxs, &nsched_ctxs, &workers, &nworkers);
 
 	if(has_req)
 	{
-		struct sched_ctx_hypervisor_wrapper* sc_w = NULL;
+		struct sc_hypervisor_wrapper* sc_w = NULL;
 		unsigned ready_to_size = 1;
 		int s;
 		starpu_pthread_mutex_lock(&act_hypervisor_mutex);
 		for(s = 0; s < nsched_ctxs; s++)
 		{
-			sc_w = sched_ctx_hypervisor_get_wrapper(sched_ctxs[s]);
+			sc_w = sc_hypervisor_get_wrapper(sched_ctxs[s]);
 			if(sc_w->submitted_flops < sc_w->total_flops)
 				ready_to_size = 0;
 		}
@@ -358,7 +358,7 @@ static double _glp_resolve(int ns, int nw, int nt, double tasks[nw][nt], double
 					glp_set_col_bnds(lp, nw*nt+s*nw+w+1, GLP_DB, 0.0, 1.0);
 			}
 
-		int *sched_ctxs = in_sched_ctxs == NULL ? sched_ctx_hypervisor_get_sched_ctxs() : in_sched_ctxs;
+		int *sched_ctxs = in_sched_ctxs == NULL ? sc_hypervisor_get_sched_ctxs() : in_sched_ctxs;
 
 		int curr_row_idx = 0;
 		/* Total worker execution time */
@@ -529,7 +529,7 @@ static double _glp_resolve(int ns, int nw, int nt, double tasks[nw][nt], double
 
 static void teft_lp_handle_poped_task(unsigned sched_ctx, int worker, struct starpu_task *task, uint32_t footprint)
 {
-	struct sched_ctx_hypervisor_wrapper* sc_w = sched_ctx_hypervisor_get_wrapper(sched_ctx);
+	struct sc_hypervisor_wrapper* sc_w = sc_hypervisor_get_wrapper(sched_ctx);
 
 	int ret = starpu_pthread_mutex_trylock(&act_hypervisor_mutex);
 	if(ret != EBUSY)
@@ -542,7 +542,7 @@ static void teft_lp_handle_poped_task(unsigned sched_ctx, int worker, struct sta
 
 		if(_velocity_gap_btw_ctxs())
 		{
-			int ns = sched_ctx_hypervisor_get_nsched_ctxs();
+			int ns = sc_hypervisor_get_nsched_ctxs();
 			int nw = starpu_worker_get_count(); /* Number of different workers */
 			int nt = 0; /* Number of different kinds of tasks */
 
@@ -594,10 +594,10 @@ static void teft_lp_handle_poped_task(unsigned sched_ctx, int worker, struct sta
 
 static void teft_lp_size_ctxs(int *sched_ctxs, int nsched_ctxs , int *workers, int nworkers)
 {
-	sched_ctx_hypervisor_save_size_req(sched_ctxs, nsched_ctxs, workers, nworkers);
+	sc_hypervisor_save_size_req(sched_ctxs, nsched_ctxs, workers, nworkers);
 }
 
-struct sched_ctx_hypervisor_policy teft_lp_policy = {
+struct sc_hypervisor_policy teft_lp_policy = {
 	.size_ctxs = teft_lp_size_ctxs,
 	.handle_poped_task = teft_lp_handle_poped_task,
 	.handle_pushed_task = NULL,

+ 22 - 22
sc_hypervisor/src/policies_utils/lp_tools.c

@@ -15,8 +15,8 @@
  */
 
 #include <math.h>
-#include "sched_ctx_hypervisor_lp.h"
-#include "sched_ctx_hypervisor_policy.h"
+#include "sc_hypervisor_lp.h"
+#include "sc_hypervisor_policy.h"
 #include <starpu_config.h>
 
 #ifdef STARPU_HAVE_GLPK_H
@@ -223,27 +223,27 @@ double _lp_compute_nworkers_per_ctx(int ns, int nw, double v[ns][nw], double flo
 
 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();
+	int *sched_ctxs = sc_hypervisor_get_sched_ctxs();
 #ifdef STARPU_HAVE_GLPK_H
 	double v[nsched_ctxs][ntypes_of_workers];
 	double flops[nsched_ctxs];
 
 	int i = 0;
-	struct sched_ctx_hypervisor_wrapper* sc_w;
+	struct sc_hypervisor_wrapper* sc_w;
 	for(i = 0; i < nsched_ctxs; i++)
 	{
-		sc_w = sched_ctx_hypervisor_get_wrapper(sched_ctxs[i]);
+		sc_w = sc_hypervisor_get_wrapper(sched_ctxs[i]);
 #ifdef STARPU_USE_CUDA
 		int ncuda = starpu_worker_get_count_by_type(STARPU_CUDA_WORKER);
 		if(ncuda != 0)
 		{
-			v[i][0] = sched_ctx_hypervisor_get_velocity(sc_w, STARPU_CUDA_WORKER);
-			v[i][1] = sched_ctx_hypervisor_get_velocity(sc_w, STARPU_CPU_WORKER);
+			v[i][0] = sc_hypervisor_get_velocity(sc_w, STARPU_CUDA_WORKER);
+			v[i][1] = sc_hypervisor_get_velocity(sc_w, STARPU_CPU_WORKER);
 		}
 		else
-			v[i][0] = sched_ctx_hypervisor_get_velocity(sc_w, STARPU_CPU_WORKER);
+			v[i][0] = sc_hypervisor_get_velocity(sc_w, STARPU_CPU_WORKER);
 #else
-		v[i][0] = sched_ctx_hypervisor_get_velocity(sc_w, STARPU_CPU_WORKER);
+		v[i][0] = sc_hypervisor_get_velocity(sc_w, STARPU_CPU_WORKER);
 #endif // STARPU_USE_CUDA
 		flops[i] = sc_w->remaining_flops/1000000000; //sc_w->total_flops/1000000000; /* in gflops*/
 //		printf("%d: flops %lf\n", sched_ctxs[i], flops[i]);
@@ -261,7 +261,7 @@ double _lp_get_tmax(int nw, int *workers)
 	int total_nw[ntypes_of_workers];
 	_get_total_nw(workers, nw, 2, total_nw);
 
-	int nsched_ctxs = sched_ctx_hypervisor_get_nsched_ctxs();
+	int nsched_ctxs = sc_hypervisor_get_nsched_ctxs();
 
 	double res[nsched_ctxs][ntypes_of_workers];
 	return _lp_get_nworkers_per_ctx(nsched_ctxs, ntypes_of_workers, res, total_nw) * 1000;
@@ -340,7 +340,7 @@ void _lp_find_workers_to_give_away(int nw, int ns, unsigned sched_ctx, int sched
 		
 		if(w == 1)
 		{
-			int nworkers_ctx = sched_ctx_hypervisor_get_nworkers_ctx(sched_ctx, arch);
+			int nworkers_ctx = sc_hypervisor_get_nworkers_ctx(sched_ctx, arch);
 			if(nworkers_ctx > res_rounded[sched_ctx_idx][w])
 			{
 				int nworkers_to_move = nworkers_ctx - res_rounded[sched_ctx_idx][w];
@@ -353,7 +353,7 @@ void _lp_find_workers_to_give_away(int nw, int ns, unsigned sched_ctx, int sched
 		}
 		else
 		{
-			double nworkers_ctx = sched_ctx_hypervisor_get_nworkers_ctx(sched_ctx, arch) * 1.0;
+			double nworkers_ctx = sc_hypervisor_get_nworkers_ctx(sched_ctx, arch) * 1.0;
 			if(nworkers_ctx > res[sched_ctx_idx][w])
 			{
 				double nworkers_to_move = nworkers_ctx - res[sched_ctx_idx][w];
@@ -411,7 +411,7 @@ void _lp_find_workers_to_accept(int nw, int ns, unsigned sched_ctx, int sched_ct
 		if(w == 0) arch = STARPU_CUDA_WORKER;
 		if(w == 1) arch = STARPU_CPU_WORKER;
 		
-		int nw_ctx2 = sched_ctx_hypervisor_get_nworkers_ctx(sched_ctx, arch);
+		int nw_ctx2 = sc_hypervisor_get_nworkers_ctx(sched_ctx, arch);
 		int nw_needed = res_rounded[sched_ctx_idx][w] - nw_ctx2;
 		
 		if( nw_needed > 0 && tmp_nw_move[w] > 0)
@@ -482,7 +482,7 @@ void _lp_find_workers_to_remove(int nw, int tmp_nw_move[nw], int tmp_workers_mov
 
 void _lp_redistribute_resources_in_ctxs(int ns, int nw, int res_rounded[ns][nw], double res[ns][nw])
 {
-	int *sched_ctxs = sched_ctx_hypervisor_get_sched_ctxs();
+	int *sched_ctxs = sc_hypervisor_get_sched_ctxs();
 	int s, s2, w;
 	for(s = 0; s < ns; s++)
 	{
@@ -532,13 +532,13 @@ void _lp_redistribute_resources_in_ctxs(int ns, int nw, int res_rounded[ns][nw],
 				
 				if(nw_move > 0)
 				{
-					sched_ctx_hypervisor_move_workers(sched_ctxs[s], sched_ctxs[s2], workers_move, nw_move, 0);
+					sc_hypervisor_move_workers(sched_ctxs[s], sched_ctxs[s2], workers_move, nw_move, 0);
 					nw_move = 0;
 				}
 
 				if(nw_add > 0)
 				{
-					sched_ctx_hypervisor_add_workers_to_sched_ctx(workers_add, nw_add, sched_ctxs[s2]);
+					sc_hypervisor_add_workers_to_sched_ctx(workers_add, nw_add, sched_ctxs[s2]);
 					nw_add = 0;
 				}
 			}
@@ -552,7 +552,7 @@ void _lp_redistribute_resources_in_ctxs(int ns, int nw, int res_rounded[ns][nw],
 		_lp_find_workers_to_remove(nw, tmp_nw_move, tmp_workers_move, 
 					   &nw_move, workers_move);
 		if(nw_move > 0)
-			sched_ctx_hypervisor_remove_workers_from_sched_ctx(workers_move, nw_move, sched_ctxs[s], 0);
+			sc_hypervisor_remove_workers_from_sched_ctx(workers_move, nw_move, sched_ctxs[s], 0);
 	}
 }
 
@@ -626,11 +626,11 @@ void _lp_distribute_resources_in_ctxs(int* sched_ctxs, int ns, int nw, int res_r
 		}
 		if(nw_add > 0)
 		{
-			sched_ctx_hypervisor_add_workers_to_sched_ctx(workers_add, nw_add, sched_ctxs[s]);
-			sched_ctx_hypervisor_start_resize(sched_ctxs[s]);
+			sc_hypervisor_add_workers_to_sched_ctx(workers_add, nw_add, sched_ctxs[s]);
+			sc_hypervisor_start_resize(sched_ctxs[s]);
 		}
 
-//		sched_ctx_hypervisor_stop_resize(current_sched_ctxs[s]);
+//		sc_hypervisor_stop_resize(current_sched_ctxs[s]);
 	}
 }
 
@@ -677,12 +677,12 @@ void _lp_place_resources_in_ctx(int ns, int nw, double w_in_s[ns][nw], int *sche
 		_lp_redistribute_resources_in_ctxs(ns, 2, nworkers_rounded, nworkers);
 	else
 	{
-		int *current_sched_ctxs = sched_ctxs_input == NULL ? sched_ctx_hypervisor_get_sched_ctxs() : sched_ctxs_input;
+		int *current_sched_ctxs = sched_ctxs_input == NULL ? sc_hypervisor_get_sched_ctxs() : sched_ctxs_input;
 
 		unsigned has_workers = 0;
 		for(s = 0; s < ns; s++)
 		{
-			int nworkers_ctx = sched_ctx_hypervisor_get_nworkers_ctx(current_sched_ctxs[s], 
+			int nworkers_ctx = sc_hypervisor_get_nworkers_ctx(current_sched_ctxs[s], 
 										 STARPU_ANY_WORKER);
 			if(nworkers_ctx != 0)
 			{

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

@@ -15,11 +15,11 @@
  */
 
 
-#include "sched_ctx_hypervisor_policy.h"
+#include "sc_hypervisor_policy.h"
 
 static int _compute_priority(unsigned sched_ctx)
 {
-	struct sched_ctx_hypervisor_policy_config *config = sched_ctx_hypervisor_get_config(sched_ctx);
+	struct sc_hypervisor_policy_config *config = sc_hypervisor_get_config(sched_ctx);
 
 	int total_priority = 0;
 
@@ -46,18 +46,18 @@ unsigned _find_poor_sched_ctx(unsigned req_sched_ctx, int nworkers_to_move)
 	int highest_priority = -1;
 	int current_priority = 0;
 	unsigned sched_ctx = STARPU_NMAX_SCHED_CTXS;
-	int *sched_ctxs = sched_ctx_hypervisor_get_sched_ctxs();
-	int nsched_ctxs = sched_ctx_hypervisor_get_nsched_ctxs();
+	int *sched_ctxs = sc_hypervisor_get_sched_ctxs();
+	int nsched_ctxs = sc_hypervisor_get_nsched_ctxs();
 
 
-	struct sched_ctx_hypervisor_policy_config *config = NULL;
+	struct sc_hypervisor_policy_config *config = NULL;
 
 	for(i = 0; i < nsched_ctxs; i++)
 	{
 		if(sched_ctxs[i] != STARPU_NMAX_SCHED_CTXS && sched_ctxs[i] != req_sched_ctx)
 		{
 			unsigned nworkers = starpu_sched_ctx_get_nworkers(sched_ctxs[i]);
-			config  = sched_ctx_hypervisor_get_config(sched_ctxs[i]);
+			config  = sc_hypervisor_get_config(sched_ctxs[i]);
 			if((nworkers + nworkers_to_move) <= config->max_nworkers)
 			{
 				current_priority = _compute_priority(sched_ctxs[i]);
@@ -103,8 +103,8 @@ int* _get_first_workers_in_list(int *start, int *workers, int nall_workers,  int
 /* get first nworkers with the highest idle time in the context */
 int* _get_first_workers(unsigned sched_ctx, int *nworkers, enum starpu_archtype arch)
 {
-	struct sched_ctx_hypervisor_wrapper* sc_w = sched_ctx_hypervisor_get_wrapper(sched_ctx);
-	struct sched_ctx_hypervisor_policy_config *config = sched_ctx_hypervisor_get_config(sched_ctx);
+	struct sc_hypervisor_wrapper* sc_w = sc_hypervisor_get_wrapper(sched_ctx);
+	struct sc_hypervisor_policy_config *config = sc_hypervisor_get_config(sched_ctx);
 
 	int *curr_workers = (int*)malloc((*nworkers) * sizeof(int));
 	int i;
@@ -176,7 +176,7 @@ int* _get_first_workers(unsigned sched_ctx, int *nworkers, enum starpu_archtype
 }
 
 /* get the number of workers in the context that are allowed to be moved (that are not fixed) */
-unsigned _get_potential_nworkers(struct sched_ctx_hypervisor_policy_config *config, unsigned sched_ctx, enum starpu_archtype arch)
+unsigned _get_potential_nworkers(struct sc_hypervisor_policy_config *config, unsigned sched_ctx, enum starpu_archtype arch)
 {
 	struct starpu_worker_collection *workers = starpu_sched_ctx_get_worker_collection(sched_ctx);
 
@@ -205,7 +205,7 @@ unsigned _get_potential_nworkers(struct sched_ctx_hypervisor_policy_config *conf
    - on the resource granularity imposed by the user for the resizing process*/
 int _get_nworkers_to_move(unsigned req_sched_ctx)
 {
-       	struct sched_ctx_hypervisor_policy_config *config = sched_ctx_hypervisor_get_config(req_sched_ctx);
+       	struct sc_hypervisor_policy_config *config = sc_hypervisor_get_config(req_sched_ctx);
 	unsigned nworkers = starpu_sched_ctx_get_nworkers(req_sched_ctx);
 	unsigned nworkers_to_move = 0;
 
@@ -267,7 +267,7 @@ unsigned _resize(unsigned sender_sched_ctx, unsigned receiver_sched_ctx, unsigne
 			else
 			{
 				poor_sched_ctx = receiver_sched_ctx;
-				struct sched_ctx_hypervisor_policy_config *config = sched_ctx_hypervisor_get_config(poor_sched_ctx);
+				struct sc_hypervisor_policy_config *config = sc_hypervisor_get_config(poor_sched_ctx);
 				unsigned nworkers = starpu_sched_ctx_get_nworkers(poor_sched_ctx);
 				unsigned nshared_workers = starpu_sched_ctx_get_nshared_workers(sender_sched_ctx, poor_sched_ctx);
 				if((nworkers+nworkers_to_move-nshared_workers) > config->max_nworkers)
@@ -277,9 +277,9 @@ unsigned _resize(unsigned sender_sched_ctx, unsigned receiver_sched_ctx, unsigne
 			if(poor_sched_ctx != STARPU_NMAX_SCHED_CTXS)
 			{
 				int *workers_to_move = _get_first_workers(sender_sched_ctx, &nworkers_to_move, STARPU_ANY_WORKER);
-				sched_ctx_hypervisor_move_workers(sender_sched_ctx, poor_sched_ctx, workers_to_move, nworkers_to_move, now);
+				sc_hypervisor_move_workers(sender_sched_ctx, poor_sched_ctx, workers_to_move, nworkers_to_move, now);
 
-				struct sched_ctx_hypervisor_policy_config *new_config = sched_ctx_hypervisor_get_config(poor_sched_ctx);
+				struct sc_hypervisor_policy_config *new_config = sc_hypervisor_get_config(poor_sched_ctx);
 				int i;
 				for(i = 0; i < nworkers_to_move; i++)
 					new_config->max_idle[workers_to_move[i]] = new_config->max_idle[workers_to_move[i]] !=MAX_IDLE_TIME ? new_config->max_idle[workers_to_move[i]] :  new_config->new_workers_max_idle;
@@ -300,7 +300,7 @@ unsigned _resize_to_unknown_receiver(unsigned sender_sched_ctx, unsigned now)
 	return _resize(sender_sched_ctx, STARPU_NMAX_SCHED_CTXS, 0, now);
 }
 
-static double _get_ispeed_sample_for_type_of_worker(struct sched_ctx_hypervisor_wrapper* sc_w, enum starpu_archtype req_arch)
+static double _get_ispeed_sample_for_type_of_worker(struct sc_hypervisor_wrapper* sc_w, enum starpu_archtype req_arch)
 {
 	struct starpu_worker_collection *workers = starpu_sched_ctx_get_worker_collection(sc_w->sched_ctx);
         int worker;
@@ -317,7 +317,7 @@ static double _get_ispeed_sample_for_type_of_worker(struct sched_ctx_hypervisor_
                 enum starpu_archtype arch = starpu_worker_get_type(worker);
                 if(arch == req_arch)
                 {
-			struct sched_ctx_hypervisor_policy_config *config = sched_ctx_hypervisor_get_config(sc_w->sched_ctx);
+			struct sc_hypervisor_policy_config *config = sc_hypervisor_get_config(sc_w->sched_ctx);
 			avg += config->ispeed_w_sample[worker];
 			n++;
 		}
@@ -329,7 +329,7 @@ static double _get_ispeed_sample_for_type_of_worker(struct sched_ctx_hypervisor_
 static double _get_ispeed_sample_for_sched_ctx(unsigned sched_ctx)
 {
 	struct starpu_worker_collection *workers = starpu_sched_ctx_get_worker_collection(sched_ctx);
-	struct sched_ctx_hypervisor_policy_config *config = sched_ctx_hypervisor_get_config(sched_ctx);
+	struct sc_hypervisor_policy_config *config = sc_hypervisor_get_config(sched_ctx);
         
 	int worker;
 	double ispeed_sample = 0.0;
@@ -347,13 +347,13 @@ static double _get_ispeed_sample_for_sched_ctx(unsigned sched_ctx)
 	return ispeed_sample;
 }
 
-double _get_ctx_velocity(struct sched_ctx_hypervisor_wrapper* sc_w)
+double _get_ctx_velocity(struct sc_hypervisor_wrapper* sc_w)
 {
-	struct sched_ctx_hypervisor_policy_config *config = sched_ctx_hypervisor_get_config(sc_w->sched_ctx);
-        double elapsed_flops = sched_ctx_hypervisor_get_elapsed_flops_per_sched_ctx(sc_w);
+	struct sc_hypervisor_policy_config *config = sc_hypervisor_get_config(sc_w->sched_ctx);
+        double elapsed_flops = sc_hypervisor_get_elapsed_flops_per_sched_ctx(sc_w);
 	double sample = _get_ispeed_sample_for_sched_ctx(sc_w->sched_ctx);
 
-/* 	double total_elapsed_flops = sched_ctx_hypervisor_get_total_elapsed_flops_per_sched_ctx(sc_w); */
+/* 	double total_elapsed_flops = sc_hypervisor_get_total_elapsed_flops_per_sched_ctx(sc_w); */
 /* 	double prc = config->ispeed_ctx_sample != 0.0 ? elapsed_flops : elapsed_flops/sc_w->total_flops; */
 /* 	double redim_sample = config->ispeed_ctx_sample != 0.0 ? config->ispeed_ctx_sample :  */
 /* 		(elapsed_flops == total_elapsed_flops ? HYPERVISOR_START_REDIM_SAMPLE : HYPERVISOR_REDIM_SAMPLE); */
@@ -375,20 +375,20 @@ double _get_ctx_velocity(struct sched_ctx_hypervisor_wrapper* sc_w)
 
 double _get_slowest_ctx_exec_time(void)
 {
-	int *sched_ctxs = sched_ctx_hypervisor_get_sched_ctxs();
-	int nsched_ctxs = sched_ctx_hypervisor_get_nsched_ctxs();
+	int *sched_ctxs = sc_hypervisor_get_sched_ctxs();
+	int nsched_ctxs = sc_hypervisor_get_nsched_ctxs();
 
 /* 	double curr_time = starpu_timing_now(); */
 	double slowest_time = 0.0;
 
 	int s;
-	struct sched_ctx_hypervisor_wrapper* sc_w;		
+	struct sc_hypervisor_wrapper* sc_w;		
 	for(s = 0; s < nsched_ctxs; s++)
 	{
-		sc_w = sched_ctx_hypervisor_get_wrapper(sched_ctxs[s]);
+		sc_w = sc_hypervisor_get_wrapper(sched_ctxs[s]);
 
 //		double elapsed_time  = (curr_time - sc_w->start_time)/1000000;
-		struct sched_ctx_hypervisor_policy_config *config = sched_ctx_hypervisor_get_config(sc_w->sched_ctx);
+		struct sc_hypervisor_policy_config *config = sc_hypervisor_get_config(sc_w->sched_ctx);
 		double elapsed_time = (config->ispeed_ctx_sample/1000000000.0)/_get_ctx_velocity(sc_w);
 		if(elapsed_time > slowest_time)
 			slowest_time = elapsed_time;
@@ -399,19 +399,19 @@ double _get_slowest_ctx_exec_time(void)
 
 double _get_fastest_ctx_exec_time(void)
 {
-	int *sched_ctxs = sched_ctx_hypervisor_get_sched_ctxs();
-	int nsched_ctxs = sched_ctx_hypervisor_get_nsched_ctxs();
+	int *sched_ctxs = sc_hypervisor_get_sched_ctxs();
+	int nsched_ctxs = sc_hypervisor_get_nsched_ctxs();
 
 	double curr_time = starpu_timing_now();
  	double fastest_time = curr_time;
 
 	int s;
-	struct sched_ctx_hypervisor_wrapper* sc_w;		
+	struct sc_hypervisor_wrapper* sc_w;		
 	for(s = 0; s < nsched_ctxs; s++)
 	{
-		sc_w = sched_ctx_hypervisor_get_wrapper(sched_ctxs[s]);
+		sc_w = sc_hypervisor_get_wrapper(sched_ctxs[s]);
 
-		struct sched_ctx_hypervisor_policy_config *config = sched_ctx_hypervisor_get_config(sc_w->sched_ctx);
+		struct sc_hypervisor_policy_config *config = sc_hypervisor_get_config(sc_w->sched_ctx);
 		double elapsed_time = (config->ispeed_ctx_sample/1000000000.0)/_get_ctx_velocity(sc_w);
 		
 		if(elapsed_time < fastest_time)
@@ -423,7 +423,7 @@ double _get_fastest_ctx_exec_time(void)
 }
 
 
-double _get_velocity_per_worker(struct sched_ctx_hypervisor_wrapper *sc_w, unsigned worker)
+double _get_velocity_per_worker(struct sc_hypervisor_wrapper *sc_w, unsigned worker)
 {
 	if(!starpu_sched_ctx_contains_worker(worker, sc_w->sched_ctx))
 		return -1.0;
@@ -431,10 +431,10 @@ double _get_velocity_per_worker(struct sched_ctx_hypervisor_wrapper *sc_w, unsig
         double elapsed_flops = sc_w->elapsed_flops[worker] / 1000000000.0; /*in gflops */
 	size_t elapsed_data_used = sc_w->elapsed_data[worker];
 	int elapsed_tasks = sc_w->elapsed_tasks[worker];
-	struct sched_ctx_hypervisor_policy_config *config = sched_ctx_hypervisor_get_config(sc_w->sched_ctx);
+	struct sc_hypervisor_policy_config *config = sc_hypervisor_get_config(sc_w->sched_ctx);
 	double sample = config->ispeed_w_sample[worker] / 1000000000.0; /*in gflops */
 
-	double ctx_elapsed_flops = sched_ctx_hypervisor_get_elapsed_flops_per_sched_ctx(sc_w);
+	double ctx_elapsed_flops = sc_hypervisor_get_elapsed_flops_per_sched_ctx(sc_w);
 	double ctx_sample = config->ispeed_ctx_sample;
 	if(ctx_elapsed_flops > ctx_sample && elapsed_flops == 0.0)
 		return 0.00000000000001;
@@ -480,7 +480,7 @@ double _get_velocity_per_worker(struct sched_ctx_hypervisor_wrapper *sc_w, unsig
 
 }
 
-static double _get_best_elapsed_flops(struct sched_ctx_hypervisor_wrapper* sc_w, int *npus, enum starpu_archtype req_arch)
+static double _get_best_elapsed_flops(struct sc_hypervisor_wrapper* sc_w, int *npus, enum starpu_archtype req_arch)
 {
 	double ret_val = 0.0;
 	struct starpu_worker_collection *workers = starpu_sched_ctx_get_worker_collection(sc_w->sched_ctx);
@@ -506,7 +506,7 @@ static double _get_best_elapsed_flops(struct sched_ctx_hypervisor_wrapper* sc_w,
 }
 
 /* compute an average value of the cpu/cuda velocity */
-double _get_velocity_per_worker_type(struct sched_ctx_hypervisor_wrapper* sc_w, enum starpu_archtype arch)
+double _get_velocity_per_worker_type(struct sc_hypervisor_wrapper* sc_w, enum starpu_archtype arch)
 {
         int npus = 0;
         double elapsed_flops = _get_best_elapsed_flops(sc_w, &npus, arch) / 1000000000.0 ; /* in gflops */
@@ -528,15 +528,15 @@ double _get_velocity_per_worker_type(struct sched_ctx_hypervisor_wrapper* sc_w,
 /* check if there is a big velocity gap between the contexts */
 int _velocity_gap_btw_ctxs()
 {
-	int *sched_ctxs = sched_ctx_hypervisor_get_sched_ctxs();
-	int nsched_ctxs = sched_ctx_hypervisor_get_nsched_ctxs();
+	int *sched_ctxs = sc_hypervisor_get_sched_ctxs();
+	int nsched_ctxs = sc_hypervisor_get_nsched_ctxs();
 	int i = 0, j = 0;
-	struct sched_ctx_hypervisor_wrapper* sc_w;
-	struct sched_ctx_hypervisor_wrapper* other_sc_w;
+	struct sc_hypervisor_wrapper* sc_w;
+	struct sc_hypervisor_wrapper* other_sc_w;
 
 	for(i = 0; i < nsched_ctxs; i++)
 	{
-		sc_w = sched_ctx_hypervisor_get_wrapper(sched_ctxs[i]);
+		sc_w = sc_hypervisor_get_wrapper(sched_ctxs[i]);
 		double ctx_v = _get_ctx_velocity(sc_w);
 		if(ctx_v != -1.0)
 		{
@@ -548,7 +548,7 @@ int _velocity_gap_btw_ctxs()
 					if(nworkers == 0) 
 						return 1;
 
-					other_sc_w = sched_ctx_hypervisor_get_wrapper(sched_ctxs[j]);
+					other_sc_w = sc_hypervisor_get_wrapper(sched_ctxs[j]);
 					double other_ctx_v = _get_ctx_velocity(other_sc_w);
 					if(other_ctx_v != -1.0)
 					{

+ 63 - 63
sc_hypervisor/src/sc_hypervisor.c

@@ -14,7 +14,7 @@
  * See the GNU Lesser General Public License in COPYING.LGPL for more details.
  */
 
-#include <sched_ctx_hypervisor_intern.h>
+#include <sc_hypervisor_intern.h>
 #include <common/uthash.h>
 #include <starpu_config.h>
 
@@ -30,19 +30,19 @@ static void notify_idle_end(unsigned sched_ctx, int  worker);
 static void notify_submitted_job(struct starpu_task *task, unsigned footprint);
 static void notify_delete_context(unsigned sched_ctx);
 
-extern struct sched_ctx_hypervisor_policy idle_policy;
-extern struct sched_ctx_hypervisor_policy app_driven_policy;
-extern struct sched_ctx_hypervisor_policy gflops_rate_policy;
+extern struct sc_hypervisor_policy idle_policy;
+extern struct sc_hypervisor_policy app_driven_policy;
+extern struct sc_hypervisor_policy gflops_rate_policy;
 #ifdef STARPU_HAVE_GLPK_H
-extern struct sched_ctx_hypervisor_policy feft_lp_policy;
-extern struct sched_ctx_hypervisor_policy teft_lp_policy;
-extern struct sched_ctx_hypervisor_policy ispeed_lp_policy;
-extern struct sched_ctx_hypervisor_policy debit_lp_policy;
+extern struct sc_hypervisor_policy feft_lp_policy;
+extern struct sc_hypervisor_policy teft_lp_policy;
+extern struct sc_hypervisor_policy ispeed_lp_policy;
+extern struct sc_hypervisor_policy debit_lp_policy;
 #endif // STARPU_HAVE_GLPK_
-extern struct sched_ctx_hypervisor_policy ispeed_policy;
+extern struct sc_hypervisor_policy ispeed_policy;
 
 
-static struct sched_ctx_hypervisor_policy *predefined_policies[] =
+static struct sc_hypervisor_policy *predefined_policies[] =
 {
         &idle_policy,
 	&app_driven_policy,
@@ -56,7 +56,7 @@ static struct sched_ctx_hypervisor_policy *predefined_policies[] =
 	&ispeed_policy
 };
 
-static void _load_hypervisor_policy(struct sched_ctx_hypervisor_policy *policy)
+static void _load_hypervisor_policy(struct sc_hypervisor_policy *policy)
 {
 	STARPU_ASSERT(policy);
 
@@ -72,7 +72,7 @@ static void _load_hypervisor_policy(struct sched_ctx_hypervisor_policy *policy)
 }
 
 
-static struct sched_ctx_hypervisor_policy *_find_hypervisor_policy_from_name(const char *policy_name)
+static struct sc_hypervisor_policy *_find_hypervisor_policy_from_name(const char *policy_name)
 {
 
 	if (!policy_name)
@@ -81,7 +81,7 @@ static struct sched_ctx_hypervisor_policy *_find_hypervisor_policy_from_name(con
 	unsigned i;
 	for (i = 0; i < sizeof(predefined_policies)/sizeof(predefined_policies[0]); i++)
 	{
-		struct sched_ctx_hypervisor_policy *p;
+		struct sc_hypervisor_policy *p;
 		p = predefined_policies[i];
 		if (p->name)
 		{
@@ -97,9 +97,9 @@ static struct sched_ctx_hypervisor_policy *_find_hypervisor_policy_from_name(con
 	return NULL;
 }
 
-static struct sched_ctx_hypervisor_policy *_select_hypervisor_policy(struct sched_ctx_hypervisor_policy* hypervisor_policy)
+static struct sc_hypervisor_policy *_select_hypervisor_policy(struct sc_hypervisor_policy* hypervisor_policy)
 {
-	struct sched_ctx_hypervisor_policy *selected_policy = NULL;
+	struct sc_hypervisor_policy *selected_policy = NULL;
 
 	if(hypervisor_policy && hypervisor_policy->custom)
 		return hypervisor_policy;
@@ -129,7 +129,7 @@ static struct sched_ctx_hypervisor_policy *_select_hypervisor_policy(struct sche
 
 
 /* initializez the performance counters that starpu will use to retrive hints for resizing */
-struct starpu_sched_ctx_performance_counters* sched_ctx_hypervisor_init(struct sched_ctx_hypervisor_policy *hypervisor_policy)
+struct starpu_sched_ctx_performance_counters* sc_hypervisor_init(struct sc_hypervisor_policy *hypervisor_policy)
 {
 	hypervisor.min_tasks = 0;
 	hypervisor.nsched_ctxs = 0;
@@ -172,7 +172,7 @@ struct starpu_sched_ctx_performance_counters* sched_ctx_hypervisor_init(struct s
 		}
 	}
 
-	struct sched_ctx_hypervisor_policy *selected_hypervisor_policy = _select_hypervisor_policy(hypervisor_policy);
+	struct sc_hypervisor_policy *selected_hypervisor_policy = _select_hypervisor_policy(hypervisor_policy);
 	_load_hypervisor_policy(selected_hypervisor_policy);
 
 	perf_counters = (struct starpu_sched_ctx_performance_counters*)malloc(sizeof(struct starpu_sched_ctx_performance_counters));
@@ -189,20 +189,20 @@ struct starpu_sched_ctx_performance_counters* sched_ctx_hypervisor_init(struct s
 	return perf_counters;
 }
 
-const char* sched_ctx_hypervisor_get_policy()
+const char* sc_hypervisor_get_policy()
 {
 	return hypervisor.policy.name;
 }
 
 /* the user can forbid the resizing process*/
-void sched_ctx_hypervisor_stop_resize(unsigned sched_ctx)
+void sc_hypervisor_stop_resize(unsigned sched_ctx)
 {
 	imposed_resize = 1;
 	hypervisor.resize[sched_ctx] = 0;
 }
 
 /* the user can restart the resizing process*/
-void sched_ctx_hypervisor_start_resize(unsigned sched_ctx)
+void sc_hypervisor_start_resize(unsigned sched_ctx)
 {
 	imposed_resize = 1;
 	hypervisor.resize[sched_ctx] = 1;
@@ -218,19 +218,19 @@ static void _print_current_time()
 	{
 		if(hypervisor.sched_ctxs[i] != STARPU_NMAX_SCHED_CTXS)
 		{
-			struct sched_ctx_hypervisor_wrapper *sc_w = &hypervisor.sched_ctx_w[hypervisor.sched_ctxs[i]];
+			struct sc_hypervisor_wrapper *sc_w = &hypervisor.sched_ctx_w[hypervisor.sched_ctxs[i]];
 
-			double cpu_speed = sched_ctx_hypervisor_get_velocity(sc_w, STARPU_CPU_WORKER);
-			double cuda_speed = sched_ctx_hypervisor_get_velocity(sc_w, STARPU_CUDA_WORKER);
-			int ncpus = sched_ctx_hypervisor_get_nworkers_ctx(sc_w->sched_ctx, STARPU_CPU_WORKER);
-			int ncuda = sched_ctx_hypervisor_get_nworkers_ctx(sc_w->sched_ctx, STARPU_CUDA_WORKER);
+			double cpu_speed = sc_hypervisor_get_velocity(sc_w, STARPU_CPU_WORKER);
+			double cuda_speed = sc_hypervisor_get_velocity(sc_w, STARPU_CUDA_WORKER);
+			int ncpus = sc_hypervisor_get_nworkers_ctx(sc_w->sched_ctx, STARPU_CPU_WORKER);
+			int ncuda = sc_hypervisor_get_nworkers_ctx(sc_w->sched_ctx, STARPU_CUDA_WORKER);
 			fprintf(stdout, "%d: cpu_v = %lf cuda_v = %lf ncpus = %d ncuda = %d\n", hypervisor.sched_ctxs[i], cpu_speed, cuda_speed, ncpus, ncuda);
 		}
 	}
 	return;
 }
 
-void sched_ctx_hypervisor_shutdown(void)
+void sc_hypervisor_shutdown(void)
 {
 //	printf("shutdown\n");
 	int i;
@@ -238,8 +238,8 @@ void sched_ctx_hypervisor_shutdown(void)
 	{
                 if(hypervisor.sched_ctxs[i] != STARPU_NMAX_SCHED_CTXS && hypervisor.nsched_ctxs > 0)
 		{
-			sched_ctx_hypervisor_stop_resize(hypervisor.sched_ctxs[i]);
-			sched_ctx_hypervisor_unregister_ctx(hypervisor.sched_ctxs[i]);
+			sc_hypervisor_stop_resize(hypervisor.sched_ctxs[i]);
+			sc_hypervisor_unregister_ctx(hypervisor.sched_ctxs[i]);
 			starpu_pthread_mutex_destroy(&hypervisor.sched_ctx_w[i].mutex);
 		}
 	}
@@ -257,7 +257,7 @@ void sched_ctx_hypervisor_shutdown(void)
 }
 
 /* the hypervisor is in charge only of the contexts registered to it*/
-void sched_ctx_hypervisor_register_ctx(unsigned sched_ctx, double total_flops)
+void sc_hypervisor_register_ctx(unsigned sched_ctx, double total_flops)
 {
 	starpu_pthread_mutex_lock(&act_hypervisor_mutex);
 	hypervisor.configurations[sched_ctx] = NULL;
@@ -309,7 +309,7 @@ static void _rearange_sched_ctxs(int *sched_ctxs, int old_nsched_ctxs)
 }
 
 /* unregistered contexts will no longer be resized */
-void sched_ctx_hypervisor_unregister_ctx(unsigned sched_ctx)
+void sc_hypervisor_unregister_ctx(unsigned sched_ctx)
 {
 	if(hypervisor.policy.end_ctx)
 		hypervisor.policy.end_ctx(sched_ctx);
@@ -334,12 +334,12 @@ void sched_ctx_hypervisor_unregister_ctx(unsigned sched_ctx)
 	starpu_pthread_mutex_destroy(&hypervisor.conf_mut[sched_ctx]);
 	starpu_pthread_mutex_destroy(&hypervisor.resize_mut[sched_ctx]);
 	if(hypervisor.nsched_ctxs == 1)
-		sched_ctx_hypervisor_stop_resize(hypervisor.sched_ctxs[0]);
+		sc_hypervisor_stop_resize(hypervisor.sched_ctxs[0]);
 
 	starpu_pthread_mutex_unlock(&act_hypervisor_mutex);
 }
 
-static double _get_best_total_elapsed_flops(struct sched_ctx_hypervisor_wrapper* sc_w, int *npus, enum starpu_archtype req_arch)
+static double _get_best_total_elapsed_flops(struct sc_hypervisor_wrapper* sc_w, int *npus, enum starpu_archtype req_arch)
 {
 	double ret_val = 0.0;
 	struct starpu_worker_collection *workers = starpu_sched_ctx_get_worker_collection(sc_w->sched_ctx);
@@ -365,7 +365,7 @@ static double _get_best_total_elapsed_flops(struct sched_ctx_hypervisor_wrapper*
 }
 
 /* compute an average value of the cpu/cuda velocity */
-double sched_ctx_hypervisor_get_velocity_per_worker_type(struct sched_ctx_hypervisor_wrapper* sc_w, enum starpu_archtype arch)
+double sc_hypervisor_get_velocity_per_worker_type(struct sc_hypervisor_wrapper* sc_w, enum starpu_archtype arch)
 {
         int npus = 0;
         double elapsed_flops = _get_best_total_elapsed_flops(sc_w, &npus, arch) / 1000000000.0 ; /* in gflops */
@@ -384,7 +384,7 @@ double sched_ctx_hypervisor_get_velocity_per_worker_type(struct sched_ctx_hyperv
 }
 
 /* compute an average value of the cpu/cuda old velocity */
-double _get_ref_velocity_per_worker_type(struct sched_ctx_hypervisor_wrapper* sc_w, enum starpu_archtype arch)
+double _get_ref_velocity_per_worker_type(struct sc_hypervisor_wrapper* sc_w, enum starpu_archtype arch)
 {
 	double ref_velocity = 0.0;
 	unsigned nw = 0;
@@ -437,7 +437,7 @@ static void _get_cpus(int *workers, int nworkers, int *cpus, int *ncpus)
 	}
 }
 
-int sched_ctx_hypervisor_get_nworkers_ctx(unsigned sched_ctx, enum starpu_archtype arch)
+int sc_hypervisor_get_nworkers_ctx(unsigned sched_ctx, enum starpu_archtype arch)
 {
 	int nworkers_ctx = 0;
 	struct starpu_worker_collection *workers = starpu_sched_ctx_get_worker_collection(sched_ctx);
@@ -471,7 +471,7 @@ static void _set_elapsed_flops_per_sched_ctx(unsigned sched_ctx, double val)
 	}
 }
 
-double sched_ctx_hypervisor_get_elapsed_flops_per_sched_ctx(struct sched_ctx_hypervisor_wrapper* sc_w)
+double sc_hypervisor_get_elapsed_flops_per_sched_ctx(struct sc_hypervisor_wrapper* sc_w)
 {
 	double ret_val = 0.0;
 	int i;
@@ -480,7 +480,7 @@ double sched_ctx_hypervisor_get_elapsed_flops_per_sched_ctx(struct sched_ctx_hyp
 	return ret_val;
 }
 
-double sched_ctx_hypervisor_get_total_elapsed_flops_per_sched_ctx(struct sched_ctx_hypervisor_wrapper* sc_w)
+double sc_hypervisor_get_total_elapsed_flops_per_sched_ctx(struct sc_hypervisor_wrapper* sc_w)
 {
 	double ret_val = 0.0;
 	int i;
@@ -493,8 +493,8 @@ double sched_ctx_hypervisor_get_total_elapsed_flops_per_sched_ctx(struct sched_c
 void _reset_resize_sample_info(unsigned sender_sched_ctx, unsigned receiver_sched_ctx)
 {
 	/* info concerning only the gflops_rate strateg */
-	struct sched_ctx_hypervisor_wrapper *sender_sc_w = &hypervisor.sched_ctx_w[sender_sched_ctx];
-	struct sched_ctx_hypervisor_wrapper *receiver_sc_w = &hypervisor.sched_ctx_w[receiver_sched_ctx];
+	struct sc_hypervisor_wrapper *sender_sc_w = &hypervisor.sched_ctx_w[sender_sched_ctx];
+	struct sc_hypervisor_wrapper *receiver_sc_w = &hypervisor.sched_ctx_w[receiver_sched_ctx];
 	
 	double start_time =  starpu_timing_now();
 	sender_sc_w->start_time = start_time;
@@ -506,7 +506,7 @@ void _reset_resize_sample_info(unsigned sender_sched_ctx, unsigned receiver_sche
 
 /* actually move the workers: the cpus are moved, gpus are only shared  */
 /* forbids another resize request before this one is take into account */
-void sched_ctx_hypervisor_move_workers(unsigned sender_sched_ctx, unsigned receiver_sched_ctx, int* workers_to_move, unsigned nworkers_to_move, unsigned now)
+void sc_hypervisor_move_workers(unsigned sender_sched_ctx, unsigned receiver_sched_ctx, int* workers_to_move, unsigned nworkers_to_move, unsigned now)
 {
 	if(nworkers_to_move > 0 && hypervisor.resize[sender_sched_ctx])
 	{
@@ -556,7 +556,7 @@ void sched_ctx_hypervisor_move_workers(unsigned sender_sched_ctx, unsigned recei
 				starpu_pthread_mutex_unlock(&hypervisor.sched_ctx_w[sender_sched_ctx].mutex);
 			}
 		}
-		struct sched_ctx_hypervisor_policy_config *new_config = sched_ctx_hypervisor_get_config(receiver_sched_ctx);
+		struct sc_hypervisor_policy_config *new_config = sc_hypervisor_get_config(receiver_sched_ctx);
 		unsigned i;
 		for(i = 0; i < nworkers_to_move; i++)
 			new_config->max_idle[workers_to_move[i]] = new_config->max_idle[workers_to_move[i]] !=MAX_IDLE_TIME ? new_config->max_idle[workers_to_move[i]] :  new_config->new_workers_max_idle;
@@ -565,7 +565,7 @@ void sched_ctx_hypervisor_move_workers(unsigned sender_sched_ctx, unsigned recei
 	return;
 }
 
-void sched_ctx_hypervisor_add_workers_to_sched_ctx(int* workers_to_add, unsigned nworkers_to_add, unsigned sched_ctx)
+void sc_hypervisor_add_workers_to_sched_ctx(int* workers_to_add, unsigned nworkers_to_add, unsigned sched_ctx)
 {
 	if(nworkers_to_add > 0 && hypervisor.resize[sched_ctx])
 	{
@@ -576,7 +576,7 @@ void sched_ctx_hypervisor_add_workers_to_sched_ctx(int* workers_to_add, unsigned
 			printf(" %d", workers_to_add[j]);
 		printf("\n");
 		starpu_sched_ctx_add_workers(workers_to_add, nworkers_to_add, sched_ctx);
-		struct sched_ctx_hypervisor_policy_config *new_config = sched_ctx_hypervisor_get_config(sched_ctx);
+		struct sc_hypervisor_policy_config *new_config = sc_hypervisor_get_config(sched_ctx);
 		unsigned i;
 		for(i = 0; i < nworkers_to_add; i++)
 			new_config->max_idle[workers_to_add[i]] = new_config->max_idle[workers_to_add[i]] != MAX_IDLE_TIME ? new_config->max_idle[workers_to_add[i]] :  new_config->new_workers_max_idle;
@@ -585,12 +585,12 @@ void sched_ctx_hypervisor_add_workers_to_sched_ctx(int* workers_to_add, unsigned
 	return;
 }
 
-unsigned sched_ctx_hypervisor_can_resize(unsigned sched_ctx)
+unsigned sc_hypervisor_can_resize(unsigned sched_ctx)
 {
 	return hypervisor.resize[sched_ctx];
 }
 
-void sched_ctx_hypervisor_remove_workers_from_sched_ctx(int* workers_to_remove, unsigned nworkers_to_remove, unsigned sched_ctx, unsigned now)
+void sc_hypervisor_remove_workers_from_sched_ctx(int* workers_to_remove, unsigned nworkers_to_remove, unsigned sched_ctx, unsigned now)
 {
 	if(nworkers_to_remove > 0 && hypervisor.resize[sched_ctx] && hypervisor.allow_remove[sched_ctx])
 	{
@@ -651,7 +651,7 @@ static unsigned _ack_resize_completed(unsigned sched_ctx, int worker)
 	if(worker != -1 && !starpu_sched_ctx_contains_worker(worker, sched_ctx))
 		return 0;
 
-	struct sched_ctx_hypervisor_resize_ack *resize_ack = NULL;
+	struct sc_hypervisor_resize_ack *resize_ack = NULL;
 	unsigned sender_sched_ctx = STARPU_NMAX_SCHED_CTXS;
 
 	int i;
@@ -659,7 +659,7 @@ static unsigned _ack_resize_completed(unsigned sched_ctx, int worker)
 	{
 		if(hypervisor.sched_ctxs[i] != STARPU_NMAX_SCHED_CTXS)
 		{
-			struct sched_ctx_hypervisor_wrapper *sc_w = &hypervisor.sched_ctx_w[hypervisor.sched_ctxs[i]];
+			struct sc_hypervisor_wrapper *sc_w = &hypervisor.sched_ctx_w[hypervisor.sched_ctxs[i]];
 			starpu_pthread_mutex_lock(&sc_w->mutex);
 			unsigned only_remove = 0;
 			if(sc_w->resize_ack.receiver_sched_ctx == -1 && hypervisor.sched_ctxs[i] != (int)sched_ctx &&
@@ -753,7 +753,7 @@ static unsigned _ack_resize_completed(unsigned sched_ctx, int worker)
 
 /* Enqueue a resize request for 'sched_ctx', to be executed when the
  * 'task_tag' tasks of 'sched_ctx' complete.  */
-void sched_ctx_hypervisor_resize(unsigned sched_ctx, int task_tag)
+void sc_hypervisor_resize(unsigned sched_ctx, int task_tag)
 {
 	struct resize_request_entry *entry;
 
@@ -784,7 +784,7 @@ static void notify_idle_cycle(unsigned sched_ctx, int worker, double idle_time)
 {
 	if(hypervisor.resize[sched_ctx])
 	{
-		struct sched_ctx_hypervisor_wrapper *sc_w = &hypervisor.sched_ctx_w[sched_ctx];
+		struct sc_hypervisor_wrapper *sc_w = &hypervisor.sched_ctx_w[sched_ctx];
 		sc_w->current_idle_time[worker] += idle_time;
 		if(hypervisor.policy.handle_idle_cycle)
 		{
@@ -825,7 +825,7 @@ static void notify_poped_task(unsigned sched_ctx, int worker, struct starpu_task
 	hypervisor.sched_ctx_w[sched_ctx].elapsed_data[worker] += data_size ;
 	hypervisor.sched_ctx_w[sched_ctx].elapsed_tasks[worker]++ ;
 	hypervisor.sched_ctx_w[sched_ctx].total_elapsed_flops[worker] += task->flops;
-	hypervisor.sched_ctx_w[sched_ctx].remaining_flops -= task->flops; //sched_ctx_hypervisor_get_elapsed_flops_per_sched_ctx(&hypervisor.sched_ctx_w[sched_ctx]);
+	hypervisor.sched_ctx_w[sched_ctx].remaining_flops -= task->flops; //sc_hypervisor_get_elapsed_flops_per_sched_ctx(&hypervisor.sched_ctx_w[sched_ctx]);
 
 	if(hypervisor.resize[sched_ctx])
 	{	
@@ -859,9 +859,9 @@ static void notify_post_exec_hook(unsigned sched_ctx, int task_tag)
 
 		if (entry != NULL)
 		{
-			struct sched_ctx_hypervisor_policy_config *config = entry->configuration;
+			struct sc_hypervisor_policy_config *config = entry->configuration;
 
-			sched_ctx_hypervisor_set_config(conf_sched_ctx, config);
+			sc_hypervisor_set_config(conf_sched_ctx, config);
 			HASH_DEL(hypervisor.configurations[conf_sched_ctx], entry);
 			free(config);
 		}
@@ -900,7 +900,7 @@ static void notify_submitted_job(struct starpu_task *task, uint32_t footprint)
 		hypervisor.policy.handle_submitted_job(task->cl, task->sched_ctx, footprint);
 }
 
-void sched_ctx_hypervisor_set_type_of_task(struct starpu_codelet *cl, unsigned sched_ctx, uint32_t footprint)
+void sc_hypervisor_set_type_of_task(struct starpu_codelet *cl, unsigned sched_ctx, uint32_t footprint)
 {
 	type_of_tasks_known = 1;
 	if(hypervisor.policy.handle_submitted_job)
@@ -910,10 +910,10 @@ void sched_ctx_hypervisor_set_type_of_task(struct starpu_codelet *cl, unsigned s
 static void notify_delete_context(unsigned sched_ctx)
 {
 	_print_current_time();
-	sched_ctx_hypervisor_unregister_ctx(sched_ctx);
+	sc_hypervisor_unregister_ctx(sched_ctx);
 }
 
-void sched_ctx_hypervisor_size_ctxs(int *sched_ctxs, int nsched_ctxs, int *workers, int nworkers)
+void sc_hypervisor_size_ctxs(int *sched_ctxs, int nsched_ctxs, int *workers, int nworkers)
 {
 	starpu_pthread_mutex_lock(&act_hypervisor_mutex);
 	unsigned curr_nsched_ctxs = sched_ctxs == NULL ? hypervisor.nsched_ctxs : nsched_ctxs;
@@ -927,24 +927,24 @@ void sched_ctx_hypervisor_size_ctxs(int *sched_ctxs, int nsched_ctxs, int *worke
 		hypervisor.policy.size_ctxs(curr_sched_ctxs, curr_nsched_ctxs, workers, nworkers);
 }
 
-struct sched_ctx_hypervisor_wrapper* sched_ctx_hypervisor_get_wrapper(unsigned sched_ctx)
+struct sc_hypervisor_wrapper* sc_hypervisor_get_wrapper(unsigned sched_ctx)
 {
 	return &hypervisor.sched_ctx_w[sched_ctx];
 }
 
-int* sched_ctx_hypervisor_get_sched_ctxs()
+int* sc_hypervisor_get_sched_ctxs()
 {
 	return hypervisor.sched_ctxs;
 }
 
-int sched_ctx_hypervisor_get_nsched_ctxs()
+int sc_hypervisor_get_nsched_ctxs()
 {
 	int ns;
 	ns = hypervisor.nsched_ctxs;
 	return ns;
 }
 
-void sched_ctx_hypervisor_save_size_req(int *sched_ctxs, int nsched_ctxs, int *workers, int nworkers)
+void sc_hypervisor_save_size_req(int *sched_ctxs, int nsched_ctxs, int *workers, int nworkers)
 {
 	hypervisor.sr = (struct size_request*)malloc(sizeof(struct size_request));
 	hypervisor.sr->sched_ctxs = sched_ctxs;
@@ -953,7 +953,7 @@ void sched_ctx_hypervisor_save_size_req(int *sched_ctxs, int nsched_ctxs, int *w
 	hypervisor.sr->nworkers = nworkers;
 }
 
-unsigned sched_ctx_hypervisor_get_size_req(int **sched_ctxs, int* nsched_ctxs, int **workers, int *nworkers)
+unsigned sc_hypervisor_get_size_req(int **sched_ctxs, int* nsched_ctxs, int **workers, int *nworkers)
 {
 	if(hypervisor.sr != NULL)
 	{
@@ -966,7 +966,7 @@ unsigned sched_ctx_hypervisor_get_size_req(int **sched_ctxs, int* nsched_ctxs, i
 	return 0;
 }
 
-void sched_ctx_hypervisor_free_size_req(void)
+void sc_hypervisor_free_size_req(void)
 {
 	if(hypervisor.sr != NULL)
 	{
@@ -975,10 +975,10 @@ void sched_ctx_hypervisor_free_size_req(void)
 	}
 }
 
-double sched_ctx_hypervisor_get_velocity(struct sched_ctx_hypervisor_wrapper *sc_w, enum starpu_archtype arch)
+double sc_hypervisor_get_velocity(struct sc_hypervisor_wrapper *sc_w, enum starpu_archtype arch)
 {
 
-	double velocity = sched_ctx_hypervisor_get_velocity_per_worker_type(sc_w, arch);
+	double velocity = sc_hypervisor_get_velocity_per_worker_type(sc_w, arch);
 	if(velocity == -1.0)
 		velocity = _get_ref_velocity_per_worker_type(sc_w, arch);
 	if(velocity == -1.0)

+ 7 - 7
sc_hypervisor/src/sc_hypervisor_intern.h

@@ -14,7 +14,7 @@
  * See the GNU Lesser General Public License in COPYING.LGPL for more details.
  */
 
-#include <sched_ctx_hypervisor.h>
+#include <sc_hypervisor.h>
 #include <common/uthash.h>
 struct size_request
 {
@@ -46,21 +46,21 @@ struct configuration_entry
 	uint32_t task_tag;
 
 	/* Value: configuration of the scheduling context.  */
-	struct sched_ctx_hypervisor_policy_config *configuration;
+	struct sc_hypervisor_policy_config *configuration;
 
 	/* Bookkeeping.  */
 	UT_hash_handle hh;
 };
 
-struct sched_ctx_hypervisor
+struct sc_hypervisor
 {
-	struct sched_ctx_hypervisor_wrapper sched_ctx_w[STARPU_NMAX_SCHED_CTXS];
+	struct sc_hypervisor_wrapper sched_ctx_w[STARPU_NMAX_SCHED_CTXS];
 	int sched_ctxs[STARPU_NMAX_SCHED_CTXS];
 	unsigned nsched_ctxs;
 	unsigned resize[STARPU_NMAX_SCHED_CTXS];
 	unsigned allow_remove[STARPU_NMAX_SCHED_CTXS];
 	int min_tasks;
-	struct sched_ctx_hypervisor_policy policy;
+	struct sc_hypervisor_policy policy;
 
 	struct configuration_entry *configurations[STARPU_NMAX_SCHED_CTXS];
 
@@ -76,13 +76,13 @@ struct sched_ctx_hypervisor
 	double start_executing_time;
 };
 
-struct sched_ctx_hypervisor_adjustment
+struct sc_hypervisor_adjustment
 {
 	int workerids[STARPU_NMAXWORKERS];
 	int nworkers;
 };
 
-struct sched_ctx_hypervisor hypervisor;
+struct sc_hypervisor hypervisor;
 
 
 void _add_config(unsigned sched_ctx);