瀏覽代碼

Save the memory node identifier in the data replicate structure

Cédric Augonnet 15 年之前
父節點
當前提交
502689da30
共有 3 個文件被更改,包括 6 次插入1 次删除
  1. 3 1
      src/datawizard/coherency.h
  2. 1 0
      src/datawizard/filters.c
  3. 2 0
      src/datawizard/interfaces/data_interface.c

+ 3 - 1
src/datawizard/coherency.h

@@ -36,11 +36,13 @@ typedef enum {
 	STARPU_INVALID
 } starpu_cache_state;
 
-/* this should contain the information relative to a given node */
+/* this should contain the information relative to a given data replicate  */
 struct starpu_data_replicate_s {
 	/* describe the actual data layout */
 	void *interface;
 
+	unsigned memory_node;
+
 	/* describes the state of the local data in term of coherency */
 	starpu_cache_state	state; 
 

+ 1 - 0
src/datawizard/filters.c

@@ -149,6 +149,7 @@ void starpu_data_partition(starpu_data_handle initial_handle, struct starpu_data
 				initial_handle->per_node[node].allocated;
 			child->per_node[node].automatically_allocated = initial_handle->per_node[node].automatically_allocated;
 			child->per_node[node].refcnt = 0;
+			child->per_node[node].memory_node = node;
 			
 			/* update the interface */
 			void *initial_interface = starpu_data_get_interface_on_node(initial_handle, node);

+ 2 - 0
src/datawizard/interfaces/data_interface.c

@@ -73,6 +73,8 @@ static void _starpu_register_new_data(starpu_data_handle handle,
 	unsigned node;
 	for (node = 0; node < STARPU_MAXNODES; node++)
 	{
+		handle->per_node[node].memory_node = node;
+
 		if (node == home_node) {
 			/* this is the home node with the only valid copy */
 			handle->per_node[node].state = STARPU_OWNER;