소스 검색

separate sched_ctx in its own file

Andra Hugo 14 년 전
부모
커밋
d56cf117eb
6개의 변경된 파일309개의 추가작업 그리고 267개의 파일을 삭제
  1. 268 0
      src/core/sched_ctx.c
  2. 36 0
      src/core/sched_ctx.h
  3. 0 255
      src/core/sched_policy.c
  4. 3 12
      src/core/sched_policy.h
  5. 1 0
      src/drivers/cpu/driver_cpu.c
  6. 1 0
      src/drivers/cuda/driver_cuda.c

+ 268 - 0
src/core/sched_ctx.c

@@ -0,0 +1,268 @@
+#include <pthread.h>
+
+#include <starpu.h>
+#include <common/config.h>
+#include <common/utils.h>
+#include <core/sched_ctx.h>
+#include <core/sched_policy.h>
+#include <profiling/profiling.h>
+
+static pthread_cond_t blocking_ths_cond = PTHREAD_COND_INITIALIZER;
+static pthread_cond_t wakeup_ths_cond = PTHREAD_COND_INITIALIZER;
+static pthread_mutex_t blocking_ths_mutex = PTHREAD_MUTEX_INITIALIZER;
+static int nblocked_ths = 0;
+
+void _starpu_create_sched_ctx(struct starpu_sched_ctx *sched_ctx, const char *policy_name, int
+			      *workerids_in_ctx, int nworkerids_in_ctx, unsigned is_init_sched)
+{
+  sched_ctx->nworkers_in_ctx = nworkerids_in_ctx;
+  sched_ctx->sched_policy = malloc(sizeof(struct starpu_sched_policy_s));
+  sched_ctx->is_init_sched = is_init_sched;
+
+  struct starpu_machine_config_s *config = (struct starpu_machine_config_s *)_starpu_get_machine_config();
+  int nworkers = config->topology.nworkers;
+
+  int j;
+  /*all the workers are in this contex*/
+  if(workerids_in_ctx == NULL){
+    for(j = 0; j < nworkers; j++){
+      sched_ctx->workerid[j] = j;
+      struct starpu_worker_s *workerarg = _starpu_get_worker_struct(j);
+      workerarg->sched_ctx[workerarg->nctxs++] = sched_ctx;
+    }
+    sched_ctx->nworkers_in_ctx = nworkers;
+  } else {
+    int i;
+    for(i = 0; i < nworkerids_in_ctx; i++){
+      sched_ctx->workerid[i] = workerids_in_ctx[i];
+      for(j = 0; j < nworkers; j++){
+	if(sched_ctx->workerid[i] == j){
+	        struct starpu_worker_s *workerarg = _starpu_get_worker_struct(j);
+		workerarg->sched_ctx[workerarg->nctxs++] = sched_ctx;
+	}
+      }
+    }
+  }
+
+  _starpu_init_sched_policy(config, sched_ctx, policy_name);
+
+  return;
+}
+
+void _starpu_decrement_nblocked_ths(void)
+{
+  PTHREAD_MUTEX_LOCK(&blocking_ths_mutex);
+
+  if(--nblocked_ths == 0)
+    PTHREAD_COND_BROADCAST(&wakeup_ths_cond);
+
+  PTHREAD_MUTEX_UNLOCK(&blocking_ths_mutex);
+}
+
+void _starpu_increment_nblocked_ths(int nworkers)
+{
+  PTHREAD_MUTEX_LOCK(&blocking_ths_mutex);
+  if (++nblocked_ths == nworkers)
+    PTHREAD_COND_BROADCAST(&blocking_ths_cond);
+
+  PTHREAD_MUTEX_UNLOCK(&blocking_ths_mutex);
+}
+
+static int _starpu_wait_for_all_threads_to_block(int nworkers)
+{
+  PTHREAD_MUTEX_LOCK(&blocking_ths_mutex);
+
+  while (nblocked_ths < nworkers)
+    PTHREAD_COND_WAIT(&blocking_ths_cond, &blocking_ths_mutex);
+
+  PTHREAD_MUTEX_UNLOCK(&blocking_ths_mutex);
+
+  return 0;
+}
+
+static int _starpu_wait_for_all_threads_to_wake_up(void)
+{
+  PTHREAD_MUTEX_LOCK(&blocking_ths_mutex);
+
+  while (nblocked_ths > 0)
+    PTHREAD_COND_WAIT(&wakeup_ths_cond, &blocking_ths_mutex);
+
+  PTHREAD_MUTEX_UNLOCK(&blocking_ths_mutex);
+
+  return 0;
+}
+
+static int set_changing_ctx_flag(starpu_worker_status changing_ctx, int nworkerids_in_ctx, int
+				 *workerids_in_ctx)
+{
+  struct starpu_machine_config_s *config = _starpu_get_machine_config();
+
+  int i;
+  int nworkers = nworkerids_in_ctx == -1 ? config->topology.nworkers : nworkerids_in_ctx;
+
+  struct starpu_worker_s *worker = NULL;
+  pthread_mutex_t *changing_ctx_mutex = NULL;
+  pthread_cond_t *changing_ctx_cond = NULL;
+
+  int workerid = -1;
+
+  for(i = 0; i < nworkers; i++)
+    {
+      workerid = workerids_in_ctx == NULL ? i : workerids_in_ctx[i];
+      worker = _starpu_get_worker_struct(workerid);
+
+      changing_ctx_mutex = &worker->changing_ctx_mutex;
+      changing_ctx_cond = &worker->changing_ctx_cond;
+
+      /*if the status is CHANGING_CTX let the thread know that it must block*/
+      PTHREAD_MUTEX_LOCK(changing_ctx_mutex);
+      worker->status = changing_ctx;
+      worker->nworkers_of_next_ctx = nworkers;
+      PTHREAD_MUTEX_UNLOCK(changing_ctx_mutex);
+
+      /*if we have finished changing the ctx wake up the blocked threads*/
+      if(changing_ctx == STATUS_UNKNOWN)
+	{
+	  PTHREAD_MUTEX_LOCK(changing_ctx_mutex);
+	  PTHREAD_COND_SIGNAL(changing_ctx_cond);
+	  PTHREAD_MUTEX_UNLOCK(changing_ctx_mutex);
+	}
+    }
+
+  /*after letting know all the concerned threads about the change                        
+    wait for them to take into account the info*/
+  if(changing_ctx == STATUS_CHANGING_CTX)
+    _starpu_wait_for_all_threads_to_block(nworkers);
+  else
+    _starpu_wait_for_all_threads_to_wake_up();
+
+  return 0;
+}
+
+void starpu_create_sched_ctx(struct starpu_sched_ctx *sched_ctx, const char *policy_name, int
+			     *workerids_in_ctx, int nworkerids_in_ctx)
+{
+  /* wait for the workers concerned by the change of contex                              
+   * to finish their work in the previous context */
+  if(!starpu_wait_for_all_tasks_of_workers(workerids_in_ctx, nworkerids_in_ctx))
+    {
+      /* block the workers until the contex is switched */
+      set_changing_ctx_flag(STATUS_CHANGING_CTX, nworkerids_in_ctx, workerids_in_ctx);
+      _starpu_create_sched_ctx(sched_ctx, policy_name, workerids_in_ctx, nworkerids_in_ctx, 0);
+      /* also wait the workers to wake up before using the context */
+      set_changing_ctx_flag(STATUS_UNKNOWN, nworkerids_in_ctx, workerids_in_ctx);
+    }
+  return;
+}
+
+int worker_belongs_to_ctx(struct starpu_worker_s *workerarg, struct starpu_sched_ctx *sched_ctx)
+{
+  unsigned i;
+  for(i = 0; i < workerarg->nctxs; i++)
+    if(sched_ctx != NULL && workerarg->sched_ctx[i] == sched_ctx
+       && workerarg->status != STATUS_JOINED)
+      return 1;
+  return 0;
+
+}
+void starpu_delete_sched_ctx(struct starpu_sched_ctx *sched_ctx)
+{
+  struct starpu_machine_config_s *config = _starpu_get_machine_config();
+  int nworkers = config->topology.nworkers;
+
+  int i;
+  for(i = 0; i < nworkers; i++)
+    {
+      struct starpu_worker_s *workerarg = _starpu_get_worker_struct(i);
+      if(worker_belongs_to_ctx(workerarg, sched_ctx))
+	workerarg->nctxs--;
+    }
+
+  free(sched_ctx->sched_policy);
+  sched_ctx->sched_policy = NULL;
+}
+
+void _starpu_delete_all_sched_ctxs()
+{
+  struct starpu_machine_config_s *config = _starpu_get_machine_config();
+  unsigned nworkers = config->topology.nworkers;
+
+  unsigned i, j;
+  struct starpu_sched_ctx *sched_ctx = NULL;
+  struct starpu_worker_s *workerarg = NULL;
+  for(i = 0; i < nworkers; i++)
+    {
+      workerarg = _starpu_get_worker_struct(i);
+      for(j = 0; j < workerarg->nctxs; j++)
+	{
+	  sched_ctx = workerarg->sched_ctx[j];
+	  if(sched_ctx != NULL && !sched_ctx->is_init_sched)
+	    {
+	      free(sched_ctx->sched_policy);
+	      sched_ctx->sched_policy = NULL;
+	      workerarg->nctxs--;
+
+	    }
+	}
+    }
+}
+
+int starpu_wait_for_all_tasks_of_worker(int workerid)
+{
+  if (STARPU_UNLIKELY(!_starpu_worker_may_perform_blocking_calls()))
+    return -EDEADLK;
+
+  struct starpu_worker_s *worker = _starpu_get_worker_struct(workerid);
+
+  PTHREAD_MUTEX_LOCK(&worker->submitted_mutex);
+
+  while (worker->nsubmitted > 0)
+    PTHREAD_COND_WAIT(&worker->submitted_cond, &worker->submitted_mutex);
+
+  PTHREAD_MUTEX_UNLOCK(&worker->submitted_mutex);
+
+  return 0;
+}
+
+int starpu_wait_for_all_tasks_of_workers(int *workerids_in_ctx, int nworkerids_in_ctx){
+  int ret_val = 0;
+
+  struct starpu_machine_config_s *config = _starpu_get_machine_config();
+  int nworkers = nworkerids_in_ctx == -1 ? config->topology.nworkers : nworkerids_in_ctx;
+
+  int workerid = -1;
+  int i, n;
+
+  for(i = 0; i < nworkers; i++)
+    {
+      workerid = workerids_in_ctx == NULL ? i : workerids_in_ctx[i];
+      n = starpu_wait_for_all_tasks_of_worker(workerid);
+      ret_val = ret_val && n;
+    }
+
+  return ret_val;
+}
+
+void _starpu_decrement_nsubmitted_tasks_of_worker(int workerid)
+{
+  struct starpu_worker_s *worker = _starpu_get_worker_struct(workerid);
+
+  PTHREAD_MUTEX_LOCK(&worker->submitted_mutex);
+
+  if (--worker->nsubmitted == 0)
+    PTHREAD_COND_BROADCAST(&worker->submitted_cond);
+
+  PTHREAD_MUTEX_UNLOCK(&worker->submitted_mutex);
+}
+
+void _starpu_increment_nsubmitted_tasks_of_worker(int workerid)
+{
+  struct starpu_worker_s *worker = _starpu_get_worker_struct(workerid);
+
+  PTHREAD_MUTEX_LOCK(&worker->submitted_mutex);
+
+  worker->nsubmitted++;
+
+  PTHREAD_MUTEX_UNLOCK(&worker->submitted_mutex);
+}
+

