Browse Source

fix bugs detected by valgrind

Nathalie Furmento 9 years ago
parent
commit
d808a28986

+ 10 - 1
mpi/tests/insert_task_recv_cache.c

@@ -1,6 +1,6 @@
 /* StarPU --- Runtime system for heterogeneous multicore architectures.
  *
- * Copyright (C) 2011, 2012, 2013, 2014, 2015  CNRS
+ * Copyright (C) 2011, 2012, 2013, 2014, 2015, 2016  CNRS
  *
  * 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
@@ -76,6 +76,15 @@ void test_cache(int rank, char *enabled, size_t *comm_amount)
 
 	for(i = 0; i < 2; i++)
 	{
+		int j;
+		for(j=0 ; j<N ; j++)
+		{
+			v[i][j] = 12;
+		}
+	}
+
+	for(i = 0; i < 2; i++)
+	{
 		int mpi_rank = my_distrib(i);
 		if (mpi_rank == rank)
 		{

+ 10 - 1
mpi/tests/insert_task_sent_cache.c

@@ -1,6 +1,6 @@
 /* StarPU --- Runtime system for heterogeneous multicore architectures.
  *
- * Copyright (C) 2011, 2012, 2013, 2014, 2015  CNRS
+ * Copyright (C) 2011, 2012, 2013, 2014, 2015, 2016  CNRS
  *
  * 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
@@ -75,6 +75,15 @@ void test_cache(int rank, char *enabled, size_t *comm_amount)
 
 	for(i = 0; i < 2; i++)
 	{
+		int j;
+		for(j=0 ; j<N ; j++)
+		{
+			v[i][j] = 12;
+		}
+	}
+
+	for(i = 0; i < 2; i++)
+	{
 		int mpi_rank = my_distrib(i);
 		if (mpi_rank == rank)
 		{

+ 2 - 0
src/util/starpu_task_insert_utils.c

@@ -450,6 +450,8 @@ int _starpu_task_insert_create(struct starpu_codelet *cl, struct starpu_task **t
 		if ((*task)->cl_arg != NULL)
 		{
 			_STARPU_DISP("Parameters STARPU_CL_ARGS and STARPU_VALUE cannot be used in the same call\n");
+			free(arg_buffer_);
+			arg_buffer_ = NULL;
 			return -EINVAL;
 		}
 		memcpy(arg_buffer_, (int *)&nargs, sizeof(nargs));