Juan 19/01/2016: add mpi_gatherv for next Elect routines
authorJuan Escobar <juan.escobar@aero.obs-mip.fr>
Tue, 19 Jan 2016 11:34:00 +0000 (11:34 +0000)
committerPhilippe WAUTELET <philippe.wautelet@aero.obs-mip.fr>
Thu, 19 May 2016 14:44:49 +0000 (16:44 +0200)
src/LIB/MPIvide/mpivide.c

index 06740a2..121853b 100644 (file)
@@ -218,6 +218,44 @@ int              *__ierr;
     *__ierr = 0;
 }
 
+#pragma weak mpi_gatherv__  = mpi_gatherv
+#pragma weak mpi_gatherv_   = mpi_gatherv
+void mpi_gatherv
+( sendbuf, sendcount, sendtype, recvbuf, recvcounts, displs, recvtype, root, comm, __ierr )
+
+void             *sendbuf;
+int              *sendcount;
+int              *sendtype;
+void             *recvbuf;
+int              *recvcounts;
+int              *displs;
+int              *recvtype;
+int              *root;
+int              *comm;
+int              *__ierr;
+{
+    int size = SIZE2PRECISION;
+    disppass("gatherv");
+    switch(*sendtype)
+    {
+      case MPI_INTEGER:
+        size = SIZEINTEGER;
+        break;
+      case MPI_PRECISION:
+        size = SIZEPRECISION;
+        break;
+      case MPI_2PRECISION:
+        size = SIZE2PRECISION;
+        break;
+      case MPI_DOUBLEDOUBLE:
+        size = SIZE_DOUBLEDOUBLE;
+        break;
+    }
+    memcpy(recvbuf, sendbuf, (*recvcounts)*size);
+
+    *__ierr = 0;
+}
+
 #pragma weak mpi_comm_get_parent__ =  mpi_comm_get_parent
 #pragma weak mpi_comm_get_parent_  =  mpi_comm_get_parent
 void mpi_comm_get_parent(int *parent , int *__ierr)