Browse Source

Check that a replicate is not busy before writing it back

Samuel Thibault 9 years ago
parent
commit
8f29983c73
1 changed files with 2 additions and 3 deletions
  1. 2 3
      src/datawizard/memalloc.c

+ 2 - 3
src/datawizard/memalloc.c

@@ -994,9 +994,8 @@ void starpu_memchunk_tidy(unsigned node)
 				mc->clean = 1;
 				mc_clean_nb[node]++;
 			}
-			else
-			{
-				/* MC is dirty, submit writeback */
+			else if (handle->per_node[node].refcnt == 0) {
+				/* MC is dirty and nobody working on it, submit writeback */
 
 				/* MC will be clean, consider it as such */
 				mc->clean = 1;