From 6d12558bf98bb09f8fc8c45527d740bf999f789c Mon Sep 17 00:00:00 2001 From: Arnaud Giersch Date: Fri, 4 Oct 2013 11:01:18 +0200 Subject: [PATCH 1/1] Enforce type for MPI_REQUEST_NULL, and fix mistakes. Thanks Marion for having noticed it. --- include/smpi/smpi.h | 2 +- src/smpi/smpi_base.c | 4 ++-- src/smpi/smpi_pmpi.c | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/include/smpi/smpi.h b/include/smpi/smpi.h index eaf6fac5e6..7caf4d5f57 100644 --- a/include/smpi/smpi.h +++ b/include/smpi/smpi.h @@ -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)); diff --git a/src/smpi/smpi_base.c b/src/smpi/smpi_base.c index e1d0252937..cb06b33939 100644 --- a/src/smpi/smpi_base.c +++ b/src/smpi/smpi_base.c @@ -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: } diff --git a/src/smpi/smpi_pmpi.c b/src/smpi/smpi_pmpi.c index bcbe9b9fc0..74c3aac1a6 100644 --- a/src/smpi/smpi_pmpi.c +++ b/src/smpi/smpi_pmpi.c @@ -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; -- 2.20.1