+ 36 - 0
src/core/sched_ctx.h

@@ -0,0 +1,36 @@
+ /* StarPU --- Runtime system for heterogeneous multicore architectures.
+ *
+ * Copyright (C) 2010  Université de Bordeaux 1
+ *
+ * StarPU is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as published by
+ * the Free Software Foundation; either version 2.1 of the License, or (at
+ * your option) any later version.
+ *
+ * StarPU is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+ *
+ * See the GNU Lesser General Public License in COPYING.LGPL for more details.
+ */
+
+#ifndef __SCHED_CONTEXT_H__
+#define __SCHED_CONTEXT_H__
+
+#include <starpu.h>
+#include <core/workers.h>
+#include <starpu_scheduler.h>
+
+
+void _starpu_create_sched_ctx(struct starpu_sched_ctx *sched_ctx, const char *policy_name, int *workerid, int nworkerids, unsigned is_init_sched);
+
+void _starpu_delete_all_sched_ctxs();
+
+void _starpu_increment_nblocked_ths(int nworkers);
+void _starpu_decrement_nblocked_ths(void);
+
+/* Keeps track of the number of tasks currently submitted to a worker */
+void _starpu_decrement_nsubmitted_tasks_of_worker(int workerid);
+void _starpu_increment_nsubmitted_tasks_of_worker(int workerid);
+
+#endif // __SCHED_CONTEXT_H__

