Przeglądaj źródła

We "free" memory, we don't "liberate" it from the yoke of an evilish malloc :)

Cédric Augonnet 15 lat temu
rodzic
commit
c92030c413

+ 14 - 14
doc/starpu.texi

@@ -830,16 +830,16 @@ returned by @code{starpu_worker_get_id}). This field is ignored if
 @item @code{detach} (optional) (default = 1):
 If this flag is set, it is not possible to synchronize with the task
 by the means of @code{starpu_task_wait} later on. Internal data structures
-are only guaranteed to be liberated once @code{starpu_task_wait} is called
-if that flag is not set.
+are only guaranteed to be freed once @code{starpu_task_wait} is called if that
+flag is not set.
 
 @item @code{destroy} (optional) (default = 1):
-If that flag is set, the task structure will automatically be liberated, either
+If that flag is set, the task structure will automatically be freed, either
 after the execution of the callback if the task is detached, or during
-@code{starpu_task_wait} otherwise. If this flag is not set, dynamically allocated data
-structures will not be liberated until @code{starpu_task_destroy} is called
-explicitly. Setting this flag for a statically allocated task structure will
-result in undefined behaviour.
+@code{starpu_task_wait} otherwise. If this flag is not set, dynamically
+allocated data structures will not be freed until @code{starpu_task_destroy} is
+called explicitly. Setting this flag for a statically allocated task structure
+will result in undefined behaviour.
 
 @end table
 @end table
@@ -862,9 +862,9 @@ constant @code{STARPU_TASK_INITIALIZER}.
 @table @asis
 @item @emph{Description}:
 Allocate a task structure and initialize it with default values. Tasks
-allocated dynamically with starpu_task_create are automatically liberated when
-the task is terminated. If the destroy flag is explicitly unset, the
-resources used by the task are liberated by calling
+allocated dynamically with starpu_task_create are automatically freed when the
+task is terminated. If the destroy flag is explicitly unset, the resources used
+by the task are freed by calling
 @code{starpu_task_destroy}.
 
 @item @emph{Prototype}:
@@ -877,7 +877,7 @@ resources used by the task are liberated by calling
 @item @emph{Description}:
 Release all the structures automatically allocated to execute the task. This is
 called implicitly by starpu_task_destroy, but the task structure itself is not
-liberated. This should be used for statically allocated tasks for instance.
+freed. This should be used for statically allocated tasks for instance.
 Note that this function is automatically called by @code{starpu_task_destroy}.
 @item @emph{Prototype}:
 @code{void starpu_task_deinit(struct starpu_task *task);}
@@ -889,8 +889,8 @@ Note that this function is automatically called by @code{starpu_task_destroy}.
 @subsection @code{starpu_task_destroy} -- Destroy a dynamically allocated Task
 @table @asis
 @item @emph{Description}:
-Liberate the resource allocated during starpu_task_create. This function can
-be called automatically after the execution of a task by setting the
+Free the resource allocated during starpu_task_create. This function can be
+called automatically after the execution of a task by setting the
 @code{.destroy} flag of the @code{starpu_task} structure (default behaviour).
 Calling this function on a statically allocated task results in an undefined
 behaviour.
@@ -1043,7 +1043,7 @@ tasks or callbacks, but only from the application directly.  It is possible to
 synchronize with the same tag multiple times, as long as the
 @code{starpu_tag_remove} function is not called.  Note that it is still
 possible to synchronize with a tag associated to a task which @code{starpu_task}
