root/ompi/mpi/c/recv_init.c

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

DEFINITIONS

This source file includes following definitions.
  1. MPI_Recv_init

   1 /*
   2  * Copyright (c) 2004-2007 The Trustees of Indiana University and Indiana
   3  *                         University Research and Technology
   4  *                         Corporation.  All rights reserved.
   5  * Copyright (c) 2004-2016 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) 2006      Cisco Systems, Inc.  All rights reserved.
  13  * Copyright (c) 2015      Research Organization for Information Science
  14  *                         and Technology (RIST). All rights reserved.
  15  * Copyright (c) 2018      FUJITSU LIMITED.  All rights reserved.
  16  * $COPYRIGHT$
  17  *
  18  * Additional copyrights may follow
  19  *
  20  * $HEADER$
  21  */
  22 #include "ompi_config.h"
  23 
  24 #include "ompi/mpi/c/bindings.h"
  25 #include "ompi/runtime/params.h"
  26 #include "ompi/communicator/communicator.h"
  27 #include "ompi/errhandler/errhandler.h"
  28 #include "ompi/mca/pml/pml.h"
  29 #include "ompi/request/request.h"
  30 #include "ompi/memchecker.h"
  31 
  32 #if OMPI_BUILD_MPI_PROFILING
  33 #if OPAL_HAVE_WEAK_SYMBOLS
  34 #pragma weak MPI_Recv_init = PMPI_Recv_init
  35 #endif
  36 #define MPI_Recv_init PMPI_Recv_init
  37 #endif
  38 
  39 static const char FUNC_NAME[] = "MPI_Recv_init";
  40 
  41 
  42 int MPI_Recv_init(void *buf, int count, MPI_Datatype type, int source,
  43                   int tag, MPI_Comm comm, MPI_Request *request)
  44 {
  45     int rc = MPI_SUCCESS;
  46 
  47     MEMCHECKER(
  48         memchecker_datatype(type);
  49         memchecker_call(&opal_memchecker_base_isaddressable, buf, count, type);
  50         memchecker_comm(comm);
  51     );
  52 
  53     if ( MPI_PARAM_CHECK ) {
  54         OMPI_ERR_INIT_FINALIZE(FUNC_NAME);
  55         OMPI_CHECK_DATATYPE_FOR_RECV(rc, type, count);
  56         OMPI_CHECK_USER_BUFFER(rc, buf, type, count);
  57 
  58         if (ompi_comm_invalid(comm)) {
  59             return OMPI_ERRHANDLER_INVOKE(MPI_COMM_WORLD, MPI_ERR_COMM, FUNC_NAME);
  60         } else if (((tag < 0) && (tag != MPI_ANY_TAG)) || (tag > mca_pml.pml_max_tag)) {
  61             rc = MPI_ERR_TAG;
  62         } else if ((source != MPI_ANY_SOURCE) &&
  63                    (MPI_PROC_NULL != source) &&
  64                    ompi_comm_peer_invalid(comm, source)) {
  65             rc = MPI_ERR_RANK;
  66         } else if (NULL == request) {
  67             rc = MPI_ERR_REQUEST;
  68         }
  69 
  70         OMPI_ERRHANDLER_CHECK(rc, comm, rc, FUNC_NAME);
  71     }
  72 
  73     if (MPI_PROC_NULL == source) {
  74         rc = ompi_request_persistent_noop_create(request);
  75         OMPI_ERRHANDLER_RETURN(rc, comm, rc, FUNC_NAME);
  76     }
  77 
  78     OPAL_CR_ENTER_LIBRARY();
  79 
  80     /*
  81      * Here, we just initialize the request -- memchecker should set the buffer in MPI_Start.
  82      */
  83     rc = MCA_PML_CALL(irecv_init(buf,count,type,source,tag,comm,request));
  84     OMPI_ERRHANDLER_RETURN(rc, comm, rc, FUNC_NAME);
  85 }

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