浏览代码

Fix not choosing RAM when it actually does not have a valid copy

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

+ 4 - 2
src/datawizard/coherency.c

@@ -25,7 +25,7 @@
 static int link_supports_direct_transfers(starpu_data_handle handle, unsigned src_node, unsigned dst_node, unsigned *handling_node);
 uint32_t _starpu_select_src_node(starpu_data_handle handle, unsigned destination)
 {
-	unsigned src_node = 0;
+	int src_node = -1;
 	unsigned i;
 
 	unsigned nnodes = _starpu_get_memory_nodes_count();
@@ -76,7 +76,7 @@ uint32_t _starpu_select_src_node(starpu_data_handle handle, unsigned destination
 			}
 		}
 
-	if (cost)
+	if (cost && src_node != -1)
 		/* Could estimate through cost, return that */
 		return src_node;
 
@@ -101,6 +101,8 @@ uint32_t _starpu_select_src_node(starpu_data_handle handle, unsigned destination
 		}
 	}
 
+	STARPU_ASSERT(src_node != -1);
+
 	return src_node;
 }