root/ompi/mpi/fortran/mpif-h/mrecv_f.c

/* [<][>][^][v][top][bottom][index][help] */

DEFINITIONS

This source file includes following definitions.
  1. ompi_mrecv_f

   1 /*
   2  * Copyright (c) 2004-2005 The Trustees of Indiana University and Indiana
   3  *                         University Research and Technology
   4  *                         Corporation.  All rights reserved.
   5  * Copyright (c) 2004-2005 The University of Tennessee and The University
   6  *                         of Tennessee Research Foundation.  All rights
   7  *                         reserved.
   8  * Copyright (c) 2004-2005 High Performance Computing Center Stuttgart,
   9  *                         University of Stuttgart.  All rights reserved.
  10  * Copyright (c) 2004-2005 The Regents of the University of California.
  11  *                         All rights reserved.
  12  * Copyright (c) 2012 Cisco Systems, Inc.  All rights reserved.
  13  * Copyright (c) 2012      Oracle and/or its affiliates.  All rights reserved.
  14  * Copyright (c) 2015      Research Organization for Information Science
  15  *                         and Technology (RIST). All rights reserved.
  16  * Copyright (c) 2015      FUJITSU LIMITED.  All rights reserved.
  17  * $COPYRIGHT$
  18  *
  19  * Additional copyrights may follow
  20  *
  21  * $HEADER$
  22  */
  23 
  24 #include "ompi_config.h"
  25 
  26 #include "ompi/mpi/fortran/mpif-h/bindings.h"
  27 #include "ompi/mpi/fortran/mpif-h/status-conversion.h"
  28 #include "ompi/mpi/fortran/base/constants.h"
  29 #include "ompi/communicator/communicator.h"
  30 
  31 #if OMPI_BUILD_MPI_PROFILING
  32 #if OPAL_HAVE_WEAK_SYMBOLS
  33 #pragma weak PMPI_MRECV = ompi_mrecv_f
  34 #pragma weak pmpi_mrecv = ompi_mrecv_f
  35 #pragma weak pmpi_mrecv_ = ompi_mrecv_f
  36 #pragma weak pmpi_mrecv__ = ompi_mrecv_f
  37 
  38 #pragma weak PMPI_Mrecv_f = ompi_mrecv_f
  39 #pragma weak PMPI_Mrecv_f08 = ompi_mrecv_f
  40 #else
  41 OMPI_GENERATE_F77_BINDINGS (PMPI_MRECV,
  42                             pmpi_mrecv,
  43                             pmpi_mrecv_,
  44                             pmpi_mrecv__,
  45                             pompi_mrecv_f,
  46                             (char *buf, MPI_Fint *count, MPI_Fint *datatype, MPI_Fint *message,
  47                              MPI_Fint *status, MPI_Fint *ierr),
  48                             (buf, count, datatype, message, status, ierr) )
  49 #endif
  50 #endif
  51 
  52 #if OPAL_HAVE_WEAK_SYMBOLS
  53 #pragma weak MPI_MRECV = ompi_mrecv_f
  54 #pragma weak mpi_mrecv = ompi_mrecv_f
  55 #pragma weak mpi_mrecv_ = ompi_mrecv_f
  56 #pragma weak mpi_mrecv__ = ompi_mrecv_f
  57 
  58 #pragma weak MPI_Mrecv_f = ompi_mrecv_f
  59 #pragma weak MPI_Mrecv_f08 = ompi_mrecv_f
  60 #else
  61 #if ! OMPI_BUILD_MPI_PROFILING
  62 OMPI_GENERATE_F77_BINDINGS (MPI_MRECV,
  63                             mpi_mrecv,
  64                             mpi_mrecv_,
  65                             mpi_mrecv__,
  66                             ompi_mrecv_f,
  67                             (char *buf, MPI_Fint *count, MPI_Fint *datatype,
  68                              MPI_Fint *message, MPI_Fint *status, MPI_Fint *ierr),
  69                             (buf, count, datatype, message, status, ierr) )
  70 #else
  71 #define ompi_mrecv_f pompi_mrecv_f
  72 #endif
  73 #endif
  74 
  75 
  76 void ompi_mrecv_f(char *buf, MPI_Fint *count, MPI_Fint *datatype,
  77                   MPI_Fint *message, MPI_Fint *status, MPI_Fint *ierr)
  78 {
  79    int c_ierr;
  80     OMPI_FORTRAN_STATUS_DECLARATION(c_status,c_status2)
  81    MPI_Message c_message = PMPI_Message_f2c(*message);
  82    MPI_Datatype c_type = PMPI_Type_f2c(*datatype);
  83 
  84     OMPI_FORTRAN_STATUS_SET_POINTER(c_status,c_status2,status)
  85 
  86    /* Call the C function */
  87    c_ierr = OMPI_INT_2_FINT(PMPI_Mrecv(OMPI_F2C_BOTTOM(buf), OMPI_FINT_2_INT(*count),
  88                                        c_type, &c_message,
  89                                        c_status));
  90    if (NULL != ierr) *ierr = OMPI_INT_2_FINT(c_ierr);
  91 
  92    if (MPI_SUCCESS == c_ierr) {
  93       OMPI_FORTRAN_STATUS_RETURN(c_status,c_status2,status,c_ierr)
  94       /* message is an INOUT, and may be updated by the recv */
  95       *message = PMPI_Message_c2f(c_message);
  96    }
  97 }

/* [<][>][^][v][top][bottom][index][help] */