Browse Source

assert that there are no pending requests while invalidating a data

Samuel Thibault 8 years ago
parent
commit
dc26a9be46
1 changed files with 10 additions and 0 deletions
  1. 10 0
      src/datawizard/interfaces/data_interface.c

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

@@ -932,6 +932,16 @@ static void _starpu_data_invalidate(void *data)
 
 
 	_STARPU_DEBUG("Really invalidating data %p\n", data);
 	_STARPU_DEBUG("Really invalidating data %p\n", data);
 
 
+#ifdef STARPU_DEBUG
+	{
+		/* There shouldn't be any pending request since we acquired the data in W mode */
+		unsigned i, j, nnodes = starpu_memory_nodes_get_count();
+		for (i = 0; i < nnodes; i++)
+			for (j = 0; j < nnodes; j++)
+				STARPU_ASSERT_MSG(!handle->per_node[i].request[j], "request for handle %p pending from %d to %d while invalidating data!", handle, j, i);
+	}
+#endif
+
 	unsigned node;
 	unsigned node;
 	for (node = 0; node < STARPU_MAXNODES; node++)
 	for (node = 0; node < STARPU_MAXNODES; node++)
 	{
 	{