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

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

DEFINITIONS

This source file includes following definitions.
  1. ompi_recv_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) 2011-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$
  17  *
  18  * Additional copyrights may follow
  19  *
  20  * $HEADER$
  21  */
  22 
  23 #include "ompi_config.h"
  24 
  25 #include "ompi/mpi/fortran/mpif-h/bindings.h"
  26 #include "ompi/mpi/fortran/mpif-h/status-conversion.h"
  27 #include "ompi/mpi/fortran/base/constants.h"
  28 #include "ompi/communicator/communicator.h"
  29 
  30 #if OMPI_BUILD_MPI_PROFILING
  31 #if OPAL_HAVE_WEAK_SYMBOLS
  32 #pragma weak PMPI_RECV = ompi_recv_f
  33 #pragma weak pmpi_recv = ompi_recv_f
  34 #pragma weak pmpi_recv_ = ompi_recv_f
  35 #pragma weak pmpi_recv__ = ompi_recv_f
  36 
  37 #pragma weak PMPI_Recv_f = ompi_recv_f
  38 #pragma weak PMPI_Recv_f08 = ompi_recv_f
  39 #else
  40 OMPI_GENERATE_F77_BINDINGS (PMPI_RECV,
  41                            pmpi_recv,
  42                            pmpi_recv_,
  43                            pmpi_recv__,
  44                            pompi_recv_f,
  45                            (char *buf, MPI_Fint *count, MPI_Fint *datatype, MPI_Fint *source, MPI_Fint *tag, MPI_Fint *comm, MPI_Fint *status, MPI_Fint *ierr),
  46                            (buf, count, datatype, source, tag, comm, status, ierr) )
  47 #endif
  48 #endif
  49 
  50 #if OPAL_HAVE_WEAK_SYMBOLS
  51 #pragma weak MPI_RECV = ompi_recv_f
  52 #pragma weak mpi_recv = ompi_recv_f
  53 #pragma weak mpi_recv_ = ompi_recv_f
  54 #pragma weak mpi_recv__ = ompi_recv_f
  55 
  56 #pragma weak MPI_Recv_f = ompi_recv_f
  57 #pragma weak MPI_Recv_f08 = ompi_recv_f
  58 #else
  59 #if ! OMPI_BUILD_MPI_PROFILING
  60 OMPI_GENERATE_F77_BINDINGS (MPI_RECV,
  61                            mpi_recv,
  62                            mpi_recv_,
  63                            mpi_recv__,
  64                            ompi_recv_f,
  65                            (char *buf, MPI_Fint *count, MPI_Fint *datatype, MPI_Fint *source, MPI_Fint *tag, MPI_Fint *comm, MPI_Fint *status, MPI_Fint *ierr),
  66                            (buf, count, datatype, source, tag, comm, status, ierr) )
  67 #else
  68 #define ompi_recv_f pompi_recv_f
  69 #endif
  70 #endif
  71 
  72 
  73 void ompi_recv_f(char *buf, MPI_Fint *count, MPI_Fint *datatype,
  74                 MPI_Fint *source, MPI_Fint *tag, MPI_Fint *comm,
  75                 MPI_Fint *status, MPI_Fint *ierr)
  76 {
  77     OMPI_FORTRAN_STATUS_DECLARATION(c_status,c_status2)
  78    MPI_Comm c_comm = PMPI_Comm_f2c(*comm);
  79    MPI_Datatype c_type = PMPI_Type_f2c(*datatype);
  80    int c_ierr;
  81 
  82     OMPI_FORTRAN_STATUS_SET_POINTER(c_status,c_status2,status)
  83 
  84    /* Call the C function */
  85    c_ierr = PMPI_Recv(OMPI_F2C_BOTTOM(buf), OMPI_FINT_2_INT(*count),
  86                      c_type, OMPI_FINT_2_INT(*source),
  87                      OMPI_FINT_2_INT(*tag), c_comm,
  88                      c_status);
  89    if (NULL != ierr) *ierr = OMPI_INT_2_FINT(c_ierr);
  90 
  91     OMPI_FORTRAN_STATUS_RETURN(c_status,c_status2,status,c_ierr)
  92 }

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