+ 0 - 255
src/core/sched_policy.c

@@ -26,10 +26,6 @@
 //static struct starpu_sched_policy_s policy;
 //static struct starpu_sched_policy_s policy;
 
 
 static int use_prefetch = 0;
 static int use_prefetch = 0;
-static pthread_cond_t blocking_ths_cond = PTHREAD_COND_INITIALIZER;
-static pthread_cond_t wakeup_ths_cond = PTHREAD_COND_INITIALIZER;
-static pthread_mutex_t blocking_ths_mutex = PTHREAD_MUTEX_INITIALIZER;
-static int nblocked_ths = 0;
 
 
 int starpu_get_prefetch_flag(void)
 int starpu_get_prefetch_flag(void)
 {
 {
@@ -418,254 +414,3 @@ int starpu_push_local_task(int workerid, struct starpu_task *task, int back)
 
 
 	return _starpu_push_local_task(worker, task, back);
 	return _starpu_push_local_task(worker, task, back);
 }
 }
-
-void _starpu_create_sched_ctx(struct starpu_sched_ctx *sched_ctx, const char *policy_name, int *workerids_in_ctx, int nworkerids_in_ctx, unsigned is_init_sched)
-{
-	sched_ctx->nworkers_in_ctx = nworkerids_in_ctx;
-	sched_ctx->sched_policy = malloc(sizeof(struct starpu_sched_policy_s));
-	sched_ctx->is_init_sched = is_init_sched;
-
-	struct starpu_machine_config_s *config = _starpu_get_machine_config();
-	int nworkers = config->topology.nworkers;
-       
-	int j;
-	/*all the workers are in this contex*/
-	if(workerids_in_ctx == NULL){
-		for(j = 0; j < nworkers; j++){
-			sched_ctx->workerid[j] = j;
-			struct starpu_worker_s *workerarg = _starpu_get_worker_struct(j);
-			workerarg->sched_ctx[workerarg->nctxs++] = sched_ctx;
-		}
-		sched_ctx->nworkers_in_ctx = nworkers;
-	} else {
-		int i;
-		for(i = 0; i < nworkerids_in_ctx; i++){
-			sched_ctx->workerid[i] = workerids_in_ctx[i];
-			for(j = 0; j < nworkers; j++){
-				if(sched_ctx->workerid[i] == j){
-					struct starpu_worker_s *workerarg = _starpu_get_worker_struct(j);
-
-					workerarg->sched_ctx[workerarg->nctxs++] = sched_ctx;
-				}
-			}
-		}
-	}
-
-	_starpu_init_sched_policy(config, sched_ctx, policy_name);
-
-	return;
-}
-
-void _starpu_decrement_nblocked_ths(void)
-{
-	PTHREAD_MUTEX_LOCK(&blocking_ths_mutex);
-
-	if(--nblocked_ths == 0)
-		PTHREAD_COND_BROADCAST(&wakeup_ths_cond);
-
-	PTHREAD_MUTEX_UNLOCK(&blocking_ths_mutex);
-}
-
-void _starpu_increment_nblocked_ths(int nworkers)
-{
-	PTHREAD_MUTEX_LOCK(&blocking_ths_mutex);
-	if (++nblocked_ths == nworkers)
-		PTHREAD_COND_BROADCAST(&blocking_ths_cond);
-
-	PTHREAD_MUTEX_UNLOCK(&blocking_ths_mutex);
-}
-
-static int _starpu_wait_for_all_threads_to_block(int nworkers)
-{
-	PTHREAD_MUTEX_LOCK(&blocking_ths_mutex);
-
-	while (nblocked_ths < nworkers)
-		PTHREAD_COND_WAIT(&blocking_ths_cond, &blocking_ths_mutex);
-       
-	PTHREAD_MUTEX_UNLOCK(&blocking_ths_mutex);
-
-	return 0;
-}
-
-static int _starpu_wait_for_all_threads_to_wake_up(void)
-{
-	PTHREAD_MUTEX_LOCK(&blocking_ths_mutex);
-
-	while (nblocked_ths > 0)
-		PTHREAD_COND_WAIT(&wakeup_ths_cond, &blocking_ths_mutex);
-
-	PTHREAD_MUTEX_UNLOCK(&blocking_ths_mutex);
-	
-	return 0;
-}
-
-static int set_changing_ctx_flag(starpu_worker_status changing_ctx, int nworkerids_in_ctx, int *workerids_in_ctx)
-{
-	struct starpu_machine_config_s *config = _starpu_get_machine_config();
-
-	int i;
-	int nworkers = nworkerids_in_ctx == -1 ? config->topology.nworkers : nworkerids_in_ctx;
-	
-	struct starpu_worker_s *worker = NULL;
-	pthread_mutex_t *changing_ctx_mutex = NULL;
-	pthread_cond_t *changing_ctx_cond = NULL;
-
-	int workerid = -1;
-	
-	for(i = 0; i < nworkers; i++)
-	  {
-		workerid = workerids_in_ctx == NULL ? i : workerids_in_ctx[i];
-		worker = _starpu_get_worker_struct(workerid);
-		
-		changing_ctx_mutex = &worker->changing_ctx_mutex;
-		changing_ctx_cond = &worker->changing_ctx_cond;
-
-		/*if the status is CHANGING_CTX let the thread know that it must block*/
-		PTHREAD_MUTEX_LOCK(changing_ctx_mutex);
-		worker->status = changing_ctx;
-		worker->nworkers_of_next_ctx = nworkers;
-		PTHREAD_MUTEX_UNLOCK(changing_ctx_mutex);
-		
-		/*if we have finished changing the ctx wake up the blocked threads*/
-		if(changing_ctx == STATUS_UNKNOWN)
-		  {
-			PTHREAD_MUTEX_LOCK(changing_ctx_mutex);
-			PTHREAD_COND_SIGNAL(changing_ctx_cond);
-			PTHREAD_MUTEX_UNLOCK(changing_ctx_mutex);
-		  }
-	  }
-
-	/*after letting know all the concerned threads about the change
-	  wait for them to take into account the info*/
-	if(changing_ctx == STATUS_CHANGING_CTX)
-		_starpu_wait_for_all_threads_to_block(nworkers);
-	else
-		_starpu_wait_for_all_threads_to_wake_up();
-
-	return 0;
-}
-
-void starpu_create_sched_ctx(struct starpu_sched_ctx *sched_ctx, const char *policy_name, int *workerids_in_ctx, int nworkerids_in_ctx)
-{
-	/* wait for the workers concerned by the change of contex
-	 * to finish their work in the previous context */
-	if(!starpu_wait_for_all_tasks_of_workers(workerids_in_ctx, nworkerids_in_ctx))
-	  {
-		/* block the workers until the contex is switched */
-		set_changing_ctx_flag(STATUS_CHANGING_CTX, nworkerids_in_ctx, workerids_in_ctx);
-		_starpu_create_sched_ctx(sched_ctx, policy_name, workerids_in_ctx, nworkerids_in_ctx, 0);
-		/* also wait the workers to wake up before using the context */
-		set_changing_ctx_flag(STATUS_UNKNOWN, nworkerids_in_ctx, workerids_in_ctx);
-	  }
-	  return;
-}
-
-int worker_belongs_to_ctx(struct starpu_worker_s *workerarg, struct starpu_sched_ctx *sched_ctx)
-{
-	unsigned i;
-	for(i = 0; i < workerarg->nctxs; i++)
-		if(sched_ctx != NULL && workerarg->sched_ctx[i] == sched_ctx 
-		   && workerarg->status != STATUS_JOINED)
-		  return 1;
-	return 0;
-
-}
-void starpu_delete_sched_ctx(struct starpu_sched_ctx *sched_ctx)
-{
-	struct starpu_machine_config_s *config = _starpu_get_machine_config();
-	int nworkers = config->topology.nworkers;
-       
-	int i;
-	for(i = 0; i < nworkers; i++)
-	  {
-		struct starpu_worker_s *workerarg = _starpu_get_worker_struct(i);
-		if(worker_belongs_to_ctx(workerarg, sched_ctx))
-			workerarg->nctxs--;
-	  }
-
-	free(sched_ctx->sched_policy);
-	sched_ctx->sched_policy = NULL;
-}
-
-void _starpu_delete_all_sched_ctxs()
-{
-  	struct starpu_machine_config_s *config = _starpu_get_machine_config();
-	unsigned nworkers = config->topology.nworkers;
-
-	unsigned i, j;
-	struct starpu_sched_ctx *sched_ctx = NULL;
-	struct starpu_worker_s *workerarg = NULL;
-	for(i = 0; i < nworkers; i++)
-	  {
-		workerarg = _starpu_get_worker_struct(i);
-		for(j = 0; j < workerarg->nctxs; j++)
-		  {
-			sched_ctx = workerarg->sched_ctx[j];
-			if(sched_ctx != NULL && !sched_ctx->is_init_sched)
-			  {
-				free(sched_ctx->sched_policy);
-				sched_ctx->sched_policy = NULL;
-				workerarg->nctxs--;
-			  }
-		  }
-	  }
-}
-
-int starpu_wait_for_all_tasks_of_worker(int workerid)
-{
-	if (STARPU_UNLIKELY(!_starpu_worker_may_perform_blocking_calls()))
-		return -EDEADLK;
-
-	struct starpu_worker_s *worker = _starpu_get_worker_struct(workerid);
-
-	PTHREAD_MUTEX_LOCK(&worker->submitted_mutex);
-	
-	while (worker->nsubmitted > 0)
-		PTHREAD_COND_WAIT(&worker->submitted_cond, &worker->submitted_mutex);
-
-	PTHREAD_MUTEX_UNLOCK(&worker->submitted_mutex);
-
-	return 0;
-}
-
-int starpu_wait_for_all_tasks_of_workers(int *workerids_in_ctx, int nworkerids_in_ctx){
-	int ret_val = 0;
-
-	struct starpu_machine_config_s *config = _starpu_get_machine_config();
-	int nworkers = nworkerids_in_ctx == -1 ? config->topology.nworkers : nworkerids_in_ctx;
-
-	int workerid = -1;
-	int i, n;
-
-	for(i = 0; i < nworkers; i++)
-	  {
-		workerid = workerids_in_ctx == NULL ? i : workerids_in_ctx[i];
-		n = starpu_wait_for_all_tasks_of_worker(workerid);
-		ret_val = ret_val && n;
-	  }
-
-	return ret_val;
-}
-
-void _starpu_decrement_nsubmitted_tasks_of_worker(int workerid)
-{
-	struct starpu_worker_s *worker = _starpu_get_worker_struct(workerid);
-
-	PTHREAD_MUTEX_LOCK(&worker->submitted_mutex);
-
-	if (--worker->nsubmitted == 0)
-		PTHREAD_COND_BROADCAST(&worker->submitted_cond);
-
-	PTHREAD_MUTEX_UNLOCK(&worker->submitted_mutex);
-}
-
-void _starpu_increment_nsubmitted_tasks_of_worker(int workerid)
-{
-	struct starpu_worker_s *worker = _starpu_get_worker_struct(workerid);
-	
-	PTHREAD_MUTEX_LOCK(&worker->submitted_mutex);
-
-	worker->nsubmitted++;
-	
-	PTHREAD_MUTEX_UNLOCK(&worker->submitted_mutex);
-}

