Pārlūkot izejas kodu

Make it more explicit what prio_list_pop_front/back actually takes

Samuel Thibault 7 gadi atpakaļ
vecāks
revīzija
9182b57470

+ 1 - 1
mpi/src/starpu_mpi.c

@@ -1484,7 +1484,7 @@ static void *_starpu_mpi_progress_thread_func(void *arg)
 				/* Already spent some time on submitting ready send requests, poll before processing more ready send requests */
 				break;
 
-			req = _starpu_mpi_req_prio_list_pop_back(&ready_send_requests);
+			req = _starpu_mpi_req_prio_list_pop_back_lowest(&ready_send_requests);
 
 			/* handling a request is likely to block for a while
 			 * (on a sync_data_with_mem call), we want to let the

+ 14 - 14
src/common/prio_list.h

@@ -47,17 +47,17 @@
  * * Remove given cell from the priority list
  * void FOO_prio_list_erase(struct FOO_prio_list*, struct FOO*)
  *
- * * Return and remove the first cell of the priority list
- * void FOO_prio_list_pop_front(struct FOO_prio_list*)
+ * * Return and remove the first cell of highest priority of the priority list
+ * void FOO_prio_list_pop_front_highest(struct FOO_prio_list*)
  *
- * * Return and remove the last cell of the priority list
- * void FOO_prio_list_pop_back(struct FOO_prio_list*)
+ * * Return and remove the last cell of lowest priority of the priority list
+ * void FOO_prio_list_pop_back_lowest(struct FOO_prio_list*)
  *
- * * Return the first cell of the priority list
- * void FOO_prio_list_front(struct FOO_prio_list*)
+ * * Return the first cell of highest priority of the priority list
+ * void FOO_prio_list_front_highest(struct FOO_prio_list*)
  *
- * * Return the last cell of the priority list
- * void FOO_prio_list_back(struct FOO_prio_list*)
+ * * Return the last cell of lowest priority of sthe priority list
+ * void FOO_prio_list_back_lowest(struct FOO_prio_list*)
  *
  * * Append second priority list at ends of the first priority list (O(log2 p))
  * void FOO_prio_list_push_prio_list_back(struct FOO_prio_list*, struct FOO_prio_list*)
@@ -247,7 +247,7 @@
 		struct starpu_rbtree_node *node = starpu_rbtree_first(&priolist->tree); \
 		return ENAME##_prio_list_get_next_nonempty_stage(priolist, node, pnode, pstage); \
 	} \
-	PRIO_LIST_INLINE struct ENAME *ENAME##_prio_list_pop_front(struct ENAME##_prio_list *priolist) \
+	PRIO_LIST_INLINE struct ENAME *ENAME##_prio_list_pop_front_highest(struct ENAME##_prio_list *priolist) \
 	{ \
 		struct starpu_rbtree_node *node; \
 		struct ENAME##_prio_list_stage *stage; \
@@ -266,7 +266,7 @@
 		} \
 		return ret; \
 	} \
-	PRIO_LIST_INLINE struct ENAME *ENAME##_prio_list_front(struct ENAME##_prio_list *priolist) \
+	PRIO_LIST_INLINE struct ENAME *ENAME##_prio_list_front_highest(struct ENAME##_prio_list *priolist) \
 	{ \
 		struct starpu_rbtree_node *node; \
 		struct ENAME##_prio_list_stage *stage; \
@@ -304,7 +304,7 @@
 		struct starpu_rbtree_node *node = starpu_rbtree_last(&priolist->tree); \
 		return ENAME##_prio_list_get_prev_nonempty_stage(priolist, node, pnode, pstage); \
 	} \
-	PRIO_LIST_INLINE struct ENAME *ENAME##_prio_list_pop_back(struct ENAME##_prio_list *priolist) \
+	PRIO_LIST_INLINE struct ENAME *ENAME##_prio_list_pop_back_lowest(struct ENAME##_prio_list *priolist) \
 	{ \
 		struct starpu_rbtree_node *node; \
 		struct ENAME##_prio_list_stage *stage; \
@@ -323,7 +323,7 @@
 		} \
 		return ret; \
 	} \
-	PRIO_LIST_INLINE struct ENAME *ENAME##_prio_list_back(struct ENAME##_prio_list *priolist) \
+	PRIO_LIST_INLINE struct ENAME *ENAME##_prio_list_back_lowest(struct ENAME##_prio_list *priolist) \
 	{ \
 		struct starpu_rbtree_node *node; \
 		struct ENAME##_prio_list_stage *stage; \
@@ -456,9 +456,9 @@
 	{ return ENAME##_list_empty(&(priolist)->list); } \
 	PRIO_LIST_INLINE void ENAME##_prio_list_erase(struct ENAME##_prio_list *priolist, struct ENAME *e) \
 	{ ENAME##_list_erase(&(priolist)->list, (e)); } \
-	PRIO_LIST_INLINE struct ENAME *ENAME##_prio_list_pop_front(struct ENAME##_prio_list *priolist) \
+	PRIO_LIST_INLINE struct ENAME *ENAME##_prio_list_pop_front_highest(struct ENAME##_prio_list *priolist) \
 	{ return ENAME##_list_pop_front(&(priolist)->list); } \
-	PRIO_LIST_INLINE struct ENAME *ENAME##_prio_list_pop_back(struct ENAME##_prio_list *priolist) \
+	PRIO_LIST_INLINE struct ENAME *ENAME##_prio_list_pop_back_lowest(struct ENAME##_prio_list *priolist) \
 	{ return ENAME##_list_pop_back(&(priolist)->list); } \
 	PRIO_LIST_INLINE void ENAME##_prio_list_push_prio_list_back(struct ENAME##_prio_list *priolist, struct ENAME##_prio_list *priolist_toadd) \
 	{ ENAME##_list_push_list_back(&(priolist)->list, &(priolist_toadd)->list); } \

+ 3 - 3
src/datawizard/data_request.c

@@ -594,7 +594,7 @@ static int __starpu_handle_node_data_requests(struct _starpu_data_request_prio_l
 			break;
 		}
 
-		r = _starpu_data_request_prio_list_pop_front(&local_list);
+		r = _starpu_data_request_prio_list_pop_front_highest(&local_list);
 
 		res = starpu_handle_data_request(r, may_alloc, prefetch);
 		if (res != 0 && res != -EAGAIN)
@@ -620,7 +620,7 @@ static int __starpu_handle_node_data_requests(struct _starpu_data_request_prio_l
 	/* Push back requests we didn't handle on the proper list */
 	while (!_starpu_data_request_prio_list_empty(&local_list))
 	{
-		r = _starpu_data_request_prio_list_pop_front(&local_list);
+		r = _starpu_data_request_prio_list_pop_front_highest(&local_list);
 		/* Prefetch requests might have gotten promoted while in tmp list */
 		_starpu_data_request_prio_list_push_back(&new_data_requests[r->prefetch], r);
 	}
