root/ompi/mpi/c/issend.c

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

DEFINITIONS

This source file includes following definitions.
  1. MPI_Issend

   1 /* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil -*- */
   2 /*
   3  * Copyright (c) 2004-2007 The Trustees of Indiana University and Indiana
   4  *                         University Research and Technology
   5  *                         Corporation.  All rights reserved.
   6  * Copyright (c) 2004-2018 The University of Tennessee and The University
   7  *                         of Tennessee Research Foundation.  All rights
   8  *                         reserved.
   9  * Copyright (c) 2004-2008 High Performance Computing Center Stuttgart,
  10  *                         University of Stuttgart.  All rights reserved.
  11  * Copyright (c) 2004-2005 The Regents of the University of California.
  12  *                         All rights reserved.
  13  * Copyright (c) 2013      Los Alamos National Security, LLC.  All rights
  14  *                         reserved.
  15  * Copyright (c) 2015      Research Organization for Information Science
  16  *                         and Technology (RIST). All rights reserved.
  17  * $COPYRIGHT$
  18  *
  19  * Additional copyrights may follow
  20  *
  21  * $HEADER$
  22  */
  23 
  24 #include "ompi_config.h"
  25 
  26 #include "ompi/mpi/c/bindings.h"
  27 #include "ompi/runtime/params.h"
  28 #include "ompi/communicator/communicator.h"
  29 #include "ompi/errhandler/errhandler.h"
  30 #include "ompi/mca/pml/pml.h"
  31 #include "ompi/request/request.h"
  32 #include "ompi/memchecker.h"
  33 #include "ompi/runtime/ompi_spc.h"
  34 
  35 #if OMPI_BUILD_MPI_PROFILING
  36 #if OPAL_HAVE_WEAK_SYMBOLS
  37 #pragma weak MPI_Issend = PMPI_Issend
  38 #endif
  39 #define MPI_Issend PMPI_Issend
  40 #endif
  41 
  42 static const char FUNC_NAME[] = "MPI_Issend";
  43 
  44 
  45 int MPI_Issend(const void *buf, int count, MPI_Datatype type, int dest,
  46                int tag, MPI_Comm comm, MPI_Request *request)
  47 {
  48     int rc = MPI_SUCCESS;
  49 
  50     SPC_RECORD(OMPI_SPC_ISSEND, 1);
  51 
  52     MEMCHECKER(
  53         memchecker_datatype(type);
  54         memchecker_call(&opal_memchecker_base_isdefined, buf, count, type);
  55         memchecker_comm(comm);
  56     );
  57 
  58     if ( MPI_PARAM_CHECK ) {
  59         OMPI_ERR_INIT_FINALIZE(FUNC_NAME);
  60         if (ompi_comm_invalid(comm)) {
  61             return OMPI_ERRHANDLER_INVOKE(MPI_COMM_WORLD, MPI_ERR_COMM, FUNC_NAME);
  62         } else if (count < 0) {
  63             rc = MPI_ERR_COUNT;
  64         } else if (tag < 0 || tag > mca_pml.pml_max_tag) {
  65             rc = MPI_ERR_TAG;
  66         } else if (ompi_comm_peer_invalid(comm, dest) &&
  67                    (MPI_PROC_NULL != dest)) {
  68             rc = MPI_ERR_RANK;
  69         } else if (request == NULL) {
  70             rc = MPI_ERR_REQUEST;
  71         } else {
  72             OMPI_CHECK_DATATYPE_FOR_SEND(rc, type, count);
  73             OMPI_CHECK_USER_BUFFER(rc, buf, type, count);
  74         }
  75         OMPI_ERRHANDLER_CHECK(rc, comm, rc, FUNC_NAME);
  76     }
  77 
  78     if (MPI_PROC_NULL == dest) {
  79         *request = &ompi_request_empty;
  80         return MPI_SUCCESS;
  81     }
  82 
  83     OPAL_CR_ENTER_LIBRARY();
  84 
  85     MEMCHECKER (
  86         memchecker_call(&opal_memchecker_base_mem_noaccess, buf, count, type);
  87     );
  88     rc = MCA_PML_CALL(isend(buf, count, type, dest, tag,
  89                             MCA_PML_BASE_SEND_SYNCHRONOUS, comm, request));
  90     OMPI_ERRHANDLER_RETURN(rc, comm, rc, FUNC_NAME);
  91 }
  92 
  93 

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