소스 검색

scheduler: rename getter and setter functions for minimum and maximum task priorities

Nathalie Furmento 12 년 전
부모
커밋
26a6b33bf4

+ 2 - 1
ChangeLog

@@ -114,7 +114,6 @@ New features:
     and a Simgrid one. Applications using StarPU and wishing to use
     the Simgrid StarPU features should use it.
 
-
 Small features:
   * Add starpu_worker_get_by_type and starpu_worker_get_by_devid
   * Add starpu_fxt_stop_profiling/starpu_fxt_start_profiling which permits to
@@ -175,6 +174,8 @@ Changes:
   * Rename function starpu_helper_cublas_shutdown to starpu_cublas_shutdown
   * Rename function starpu_allocate_buffer_on_node to starpu_malloc_on_node
   * Rename function starpu_free_buffer_on_node to starpu_free_on_node
+  * Rename getter and setter functions for minimum and maximum task
+    priorities
 
 Small changes:
   * STARPU_NCPU should now be used instead of STARPU_NCPUS. STARPU_NCPUS is

+ 7 - 7
doc/chapters/advanced-api.texi

@@ -913,29 +913,29 @@ It is memorize through a local structure. This function assigns it to a scheduli
 Returns the policy data previously assigned to a context
 @end deftypefun
 
-@deftypefun void starpu_sched_set_min_priority (int @var{min_prio})
-Defines the minimum priority level supported by the scheduling policy. The
+@deftypefun void starpu_task_set_min_priority (int @var{min_prio})
+Defines the minimum task priority level supported by the scheduling policy. The
 default minimum priority level is the same as the default priority level which
 is 0 by convention.  The application may access that value by calling the
-@code{starpu_sched_get_min_priority} function. This function should only be
+@code{starpu_task_get_min_priority} function. This function should only be
 called from the initialization method of the scheduling policy, and should not
 be used directly from the application.
 @end deftypefun
 
-@deftypefun void starpu_sched_set_max_priority (int @var{max_prio})
+@deftypefun void starpu_task_set_max_priority (int @var{max_prio})
 Defines the maximum priority level supported by the scheduling policy. The
 default maximum priority level is 1.  The application may access that value by
-calling the @code{starpu_sched_get_max_priority} function. This function should
+calling the @code{starpu_task_get_max_priority} function. This function should
 only be called from the initialization method of the scheduling policy, and
 should not be used directly from the application.
 @end deftypefun
 
-@deftypefun int starpu_sched_get_min_priority (void)
+@deftypefun int starpu_task_get_min_priority (void)
 Returns the current minimum priority level supported by the
 scheduling policy
 @end deftypefun
 
-@deftypefun int starpu_sched_get_max_priority (void)
+@deftypefun int starpu_task_get_max_priority (void)
 Returns the current maximum priority level supported by the
 scheduling policy
 @end deftypefun

+ 3 - 3
doc/chapters/basic-api.texi

@@ -1828,11 +1828,11 @@ process the task). Otherwise, @code{starpu_task_submit} returns immediately.
 @item @code{int priority} (optional) (default: @code{STARPU_DEFAULT_PRIO})
 This field indicates a level of priority for the task. This is an integer value
 that must be set between the return values of the
-@code{starpu_sched_get_min_priority} function for the least important tasks,
-and that of the @code{starpu_sched_get_max_priority} for the most important
+@code{starpu_task_get_min_priority} function for the least important tasks,
+and that of the @code{starpu_task_get_max_priority} for the most important
 tasks (included). The @code{STARPU_MIN_PRIO} and @code{STARPU_MAX_PRIO} macros
 are provided for convenience and respectively returns value of
-@code{starpu_sched_get_min_priority} and @code{starpu_sched_get_max_priority}.
+@code{starpu_task_get_min_priority} and @code{starpu_task_get_max_priority}.
 Default priority is @code{STARPU_DEFAULT_PRIO}, which is always defined as 0 in
 order to allow static task initialization.  Scheduling strategies that take
 priorities into account can use this parameter to take better scheduling

+ 5 - 0
include/starpu_deprecated_api.h

@@ -88,6 +88,11 @@ typedef enum starpu_access_mode starpu_access_mode;
 #define starpu_depth_block_filter_func_block		starpu_block_filter_depth_block
 #define starpu_depth_block_shadow_filter_func_block	starpu_block_filter_depth_block_shadow
 
