root/ompi/mpi/c/ssend.c

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

DEFINITIONS

This source file includes following definitions.
  1. MPI_Ssend

   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) 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$
  19  *
  20  * Additional copyrights may follow
  21  *
  22  * $HEADER$
  23  */
  24 #include "ompi_config.h"
  25 #include <stdio.h>
  26 
  27 #include "ompi/mpi/c/bindings.h"
  28 #include "ompi/runtime/params.h"
  29 #include "ompi/communicator/communicator.h"
  30 #include "ompi/errhandler/errhandler.h"
  31 #include "ompi/mca/pml/pml.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_Ssend = PMPI_Ssend
  38 #endif
  39 #define MPI_Ssend PMPI_Ssend
  40 #endif
  41 
  42 static const char FUNC_NAME[] = "MPI_Ssend";
  43 
  44 
  45 int MPI_Ssend(const void *buf, int count, MPI_Datatype type, int dest, int tag, MPI_Comm comm)
  46 {
  47     int rc = MPI_SUCCESS;
  48 
  49     SPC_RECORD(OMPI_SPC_SSEND, 1);
  50 
  51     MEMCHECKER(
  52         memchecker_datatype(type);
  53         memchecker_call(&opal_memchecker_base_isdefined, buf, count, type);
  54         memchecker_comm(comm);
  55     );
  56 
  57     if ( MPI_PARAM_CHECK ) {
  58         OMPI_ERR_INIT_FINALIZE(FUNC_NAME);
  59         if (ompi_comm_invalid(comm)) {
  60             return OMPI_ERRHANDLER_INVOKE(MPI_COMM_WORLD, MPI_ERR_COMM, FUNC_NAME);
  61         } else if (count < 0) {
  62             rc = MPI_ERR_COUNT;
  63         } else if (MPI_DATATYPE_NULL == type || NULL == type) {
  64             rc = MPI_ERR_TYPE;
  65         } else if (tag < 0 || tag > mca_pml.pml_max_tag) {
  66             rc = MPI_ERR_TAG;
  67         } else if (ompi_comm_peer_invalid(comm, dest) &&
  68                    (MPI_PROC_NULL != dest)) {
  69             rc = MPI_ERR_RANK;
  70         } else {
  71             OMPI_CHECK_DATATYPE_FOR_SEND(rc, type, count);
  72             OMPI_CHECK_USER_BUFFER(rc, buf, type, count);
  73         }
  74         OMPI_ERRHANDLER_CHECK(rc, comm, rc, FUNC_NAME);
  75     }
  76 
  77     if (MPI_PROC_NULL == dest) {
  78         return MPI_SUCCESS;
  79     }
  80 
  81     OPAL_CR_ENTER_LIBRARY();
  82     rc = MCA_PML_CALL(send(buf, count, type, dest, tag,
  83                            MCA_PML_BASE_SEND_SYNCHRONOUS, comm));
  84     OMPI_ERRHANDLER_RETURN(rc, comm, rc, FUNC_NAME);
  85 }
  86 

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