-data structure was liberated (e.g. if the @code{destroy} flag of the
+data structure was freed (e.g. if the @code{destroy} flag of the
 @code{starpu_task} was enabled).
 
 @item @emph{Prototype}:

+ 17 - 17
include/starpu_task.h

@@ -98,16 +98,16 @@ struct starpu_task {
 
 	/* If this flag is set, it is not possible to synchronize with the task
 	 * by the means of starpu_task_wait later on. Internal data structures
-	 * are only garanteed to be liberated once starpu_task_wait is called
-	 * if that flag is not set. */
+	 * are only garanteed to be freed once starpu_task_wait is called if
+	 * that flag is not set. */
 	int detach;
 
-	/* If that flag is set, the task structure will automatically be
-	 * liberated, either after the execution of the callback if the task is
-	 * detached, or during starpu_task_wait otherwise. If this flag is not
-	 * set, dynamically allocated data structures will not be liberated
-	 * until starpu_task_destroy is called explicitely. Setting this flag
-	 * for a statically allocated task structure will result in undefined
+	/* If that flag is set, the task structure will automatically be freed,
+	 * either after the execution of the callback if the task is detached,
+	 * or during starpu_task_wait otherwise. If this flag is not set,
+	 * dynamically allocated data structures will not be freed until
+	 * starpu_task_destroy is called explicitely. Setting this flag for a
+	 * statically allocated task structure will result in undefined
 	 * behaviour. */
 	int destroy;
 
@@ -184,22 +184,22 @@ void starpu_task_init(struct starpu_task *task);
 
 /* Release all the structures automatically allocated to execute the task. This
  * is called implicitely by starpu_task_destroy, but the task structure itself
- * is not liberated. This should be used for statically allocated tasks for
+ * is not freed. This should be used for statically allocated tasks for
  * instance. */
 void starpu_task_deinit(struct starpu_task *task);
 
 /* Allocate a task structure and initialize it with default values. Tasks
- * allocated dynamically with starpu_task_create are automatically liberated
- * when the task is terminated. If the destroy flag is explicitely unset, the
- * ressources used by the task are liberated by calling starpu_task_destroy.
+ * allocated dynamically with starpu_task_create are automatically freed when
+ * the task is terminated. If the destroy flag is explicitely unset, the
+ * ressources used by the task are freed by calling starpu_task_destroy.
  * */
 struct starpu_task *starpu_task_create(void);
 
-/* Liberate the ressource allocated during the execution of the task and
- * deallocate the task structure itself. This function can be called
- * automatically after the execution of a task by setting the "destroy" flag of
- * the starpu_task structure (default behaviour). Calling this function on a
- * statically allocated task results in an undefined behaviour. */
+/* Free the ressource allocated during the execution of the task and deallocate
+ * the task structure itself. This function can be called automatically after
+ * the execution of a task by setting the "destroy" flag of the starpu_task
+ * structure (default behaviour). Calling this function on a statically
+ * allocated task results in an undefined behaviour. */
 void starpu_task_destroy(struct starpu_task *task);
 int starpu_task_submit(struct starpu_task *task);
 

+ 4 - 4
mpi/starpu_mpi.c

@@ -389,9 +389,9 @@ int starpu_mpi_test(starpu_mpi_req *public_req, int *flag, MPI_Status *status)
 
 		if (*testing_req.flag)
 		{
-			/* The request was completed so we liberate the
-			 * internal request structure which was automatically
-			 * allocated */
+			/* The request was completed so we free the internal
+			 * request structure which was automatically allocated
+			 * */
 			*public_req = NULL;
 			free(req);
 		}
@@ -685,7 +685,7 @@ int starpu_mpi_shutdown(void)
 	starpu_progression_hook_deregister(hookid);
 #endif 
 
-	/* liberate the request queues */
+	/* free the request queues */
 	starpu_mpi_req_list_delete(detached_requests);
 	starpu_mpi_req_list_delete(new_requests);
 

+ 2 - 2
src/core/dependencies/cg.c

@@ -42,8 +42,8 @@ void _starpu_cg_list_deinit(struct starpu_cg_list_s *list)
 	{
 		starpu_cg_t *cg = list->succ[id];
 
-		/* We remove the reference on the completion group, and
-		 * liberate it if there is no more reference. */		
+		/* We remove the reference on the completion group, and free it
+		 * if there is no more reference. */		
 		unsigned ntags = STARPU_ATOMIC_ADD(&cg->ntags, -1);
 		if (ntags == 0)
 			free(list->succ[id]);

+ 1 - 1
src/core/mechanisms/fifo_queues.c

@@ -64,7 +64,7 @@ void _starpu_destroy_fifo(struct starpu_jobq_s *jobq)
 {
 	STARPU_ASSERT(jobq);
 
-	/* We first liberate the FIFO-specific data structure */
+	/* We first free the FIFO-specific data structure */
 	struct starpu_fifo_jobq_s *fifo = jobq->queue;
 
 	starpu_job_list_delete(fifo->jobq);

+ 6 - 7
src/core/task.c

@@ -65,8 +65,8 @@ void starpu_task_init(struct starpu_task *task)
 	task->starpu_private = NULL;
 }
 
-/* Liberate all the ressources allocated for a task, without deallocating the
- * task structure itself (this is required for statically allocated tasks). */
+/* Free all the ressources allocated for a task, without deallocating the task
+ * structure itself (this is required for statically allocated tasks). */
 void starpu_task_deinit(struct starpu_task *task)
 {
 	STARPU_ASSERT(task);
@@ -92,11 +92,10 @@ struct starpu_task * __attribute__((malloc)) starpu_task_create(void)
 	return task;
 }
 
-/* Liberate the ressource allocated during starpu_task_create. This function
- * can be called automatically after the execution of a task by setting the
- * "destroy" flag of the starpu_task structure (default behaviour). Calling
- * this function on a statically allocated task results in an undefined
- * behaviour. */
+/* Free the ressource allocated during starpu_task_create. This function can be
+ * called automatically after the execution of a task by setting the "destroy"
+ * flag of the starpu_task structure (default behaviour). Calling this function
+ * on a statically allocated task results in an undefined behaviour. */
 void starpu_task_destroy(struct starpu_task *task)
 {
 	STARPU_ASSERT(task);

+ 1 - 3
src/datawizard/coherency.c

@@ -432,9 +432,7 @@ void _starpu_push_task_output(struct starpu_task *task, uint32_t mask)
 		{
 			void *interface = task->interface[index];
 
-//			fprintf(stderr, "liberate interface %p\n", interface);
-
-			handle->ops->liberate_data_on_node(interface, local_node);
+			handle->ops->free_data_on_node(interface, local_node);
 
 			free(interface);
 		}

+ 1 - 1
src/datawizard/filters.c

@@ -172,7 +172,7 @@ void starpu_data_unpartition(starpu_data_handle root_handle, uint32_t gathering_
 		 * really */
 		STARPU_ASSERT(ret == 0); 
 
-		starpu_data_liberate_interfaces(&root_handle->children[child]);
+		starpu_data_free_interfaces(&root_handle->children[child]);
 	}
 
 	/* the gathering_node should now have a valid copy of all the children.

+ 3 - 3
src/datawizard/interfaces/bcsr_interface.c

@@ -61,14 +61,14 @@ static const struct starpu_copy_data_methods_s bcsr_copy_data_methods_s = {
 
 static void register_bcsr_handle(starpu_data_handle handle, uint32_t home_node, void *interface);
 static size_t allocate_bcsr_buffer_on_node(void *interface, uint32_t dst_node);
-static void liberate_bcsr_buffer_on_node(void *interface, uint32_t node);
+static void free_bcsr_buffer_on_node(void *interface, uint32_t node);
 static size_t bcsr_interface_get_size(starpu_data_handle handle);
 static uint32_t footprint_bcsr_interface_crc32(starpu_data_handle handle);
 
 static struct starpu_data_interface_ops_t interface_bcsr_ops = {
 	.register_data_handle = register_bcsr_handle,
 	.allocate_data_on_node = allocate_bcsr_buffer_on_node,
-	.liberate_data_on_node = liberate_bcsr_buffer_on_node,
+	.free_data_on_node = free_bcsr_buffer_on_node,
 	.copy_methods = &bcsr_copy_data_methods_s,
 	.get_size = bcsr_interface_get_size,
 	.interfaceid = STARPU_BCSCR_INTERFACE_ID,
@@ -366,7 +366,7 @@ fail_nzval:
 	return allocated_memory;
 }
 
-static void liberate_bcsr_buffer_on_node(void *interface, uint32_t node)
+static void free_bcsr_buffer_on_node(void *interface, uint32_t node)
 {
 	starpu_bcsr_interface_t *bcsr_interface = interface;	
 

+ 3 - 3
src/datawizard/interfaces/block_interface.c

@@ -66,7 +66,7 @@ static const struct starpu_copy_data_methods_s block_copy_data_methods_s = {
 
 static void register_block_handle(starpu_data_handle handle, uint32_t home_node, void *interface);
 static size_t allocate_block_buffer_on_node(void *interface_, uint32_t dst_node);
-static void liberate_block_buffer_on_node(void *interface, uint32_t node);
+static void free_block_buffer_on_node(void *interface, uint32_t node);
 static size_t block_interface_get_size(starpu_data_handle handle);
 static uint32_t footprint_block_interface_crc32(starpu_data_handle handle);
 static void display_block_interface(starpu_data_handle handle, FILE *f);
@@ -77,7 +77,7 @@ static int convert_block_to_gordon(void *interface, uint64_t *ptr, gordon_stride
 static struct starpu_data_interface_ops_t interface_block_ops = {
 	.register_data_handle = register_block_handle,
 	.allocate_data_on_node = allocate_block_buffer_on_node,
-	.liberate_data_on_node = liberate_block_buffer_on_node,
+	.free_data_on_node = free_block_buffer_on_node,
 	.copy_methods = &block_copy_data_methods_s,
 	.get_size = block_interface_get_size,
 	.footprint = footprint_block_interface_crc32,
@@ -335,7 +335,7 @@ static size_t allocate_block_buffer_on_node(void *interface_, uint32_t dst_node)
 	return allocated_memory;
 }
 
-static void liberate_block_buffer_on_node(void *interface, uint32_t node)
+static void free_block_buffer_on_node(void *interface, uint32_t node)
 {
 	starpu_block_interface_t *block_interface = interface;
 

+ 3 - 3
src/datawizard/interfaces/csr_interface.c

@@ -57,14 +57,14 @@ static const struct starpu_copy_data_methods_s csr_copy_data_methods_s = {
 
 static void register_csr_handle(starpu_data_handle handle, uint32_t home_node, void *interface);
 static size_t allocate_csr_buffer_on_node(void *interface_, uint32_t dst_node);
-static void liberate_csr_buffer_on_node(void *interface, uint32_t node);
+static void free_csr_buffer_on_node(void *interface, uint32_t node);
 static size_t csr_interface_get_size(starpu_data_handle handle);
 static uint32_t footprint_csr_interface_crc32(starpu_data_handle handle);
 
 static struct starpu_data_interface_ops_t interface_csr_ops = {
 	.register_data_handle = register_csr_handle,
 	.allocate_data_on_node = allocate_csr_buffer_on_node,
-	.liberate_data_on_node = liberate_csr_buffer_on_node,
+	.free_data_on_node = free_csr_buffer_on_node,
 	.copy_methods = &csr_copy_data_methods_s,
 	.get_size = csr_interface_get_size,
 	.interfaceid = STARPU_CSR_INTERFACE_ID,
@@ -337,7 +337,7 @@ fail_nzval:
 	return allocated_memory;
 }
 
-static void liberate_csr_buffer_on_node(void *interface, uint32_t node)
+static void free_csr_buffer_on_node(void *interface, uint32_t node)
 {
 	starpu_csr_interface_t *csr_interface = interface;	
 

+ 2 - 2
src/datawizard/interfaces/data_interface.c

@@ -122,7 +122,7 @@ void _starpu_register_data_handle(starpu_data_handle *handleptr, uint32_t home_n
  * Stop monitoring a piece of data
  */
 
-void starpu_data_liberate_interfaces(starpu_data_handle handle)
+void starpu_data_free_interfaces(starpu_data_handle handle)
 {
 	unsigned node;
 	for (node = 0; node < STARPU_MAXNODES; node++)
@@ -146,7 +146,7 @@ void starpu_data_unregister(starpu_data_handle handle)
 
 	starpu_data_requester_list_delete(handle->req_list);
 
-	starpu_data_liberate_interfaces(handle);
+	starpu_data_free_interfaces(handle);
 
 	free(handle);
 }

+ 2 - 2
src/datawizard/interfaces/data_interface.h

@@ -29,7 +29,7 @@ struct starpu_data_interface_ops_t {
 	void (*register_data_handle)(starpu_data_handle handle,
 					uint32_t home_node, void *interface);
 	size_t (*allocate_data_on_node)(void *interface, uint32_t node);
-	void (*liberate_data_on_node)(void *interface, uint32_t node);
+	void (*free_data_on_node)(void *interface, uint32_t node);
 	const struct starpu_copy_data_methods_s *copy_methods;
 	size_t (*get_size)(starpu_data_handle handle);
 	uint32_t (*footprint)(starpu_data_handle handle);
@@ -49,6 +49,6 @@ void _starpu_register_data_handle(starpu_data_handle *handleptr, uint32_t home_n
 /* Some data interfaces or filters use this interface internally */
 extern struct starpu_data_interface_ops_t _starpu_interface_matrix_ops;
 
-void starpu_data_liberate_interfaces(starpu_data_handle handle);
+void starpu_data_free_interfaces(starpu_data_handle handle);
 
 #endif // __DATA_INTERFACE_H__

+ 3 - 3
src/datawizard/interfaces/matrix_interface.c

@@ -69,7 +69,7 @@ static const struct starpu_copy_data_methods_s matrix_copy_data_methods_s = {
 
 static void register_matrix_handle(starpu_data_handle handle, uint32_t home_node, void *interface);
 static size_t allocate_matrix_buffer_on_node(void *interface_, uint32_t dst_node);
-static void liberate_matrix_buffer_on_node(void *interface, uint32_t node);
+static void free_matrix_buffer_on_node(void *interface, uint32_t node);
 static size_t matrix_interface_get_size(starpu_data_handle handle);
 static uint32_t footprint_matrix_interface_crc32(starpu_data_handle handle);
 static void display_matrix_interface(starpu_data_handle handle, FILE *f);
@@ -80,7 +80,7 @@ static int convert_matrix_to_gordon(void *interface, uint64_t *ptr, gordon_strid
 struct starpu_data_interface_ops_t _starpu_interface_matrix_ops = {
 	.register_data_handle = register_matrix_handle,
 	.allocate_data_on_node = allocate_matrix_buffer_on_node,
-	.liberate_data_on_node = liberate_matrix_buffer_on_node,
+	.free_data_on_node = free_matrix_buffer_on_node,
 	.copy_methods = &matrix_copy_data_methods_s,
 	.get_size = matrix_interface_get_size,
 	.footprint = footprint_matrix_interface_crc32,
@@ -311,7 +311,7 @@ static size_t allocate_matrix_buffer_on_node(void *interface_, uint32_t dst_node
 	return allocated_memory;
 }
 
-static void liberate_matrix_buffer_on_node(void *interface, uint32_t node)
+static void free_matrix_buffer_on_node(void *interface, uint32_t node)
 {
 	starpu_matrix_interface_t *matrix_interface = interface;
 

+ 3 - 3
src/datawizard/interfaces/variable_interface.c

@@ -69,7 +69,7 @@ static const struct starpu_copy_data_methods_s variable_copy_data_methods_s = {
 
 static void register_variable_handle(starpu_data_handle handle, uint32_t home_node, void *interface);
 static size_t allocate_variable_buffer_on_node(void *interface_, uint32_t dst_node);
-static void liberate_variable_buffer_on_node(void *interface, uint32_t node);
+static void free_variable_buffer_on_node(void *interface, uint32_t node);
 static size_t variable_interface_get_size(starpu_data_handle handle);
 static uint32_t footprint_variable_interface_crc32(starpu_data_handle handle);
 static void display_variable_interface(starpu_data_handle handle, FILE *f);
@@ -80,7 +80,7 @@ static int convert_variable_to_gordon(void *interface, uint64_t *ptr, gordon_str
 static struct starpu_data_interface_ops_t interface_variable_ops = {
 	.register_data_handle = register_variable_handle,
 	.allocate_data_on_node = allocate_variable_buffer_on_node,
-	.liberate_data_on_node = liberate_variable_buffer_on_node,
+	.free_data_on_node = free_variable_buffer_on_node,
 	.copy_methods = &variable_copy_data_methods_s,
 	.get_size = variable_interface_get_size,
 	.footprint = footprint_variable_interface_crc32,
@@ -236,7 +236,7 @@ static size_t allocate_variable_buffer_on_node(void *interface_, uint32_t dst_no
 	return allocated_memory;
 }
 
-static void liberate_variable_buffer_on_node(void *interface, uint32_t node)
+static void free_variable_buffer_on_node(void *interface, uint32_t node)
 {
 	starpu_node_kind kind = _starpu_get_node_kind(node);
 	switch(kind) {

+ 3 - 3
src/datawizard/interfaces/vector_interface.c

@@ -68,7 +68,7 @@ static const struct starpu_copy_data_methods_s vector_copy_data_methods_s = {
 
 static void register_vector_handle(starpu_data_handle handle, uint32_t home_node, void *interface);
 static size_t allocate_vector_buffer_on_node(void *interface_, uint32_t dst_node);
-static void liberate_vector_buffer_on_node(void *interface, uint32_t node);
+static void free_vector_buffer_on_node(void *interface, uint32_t node);
 static size_t vector_interface_get_size(starpu_data_handle handle);
 static uint32_t footprint_vector_interface_crc32(starpu_data_handle handle);
 static void display_vector_interface(starpu_data_handle handle, FILE *f);
@@ -79,7 +79,7 @@ static int convert_vector_to_gordon(void *interface, uint64_t *ptr, gordon_strid
 static struct starpu_data_interface_ops_t interface_vector_ops = {
 	.register_data_handle = register_vector_handle,
 	.allocate_data_on_node = allocate_vector_buffer_on_node,
-	.liberate_data_on_node = liberate_vector_buffer_on_node,
+	.free_data_on_node = free_vector_buffer_on_node,
 	.copy_methods = &vector_copy_data_methods_s,
 	.get_size = vector_interface_get_size,
 	.footprint = footprint_vector_interface_crc32,
@@ -268,7 +268,7 @@ static size_t allocate_vector_buffer_on_node(void *interface_, uint32_t dst_node
 	return allocated_memory;
 }
 
-static void liberate_vector_buffer_on_node(void *interface, uint32_t node)
+static void free_vector_buffer_on_node(void *interface, uint32_t node)
 {
 	starpu_vector_interface_t *vector_interface = interface;
 

+ 43 - 43
src/datawizard/memalloc.c

@@ -21,7 +21,7 @@ static pthread_rwlock_t mc_rwlock[STARPU_MAXNODES];
 static starpu_mem_chunk_list_t mc_list[STARPU_MAXNODES];
 static starpu_mem_chunk_list_t mc_list_to_free[STARPU_MAXNODES];
 
-static size_t liberate_memory_on_node(starpu_mem_chunk_t mc, uint32_t node);
+static size_t free_memory_on_node(starpu_mem_chunk_t mc, uint32_t node);
 
 void _starpu_init_mem_chunk_lists(void)
 {
@@ -110,7 +110,7 @@ static size_t do_free_mem_chunk(starpu_mem_chunk_t mc, unsigned node)
 	size_t size;
 
 	/* free the actual buffer */
-	size = liberate_memory_on_node(mc, node);
+	size = free_memory_on_node(mc, node);
 
 	/* remove the mem_chunk from the list */
 	starpu_mem_chunk_list_erase(mc_list[node], mc);
@@ -190,7 +190,7 @@ static void transfer_subtree_to_node(starpu_data_handle handle, unsigned src_nod
 
 static size_t try_to_free_mem_chunk(starpu_mem_chunk_t mc, unsigned node)
 {
-	size_t liberated = 0;
+	size_t freed = 0;
 
 	starpu_data_handle handle;
 
@@ -212,14 +212,14 @@ static size_t try_to_free_mem_chunk(starpu_mem_chunk_t mc, unsigned node)
 
 		STARPU_ASSERT(handle->per_node[node].refcnt == 0);
 
-		/* now the actual buffer may be liberated */
-		liberated = do_free_mem_chunk(mc, node);
+		/* now the actual buffer may be freed */
+		freed = do_free_mem_chunk(mc, node);
 	}
 
 	/* unlock the leafs */
 	unlock_all_subtree(handle);
 
-	return liberated;
+	return freed;
 }
 
 #ifdef STARPU_USE_ALLOCATION_CACHE
@@ -294,7 +294,7 @@ static unsigned try_to_reuse_mem_chunk(starpu_mem_chunk_t mc, unsigned node, sta
 }
 
 /* this function looks for a memory chunk that matches a given footprint in the
- * list of mem chunk that need to be liberated */
+ * list of mem chunk that need to be freed */
 static unsigned try_to_find_reusable_mem_chunk(unsigned node, starpu_data_handle data, uint32_t footprint)
 {
 	pthread_rwlock_wrlock(&mc_rwlock[node]);
@@ -330,9 +330,9 @@ static unsigned try_to_find_reusable_mem_chunk(unsigned node, starpu_data_handle
 	     mc != starpu_mem_chunk_list_end(mc_list[node]);
 	     mc = next_mc)
 	{
-		/* there is a risk that the memory chunk is liberated 
-		   before next iteration starts: so we compute the next
-		   element of the list now */
+		/* there is a risk that the memory chunk is freed before next
+		 * iteration starts: so we compute the next element of the list
+		 * now */
 		next_mc = starpu_mem_chunk_list_next(mc);
 
 		if (mc->data->is_not_important && (mc->footprint == footprint))
@@ -353,14 +353,14 @@ static unsigned try_to_find_reusable_mem_chunk(unsigned node, starpu_data_handle
 #endif
 
 /*
- * Liberate the memory chuncks that are explicitely tagged to be liberated. The
+ * Free the memory chuncks that are explicitely tagged to be freed. The
  * mc_rwlock[node] rw-lock should be taken prior to calling this function.
  */
 static size_t perform_mc_removal_requests(uint32_t node)
 {
 	starpu_mem_chunk_t mc, next_mc;
 	
-	size_t liberated = 0;
+	size_t freed = 0;
 
 	for (mc = starpu_mem_chunk_list_begin(mc_list_to_free[node]);
 	     mc != starpu_mem_chunk_list_end(mc_list_to_free[node]);
@@ -368,7 +368,7 @@ static size_t perform_mc_removal_requests(uint32_t node)
 	{
 		next_mc = starpu_mem_chunk_list_next(mc);
 
-		liberated += liberate_memory_on_node(mc, node);
+		freed += free_memory_on_node(mc, node);
 
 		starpu_mem_chunk_list_erase(mc_list_to_free[node], mc);
 
@@ -376,18 +376,18 @@ static size_t perform_mc_removal_requests(uint32_t node)
 		starpu_mem_chunk_delete(mc);
 	}
 
-	return liberated;
+	return freed;
 }
 
 /*
- * Try to liberate the buffers currently in use on the memory node. If the
- * force flag is set, the memory is liberated regardless of coherency concerns
- * (this should only be used at the termination of StarPU for instance). The
+ * Try to free the buffers currently in use on the memory node. If the force
+ * flag is set, the memory is freed regardless of coherency concerns (this
+ * should only be used at the termination of StarPU for instance). The
  * mc_rwlock[node] rw-lock should be taken prior to calling this function.
  */
-static size_t liberate_potentially_in_use_mc(uint32_t node, unsigned force)
+static size_t free_potentially_in_use_mc(uint32_t node, unsigned force)
 {
-	size_t liberated = 0;
+	size_t freed = 0;
 
 	starpu_mem_chunk_t mc, next_mc;
 
@@ -395,27 +395,27 @@ static size_t liberate_potentially_in_use_mc(uint32_t node, unsigned force)
 	     mc != starpu_mem_chunk_list_end(mc_list[node]);
 	     mc = next_mc)
 	{
-		/* there is a risk that the memory chunk is liberated 
+		/* there is a risk that the memory chunk is freed 
 		   before next iteration starts: so we compute the next
 		   element of the list now */
 		next_mc = starpu_mem_chunk_list_next(mc);
 
 		if (!force)
 		{
-			liberated += try_to_free_mem_chunk(mc, node);
+			freed += try_to_free_mem_chunk(mc, node);
 			#if 0
-			if (liberated > toreclaim)
+			if (freed > toreclaim)
 				break;
 			#endif
 		}
 		else {
-			/* We must liberate the memory now: note that data
+			/* We must free the memory now: note that data
 			 * coherency is not maintained in that case ! */
-			liberated += do_free_mem_chunk(mc, node);
+			freed += do_free_mem_chunk(mc, node);
 		}
 	}
 
-	return liberated;
+	return freed;
 }
 
 /* 
@@ -426,44 +426,44 @@ static size_t liberate_potentially_in_use_mc(uint32_t node, unsigned force)
 static size_t reclaim_memory(uint32_t node, size_t toreclaim __attribute__ ((unused)))
 {
 	int res;
-	size_t liberated = 0;
+	size_t freed = 0;
 
 	res = pthread_rwlock_wrlock(&mc_rwlock[node]);
 	STARPU_ASSERT(!res);
 
 	/* remove all buffers for which there was a removal request */
-	liberated += perform_mc_removal_requests(node);
+	freed += perform_mc_removal_requests(node);
 
 	/* try to free all allocated data potentially in use */
-	liberated += liberate_potentially_in_use_mc(node, 0);
+	freed += free_potentially_in_use_mc(node, 0);
 
 	res = pthread_rwlock_unlock(&mc_rwlock[node]);
 	STARPU_ASSERT(!res);
 
-	return liberated;
+	return freed;
 }
 
 /*
- * This function liberates all the memory that was implicitely allocated by
- * StarPU (for the data replicates). This is not ensuring data coherency, and
- * should only be called while StarPU is getting shut down.
+ * This function frees all the memory that was implicitely allocated by StarPU
+ * (for the data replicates). This is not ensuring data coherency, and should
+ * only be called while StarPU is getting shut down.
  */
-size_t _starpu_liberate_all_automatically_allocated_buffers(uint32_t node)
+size_t _starpu_free_all_automatically_allocated_buffers(uint32_t node)
 {
 	int res;
 
-	size_t liberated = 0;
+	size_t freed = 0;
 
 	res = pthread_rwlock_wrlock(&mc_rwlock[node]);
 	STARPU_ASSERT(!res);
 
-	liberated += perform_mc_removal_requests(node);
-	liberated += liberate_potentially_in_use_mc(node, 1);
+	freed += perform_mc_removal_requests(node);
+	freed += free_potentially_in_use_mc(node, 1);
 
 	res = pthread_rwlock_unlock(&mc_rwlock[node]);
 	STARPU_ASSERT(!res);
 
-	return liberated;
+	return freed;
 }
 
 
@@ -537,12 +537,12 @@ void _starpu_request_mem_chunk_removal(starpu_data_handle handle, unsigned node)
 	STARPU_ASSERT(!res);
 }
 
-static size_t liberate_memory_on_node(starpu_mem_chunk_t mc, uint32_t node)
+static size_t free_memory_on_node(starpu_mem_chunk_t mc, uint32_t node)
 {
-	size_t liberated = 0;
+	size_t freed = 0;
 
 	STARPU_ASSERT(mc->ops);
-	STARPU_ASSERT(mc->ops->liberate_data_on_node);
+	STARPU_ASSERT(mc->ops->free_data_on_node);
 
 	starpu_data_handle handle = mc->data;
 
@@ -556,7 +556,7 @@ static size_t liberate_memory_on_node(starpu_mem_chunk_t mc, uint32_t node)
 	{
 		STARPU_ASSERT(handle->per_node[node].allocated);
 
-		mc->ops->liberate_data_on_node(mc->interface, node);
+		mc->ops->free_data_on_node(mc->interface, node);
 
 		if (!mc->data_was_deleted)
 		{
@@ -566,14 +566,14 @@ static size_t liberate_memory_on_node(starpu_mem_chunk_t mc, uint32_t node)
 			handle->per_node[node].automatically_allocated = 0;
 		}
 
-		liberated = mc->size;
+		freed = mc->size;
 
 		STARPU_ASSERT(handle->per_node[node].refcnt == 0);
 	}
 
 //	_starpu_spin_unlock(&handle->header_lock);
 
-	return liberated;
+	return freed;
 }
 
 /*

+ 1 - 1
src/datawizard/memalloc.h

@@ -48,6 +48,6 @@ void _starpu_deinit_mem_chunk_lists(void);
 void _starpu_request_mem_chunk_removal(starpu_data_handle handle, unsigned node);
 size_t _starpu_allocate_interface(starpu_data_handle handle, void *interface, uint32_t dst_node);
 int _starpu_allocate_memory_on_node(starpu_data_handle handle, uint32_t dst_node, unsigned may_alloc);
-size_t _starpu_liberate_all_automatically_allocated_buffers(uint32_t node);
+size_t _starpu_free_all_automatically_allocated_buffers(uint32_t node);
 
 #endif

+ 1 - 1
src/drivers/cpu/driver_cpu.c

@@ -202,7 +202,7 @@ void *_starpu_cpu_worker(void *arg)
 	/* In case there remains some memory that was automatically
 	 * allocated by StarPU, we release it now. Note that data
 	 * coherency is not maintained anymore at that point ! */
-	_starpu_liberate_all_automatically_allocated_buffers(memnode);
+	_starpu_free_all_automatically_allocated_buffers(memnode);
 
 #ifdef STARPU_DATA_STATS
 	fprintf(stderr, "CPU #%d computation %le comm %le (%lf \%%)\n", cpu_arg->devid, cpu_arg->jobq->total_computation_time, cpu_arg->jobq->total_communication_time,  cpu_arg->jobq->total_communication_time*100.0/cpu_arg->jobq->total_computation_time);

+ 1 - 1
src/drivers/cuda/driver_cuda.c

@@ -286,7 +286,7 @@ void *_starpu_cuda_worker(void *arg)
 	/* In case there remains some memory that was automatically
 	 * allocated by StarPU, we release it now. Note that data
 	 * coherency is not maintained anymore at that point ! */
-	_starpu_liberate_all_automatically_allocated_buffers(memnode);
+	_starpu_free_all_automatically_allocated_buffers(memnode);
 
 	deinit_context(args->workerid);