浏览代码

Fix request list push: we need to push and pop in the same order to keep consistent with task order

Samuel Thibault 13 年之前
父节点
当前提交
2d2acb47ab
共有 2 个文件被更改,包括 8 次插入4 次删除
  1. 4 0
      include/starpu.h
  2. 4 4
      src/datawizard/data_request.c

+ 4 - 0
include/starpu.h

@@ -47,6 +47,10 @@ typedef unsigned long long uint64_t;
 extern "C" {
 #endif
 
+#define dprintf(fmt, ...) ({ struct timespec tp; starpu_clock_gettime(&tp); fprintf(stderr,"%07.3f: "fmt,((float)tp.tv_nsec) / 1000000,##__VA_ARGS__); })
+	void starpu_clock_gettime(struct timespec *ts);
+
+
 struct starpu_conf {
 	/* which scheduling policy should be used ? (NULL for default) */
 	const char *sched_policy_name;

+ 4 - 4
src/datawizard/data_request.c

@@ -189,10 +189,10 @@ void _starpu_post_data_request(starpu_data_request_t r, uint32_t handling_node)
 
 	/* insert the request in the proper list */
 	PTHREAD_MUTEX_LOCK(&data_requests_list_mutex[handling_node]);
-	if (r->prefetch)
-		starpu_data_request_list_push_back(prefetch_requests[handling_node], r);
-	else
-		starpu_data_request_list_push_back(data_requests[handling_node], r);
+	if (r->prefetch) {
+		starpu_data_request_list_push_front(prefetch_requests[handling_node], r);
+	} else
+		starpu_data_request_list_push_front(data_requests[handling_node], r);
 	PTHREAD_MUTEX_UNLOCK(&data_requests_list_mutex[handling_node]);
 
 #ifndef STARPU_NON_BLOCKING_DRIVERS