root/ompi/mpi/c/irecv.c

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

DEFINITIONS

This source file includes following definitions.
  1. MPI_Irecv

   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-2018 The University of Tennessee and The University
   6  *                         of Tennessee Research Foundation.  All rights
   7  *                         reserved.
   8  * Copyright (c) 2004-2008 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$
  16  *
  17  * Additional copyrights may follow
  18  *
  19  * $HEADER$
  20  */
  21 #include "ompi_config.h"
  22 
  23 #include "ompi/mpi/c/bindings.h"
  24 #include "ompi/runtime/params.h"
  25 #include "ompi/communicator/communicator.h"
  26 #include "ompi/errhandler/errhandler.h"
  27 #include "ompi/mca/pml/pml.h"
  28 #include "ompi/request/request.h"
  29 #include "ompi/memchecker.h"
  30 #include "ompi/runtime/ompi_spc.h"
  31 
  32 #if OMPI_BUILD_MPI_PROFILING
  33 #if OPAL_HAVE_WEAK_SYMBOLS
  34 #pragma weak MPI_Irecv = PMPI_Irecv
  35 #endif
  36 #define MPI_Irecv PMPI_Irecv
  37 #endif
  38 
  39 static const char FUNC_NAME[] = "MPI_Irecv";
  40 
  41 
  42 int MPI_Irecv(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     SPC_RECORD(OMPI_SPC_IRECV, 1);
  48 
  49     MEMCHECKER(
  50         memchecker_datatype(type);
  51         memchecker_comm(comm);
  52     );
  53 
  54     if ( MPI_PARAM_CHECK ) {
  55         OMPI_ERR_INIT_FINALIZE(FUNC_NAME);
  56         OMPI_CHECK_DATATYPE_FOR_RECV(rc, type, count);
  57         OMPI_CHECK_USER_BUFFER(rc, buf, type, count);
  58 
  59         if (ompi_comm_invalid(comm)) {
  60             return OMPI_ERRHANDLER_INVOKE(MPI_COMM_WORLD, MPI_ERR_COMM, FUNC_NAME);
  61         } else if (((tag < 0) && (tag != MPI_ANY_TAG)) || (tag > mca_pml.pml_max_tag)) {
  62             rc = MPI_ERR_TAG;
  63         } else if ((MPI_ANY_SOURCE != source) &&
  64                    (MPI_PROC_NULL != source) &&
  65                    ompi_comm_peer_invalid(comm, source)) {
  66             rc = MPI_ERR_RANK;
  67         } else if (NULL == request) {
  68             rc = MPI_ERR_REQUEST;
  69         }
  70         OMPI_ERRHANDLER_CHECK(rc, comm, rc, FUNC_NAME);
  71     }
  72 
  73     if (source == MPI_PROC_NULL) {
  74         *request = &ompi_request_empty;
  75         return MPI_SUCCESS;
  76     }
  77 
  78     OPAL_CR_ENTER_LIBRARY();
  79 
  80     MEMCHECKER (
  81         memchecker_call(&opal_memchecker_base_mem_noaccess, buf, count, type);
  82     );
  83     rc = MCA_PML_CALL(irecv(buf,count,type,source,tag,comm,request));
  84     OMPI_ERRHANDLER_RETURN(rc, comm, rc, FUNC_NAME);
  85 }

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