priorities.c 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. /* StarPU --- Runtime system for heterogeneous multicore architectures.
  2. *
  3. * Copyright (C) 2010 Université de Bordeaux 1
  4. *
  5. * StarPU is free software; you can redistribute it and/or modify
  6. * it under the terms of the GNU Lesser General Public License as published by
  7. * the Free Software Foundation; either version 2.1 of the License, or (at
  8. * your option) any later version.
  9. *
  10. * StarPU is distributed in the hope that it will be useful, but
  11. * WITHOUT ANY WARRANTY; without even the implied warranty of
  12. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
  13. *
  14. * See the GNU Lesser General Public License in COPYING.LGPL for more details.
  15. */
  16. #include <starpu.h>
  17. #include <starpu_scheduler.h>
  18. #include <common/config.h>
  19. /* By default we have a binary type of priority: either a task is a priority
  20. * task (level 1) or it is not (level 0). */
  21. static int sched_min_prio = 0;
  22. static int sched_max_prio = 1;
  23. /* The scheduling policy may set its own priority bounds in case it supports
  24. * different priority levels. These methods should only be called from the
  25. * scheduling policy. */
  26. void starpu_sched_set_min_priority(int min_prio)
  27. {
  28. sched_min_prio = min_prio;
  29. }
  30. void starpu_sched_set_max_priority(int max_prio)
  31. {
  32. sched_max_prio = max_prio;
  33. }
  34. /* Returns the minimum priority level supported by the scheduling policy. */
  35. int starpu_sched_get_min_priority(void)
  36. {
  37. return sched_min_prio;
  38. }
  39. /* Returns the maximum priority level supported by the scheduling policy. */
  40. int starpu_sched_get_max_priority(void)
  41. {
  42. return sched_max_prio;
  43. }