|
@@ -1,6 +1,6 @@
|
|
/* StarPU --- Runtime system for heterogeneous multicore architectures.
|
|
/* StarPU --- Runtime system for heterogeneous multicore architectures.
|
|
*
|
|
*
|
|
- * Copyright (C) 2010, 2013-2016 Université de Bordeaux
|
|
|
|
|
|
+ * Copyright (C) 2010, 2013-2017 Université de Bordeaux
|
|
*
|
|
*
|
|
* StarPU is free software; you can redistribute it and/or modify
|
|
* 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
|
|
* it under the terms of the GNU Lesser General Public License as published by
|
|
@@ -248,7 +248,7 @@ void assign_blocks_to_mpi_nodes(int world_size)
|
|
|
|
|
|
static size_t allocated = 0;
|
|
static size_t allocated = 0;
|
|
|
|
|
|
-static void allocate_block_on_node(starpu_data_handle_t *handleptr, TYPE **ptr, unsigned nx, unsigned ny, unsigned nz)
|
|
|
|
|
|
+static void allocate_block_on_node(starpu_data_handle_t *handleptr, unsigned bz, TYPE **ptr, unsigned nx, unsigned ny, unsigned nz)
|
|
{
|
|
{
|
|
int ret;
|
|
int ret;
|
|
size_t block_size = nx*ny*nz*sizeof(TYPE);
|
|
size_t block_size = nx*ny*nz*sizeof(TYPE);
|
|
@@ -271,6 +271,8 @@ static void allocate_block_on_node(starpu_data_handle_t *handleptr, TYPE **ptr,
|
|
|
|
|
|
/* Register it to StarPU */
|
|
/* Register it to StarPU */
|
|
starpu_block_data_register(handleptr, STARPU_MAIN_RAM, (uintptr_t)*ptr, nx, nx*ny, nx, ny, nz, sizeof(TYPE));
|
|
starpu_block_data_register(handleptr, STARPU_MAIN_RAM, (uintptr_t)*ptr, nx, nx*ny, nx, ny, nz, sizeof(TYPE));
|
|
|
|
+
|
|
|
|
+ starpu_data_set_coordinates(*handleptr, 1, bz);
|
|
}
|
|
}
|
|
|
|
|
|
static void free_block_on_node(starpu_data_handle_t handleptr, unsigned nx, unsigned ny, unsigned nz)
|
|
static void free_block_on_node(starpu_data_handle_t handleptr, unsigned nx, unsigned ny, unsigned nz)
|
|
@@ -300,7 +302,7 @@ void allocate_memory_on_node(int rank)
|
|
/* Main blocks */
|
|
/* Main blocks */
|
|
if (node == rank)
|
|
if (node == rank)
|
|
{
|
|
{
|
|
- allocate_block_on_node(&block->layers_handle[0], &block->layers[0],
|
|
|
|
|
|
+ allocate_block_on_node(&block->layers_handle[0], bz, &block->layers[0],
|
|
(sizex + 2*K), (sizey + 2*K), (size_bz + 2*K));
|
|
(sizex + 2*K), (sizey + 2*K), (size_bz + 2*K));
|
|
#ifndef STARPU_SIMGRID
|
|
#ifndef STARPU_SIMGRID
|
|
#ifdef LIFE
|
|
#ifdef LIFE
|
|
@@ -314,7 +316,7 @@ void allocate_memory_on_node(int rank)
|
|
/* printf("block %d starts with %d/%d alive\n", bz, sum, sizex*sizey*size_bz);*/
|
|
/* printf("block %d starts with %d/%d alive\n", bz, sum, sizex*sizey*size_bz);*/
|
|
#endif
|
|
#endif
|
|
#endif
|
|
#endif
|
|
- allocate_block_on_node(&block->layers_handle[1], &block->layers[1],
|
|
|
|
|
|
+ allocate_block_on_node(&block->layers_handle[1], bz, &block->layers[1],
|
|
(sizex + 2*K), (sizey + 2*K), (size_bz + 2*K));
|
|
(sizex + 2*K), (sizey + 2*K), (size_bz + 2*K));
|
|
}
|
|
}
|
|
|
|
|
|
@@ -322,9 +324,9 @@ void allocate_memory_on_node(int rank)
|
|
int top_node = block->boundary_blocks[T]->mpi_node;
|
|
int top_node = block->boundary_blocks[T]->mpi_node;
|
|
if ((node == rank) || (top_node == rank))
|
|
if ((node == rank) || (top_node == rank))
|
|
{
|
|
{
|
|
- allocate_block_on_node(&block->boundaries_handle[T][0], &block->boundaries[T][0],
|
|
|
|
|
|
+ allocate_block_on_node(&block->boundaries_handle[T][0], bz, &block->boundaries[T][0],
|
|
(sizex + 2*K), (sizey + 2*K), K);
|
|
(sizex + 2*K), (sizey + 2*K), K);
|
|
- allocate_block_on_node(&block->boundaries_handle[T][1], &block->boundaries[T][1],
|
|
|
|
|
|
+ allocate_block_on_node(&block->boundaries_handle[T][1], bz, &block->boundaries[T][1],
|
|
(sizex + 2*K), (sizey + 2*K), K);
|
|
(sizex + 2*K), (sizey + 2*K), K);
|
|
}
|
|
}
|
|
|
|
|
|
@@ -332,9 +334,9 @@ void allocate_memory_on_node(int rank)
|
|
int bottom_node = block->boundary_blocks[B]->mpi_node;
|
|
int bottom_node = block->boundary_blocks[B]->mpi_node;
|
|
if ((node == rank) || (bottom_node == rank))
|
|
if ((node == rank) || (bottom_node == rank))
|
|
{
|
|
{
|
|
- allocate_block_on_node(&block->boundaries_handle[B][0], &block->boundaries[B][0],
|
|
|
|
|
|
+ allocate_block_on_node(&block->boundaries_handle[B][0], bz, &block->boundaries[B][0],
|
|
(sizex + 2*K), (sizey + 2*K), K);
|
|
(sizex + 2*K), (sizey + 2*K), K);
|
|
- allocate_block_on_node(&block->boundaries_handle[B][1], &block->boundaries[B][1],
|
|
|
|
|
|
+ allocate_block_on_node(&block->boundaries_handle[B][1], bz, &block->boundaries[B][1],
|
|
(sizex + 2*K), (sizey + 2*K), K);
|
|
(sizex + 2*K), (sizey + 2*K), K);
|
|
}
|
|
}
|
|
}
|
|
}
|