root/ompi/mpi/c/rput.c

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

DEFINITIONS

This source file includes following definitions.
  1. MPI_Rput

   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) 2014-2015 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/win/win.h"
  32 #include "ompi/mca/osc/osc.h"
  33 #include "ompi/datatype/ompi_datatype.h"
  34 #include "ompi/runtime/ompi_spc.h"
  35 
  36 #if OMPI_BUILD_MPI_PROFILING
  37 #if OPAL_HAVE_WEAK_SYMBOLS
  38 #pragma weak MPI_Rput = PMPI_Rput
  39 #endif
  40 #define MPI_Rput PMPI_Rput
  41 #endif
  42 
  43 static const char FUNC_NAME[] = "MPI_Rput";
  44 
  45 
  46 int MPI_Rput(const void *origin_addr, int origin_count, MPI_Datatype origin_datatype,
  47             int target_rank, MPI_Aint target_disp, int target_count,
  48              MPI_Datatype target_datatype, MPI_Win win, MPI_Request *request)
  49 {
  50     int rc;
  51 
  52     SPC_RECORD(OMPI_SPC_RPUT, 1);
  53 
  54     if (MPI_PARAM_CHECK) {
  55         rc = OMPI_SUCCESS;
  56 
  57         OMPI_ERR_INIT_FINALIZE(FUNC_NAME);
  58 
  59         if (ompi_win_invalid(win)) {
  60             return OMPI_ERRHANDLER_INVOKE(MPI_COMM_WORLD, MPI_ERR_WIN, FUNC_NAME);
  61         } else if (origin_count < 0 || target_count < 0) {
  62             rc = MPI_ERR_COUNT;
  63         } else if (ompi_win_peer_invalid(win, target_rank) &&
  64                    (MPI_PROC_NULL != target_rank)) {
  65             rc = MPI_ERR_RANK;
  66         } else if (NULL == target_datatype ||
  67                    MPI_DATATYPE_NULL == target_datatype) {
  68             rc = MPI_ERR_TYPE;
  69         } else if ( MPI_WIN_FLAVOR_DYNAMIC != win->w_flavor && target_disp < 0 ) {
  70             rc = MPI_ERR_DISP;
  71         } else {
  72             OMPI_CHECK_DATATYPE_FOR_ONE_SIDED(rc, origin_datatype, origin_count);
  73             if (OMPI_SUCCESS == rc) {
  74                 OMPI_CHECK_DATATYPE_FOR_ONE_SIDED(rc, target_datatype, target_count);
  75             }
  76         }
  77         OMPI_ERRHANDLER_CHECK(rc, win, rc, FUNC_NAME);
  78     }
  79 
  80     if (MPI_PROC_NULL == target_rank) {
  81         *request = &ompi_request_empty;
  82         return MPI_SUCCESS;
  83     }
  84 
  85     OPAL_CR_ENTER_LIBRARY();
  86 
  87     rc = win->w_osc_module->osc_rput(origin_addr, origin_count, origin_datatype,
  88                                      target_rank, target_disp, target_count,
  89                                      target_datatype, win, request);
  90     OMPI_ERRHANDLER_RETURN(rc, win, rc, FUNC_NAME);
  91 }

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