Browse Source

tests: free allocated memory

Nathalie Furmento 14 years ago
parent
commit
5e98aced54

+ 2 - 1
tests/core/empty_task_chain.c

@@ -1,7 +1,7 @@
 /* StarPU --- Runtime system for heterogeneous multicore architectures.
  *
  * Copyright (C) 2010  Université de Bordeaux 1
- * Copyright (C) 2010  Centre National de la Recherche Scientifique
+ * Copyright (C) 2010, 2011  Centre National de la Recherche Scientifique
  *
  * StarPU is free software; you can redistribute it and/or modify
  * it under the terms of the GNU Lesser General Public License as published by
@@ -49,6 +49,7 @@ int main(int argc, char **argv)
 	starpu_task_wait(tasks[N-1]);
 
 	starpu_shutdown();
+	free(tasks);
 
 	return 0;
 }

+ 1 - 0
tests/core/execute_on_a_specific_worker.c

@@ -122,6 +122,7 @@ int main(int argc, char **argv)
 		pthread_cond_wait(&cond, &mutex);
 	pthread_mutex_unlock(&mutex);
 
+	starpu_free(v);
 	starpu_shutdown();
 
 	return 0;

+ 5 - 0
tests/datawizard/data_implicit_deps.c

@@ -118,6 +118,11 @@ int main(int argc, char **argv)
 
 	starpu_task_wait_for_all();
 
+	free(A);
+	free(B);
+	free(C);
+	free(D);
+
 	starpu_shutdown();
 
 	return 0;

+ 1 - 0
tests/datawizard/data_lookup.c

@@ -136,6 +136,7 @@ static void test_filters()
 	assert(starpu_data_lookup(ptr) == handle);
 
 	starpu_data_unregister(handle);
+	starpu_free(ptr);
 
 #undef CHILDREN_COUNT
 }

+ 2 - 0
tests/datawizard/dsm_stress.c

@@ -124,6 +124,8 @@ int main(int argc, char **argv)
 		pthread_cond_wait(&cond, &mutex);
 	pthread_mutex_unlock(&mutex);
 
+	starpu_free(v);
+	starpu_free(v2);
 	starpu_shutdown();
 
 	return 0;

+ 4 - 2
tests/datawizard/sync_with_data_with_mem.c

@@ -1,7 +1,7 @@
 /* StarPU --- Runtime system for heterogeneous multicore architectures.
  *
  * Copyright (C) 2010  Université de Bordeaux 1
- * Copyright (C) 2010  Centre National de la Recherche Scientifique
+ * Copyright (C) 2010, 2011  Centre National de la Recherche Scientifique
  *
  * StarPU is free software; you can redistribute it and/or modify
  * it under the terms of the GNU Lesser General Public License as published by
@@ -98,8 +98,10 @@ int main(int argc, char **argv)
 	}
 
 	/* do some cleanup */
-	for (b = 0; b < NBUFFERS; b++)
+	for (b = 0; b < NBUFFERS; b++) {
 		starpu_data_unregister(v_handle[b]);
+		starpu_free(buffer[b]);
+	}
 
 	starpu_shutdown();
 

+ 4 - 2
tests/datawizard/sync_with_data_with_mem_non_blocking.c

@@ -1,7 +1,7 @@
 /* StarPU --- Runtime system for heterogeneous multicore architectures.
  *
  * Copyright (C) 2010  Université de Bordeaux 1
- * Copyright (C) 2010  Centre National de la Recherche Scientifique
+ * Copyright (C) 2010, 2011  Centre National de la Recherche Scientifique
  *
  * StarPU is free software; you can redistribute it and/or modify
  * it under the terms of the GNU Lesser General Public License as published by
@@ -131,8 +131,10 @@ int main(int argc, char **argv)
 	}
 
 	/* do some cleanup */
-	for (b = 0; b < NBUFFERS; b++)
+	for (b = 0; b < NBUFFERS; b++) {
 		starpu_data_unregister(v_handle[b]);
+		starpu_free(buffer[b]);
+	}
 
 	starpu_shutdown();
 

+ 4 - 2
tests/datawizard/sync_with_data_with_mem_non_blocking_implicit.c

@@ -1,7 +1,7 @@
 /* StarPU --- Runtime system for heterogeneous multicore architectures.
  *
  * Copyright (C) 2010  Université de Bordeaux 1
- * Copyright (C) 2010  Centre National de la Recherche Scientifique
+ * Copyright (C) 2010, 2011  Centre National de la Recherche Scientifique
  *
  * StarPU is free software; you can redistribute it and/or modify
  * it under the terms of the GNU Lesser General Public License as published by
@@ -130,8 +130,10 @@ int main(int argc, char **argv)
 	starpu_task_wait_for_all();
 
 	/* do some cleanup */
