Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
provide Test and Wait functions with a better MPI_STATUS_IGNORE and MPI_REQUEST_NULL...
[simgrid.git] / src / smpi / smpi_pmpi.c
index 2650e19..64f0161 100644 (file)
@@ -1077,6 +1077,7 @@ int PMPI_Test(MPI_Request * request, int *flag, MPI_Status * status)
   if (request == MPI_REQUEST_NULL || flag == NULL) {
     retval = MPI_ERR_ARG;
   } else if (*request == MPI_REQUEST_NULL) {
+    *flag=TRUE;
     retval = MPI_ERR_REQUEST;
   } else {
     *flag = smpi_mpi_test(request, status);
@@ -1323,6 +1324,23 @@ int PMPI_Waitsome(int incount, MPI_Request requests[], int *outcount,
   return retval;
 }
 
+int PMPI_Testsome(int incount, MPI_Request requests[], int* outcount,
+                 int* indices, MPI_Status status[])
+{
+  int retval;
+
+   smpi_bench_end();
+   if (outcount == NULL || indices == NULL) {
+     retval = MPI_ERR_ARG;
+   } else {
+     *outcount = smpi_mpi_testsome(incount, requests, indices, status);
+     retval = MPI_SUCCESS;
+   }
+   smpi_bench_begin();
+   return retval;
+}
+
+
 int PMPI_Bcast(void *buf, int count, MPI_Datatype datatype, int root, MPI_Comm comm)
 {
   int retval;
@@ -2025,10 +2043,6 @@ int PMPI_Buffer_detach(void* buffer, int* size) {
    return not_yet_implemented();
 }
 
-int PMPI_Testsome(int incount, MPI_Request* requests, int* outcount, int* indices, MPI_Status* statuses) {
-   return not_yet_implemented();
-}
-
 int PMPI_Comm_test_inter(MPI_Comm comm, int* flag) {
    return not_yet_implemented();
 }