|
@@ -1,6 +1,6 @@
|
|
|
/* StarPU --- Runtime system for heterogeneous multicore architectures.
|
|
|
*
|
|
|
- * Copyright (C) 2011, 2012, 2013, 2014, 2015, 2016 CNRS
|
|
|
+ * Copyright (C) 2011, 2012, 2013, 2014, 2015, 2016, 2017 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
|
|
@@ -63,7 +63,7 @@ void test_cache(int rank, char *enabled, size_t *comm_amount)
|
|
|
{
|
|
|
int i;
|
|
|
int ret;
|
|
|
- unsigned **v;
|
|
|
+ unsigned *v[2];
|
|
|
starpu_data_handle_t data_handles[2];
|
|
|
|
|
|
setenv("STARPU_MPI_CACHE", enabled, 1);
|
|
@@ -73,7 +73,6 @@ void test_cache(int rank, char *enabled, size_t *comm_amount)
|
|
|
ret = starpu_mpi_init(NULL, NULL, 0);
|
|
|
STARPU_CHECK_RETURN_VALUE(ret, "starpu_mpi_init");
|
|
|
|
|
|
- v = malloc(2 * sizeof(unsigned *));
|
|
|
for(i = 0; i < 2; i++)
|
|
|
{
|
|
|
int j;
|
|
@@ -90,7 +89,7 @@ void test_cache(int rank, char *enabled, size_t *comm_amount)
|
|
|
if (mpi_rank == rank)
|
|
|
{
|
|
|
//FPRINTF(stderr, "[%d] Owning data[%d][%d]\n", rank, x, y);
|
|
|
- starpu_vector_data_register(&data_handles[i], STARPU_MAIN_RAM, (uintptr_t)&(v[i]), N, sizeof(unsigned));
|
|
|
+ starpu_vector_data_register(&data_handles[i], STARPU_MAIN_RAM, (uintptr_t)v[i], N, sizeof(unsigned));
|
|
|
}
|
|
|
else
|
|
|
{
|
|
@@ -131,7 +130,6 @@ void test_cache(int rank, char *enabled, size_t *comm_amount)
|
|
|
starpu_data_unregister(data_handles[i]);
|
|
|
free(v[i]);
|
|
|
}
|
|
|
- free(v);
|
|
|
|
|
|
starpu_mpi_comm_amounts_retrieve(comm_amount);
|
|
|
starpu_mpi_shutdown();
|