Ver código fonte

port r14943 from 1.1: Fix case when two concurrent workers are allocating the same data

Samuel Thibault 10 anos atrás
pai
commit
e7e08f9787
1 arquivos alterados com 4 adições e 0 exclusões
  1. 4 0
      src/datawizard/memalloc.c

+ 4 - 0
src/datawizard/memalloc.c

@@ -1046,6 +1046,10 @@ int _starpu_allocate_memory_on_node(starpu_data_handle_t handle, struct _starpu_
 	if (allocated_memory == -ENOMEM)
 		return -ENOMEM;
 
+	if (replicate->allocated)
+		/* Somebody allocated it in between already */
+		return 0;
+
 	register_mem_chunk(replicate, 1);
 
 	replicate->allocated = 1;