root/ompi/mpi/c/imrecv.c

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

DEFINITIONS

This source file includes following definitions.
  1. MPI_Imrecv

   1 /*
   2  * Copyright (c) 2011      Sandia National Laboratories. All rights reserved.
   3  * Copyright (c) 2012 Cisco Systems, Inc.  All rights reserved.
   4  * Copyright (c) 2015      Research Organization for Information Science
   5  *                         and Technology (RIST). All rights reserved.
   6  * $COPYRIGHT$
   7  *
   8  * Additional copyrights may follow
   9  *
  10  * $HEADER$
  11  */
  12 
  13 #include "ompi_config.h"
  14 
  15 #include "ompi/mpi/c/bindings.h"
  16 #include "ompi/runtime/params.h"
  17 #include "ompi/mca/pml/pml.h"
  18 #include "ompi/memchecker.h"
  19 #include "ompi/request/request.h"
  20 #include "ompi/message/message.h"
  21 
  22 #if OMPI_BUILD_MPI_PROFILING
  23 #if OPAL_HAVE_WEAK_SYMBOLS
  24 #pragma weak MPI_Imrecv = PMPI_Imrecv
  25 #endif
  26 #define MPI_Imrecv PMPI_Imrecv
  27 #endif
  28 
  29 static const char FUNC_NAME[] = "MPI_Imrecv";
  30 
  31 
  32 int MPI_Imrecv(void *buf, int count, MPI_Datatype type,
  33                MPI_Message *message, MPI_Request *request)
  34 {
  35     int rc = MPI_SUCCESS;
  36     ompi_communicator_t *comm;
  37 
  38     MEMCHECKER(
  39         memchecker_datatype(type);
  40         memchecker_message(message);
  41         memchecker_call(&opal_memchecker_base_isaddressable, buf, count, type);
  42         memchecker_comm(comm);
  43     );
  44 
  45     if ( MPI_PARAM_CHECK ) {
  46         OMPI_ERR_INIT_FINALIZE(FUNC_NAME);
  47         OMPI_CHECK_DATATYPE_FOR_RECV(rc, type, count);
  48         OMPI_CHECK_USER_BUFFER(rc, buf, type, count);
  49 
  50         if (NULL == message || MPI_MESSAGE_NULL == *message) {
  51             rc = MPI_ERR_REQUEST;
  52             comm = MPI_COMM_NULL;
  53         } else {
  54             comm = (*message)->comm;
  55         }
  56 
  57         OMPI_ERRHANDLER_CHECK(rc, comm, rc, FUNC_NAME);
  58     } else {
  59         comm = (*message)->comm;
  60     }
  61 
  62     if (&ompi_message_no_proc.message == *message) {
  63         *request = &ompi_request_empty;
  64         *message = MPI_MESSAGE_NULL;
  65         return MPI_SUCCESS;
  66      }
  67 
  68     OPAL_CR_ENTER_LIBRARY();
  69 
  70     rc = MCA_PML_CALL(imrecv(buf, count, type, message, request));
  71     OMPI_ERRHANDLER_RETURN(rc, comm, rc, FUNC_NAME);
  72 }

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