Sfoglia il codice sorgente

mpi: document and check the value of MPI_Status

Nathalie Furmento 4 anni fa
parent
commit
92772b1255
2 ha cambiato i file con 7 aggiunte e 0 eliminazioni
  1. 4 0
      mpi/include/starpu_mpi.h
  2. 3 0
      mpi/src/starpu_mpi.c

+ 4 - 0
mpi/include/starpu_mpi.h

@@ -197,6 +197,8 @@ int starpu_mpi_send_prio(starpu_data_handle_t data_handle, int dest, starpu_mpi_
    Perform a standard-mode, blocking receive in \p data_handle from
    the node \p source using the message tag \p data_tag within the
    communicator \p comm.
+   The value of \p status cannot be NULL, use the predefined value
+   MPI_STATUS_IGNORE to ignore the status.
 */
 int starpu_mpi_recv(starpu_data_handle_t data_handle, int source, starpu_mpi_tag_t data_tag, MPI_Comm comm, MPI_Status *status);
 
@@ -277,6 +279,8 @@ int starpu_mpi_issend_detached_prio(starpu_data_handle_t data_handle, int dest,
 
 /**
    Return when the operation identified by request \p req is complete.
+   The value of \p status cannot be NULL, use the predefined value
+   MPI_STATUS_IGNORE to ignore the status.
 */
 int starpu_mpi_wait(starpu_mpi_req *req, MPI_Status *status);
 

+ 3 - 0
mpi/src/starpu_mpi.c

@@ -348,6 +348,8 @@ int starpu_mpi_irecv_detached_sequential_consistency(starpu_data_handle_t data_h
 
 int starpu_mpi_recv(starpu_data_handle_t data_handle, int source, starpu_mpi_tag_t data_tag, MPI_Comm comm, MPI_Status *status)
 {
+	STARPU_ASSERT_MSG(status != NULL || status == MPI_STATUS_IGNORE, "MPI_Status value cannot be NULL or different from MPI_STATUS_IGNORE");
+
 	starpu_mpi_req req;
 
 	_STARPU_MPI_LOG_IN();
@@ -361,6 +363,7 @@ int starpu_mpi_recv(starpu_data_handle_t data_handle, int source, starpu_mpi_tag
 
 int starpu_mpi_wait(starpu_mpi_req *public_req, MPI_Status *status)
 {
+	STARPU_ASSERT_MSG(status != NULL || status == MPI_STATUS_IGNORE, "MPI_Status value cannot be NULL or different from MPI_STATUS_IGNORE");
 	return _mpi_backend._starpu_mpi_backend_wait(public_req, status);
 }