From fa7f60d9e04bc8f3551a9d4da799b9668cc6df59 Mon Sep 17 00:00:00 2001 From: Augustin Degomme Date: Wed, 28 Nov 2012 09:58:41 +0100 Subject: [PATCH] add two functions to fortran bindings, needed by specfem --- src/smpi/private.h | 8 ++++++++ src/smpi/smpi_f77.c | 16 ++++++++++++++++ 2 files changed, 24 insertions(+) diff --git a/src/smpi/private.h b/src/smpi/private.h index 4219adb957..0898994e1b 100644 --- a/src/smpi/private.h +++ b/src/smpi/private.h @@ -286,6 +286,9 @@ void mpi_scatter__(void* sendbuf, int* sendcount, int* sendtype, void mpi_gather__(void* sendbuf, int* sendcount, int* sendtype, void* recvbuf, int* recvcount, int* recvtype, int* root, int* comm, int* ierr); +void mpi_gatherv__(void* sendbuf, int* sendcount, int* sendtype, + void* recvbuf, int* recvcounts, int* displs, int* recvtype, + int* root, int* comm, int* ierr); void mpi_allgather__(void* sendbuf, int* sendcount, int* sendtype, void* recvbuf, int* recvcount, int* recvtype, int* comm, int* ierr); @@ -304,5 +307,10 @@ void mpi_get_count__(MPI_Status * status, int* datatype, int *count, int* ierr); void mpi_type_extent__(int* datatype, MPI_Aint * extent, int* ierr); void mpi_type_lb__(int* datatype, MPI_Aint * extent, int* ierr); void mpi_type_ub__(int* datatype, MPI_Aint * extent, int* ierr); +void mpi_sendrecv__(void* sendbuf, int* sendcount, int* sendtype, int* dst, + int* sendtag, void *recvbuf, int* recvcount, + int* recvtype, int* src, int* recvtag, + int* comm, MPI_Status* status, int* ierr); + #endif diff --git a/src/smpi/smpi_f77.c b/src/smpi/smpi_f77.c index ffe8916651..c181e6dd6b 100644 --- a/src/smpi/smpi_f77.c +++ b/src/smpi/smpi_f77.c @@ -201,6 +201,15 @@ void mpi_send__(void* buf, int* count, int* datatype, int* dst, get_comm(*comm)); } +void mpi_sendrecv__(void* sendbuf, int* sendcount, int* sendtype, int* dst, + int* sendtag, void *recvbuf, int* recvcount, + int* recvtype, int* src, int* recvtag, + int* comm, MPI_Status* status, int* ierr) { + *ierr = MPI_Sendrecv(sendbuf, *sendcount, get_datatype(*sendtype), *dst, + *sendtag, recvbuf, *recvcount,get_datatype(*recvtype), *src, *recvtag, + get_comm(*comm), status); +} + void mpi_recv_init__(void *buf, int* count, int* datatype, int* src, int* tag, int* comm, int* request, int* ierr) { MPI_Request req; @@ -311,6 +320,13 @@ void mpi_gather__(void* sendbuf, int* sendcount, int* sendtype, recvbuf, *recvcount, get_datatype(*recvtype), *root, get_comm(*comm)); } +void mpi_gatherv__(void* sendbuf, int* sendcount, int* sendtype, + void* recvbuf, int* recvcounts, int* displs, int* recvtype, + int* root, int* comm, int* ierr) { + *ierr = MPI_Gatherv(sendbuf, *sendcount, get_datatype(*sendtype), + recvbuf, recvcounts, displs, get_datatype(*recvtype), *root, get_comm(*comm)); +} + void mpi_allgather__(void* sendbuf, int* sendcount, int* sendtype, void* recvbuf, int* recvcount, int* recvtype, int* comm, int* ierr) { -- 2.20.1