root/ompi/mpi/c/mprobe.c

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

DEFINITIONS

This source file includes following definitions.
  1. MPI_Mprobe

   1 /*
   2  * Copyright (c) 2011      Sandia National Laboratories. All rights reserved.
   3  * Copyright (c) 2012 Cisco Systems, Inc.  All rights reserved.
   4  * Copyright (c) 2012      Oracle and/or its affiliates.  All rights reserved.
   5  * Copyright (c) 2015      Research Organization for Information Science
   6  *                         and Technology (RIST). All rights reserved.
   7  * $COPYRIGHT$
   8  *
   9  * Additional copyrights may follow
  10  *
  11  * $HEADER$
  12  */
  13 
  14 #include "ompi_config.h"
  15 #include <stdio.h>
  16 
  17 #include "ompi/mpi/c/bindings.h"
  18 #include "ompi/runtime/params.h"
  19 #include "ompi/mca/pml/pml.h"
  20 #include "ompi/memchecker.h"
  21 #include "ompi/request/request.h"
  22 #include "ompi/message/message.h"
  23 
  24 #if OMPI_BUILD_MPI_PROFILING
  25 #if OPAL_HAVE_WEAK_SYMBOLS
  26 #pragma weak MPI_Mprobe = PMPI_Mprobe
  27 #endif
  28 #define MPI_Mprobe PMPI_Mprobe
  29 #endif
  30 
  31 static const char FUNC_NAME[] = "MPI_Mprobe";
  32 
  33 int MPI_Mprobe(int source, int tag, MPI_Comm comm,
  34                MPI_Message *message, MPI_Status *status)
  35 {
  36     int rc;
  37 
  38     MEMCHECKER(
  39         memchecker_comm(comm);
  40     );
  41 
  42     if ( MPI_PARAM_CHECK ) {
  43         rc = MPI_SUCCESS;
  44         OMPI_ERR_INIT_FINALIZE(FUNC_NAME);
  45         if (((tag < 0) && (tag != MPI_ANY_TAG)) || (tag > mca_pml.pml_max_tag)) {
  46             rc = MPI_ERR_TAG;
  47         } else if (ompi_comm_invalid(comm)) {
  48             rc = MPI_ERR_COMM;
  49         } else if ((source != MPI_ANY_SOURCE) &&
  50                    (MPI_PROC_NULL != source) &&
  51                    ompi_comm_peer_invalid(comm, source)) {
  52             rc = MPI_ERR_RANK;
  53         } else if (NULL == message) {
  54             rc = MPI_ERR_REQUEST;
  55         }
  56         OMPI_ERRHANDLER_CHECK(rc, comm, rc, FUNC_NAME);
  57     }
  58 
  59     if (MPI_PROC_NULL == source) {
  60         if (MPI_STATUS_IGNORE != status) {
  61             *status = ompi_request_empty.req_status;
  62             /* Per MPI-1, the MPI_ERROR field is not defined for
  63                single-completion calls */
  64             MEMCHECKER(
  65                 opal_memchecker_base_mem_undefined(&status->MPI_ERROR, sizeof(int));
  66             );
  67         }
  68         *message = &ompi_message_no_proc.message;
  69         return MPI_SUCCESS;
  70     }
  71 
  72     OPAL_CR_ENTER_LIBRARY();
  73 
  74     rc = MCA_PML_CALL(mprobe(source, tag, comm, message, status));
  75     /* Per MPI-1, the MPI_ERROR field is not defined for
  76        single-completion calls */
  77     MEMCHECKER(
  78         opal_memchecker_base_mem_undefined(&status->MPI_ERROR, sizeof(int));
  79     );
  80 
  81     OMPI_ERRHANDLER_RETURN(rc, comm, rc, FUNC_NAME);
  82 }

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