Bläddra i källkod

coherency: Fix crash when fetching for write-only in the home node

In that case we do not have a memchunk (just like when the data is
already available, above)
Samuel Thibault 4 år sedan
förälder
incheckning
31800aa5d6
1 ändrade filer med 8 tillägg och 3 borttagningar
  1. 8 3
      src/datawizard/coherency.c

+ 8 - 3
src/datawizard/coherency.c

@@ -575,9 +575,14 @@ struct _starpu_data_request *_starpu_create_request_to_fetch_data(starpu_data_ha
 			if (_starpu_allocate_memory_on_node(handle, dst_replicate, is_prefetch) == 0)
 			{
 				_starpu_update_data_state(handle, dst_replicate, mode);
-				if (is_prefetch == STARPU_TASK_PREFETCH)
-					/* Make sure it stays there */
-					dst_replicate->mc->nb_tasks_prefetch++;
+				if (dst_replicate->mc)
+				{
+					if (is_prefetch == STARPU_TASK_PREFETCH)
+						/* Make sure it stays there */
+						dst_replicate->mc->nb_tasks_prefetch++;
+
+					_starpu_memchunk_recently_used(dst_replicate->mc, requesting_node);
+				}
 
 				_starpu_spin_unlock(&handle->header_lock);