|
@@ -234,10 +234,13 @@ The list of functions is described in \ref MPIInsertTask "MPI Insert Task".
|
|
|
|
|
|
Here an stencil example showing how to use starpu_mpi_task_insert(). One
|
|
|
first needs to define a distribution function which specifies the
|
|
|
-locality of the data. Note that that distribution information needs to
|
|
|
-be given to StarPU by calling starpu_data_set_rank(). A MPI tag
|
|
|
-should also be defined for each data handle by calling
|
|
|
-starpu_data_set_tag().
|
|
|
+locality of the data. Note that the data needs to be registered to MPI
|
|
|
+by calling starpu_mpi_data_register(). This function allows to set
|
|
|
+the distribution information and the MPI tag which should be used when
|
|
|
+communicating the data. The function starpu_mpi_data_register() should
|
|
|
+be prefered to starpu_data_set_rank() and starpu_data_set_tag() as
|
|
|
+it also allows to automatically clear the MPI communication cache
|
|
|
+when unregistering the data.
|
|
|
|
|
|
\code{.c}
|
|
|
/* Returns the MPI node number where data is */
|
|
@@ -284,8 +287,7 @@ data which will be needed by the tasks that we will execute.
|
|
|
/* I know it's useless to allocate anything for this */
|
|
|
data_handles[x][y] = NULL;
|
|
|
if (data_handles[x][y]) {
|
|
|
- starpu_data_set_rank(data_handles[x][y], mpi_rank);
|
|
|
- starpu_data_set_tag(data_handles[x][y], x*X+y);
|
|
|
+ starpu_mpi_data_register(data_handles[x][y], x*X+y, mpi_rank);
|
|
|
}
|
|
|
}
|
|
|
}
|
|
@@ -458,8 +460,7 @@ for(x = 0; x < nblocks ; x++)
|
|
|
data_handles[x] = NULL;
|
|
|
}
|
|
|
if (data_handles[x]) {
|
|
|
- starpu_data_set_rank(data_handles[x], mpi_rank);
|
|
|
- starpu_data_set_tag(data_handles[x], x*nblocks+y);
|
|
|
+ starpu_mpi_data_register(data_handles[x], x*nblocks+y, mpi_rank);
|
|
|
}
|
|
|
}
|
|
|
|