From b07df8ad451ab7f2b06de085894465e82b1cb30d Mon Sep 17 00:00:00 2001
From: Juan Escobar <juan.escobar@aero.obs-mip.fr>
Date: Mon, 25 Jan 2016 10:47:02 +0000
Subject: [PATCH] Juan 25/01/2016: add support for MPI_LOGICAL & correc some
 typo message

---
 src/LIB/MPIvide/mpivide.c | 30 +++++++++++++++++++++++++-----
 1 file changed, 25 insertions(+), 5 deletions(-)

diff --git a/src/LIB/MPIvide/mpivide.c b/src/LIB/MPIvide/mpivide.c
index 121853b1a..5372f4afc 100644
--- a/src/LIB/MPIvide/mpivide.c
+++ b/src/LIB/MPIvide/mpivide.c
@@ -22,8 +22,10 @@ MNH_LIC for details. version 1.
 #ifdef FUJI
 #if MNH_INT == 8 
 #define SIZEINTEGER 8
+#define SIZELOGICAL 8
 #else
 #define SIZEINTEGER 4
+#define SIZELOGICAL 4
 #endif
 #define SIZEPRECISION 8 
 #define SIZE2PRECISION 16 
@@ -45,7 +47,7 @@ static int initflag = 0; /* ADDON Didier */
 void disppass(fct)
 char *fct;
 {
-/*  printf("Passage dans %s \n", fct); */
+  /* printf("MPIVIDE::Passage dans %s \n", fct); */
 }
 
 #pragma weak mpi_cart_sub__ = mpi_cart_sub
@@ -111,7 +113,7 @@ void mpi_alltoallv(void *sendbuf, int *sendcounts,
             int *rdispls, int *recvtype, int *comm, int *__ierr)
 {
     int size = SIZE2PRECISION;
-    disppass("allgatherv");
+    disppass("alltoallv");
     switch(*sendtype)
     {
       case MPI_INTEGER:
@@ -126,6 +128,9 @@ void mpi_alltoallv(void *sendbuf, int *sendcounts,
       case MPI_DOUBLEDOUBLE:
         size = SIZE_DOUBLEDOUBLE;
         break;
+      case MPI_LOGICAL:
+        size = SIZELOGICAL ;
+        break;
     }
     memcpy(recvbuf, sendbuf, (*recvcounts)*size);
 
@@ -173,6 +178,9 @@ int              *__ierr;
       case MPI_DOUBLEDOUBLE:
         size = SIZE_DOUBLEDOUBLE;
         break;
+      case MPI_LOGICAL:
+        size = SIZELOGICAL ;
+        break;
     }
     memcpy(recvbuf, sendbuf, (*recvcounts)*size);
     *__ierr = 0;
@@ -194,7 +202,7 @@ int              *comm;
 int              *__ierr;
 {
     int size = SIZE2PRECISION;
-    disppass("allgather");
+    disppass("gather");
     switch(*sendtype)
     {
       case MPI_INTEGER:
@@ -212,6 +220,9 @@ int              *__ierr;
       case MPI_DOUBLE:
         size = 8 ;
         break;
+      case MPI_LOGICAL:
+        size = SIZELOGICAL ;
+        break;
     }
     memcpy(recvbuf, sendbuf, (*recvcount)*size);
 
@@ -250,6 +261,9 @@ int              *__ierr;
       case MPI_DOUBLEDOUBLE:
         size = SIZE_DOUBLEDOUBLE;
         break;
+      case MPI_LOGICAL:
+        size = SIZELOGICAL ;
+        break;
     }
     memcpy(recvbuf, sendbuf, (*recvcounts)*size);
 
@@ -336,6 +350,9 @@ int              *__ierr;
       case MPI_DOUBLEDOUBLE:
         size = SIZE_DOUBLEDOUBLE;
         break;
+      case MPI_LOGICAL:
+        size = SIZELOGICAL ;
+        break;
     }
     memcpy(recvbuf, sendbuf, (*recvcount)*size);
 
@@ -407,6 +424,9 @@ int              *__ierr;
       case MPI_DOUBLE:
         size = 8 ;
         break;
+      case MPI_LOGICAL:
+        size = SIZELOGICAL ;
+        break;
     }
     memcpy(recvbuf, sendbuf, (*count)*size); 
     *__ierr = 0;
@@ -578,7 +598,7 @@ int     *datatype;
 int         *comm;
 int *__ierr;
 {
-    disppass("send");
+    disppass("bsend");
     *__ierr = 0;
 }
 
@@ -587,7 +607,7 @@ int *__ierr;
 void mpi_buffer_attach
 ( )
 {
-disppass("mpi_buffer_attach_ juanito");
+disppass("buffer_attach");
 }
 
 /* JUAN void fclose( iunit )
-- 
GitLab