root/ompi/mpi/c/iprobe.c

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

DEFINITIONS

This source file includes following definitions.
  1. MPI_Iprobe

   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) 2015      Research Organization for Information Science
  13  *                         and Technology (RIST). All rights reserved.
  14  * $COPYRIGHT$
  15  *
  16  * Additional copyrights may follow
  17  *
  18  * $HEADER$
  19  */
  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/memchecker.h"
  29 #include "ompi/request/request.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_Iprobe = PMPI_Iprobe
  35 #endif
  36 #define MPI_Iprobe PMPI_Iprobe
  37 #endif
  38 
  39 static const char FUNC_NAME[] = "MPI_Iprobe";
  40 
  41 
  42 int MPI_Iprobe(int source, int tag, MPI_Comm comm, int *flag, MPI_Status *status)
  43 {
  44     int rc;
  45 
  46     SPC_RECORD(OMPI_SPC_IPROBE, 1);
  47 
  48     MEMCHECKER(
  49         memchecker_comm(comm);
  50     );
  51 
  52     if ( MPI_PARAM_CHECK ) {
  53         rc = MPI_SUCCESS;
  54         OMPI_ERR_INIT_FINALIZE(FUNC_NAME);
  55         if (((tag < 0) && (tag != MPI_ANY_TAG)) || (tag > mca_pml.pml_max_tag)) {
  56             rc = MPI_ERR_TAG;
  57         } else if (ompi_comm_invalid(comm)) {
  58             rc = MPI_ERR_COMM;
  59         } else if ((source != MPI_ANY_SOURCE) &&
  60                    (MPI_PROC_NULL != source) &&
  61                    ompi_comm_peer_invalid(comm, source)) {
  62             rc = MPI_ERR_RANK;
  63         }
  64         OMPI_ERRHANDLER_CHECK(rc, comm, rc, FUNC_NAME);
  65     }
  66 
  67     if (MPI_PROC_NULL == source) {
  68         *flag = 1;
  69         if (MPI_STATUS_IGNORE != status) {
  70             *status = ompi_request_empty.req_status;
  71             /*
  72              * Per MPI-1, the MPI_ERROR field is not defined for single-completion calls
  73              */
  74             MEMCHECKER(
  75                 opal_memchecker_base_mem_undefined(&status->MPI_ERROR, sizeof(int));
  76             );
  77         }
  78         return MPI_SUCCESS;
  79     }
  80 
  81     OPAL_CR_ENTER_LIBRARY();
  82 
  83     rc = MCA_PML_CALL(iprobe(source, tag, comm, flag, status));
  84 
  85     /*
  86      * Per MPI-1, the MPI_ERROR field is not defined for single-completion calls
  87      */
  88     MEMCHECKER(
  89         opal_memchecker_base_mem_undefined(&status->MPI_ERROR, sizeof(int));
  90     );
  91 
  92     OMPI_ERRHANDLER_RETURN(rc, comm, rc, FUNC_NAME);
  93 }
  94 

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