+ 3 - 12
src/core/sched_policy.h

@@ -25,7 +25,9 @@
 struct starpu_machine_config_s;
 struct starpu_machine_config_s;
 struct starpu_sched_policy_s *_starpu_get_sched_policy( struct starpu_sched_ctx *sched_ctx);
 struct starpu_sched_policy_s *_starpu_get_sched_policy( struct starpu_sched_ctx *sched_ctx);
 
 
-//void _starpu_init_sched_policy(struct starpu_machine_config_s *config, struct starpu_sched_ctx *sched_ctx);
+void _starpu_init_sched_policy(struct starpu_machine_config_s *config, 
+			       struct starpu_sched_ctx *sched_ctx, const char *policy_name);
+
 void _starpu_deinit_sched_policy(struct starpu_machine_config_s *config, struct starpu_sched_ctx *sched_ctx);
 void _starpu_deinit_sched_policy(struct starpu_machine_config_s *config, struct starpu_sched_ctx *sched_ctx);
 
 
 int _starpu_push_task(starpu_job_t task, unsigned job_is_already_locked);
 int _starpu_push_task(starpu_job_t task, unsigned job_is_already_locked);
@@ -37,15 +39,4 @@ void _starpu_sched_post_exec_hook(struct starpu_task *task);
 
 
 void _starpu_wait_on_sched_event(void);
 void _starpu_wait_on_sched_event(void);
 
 
