Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
fix request and coll failing tests
[simgrid.git] / src / smpi / bindings / smpi_pmpi_request.cpp
index d89bdde..571d4a2 100644 (file)
@@ -66,6 +66,12 @@ int PMPI_Recv_init(void *buf, int count, MPI_Datatype datatype, int src, int tag
   return retval;
 }
 
+int PMPI_Rsend_init(const void* buf, int count, MPI_Datatype datatype, int dst, int tag, MPI_Comm comm,
+                    MPI_Request* request)
+{
+  return PMPI_Send_init(buf, count, datatype, dst, tag, comm, request);
+}
+
 int PMPI_Ssend_init(const void* buf, int count, MPI_Datatype datatype, int dst, int tag, MPI_Comm comm, MPI_Request* request)
 {
   int retval = 0;
@@ -167,9 +173,7 @@ int PMPI_Request_free(MPI_Request * request)
   int retval = 0;
 
   smpi_bench_end();
-  if (*request == MPI_REQUEST_NULL) {
-    retval = MPI_ERR_ARG;
-  } else {
+  if (*request != MPI_REQUEST_NULL) {
     simgrid::smpi::Request::unref(request);
     retval = MPI_SUCCESS;
   }
@@ -262,6 +266,12 @@ int PMPI_Isend(const void *buf, int count, MPI_Datatype datatype, int dst, int t
   return retval;
 }
 
+int PMPI_Irsend(const void* buf, int count, MPI_Datatype datatype, int dst, int tag, MPI_Comm comm,
+                MPI_Request* request)
+{
+  return PMPI_Isend(buf, count, datatype, dst, tag, comm, request);
+}
+
 int PMPI_Issend(const void* buf, int count, MPI_Datatype datatype, int dst, int tag, MPI_Comm comm, MPI_Request* request)
 {
   int retval = 0;
@@ -390,6 +400,11 @@ int PMPI_Send(const void *buf, int count, MPI_Datatype datatype, int dst, int ta
   return retval;
 }
 
+int PMPI_Rsend(const void* buf, int count, MPI_Datatype datatype, int dst, int tag, MPI_Comm comm)
+{
+  return PMPI_Send(buf, count, datatype, dst, tag, comm);
+}
+
 int PMPI_Ssend(const void* buf, int count, MPI_Datatype datatype, int dst, int tag, MPI_Comm comm) {
   int retval = 0;
 
@@ -813,12 +828,11 @@ int PMPI_Grequest_complete( MPI_Request request){
   return simgrid::smpi::Request::grequest_complete(request);
 }
 
-
 int PMPI_Request_get_status( MPI_Request request, int *flag, MPI_Status *status){
   if(request==MPI_REQUEST_NULL){
     *flag=1;
     simgrid::smpi::Status::empty(status);
-    return MPI_ERR_REQUEST;
+    return MPI_SUCCESS;
   } else if (flag==NULL || status ==NULL){
     return MPI_ERR_ARG;
   }
@@ -826,9 +840,13 @@ int PMPI_Request_get_status( MPI_Request request, int *flag, MPI_Status *status)
 }
 
 MPI_Request PMPI_Request_f2c(MPI_Fint request){
+  if(request==-1)
+    return MPI_REQUEST_NULL;
   return static_cast<MPI_Request>(simgrid::smpi::Request::f2c(request));
 }
 
 MPI_Fint PMPI_Request_c2f(MPI_Request request) {
+  if(request==MPI_REQUEST_NULL)
+    return -1;
   return request->c2f();
 }