root/ompi/mpi/c/get.c

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

DEFINITIONS

This source file includes following definitions.
  1. MPI_Get

   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) 2015      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 #include "ompi_config.h"
  24 #include <stdio.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/win/win.h"
  31 #include "ompi/mca/osc/osc.h"
  32 #include "ompi/datatype/ompi_datatype.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_Get = PMPI_Get
  38 #endif
  39 #define MPI_Get PMPI_Get
  40 #endif
  41 
  42 static const char FUNC_NAME[] = "MPI_Get";
  43 
  44 
  45 int MPI_Get(void *origin_addr, int origin_count,
  46             MPI_Datatype origin_datatype, int target_rank,
  47             MPI_Aint target_disp, int target_count,
  48             MPI_Datatype target_datatype, MPI_Win win)
  49 {
  50     int rc;
  51 
  52     SPC_RECORD(OMPI_SPC_GET, 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 ( MPI_WIN_FLAVOR_DYNAMIC != win->w_flavor && target_disp < 0 ) {
  67             rc = MPI_ERR_DISP;
  68         } else {
  69             OMPI_CHECK_DATATYPE_FOR_ONE_SIDED(rc, origin_datatype, origin_count);
  70             if (OMPI_SUCCESS == rc) {
  71                 OMPI_CHECK_DATATYPE_FOR_ONE_SIDED(rc, target_datatype, target_count);
  72             }
  73         }
  74         OMPI_ERRHANDLER_CHECK(rc, win, rc, FUNC_NAME);
  75     }
  76 
  77     if (MPI_PROC_NULL == target_rank) return MPI_SUCCESS;
  78 
  79     OPAL_CR_ENTER_LIBRARY();
  80 
  81     rc = win->w_osc_module->osc_get(origin_addr, origin_count, origin_datatype,
  82                                     target_rank, target_disp, target_count,
  83                                     target_datatype, win);
  84     OMPI_ERRHANDLER_RETURN(rc, win, rc, FUNC_NAME);
  85 }

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