ソースを参照

mpi: minor fixes following bugs detected by valgrind

Nathalie Furmento 12 年 前
コミット
685ec404f6
共有3 個のファイルを変更した6 個の追加5 個の削除を含む
  1. 3 3
      mpi/examples/complex/mpi_complex.c
  2. 1 1
      mpi/tests/insert_task_owner2.c
  3. 2 1
      mpi/tests/insert_task_owner_data.c

+ 3 - 3
mpi/examples/complex/mpi_complex.c

@@ -77,17 +77,17 @@ int main(int argc, char **argv)
 		{
 			int *compare_ptr = &compare;
 
-			starpu_task_insert(&cl_display, STARPU_VALUE, "node0 initial value", strlen("node0 initial value"), STARPU_R, handle, 0);
+			starpu_task_insert(&cl_display, STARPU_VALUE, "node0 initial value", strlen("node0 initial value")+1, STARPU_R, handle, 0);
 			starpu_mpi_isend_detached(handle, 1, 10, MPI_COMM_WORLD, NULL, NULL);
 			starpu_mpi_irecv_detached(handle2, 1, 20, MPI_COMM_WORLD, NULL, NULL);
 
-			starpu_task_insert(&cl_display, STARPU_VALUE, "node0 received value", strlen("node0 received value"), STARPU_R, handle2, 0);
+			starpu_task_insert(&cl_display, STARPU_VALUE, "node0 received value", strlen("node0 received value")+1, STARPU_R, handle2, 0);
 			starpu_task_insert(&cl_compare, STARPU_R, handle, STARPU_R, handle2, STARPU_VALUE, &compare_ptr, sizeof(compare_ptr), 0);
 		}
 		else if (rank == 1)
 		{
 			starpu_mpi_irecv_detached(handle, 0, 10, MPI_COMM_WORLD, NULL, NULL);
-			starpu_task_insert(&cl_display, STARPU_VALUE, "node1 received value", strlen("node1 received value"), STARPU_R, handle, 0);
+			starpu_task_insert(&cl_display, STARPU_VALUE, "node1 received value", strlen("node1 received value")+1, STARPU_R, handle, 0);
 			starpu_mpi_isend_detached(handle, 0, 20, MPI_COMM_WORLD, NULL, NULL);
 		}
 

+ 1 - 1
mpi/tests/insert_task_owner2.c

@@ -29,7 +29,7 @@ void func_cpu(void *descr[], STARPU_ATTRIBUTE_UNUSED void *_args)
 	//*x2 = 45;
 	//*y = 144;
 
-	FPRINTF(stderr, "-------> CODELET VALUES: %d %d %d %d\n", *x0, *x1, *x2, *y);
+	FPRINTF(stderr, "-------> CODELET VALUES: %d %d (x2) %d\n", *x0, *x1, *y);
 	*y = (*x0 + *x1) * 100;
 	*x1 = 12;
 	*x2 = 24;

+ 2 - 1
mpi/tests/insert_task_owner_data.c

@@ -87,9 +87,10 @@ int main(int argc, char **argv)
 			starpu_data_acquire(data_handles[i], STARPU_R);
 			values[i] = *((int *)starpu_data_get_local_ptr(data_handles[i]));
 			starpu_data_release(data_handles[i]);
+
+			FPRINTF(stderr, "[%d][local ptr] VALUES: %d %d\n", rank, values[0], values[1]);
 		}
 	}
-	FPRINTF(stderr, "[%d][local ptr] VALUES: %d %d\n", rank, values[0], values[1]);
 	ret = 0;
 	if (rank == 0 && (values[0] != 12 || values[1] != 144))
 		ret = EXIT_FAILURE;