Browse Source

merge fixes

Andra Hugo 13 years ago
parent
commit
290bc1cabd

+ 2 - 2
sched_ctx_hypervisor/Makefile.am

@@ -15,7 +15,7 @@
 
 SUBDIRS = src examples
 
-libsched_ctx_hypervisor_la_includedir=$(includedir)
+versincludedir = $(includedir)/starpu/$(STARPU_EFFECTIVE_VERSION)
 
-include_HEADERS = include/sched_ctx_hypervisor.h
+versinclude_HEADERS = include/sched_ctx_hypervisor.h
 

+ 2 - 2
sched_ctx_hypervisor/src/Makefile.am

@@ -15,7 +15,7 @@
 # See the GNU Lesser General Public License in COPYING.LGPL for more details.
 
 AM_CFLAGS = -Wall $(STARPU_CUDA_CPPFLAGS) $(STARPU_OPENCL_CPPFLAGS)
-LIBS = $(top_builddir)/src/libstarpu-1.0.la
+LIBS = $(top_builddir)/src/libstarpu-@STARPU_EFFECTIVE_VERSION@.la
 
 AM_CPPFLAGS = -I$(top_srcdir)/include/ -I$(top_builddir)/include/ -I$(top_builddir)/src/ -I$(top_srcdir)/sched_ctx_hypervisor/include/
 
@@ -23,7 +23,7 @@ AM_LDFLAGS = $(STARPU_CUDA_LDFLAGS) $(STARPU_OPENCL_LDFLAGS)
 
 lib_LTLIBRARIES = libsched_ctx_hypervisor.la
 
-libsched_ctx_hypervisor_la_LIBADD = $(top_builddir)/src/libstarpu-1.0.la
+libsched_ctx_hypervisor_la_LIBADD = $(top_builddir)/src/libstarpu-@STARPU_EFFECTIVE_VERSION@.la
 
 libsched_ctx_hypervisor_la_SOURCES = 			\
 	sched_ctx_hypervisor.c				\

+ 4 - 5
src/core/sched_ctx.c

@@ -650,7 +650,7 @@ void starpu_call_poped_task_cb(int workerid, unsigned sched_ctx_id, double flops
 {
 	struct _starpu_sched_ctx *sched_ctx = _starpu_get_sched_ctx_struct(sched_ctx_id);
 	if(sched_ctx != NULL && sched_ctx_id != 0 && sched_ctx_id != STARPU_NMAX_SCHED_CTXS
-		   && sched_ctx->perf_counters != NULL)
+	   && sched_ctx->perf_counters != NULL)
 		sched_ctx->perf_counters->notify_poped_task(sched_ctx_id, workerid, flops);
 }
 
@@ -658,10 +658,9 @@ void starpu_call_pushed_task_cb(int workerid, unsigned sched_ctx_id)
 {
 	struct _starpu_sched_ctx *sched_ctx = _starpu_get_sched_ctx_struct(sched_ctx_id);
 
-	if(sched_ctx != NULL && sched_ctx_id != 0)
-		if(sched_ctx->perf_counters != NULL)
-			sched_ctx->perf_counters->notify_pushed_task(sched_ctx_id, workerid);
-
+	if(sched_ctx != NULL && sched_ctx_id != 0 && sched_ctx_id != STARPU_NMAX_SCHED_CTXS
+	   && sched_ctx->perf_counters != NULL)
+		sched_ctx->perf_counters->notify_pushed_task(sched_ctx_id, workerid);
 }
 
 #endif //STARPU_USE_SCHED_CTX_HYPERVISOR

+ 19 - 18
src/core/sched_policy.c

@@ -246,12 +246,13 @@ static int _starpu_push_task_on_specific_worker(struct starpu_task *task, int wo
 		if (sched_ctx != NULL && sched_ctx->sched_policy != NULL && sched_ctx->sched_policy->push_task_notify)
 		{
 			sched_ctx->sched_policy->push_task_notify(task, workerid);
-#ifdef STARPU_USE_SCHED_CTX_HYPERVISOR
-			starpu_call_pushed_task_cb(workerid, sched_ctx->id);
-#endif //STARPU_USE_SCHED_CTX_HYPERVISOR
 		}
 
 	}
