Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Enforce type for MPI_REQUEST_NULL, and fix mistakes.
authorArnaud Giersch <arnaud.giersch@iut-bm.univ-fcomte.fr>
Fri, 4 Oct 2013 09:01:18 +0000 (11:01 +0200)
committerArnaud Giersch <arnaud.giersch@iut-bm.univ-fcomte.fr>
Fri, 4 Oct 2013 13:59:50 +0000 (15:59 +0200)
Thanks Marion for having noticed it.

include/smpi/smpi.h
src/smpi/smpi_base.c
src/smpi/smpi_pmpi.c

index eaf6fac..7caf4d5 100644 (file)
@@ -255,7 +255,7 @@ XBT_PUBLIC_DATA( int ) MPI_UNIVERSE_SIZE;
 struct s_smpi_mpi_request;
 typedef struct s_smpi_mpi_request *MPI_Request;
 
-#define MPI_REQUEST_NULL NULL
+#define MPI_REQUEST_NULL ((MPI_Request)NULL)
 #define MPI_FORTRAN_REQUEST_NULL -1
 
 MPI_CALL(XBT_PUBLIC(int), MPI_Init, (int *argc, char ***argv));
index e1d0252..cb06b33 100644 (file)
@@ -621,7 +621,7 @@ int smpi_mpi_test(MPI_Request * request, MPI_Status * status) {
     flag = simcall_comm_test((*request)->action);
   if(flag) {
     finish_wait(request, status);
-    request=MPI_REQUEST_NULL;
+    *request = MPI_REQUEST_NULL;
   }else{
     smpi_empty_status(status);
   }
@@ -762,7 +762,7 @@ void smpi_mpi_wait(MPI_Request * request, MPI_Status * status)
 #endif
 
   finish_wait(request, status);
-  request=MPI_REQUEST_NULL;
+  *request = MPI_REQUEST_NULL;
   // FIXME for a detached send, finish_wait is not called:
 }
 
index bcbe9b9..74c3aac 100644 (file)
@@ -1374,7 +1374,7 @@ int PMPI_Test(MPI_Request * request, int *flag, MPI_Status * status)
   int retval = 0;
 
   smpi_bench_end();
-  if (request == MPI_REQUEST_NULL || flag == NULL) {
+  if (*request == MPI_REQUEST_NULL || flag == NULL) {
     retval = MPI_ERR_ARG;
   } else if (*request == MPI_REQUEST_NULL) {
     *flag= TRUE;