Browse Source

sched_policies: remove old starpu_deque_jobq internal interface

Samuel Pitoiset 9 years ago
parent
commit
53197aee7b
3 changed files with 0 additions and 197 deletions
  1. 0 2
      src/Makefile.am
  2. 0 143
      src/sched_policies/deque_queues.c
  3. 0 52
      src/sched_policies/deque_queues.h

+ 0 - 2
src/Makefile.am

@@ -89,7 +89,6 @@ noinst_HEADERS = 						\
 	core/detect_combined_workers.h				\
 	sched_policies/helper_mct.h				\
 	sched_policies/fifo_queues.h				\
-	sched_policies/deque_queues.h				\
 	sched_policies/stack_queues.h				\
 	datawizard/footprint.h					\
 	datawizard/datawizard.h					\
@@ -201,7 +200,6 @@ libstarpu_@STARPU_EFFECTIVE_VERSION@_la_SOURCES = 		\
 	sched_policies/deque_modeling_policy_data_aware.c	\
 	sched_policies/random_policy.c				\
 	sched_policies/stack_queues.c				\
-	sched_policies/deque_queues.c				\
 	sched_policies/fifo_queues.c				\
 	sched_policies/parallel_heft.c				\
 	sched_policies/parallel_eager.c				\

+ 0 - 143
src/sched_policies/deque_queues.c

@@ -1,143 +0,0 @@
-/* StarPU --- Runtime system for heterogeneous multicore architectures.
- *
- * Copyright (C) 2010-2011, 2014-2015  Université de Bordeaux
- * Copyright (C) 2010, 2011, 2013  CNRS
- * Copyright (C) 2011  Télécom-SudParis
- *
- * 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.
- */
-
-/* Deque queues, ready for use by schedulers */
-
-#include <starpu.h>
-#include <starpu_scheduler.h>
-#include <sched_policies/deque_queues.h>
-
-#include <core/workers.h>
-
-struct _starpu_deque_jobq *_starpu_create_deque(void)
-{
-	struct _starpu_deque_jobq *deque;
-	deque = (struct _starpu_deque_jobq *) malloc(sizeof(struct _starpu_deque_jobq));
-
-	/* note that not all mechanisms (eg. the semaphore) have to be used */
-	_starpu_job_list_init(&deque->jobq);
-	deque->njobs = 0;
-	deque->nprocessed = 0;
-
-	deque->exp_start = starpu_timing_now();
-	deque->exp_len = 0.0;
-	deque->exp_end = deque->exp_start;
-
-	return deque;
-}
-
-void _starpu_destroy_deque(struct _starpu_deque_jobq *deque)
-{
-	free(deque);
-}
-
-unsigned _starpu_get_deque_njobs(struct _starpu_deque_jobq *deque_queue)
-{
-	return deque_queue->njobs;
-}
-
-int _starpu_get_deque_nprocessed(struct _starpu_deque_jobq *deque_queue)
-{
-	return deque_queue->nprocessed;
-}
-
-struct starpu_task *_starpu_deque_pop_task(struct _starpu_deque_jobq *deque_queue, int workerid)
-{
-	struct _starpu_job *j = NULL;
-
-	if ((deque_queue->njobs == 0) && _starpu_machine_is_running())
-	{
-		return NULL;
-	}
-
-	/* TODO find a task that suits workerid */
-	for (j  = _starpu_job_list_begin(&deque_queue->jobq);
-	     j != _starpu_job_list_end(&deque_queue->jobq);
-	     j  = _starpu_job_list_next(j))
-	{
-		unsigned nimpl;
-		STARPU_ASSERT(j);
-
-		if (starpu_worker_can_execute_task_first_impl(workerid, j->task, &nimpl))
-		{
-			j->nimpl = nimpl;
-			j = _starpu_job_list_pop_front(&deque_queue->jobq);
-			return j->task;
-		}
-	}
-
-	return NULL;
-}
-
-struct _starpu_job_list *_starpu_deque_pop_every_task(struct _starpu_deque_jobq *deque_queue, starpu_pthread_mutex_t *sched_mutex, int workerid)
-{
-	struct _starpu_job_list *new_list, *old_list;
-
-	/* block until some task is available in that queue */
-	STARPU_PTHREAD_MUTEX_LOCK(sched_mutex);
-
-	if (deque_queue->njobs == 0)
-	{
-		new_list = NULL;
-	}
-	else
-	{
-		/* there is a task */
-		old_list = &deque_queue->jobq;
-		new_list = _starpu_job_list_new();
-
-		unsigned new_list_size = 0;
-
-		struct _starpu_job *i;
-		struct _starpu_job *next_job;
-		/* note that this starts at the _head_ of the list, so we put
- 		 * elements at the back of the new list */
-		for(i = _starpu_job_list_begin(old_list);
-			i != _starpu_job_list_end(old_list);
-			i  = next_job)
-		{
-			unsigned nimpl;
-			next_job = _starpu_job_list_next(i);
-
-			if (starpu_worker_can_execute_task_first_impl(workerid, i->task, &nimpl))
-			{
-				/* this elements can be moved into the new list */
-				new_list_size++;
-
-				_starpu_job_list_erase(old_list, i);
-				_starpu_job_list_push_back(new_list, i);
-				i->nimpl = nimpl;
-			}
-		}
-
-		if (new_list_size == 0)
-		{
-			/* the new list is empty ... */
-			_starpu_job_list_delete(new_list);
-			new_list = NULL;
-		}
-		else
-		{
-			deque_queue->njobs -= new_list_size;
-		}
-	}
-
-	STARPU_PTHREAD_MUTEX_UNLOCK(sched_mutex);
-
-	return new_list;
-}

+ 0 - 52
src/sched_policies/deque_queues.h

@@ -1,52 +0,0 @@
-/* StarPU --- Runtime system for heterogeneous multicore architectures.
- *
- * Copyright (C) 2010-2011, 2015  Université de Bordeaux
- *
- * 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.
- */
-
-/* Deque queues, ready for use by schedulers */
-
-#ifndef __DEQUE_QUEUES_H__
-#define __DEQUE_QUEUES_H__
-
-#include <starpu.h>
-#include <core/jobs.h>
-
-struct _starpu_deque_jobq
-{
-	/* the actual list */
-	struct _starpu_job_list jobq;
-
-	/* the number of tasks currently in the queue */
-	unsigned njobs;
-
-	/* the number of tasks that were processed */
-	int nprocessed;
-
-	/* only meaningful if the queue is only used by a single worker */
-	double exp_start; /* Expected start date of first task in the queue */
-	double exp_end; /* Expected end date of last task in the queue */
-	double exp_len; /* Expected duration of the set of tasks in the queue */
-};
-
-struct _starpu_deque_jobq *_starpu_create_deque(void);
-void _starpu_destroy_deque(struct _starpu_deque_jobq *deque);
-
-struct starpu_task *_starpu_deque_pop_task(struct _starpu_deque_jobq *deque_queue, int workerid);
-struct _starpu_job_list *_starpu_deque_pop_every_task(struct _starpu_deque_jobq *deque_queue, starpu_pthread_mutex_t *sched_mutex, int workerid);
-
-unsigned _starpu_get_deque_njobs(struct _starpu_deque_jobq *deque_queue);
-int _starpu_get_deque_nprocessed(struct _starpu_deque_jobq *deque_queue);
-
-
-#endif // __DEQUE_QUEUES_H__