Browse Source

prefix MIN_PRIO and MAX_PRIO everywhere, and remove duplicate definitions.

Cédric Augonnet 15 years ago
parent
commit
21e7159c59

+ 2 - 2
include/starpu-task.h

@@ -91,8 +91,8 @@ struct starpu_task {
 
 	/* options for the task execution */
 	unsigned synchronous; /* if set, a call to push is blocking */
-	int priority; /* MAX_PRIO = most important 
-        		: MIN_PRIO = least important */
+	int priority; /* STARPU_MAX_PRIO = most important 
+        		: STARPU_MIN_PRIO = least important */
 
 	/* in case the task has to be executed on a specific worker */
 	unsigned execute_on_a_specific_worker;

+ 4 - 4
mpi/examples/mpi_lu/pxlu.c

@@ -277,7 +277,7 @@ static void create_task_11_real(unsigned k)
 
 	/* this is an important task */
 	if (!no_prio)
-		task->priority = MAX_PRIO;
+		task->priority = STARPU_MAX_PRIO;
 
 	/* enforce dependencies ... */
 	if (k > 0) {
@@ -450,7 +450,7 @@ static void create_task_12_real(unsigned k, unsigned j)
 	task->callback_arg = arg;
 
 	if (!no_prio && (j == k+1)) {
-		task->priority = MAX_PRIO;
+		task->priority = STARPU_MAX_PRIO;
 	}
 
 	/* enforce dependencies ... */
@@ -621,7 +621,7 @@ static void create_task_21_real(unsigned k, unsigned i)
 	task->callback_arg = arg;
 
 	if (!no_prio && (i == k+1)) {
-		task->priority = MAX_PRIO;
+		task->priority = STARPU_MAX_PRIO;
 	}
 
 	/* enforce dependencies ... */
@@ -741,7 +741,7 @@ static void create_task_22_real(unsigned k, unsigned i, unsigned j)
 	STARPU_ASSERT(task->buffers[2].handle != STARPU_POISON_PTR);
 
 	if (!no_prio &&  (i == k + 1) && (j == k +1) ) {
-		task->priority = MAX_PRIO;
+		task->priority = STARPU_MAX_PRIO;
 	}
 
 	/* enforce dependencies ... */

+ 3 - 1
src/core/mechanisms/priority_queues.c

@@ -14,6 +14,8 @@
  * See the GNU Lesser General Public License in COPYING.LGPL for more details.
  */
 
+#include <starpu.h>
+#include <common/config.h>
 #include <core/mechanisms/priority_queues.h>
 
 /*
@@ -76,7 +78,7 @@ int priority_push_task(struct jobq_s *q, job_t j)
 
 	TRACE_JOB_PUSH(j, 1);
 	
-	unsigned priolevel = j->task->priority - MIN_PRIO;
+	unsigned priolevel = j->task->priority - STARPU_MIN_PRIO;
 
 	job_list_push_front(queue->jobq[priolevel], j);
 	queue->njobs[priolevel]++;

+ 5 - 6
src/core/mechanisms/priority_queues.h

@@ -17,16 +17,15 @@
 #ifndef __PRIORITY_QUEUES_H__
 #define __PRIORITY_QUEUES_H__
 
-#define MIN_PRIO	(-4)
-#define MAX_PRIO	5
-
-#define NPRIO_LEVELS	((MAX_PRIO) - (MIN_PRIO) + 1)
-
+#include <starpu.h>
+#include <common/config.h>
 #include <core/mechanisms/queues.h>
 
+#define NPRIO_LEVELS	((STARPU_MAX_PRIO) - (STARPU_MIN_PRIO) + 1)
+
 struct priority_jobq_s {
 	/* the actual lists 
-	 *	jobq[p] is for priority [p - MIN_PRIO] */
+	 *	jobq[p] is for priority [p - STARPU_MIN_PRIO] */
 	job_list_t jobq[NPRIO_LEVELS];
 	unsigned njobs[NPRIO_LEVELS];