ソースを参照

nactive_readonly_children is actually only the allocated size, not the used size

Samuel Thibault 4 年 前
コミット
a8e512e964

+ 1 - 1
src/datawizard/coherency.h

@@ -147,8 +147,8 @@ struct _starpu_data_state
 	starpu_data_handle_t *active_children; /** The currently active set of read-write children */
 	unsigned active_nchildren;
 	starpu_data_handle_t **active_readonly_children; /** The currently active set of read-only children */
-	unsigned nactive_readonly_children; /** Size of active_readonly_children array */
 	unsigned *active_readonly_nchildren; /** Size of active_readonly_children[i] array */
+	unsigned nactive_readonly_children; /** Size of active_readonly_children and active_readonly_nchildren arrays. Actual use is given by 'partitioned' */
 	/** Our siblings in the father partitioning */
 	unsigned nsiblings; /** How many siblings */
 	starpu_data_handle_t *siblings;

+ 1 - 0
src/datawizard/filters.c

@@ -754,6 +754,7 @@ void starpu_data_partition_readwrite_upgrade_submit(starpu_data_handle_t initial
 	initial_handle->active_nchildren = initial_handle->active_readonly_nchildren[0];
 	initial_handle->active_children = initial_handle->active_readonly_children[0];
 	initial_handle->active_readonly_children[0] = NULL;
+	initial_handle->active_readonly_nchildren[0] = 0;
 	_starpu_spin_unlock(&initial_handle->header_lock);
 
 	unsigned i;

+ 1 - 1
src/datawizard/user_interactions.c

@@ -701,7 +701,7 @@ void starpu_data_wont_use(starpu_data_handle_t handle)
 	if (handle->nactive_readonly_children != 0)
 	{
 		unsigned i;
-		for(i=0 ; i<handle->nactive_readonly_children ; i++)
+		for(i=0 ; i<handle->partitioned; i++)
 		{
 			unsigned j;
 			for(j=0 ; j<handle->active_readonly_nchildren[i] ; j++)

+ 3 - 0
tests/datawizard/temporary_partition.c

@@ -80,6 +80,9 @@ int main(void)
 	/* Invalidate one random piece we don't care coherency about */
 	starpu_data_invalidate_submit(handles[NPARTS/2]);
 
+	/* Try to wontuse the whole thing */
+	starpu_data_wont_use(handle);
+
 	/* Clean */
 	starpu_data_unpartition_submit(handle, NPARTS, handles, -1);
 	starpu_data_partition_clean(handle, NPARTS, handles);

+ 3 - 0
tests/datawizard/temporary_partition_implicit.c

@@ -80,6 +80,9 @@ int main(void)
 	/* Invalidate one random piece we don't care coherency about */
 	starpu_data_invalidate_submit(handles[NPARTS/2]);
 
+	/* Try to wontuse the whole thing */
+	starpu_data_wont_use(handle);
+
 	/* Clean */
 	starpu_data_unpartition_submit(handle, NPARTS, handles, -1);
 	starpu_data_partition_clean(handle, NPARTS, handles);