+#define starpu_sched_get_min_priority		starpu_task_get_min_priority
+#define starpu_sched_get_max_priority		starpu_task_get_max_priority
+#define starpu_sched_set_min_priority		starpu_task_set_min_priority
+#define starpu_sched_set_max_priority		starpu_task_set_max_priority
+
 #endif /* STARPU_USE_DEPRECATED_ONE_ZERO_API */
 
 #ifdef __cplusplus

+ 0 - 18
include/starpu_scheduler.h

@@ -101,24 +101,6 @@ int starpu_push_local_task(int workerid, struct starpu_task *task, int back);
 int starpu_push_task_end(struct starpu_task *task);
 
 /*
- *	Priorities
- */
-
-/* Provided for legacy reasons */
-#define STARPU_MIN_PRIO		(starpu_sched_get_min_priority())
-#define STARPU_MAX_PRIO		(starpu_sched_get_max_priority())
-
-/* By convention, the default priority level should be 0 so that we can
- * statically allocate tasks with a default priority. */
-#define STARPU_DEFAULT_PRIO	0
-
-int starpu_sched_get_min_priority(void);
-int starpu_sched_get_max_priority(void);
-
-void starpu_sched_set_min_priority(int min_prio);
-void starpu_sched_set_max_priority(int max_prio);
-
-/*
  *	Parallel tasks
  */
 

+ 17 - 0
include/starpu_task.h

@@ -213,6 +213,23 @@ struct starpu_task
 	unsigned scheduled;
 };
 
+/*
+ *	Priorities
+ */
+int starpu_task_get_min_priority(void);
+int starpu_task_get_max_priority(void);
+
+void starpu_task_set_min_priority(int min_prio);
+void starpu_task_set_max_priority(int max_prio);
+
+/* Provided for legacy reasons */
+#define STARPU_MIN_PRIO		(starpu_task_get_min_priority())
+#define STARPU_MAX_PRIO		(starpu_task_get_max_priority())
+
+/* By convention, the default priority level should be 0 so that we can
+ * statically allocate tasks with a default priority. */
+#define STARPU_DEFAULT_PRIO	0
+
 /* It is possible to initialize statically allocated tasks with this value.
  * This is equivalent to initializing a starpu_task structure with the
  * starpu_task_init function. */

+ 4 - 4
src/core/priorities.c

@@ -26,24 +26,24 @@ static int sched_max_prio = 1;
 /* The scheduling policy may set its own priority bounds in case it supports
  * different priority levels. These methods should only be called from the
  * scheduling policy. */
-void starpu_sched_set_min_priority(int min_prio)
+void starpu_task_set_min_priority(int min_prio)
 {
 	sched_min_prio = min_prio;
 }
 
-void starpu_sched_set_max_priority(int max_prio)
+void starpu_task_set_max_priority(int max_prio)
 {
 	sched_max_prio = max_prio;
 }
 
 /* Returns the minimum priority level supported by the scheduling policy. */
-int starpu_sched_get_min_priority(void)
+int starpu_task_get_min_priority(void)
 {
 	return sched_min_prio;
 }
 
 /* Returns the maximum priority level supported by the scheduling policy. */
-int starpu_sched_get_max_priority(void)
+int starpu_task_get_max_priority(void)
 {
 	return sched_max_prio;
 }

+ 2 - 2
src/sched_policies/deque_modeling_policy_data_aware.c

@@ -866,8 +866,8 @@ static void initialize_dmda_sorted_policy(unsigned sched_ctx_id)
 	initialize_dmda_policy(sched_ctx_id);
 
 	/* The application may use any integer */
-	starpu_sched_set_min_priority(INT_MIN);
-	starpu_sched_set_max_priority(INT_MAX);
+	starpu_task_set_min_priority(INT_MIN);
+	starpu_task_set_max_priority(INT_MAX);
 }
 
 static void deinitialize_dmda_policy(unsigned sched_ctx_id)

+ 2 - 2
src/sched_policies/eager_central_priority_policy.c

@@ -80,8 +80,8 @@ static void initialize_eager_center_priority_policy(unsigned sched_ctx_id)
 	struct _starpu_eager_central_prio_data *data = (struct _starpu_eager_central_prio_data*)malloc(sizeof(struct _starpu_eager_central_prio_data));
 
 	/* In this policy, we support more than two levels of priority. */
-	starpu_sched_set_min_priority(MIN_LEVEL);
-	starpu_sched_set_max_priority(MAX_LEVEL);
+	starpu_task_set_min_priority(MIN_LEVEL);
+	starpu_task_set_max_priority(MAX_LEVEL);
 
 	/* only a single queue (even though there are several internaly) */
 	data->taskq = _starpu_create_priority_taskq();