-	for (b = 0; b < NBUFFERS; b++)
+	for (b = 0; b < NBUFFERS; b++) {
 		starpu_data_unregister(v_handle[b]);
+		starpu_free(buffer[b]);
+	}
 
 	starpu_shutdown();
 

+ 1 - 0
tests/datawizard/unpartition.c

@@ -106,6 +106,7 @@ int main(int argc, char **argv)
 	}
 
 	starpu_data_unregister(v_handle);
+	starpu_free(buffer);
 
 	starpu_shutdown();
 

+ 1 - 0
tests/microbenchs/async_tasks_overhead.c

@@ -194,6 +194,7 @@ int main(int argc, char **argv)
         }
 
 	starpu_shutdown();
+	free(tasks);
 
 	return 0;
 }

+ 1 - 0
tests/microbenchs/local_pingpong.c

@@ -98,6 +98,7 @@ int main(int argc, char **argv)
 	fprintf(stderr, "Took %f ms\n", timing/1000);
 	fprintf(stderr, "Avg. transfer time : %f us\n", timing/(2*niter));
 
+	starpu_free(v);
 	starpu_shutdown();
 
 	return 0;

+ 2 - 0
tests/microbenchs/prefetch_data_on_node.c

@@ -129,11 +129,13 @@ int main(int argc, char **argv)
 		pthread_cond_wait(&cond, &mutex);
 	pthread_mutex_unlock(&mutex);
 
+	starpu_free(v);
 	starpu_shutdown();
 
 	return 0;
 
 enodev:
+	starpu_free(v);
 	fprintf(stderr, "WARNING: No one can execute this task\n");
 	/* yes, we do not perform the computation but we did detect that no one
  	 * could perform the kernel, so this is not an error from StarPU */

+ 2 - 0
tests/microbenchs/redundant_buffer.c

@@ -76,11 +76,13 @@ int main(int argc, char **argv)
 
 	starpu_task_wait_for_all();
 
+	starpu_free(v);
 	starpu_shutdown();
 
 	return 0;
 
 enodev:
+	starpu_free(v);
 	fprintf(stderr, "WARNING: No one can execute this task\n");
 	/* yes, we do not perform the computation but we did detect that no one
  	 * could perform the kernel, so this is not an error from StarPU */

+ 2 - 0
tests/overlap/overlap.c

@@ -119,11 +119,13 @@ int main(int argc, char **argv)
 		pthread_cond_wait(&cond, &mutex);
 	pthread_mutex_unlock(&mutex);
 
+	starpu_free(buffer);
 	starpu_shutdown();
 
 	return 0;
 
 enodev:
+	starpu_free(buffer);
 	fprintf(stderr, "WARNING: No one can execute this task\n");
 	/* yes, we do not perform the computation but we did detect that no one
  	 * could perform the kernel, so this is not an error from StarPU */

+ 2 - 0
tests/parallel_tasks/explicit_combined_worker.c

@@ -96,11 +96,13 @@ int main(int argc, char **argv)
 
 	starpu_task_wait_for_all();
 
+	starpu_free(v);
 	starpu_shutdown();
 
 	return 0;
 
 enodev:
+	starpu_free(v);
 	fprintf(stderr, "WARNING: No one can execute this task\n");
 	/* yes, we do not perform the computation but we did detect that no one
  	 * could perform the kernel, so this is not an error from StarPU */

+ 2 - 0
tests/parallel_tasks/parallel_kernels.c

@@ -99,11 +99,13 @@ int main(int argc, char **argv)
 
 	starpu_task_wait_for_all();
 
+	starpu_free(v);
 	starpu_shutdown();
 
 	return 0;
 
 enodev:
+	starpu_free(v);
 	fprintf(stderr, "WARNING: No one can execute this task\n");
 	/* yes, we do not perform the computation but we did detect that no one
  	 * could perform the kernel, so this is not an error from StarPU */

+ 2 - 0
tests/parallel_tasks/parallel_kernels_spmd.c

@@ -101,11 +101,13 @@ int main(int argc, char **argv)
 
 	starpu_task_wait_for_all();
 
+	starpu_free(v);
 	starpu_shutdown();
 
 	return 0;
 
 enodev:
+	starpu_free(v);
 	fprintf(stderr, "WARNING: No one can execute this task\n");
 	/* yes, we do not perform the computation but we did detect that no one
  	 * could perform the kernel, so this is not an error from StarPU */

+ 2 - 0
tests/parallel_tasks/spmd_pgreedy.c

@@ -79,11 +79,13 @@ int main(int argc, char **argv)
 
 	starpu_task_wait_for_all();
 
+	starpu_free(v);
 	starpu_shutdown();
 
 	return 0;
 
 enodev:
+	starpu_free(v);
 	fprintf(stderr, "WARNING: No one can execute this task\n");
 	/* yes, we do not perform the computation but we did detect that no one
  	 * could perform the kernel, so this is not an error from StarPU */