-void _starpu_create_sched_ctx(struct starpu_sched_ctx *sched_ctx, const char *policy_name, int *workerid, int nworkerids, unsigned is_init_sched);
-
-void _starpu_delete_all_sched_ctxs();
-
-void _starpu_increment_nblocked_ths(int nworkers);
-void _starpu_decrement_nblocked_ths(void);
-
-/* Keeps track of the number of tasks currently submitted to a worker */
-void _starpu_decrement_nsubmitted_tasks_of_worker(int workerid);
-void _starpu_increment_nsubmitted_tasks_of_worker(int workerid);
-
 #endif // __SCHED_POLICY_H__
 #endif // __SCHED_POLICY_H__

+ 1 - 0
src/drivers/cpu/driver_cpu.c

@@ -25,6 +25,7 @@
 #include <core/debug.h>
 #include <core/debug.h>
 #include "driver_cpu.h"
 #include "driver_cpu.h"
 #include <core/sched_policy.h>
 #include <core/sched_policy.h>
+#include <core/sched_ctx.h>
 
 
 static int execute_job_on_cpu(starpu_job_t j, struct starpu_worker_s *cpu_args, int is_parallel_task, int rank, enum starpu_perf_archtype perf_arch)
 static int execute_job_on_cpu(starpu_job_t j, struct starpu_worker_s *cpu_args, int is_parallel_task, int rank, enum starpu_perf_archtype perf_arch)
 {
 {

+ 1 - 0
src/drivers/cuda/driver_cuda.c

@@ -25,6 +25,7 @@
 #include <drivers/driver_common/driver_common.h>
 #include <drivers/driver_common/driver_common.h>
 #include "driver_cuda.h"
 #include "driver_cuda.h"
 #include <core/sched_policy.h>
 #include <core/sched_policy.h>
+#include <core/sched_ctx.h>
 #include <profiling/profiling.h>
 #include <profiling/profiling.h>
 
 
 /* the number of CUDA devices */
 /* the number of CUDA devices */