Browse Source

backport branches/starpu-1.1@13969: mpi: new function starpu_mpi_issend_detached

Nathalie Furmento 10 years ago
parent
commit
d519643baf
4 changed files with 25 additions and 2 deletions
  1. 3 2
      ChangeLog
  2. 11 0
      doc/doxygen/chapters/api/mpi.doxy
  3. 1 0
      mpi/include/starpu_mpi.h
  4. 10 0
      mpi/src/starpu_mpi.c

+ 3 - 2
ChangeLog

@@ -137,8 +137,9 @@ New features:
   * Fix and actually enable the cache allocation.
   * Enable allocation cache in main RAM when STARPU_LIMIT_CPU_MEM is set by
     the user.
-  * New MPI function starpu_mpi_issend to send data using a synchronous
-    and non-blocking mode (internally uses MPI_Issend)
+  * New MPI functions starpu_mpi_issend and starpu_mpi_issend_detached
+    to send data using a synchronous and non-blocking mode (internally
+    uses MPI_Issend)
 
 Changes:
   * Fix complexity of implicit task/data dependency, from quadratic to linear.

+ 11 - 0
doc/doxygen/chapters/api/mpi.doxy

@@ -126,6 +126,17 @@ Performs a synchronous-mode, non-blocking send of \p data_handle to the node
 \p dest using the message tag \p mpi_tag within the communicator \p
 comm.
 
+int starpu_mpi_issend_detached(starpu_data_handle_t data_handle, starpu_mpi_req *req, int dest, int mpi_tag, MPI_Comm comm, void (*callback)(void *), void *arg)
+\ingroup API_MPI_Support
+Performs a synchronous-mode, non-blocking send of \p data_handle to the node
+\p dest using the message tag \p mpi_tag within the communicator \p
+comm. On completion, the \p callback function is called with the argument \p
+arg.
+Similarly to the pthread detached functionality, when a detached
+communication completes, its resources are automatically released back
+to the system, there is no need to test or to wait for the completion
+of the request.
+
 \fn int starpu_mpi_wait(starpu_mpi_req *req, MPI_Status *status)
 \ingroup API_MPI_Support
 Returns when the operation identified by request \p req is complete.

+ 1 - 0
mpi/include/starpu_mpi.h

@@ -37,6 +37,7 @@ int starpu_mpi_recv(starpu_data_handle_t data_handle, int source, int mpi_tag, M
 int starpu_mpi_isend_detached(starpu_data_handle_t data_handle, int dest, int mpi_tag, MPI_Comm comm, void (*callback)(void *), void *arg);
 int starpu_mpi_irecv_detached(starpu_data_handle_t data_handle, int source, int mpi_tag, MPI_Comm comm, void (*callback)(void *), void *arg);
 int starpu_mpi_issend(starpu_data_handle_t data_handle, starpu_mpi_req *req, int dest, int mpi_tag, MPI_Comm comm);
+int starpu_mpi_issend_detached(starpu_data_handle_t data_handle, starpu_mpi_req *req, int dest, int mpi_tag, MPI_Comm comm, void (*callback)(void *), void *arg);
 int starpu_mpi_wait(starpu_mpi_req *req, MPI_Status *status);
 int starpu_mpi_test(starpu_mpi_req *req, int *flag, MPI_Status *status);
 int starpu_mpi_barrier(MPI_Comm comm);

+ 10 - 0
mpi/src/starpu_mpi.c

@@ -318,6 +318,16 @@ int starpu_mpi_issend(starpu_data_handle_t data_handle, starpu_mpi_req *public_r
 	return 0;
 }
 
+int starpu_mpi_issend_detached(starpu_data_handle_t data_handle, starpu_mpi_req *req, int dest, int mpi_tag, MPI_Comm comm, void (*callback)(void *), void *arg)
+{
+	_STARPU_MPI_LOG_IN();
+
+	_starpu_mpi_isend_common(data_handle, dest, mpi_tag, comm, 1, 1, callback, arg, 1);
+
+	_STARPU_MPI_LOG_OUT();
+	return 0;
+}
+
 /********************************************************/
 /*                                                      */
 /*  receive functionalities                             */