Переглянути джерело

mpi: new function starpu_mpi_comm_amounts_retrieve() to retrieve the currennt amount of communications from the current node

Nathalie Furmento 12 роки тому
батько
коміт
8af207fdfb

+ 1 - 0
doc/chapters/configuration.texi

@@ -411,6 +411,7 @@ THE SOCL test suite is only run when the environment variable
 of the libOpenCL.so file of the OCL ICD implementation.
 
 @item @code{STARPU_COMM_STATS}
+@anchor{STARPU_COMM_STATS}
 Communication statistics for starpumpi (@pxref{StarPU MPI support})
 will be enabled when the environment variable @code{STARPU_COMM_STATS}
 is defined to an value other than 0.

+ 7 - 0
doc/chapters/mpi-support.texi

@@ -65,6 +65,13 @@ Cleans the starpumpi library. This must be called between calling
 by calling @code{starpu_mpi_initialize_extended}.
 @end deftypefun
 
+@deftypefun void starpu_mpi_comm_amounts_retrieve (size_t *@var{comm_amounts})
+Retrieve the current amount of communications from the current node in
+the array @code{comm_amounts} which must have a size greater or equal
+to the world size. Communications statistics must be enabled
+(@pxref{STARPU_COMM_STATS}).
+@end deftypefun
+
 @subsection Communication
 
 The standard point to point communications of MPI have been

+ 2 - 0
mpi/include/starpu_mpi.h

@@ -62,6 +62,8 @@ int starpu_mpi_irecv_detached_unlock_tag(starpu_data_handle_t data_handle, int s
 int starpu_mpi_isend_array_detached_unlock_tag(unsigned array_size, starpu_data_handle_t *data_handle, int *dest, int *mpi_tag, MPI_Comm *comm, starpu_tag_t tag);
 int starpu_mpi_irecv_array_detached_unlock_tag(unsigned array_size, starpu_data_handle_t *data_handle, int *source, int *mpi_tag, MPI_Comm *comm, starpu_tag_t tag);
 
+/* retrieve the current amount of communications from the current node */
+void starpu_mpi_comm_amounts_retrieve(size_t *comm_amounts);
 #ifdef __cplusplus
 }
 #endif

+ 5 - 0
mpi/src/starpu_mpi_stats.c

@@ -63,6 +63,11 @@ void _starpu_mpi_comm_amounts_inc(MPI_Comm comm, unsigned dst, MPI_Datatype data
 	comm_amount[dst] += count*size;
 }
 
+void starpu_mpi_comm_amounts_retrieve(size_t *comm_amounts)
+{
+	memcpy(comm_amounts, comm_amount, world_size * sizeof(size_t));
+}
+
 void _starpu_mpi_comm_amounts_display(int node)
 {
 	unsigned dst;