root/ompi/mpi/c/bsend_init.c

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

DEFINITIONS

This source file includes following definitions.
  1. MPI_Bsend_init

   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-2016 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) 2006      Cisco Systems, Inc.  All rights reserved.
  14  * Copyright (c) 2013      Los Alamos National Security, LLC.  All rights
  15  *                         reserved.
  16  * Copyright (c) 2015      Research Organization for Information Science
  17  *                         and Technology (RIST). All rights reserved.
  18  * Copyright (c) 2018      FUJITSU LIMITED.  All rights reserved.
  19  * $COPYRIGHT$
  20  *
  21  * Additional copyrights may follow
  22  *
  23  * $HEADER$
  24  */
  25 #include "ompi_config.h"
  26 #include <stdio.h>
  27 
  28 #include "ompi/mpi/c/bindings.h"
  29 #include "ompi/runtime/params.h"
  30 #include "ompi/communicator/communicator.h"
  31 #include "ompi/errhandler/errhandler.h"
  32 #include "ompi/mca/pml/pml.h"
  33 #include "ompi/mca/pml/base/pml_base_bsend.h"
  34 #include "ompi/memchecker.h"
  35 
  36 #if OMPI_BUILD_MPI_PROFILING
  37 #if OPAL_HAVE_WEAK_SYMBOLS
  38 #pragma weak MPI_Bsend_init = PMPI_Bsend_init
  39 #endif
  40 #define MPI_Bsend_init PMPI_Bsend_init
  41 #endif
  42 
  43 static const char FUNC_NAME[] = "MPI_Bsend_init";
  44 
  45 
  46 int MPI_Bsend_init(const void *buf, int count, MPI_Datatype type,
  47                    int dest, int tag, MPI_Comm comm, MPI_Request *request)
  48 {
  49     int rc;
  50 
  51     MEMCHECKER(
  52         memchecker_datatype(type);
  53         memchecker_call(&opal_memchecker_base_isaddressable, buf, count, type);
  54         memchecker_comm(comm);
  55     );
  56 
  57     if ( MPI_PARAM_CHECK ) {
  58         rc = MPI_SUCCESS;
  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 (type == MPI_DATATYPE_NULL) {
  65             rc = MPI_ERR_TYPE;
  66         } else if (tag < 0 || tag > mca_pml.pml_max_tag) {
  67             rc = MPI_ERR_TAG;
  68         } else if (ompi_comm_peer_invalid(comm, dest) &&
  69                    (MPI_PROC_NULL != dest)) {
  70             rc = MPI_ERR_RANK;
  71         } else if (request == NULL) {
  72             rc = MPI_ERR_REQUEST;
  73         }
  74         OMPI_ERRHANDLER_CHECK(rc, comm, rc, FUNC_NAME);
  75     }
  76 
  77     if (MPI_PROC_NULL == dest) {
  78         rc = ompi_request_persistent_noop_create(request);
  79         OMPI_ERRHANDLER_RETURN(rc, comm, rc, FUNC_NAME);
  80     }
  81 
  82     OPAL_CR_ENTER_LIBRARY();
  83 
  84     /*
  85      * Here, we just initialize the request -- memchecker should set the buffer in MPI_Start.
  86      */
  87     rc = MCA_PML_CALL(isend_init(buf, count, type, dest, tag,
  88                                  MCA_PML_BASE_SEND_BUFFERED, comm, request));
  89     OMPI_ERRHANDLER_RETURN(rc, comm, rc, FUNC_NAME);
  90 }
  91 

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