+
+#ifdef STARPU_USE_SCHED_CTX_HYPERVISOR
+	starpu_call_pushed_task_cb(workerid, task->sched_ctx);
+#endif //STARPU_USE_SCHED_CTX_HYPERVISOR
 	
 	if (is_basic_worker)
 	{
@@ -312,21 +313,21 @@ static int _starpu_push_task_on_specific_worker(struct starpu_task *task, int wo
 
 static int _starpu_nworkers_able_to_execute_task(struct starpu_task *task, struct _starpu_sched_ctx *sched_ctx)
 {
-  int worker = -1, nworkers = 0;
-  struct worker_collection *workers = sched_ctx->workers;
-  if(workers->init_cursor)
-    workers->init_cursor(workers);
-  
-  while(workers->has_next(workers))
-    {
-      worker = workers->get_next(workers);
-      if (starpu_worker_can_execute_task(worker, task, 0))
-		  nworkers++;
-    }
-  
-  if(workers->init_cursor)
-    workers->deinit_cursor(workers);
-  return nworkers;
+	int worker = -1, nworkers = 0;
+	struct worker_collection *workers = sched_ctx->workers;
+	if(workers->init_cursor)
+		workers->init_cursor(workers);
+	
+	while(workers->has_next(workers))
+	{
+		worker = workers->get_next(workers);
+		if (starpu_worker_can_execute_task(worker, task, 0))
+			nworkers++;
+	}
+	
+	if(workers->init_cursor)
+		workers->deinit_cursor(workers);
+	return nworkers;
 }
 
 /* the generic interface that call the proper underlying implementation */

+ 5 - 5
src/datawizard/user_interactions.c

@@ -152,12 +152,12 @@ int starpu_data_acquire_cb(starpu_data_handle_t handle,
 		_STARPU_PTHREAD_MUTEX_UNLOCK(&handle->sequential_consistency_mutex);
 
 		if (new_task) {
-			int ret = starpu_task_submit(new_task);
+			int ret = _starpu_task_submit_internally(new_task);
 			STARPU_ASSERT(!ret);
 		}
 
 		/* TODO detect if this is superflous */
-		int ret = starpu_task_submit(wrapper->pre_sync_task);
+		int ret = _starpu_task_submit_internally(wrapper->pre_sync_task);
 		STARPU_ASSERT(!ret);
 	}
 	else
@@ -216,7 +216,7 @@ int starpu_data_acquire(starpu_data_handle_t handle, enum starpu_access_mode mod
 		handle->busy_count--;
 		handle->mf_node = 0;
 		task->synchronous = 1;
-		ret = starpu_task_submit(task);
+		ret = _starpu_task_submit_internally(task);
 		STARPU_ASSERT(!ret);
 	}
 
@@ -252,13 +252,13 @@ int starpu_data_acquire(starpu_data_handle_t handle, enum starpu_access_mode mod
 		new_task = _starpu_detect_implicit_data_deps_with_handle(wrapper.pre_sync_task, wrapper.post_sync_task, handle, mode);
 		_STARPU_PTHREAD_MUTEX_UNLOCK(&handle->sequential_consistency_mutex);
 		if (new_task) {
-			int ret = starpu_task_submit(new_task);
+			int ret = _starpu_task_submit_internally(new_task);
 			STARPU_ASSERT(!ret);
 		}
 
 		/* TODO detect if this is superflous */
 		wrapper.pre_sync_task->synchronous = 1;
-		int ret = starpu_task_submit(wrapper.pre_sync_task);
+		int ret = _starpu_task_submit_internally(wrapper.pre_sync_task);
 		STARPU_ASSERT(!ret);
 	}
 	else