@@ -734,7 +734,7 @@ static int _handle_pending_node_data_requests(unsigned src_node, unsigned force)
 	while (!_starpu_data_request_prio_list_empty(&local_list))
 	{
 		struct _starpu_data_request *r;
-		r = _starpu_data_request_prio_list_pop_front(&local_list);
+		r = _starpu_data_request_prio_list_pop_front_highest(&local_list);
 		taken++;
 
 		starpu_data_handle_t handle = r->handle;

+ 2 - 2
src/sched_policies/prio_deque.h

@@ -80,7 +80,7 @@ static inline struct starpu_task * _starpu_prio_deque_pop_task(struct _starpu_pr
 	struct starpu_task *task;
 	if (starpu_task_prio_list_empty(&pdeque->list))
 		return NULL;
-	task = starpu_task_prio_list_pop_front(&pdeque->list);
+	task = starpu_task_prio_list_pop_front_highest(&pdeque->list);
 	pdeque->ntasks--;
 	return task;
 }
@@ -113,7 +113,7 @@ static inline struct starpu_task * _starpu_prio_deque_deque_task(struct _starpu_
 	struct starpu_task *task;
 	if (starpu_task_prio_list_empty(&pdeque->list))
 		return NULL;
-	task = starpu_task_prio_list_pop_back(&pdeque->list);
+	task = starpu_task_prio_list_pop_back_lowest(&pdeque->list);
 	pdeque->ntasks--;
 	return task;
 }