root/ompi/mpi/c/win_shared_query.c

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

DEFINITIONS

This source file includes following definitions.
  1. MPI_Win_shared_query

   1 /*
   2  * Copyright (c) 2012-2013 Sandia National Laboratories. All rights reserved.
   3  * Copyright (c) 2015-2017 Research Organization for Information Science
   4  *                         and Technology (RIST). All rights reserved.
   5  * $COPYRIGHT$
   6  *
   7  * Additional copyrights may follow
   8  *
   9  * $HEADER$
  10  */
  11 
  12 #include "ompi_config.h"
  13 #include <stdio.h>
  14 
  15 #include "ompi/mpi/c/bindings.h"
  16 #include "ompi/runtime/params.h"
  17 #include "ompi/communicator/communicator.h"
  18 #include "ompi/errhandler/errhandler.h"
  19 #include "ompi/win/win.h"
  20 #include "ompi/mca/osc/osc.h"
  21 
  22 #if OMPI_BUILD_MPI_PROFILING
  23 #if OPAL_HAVE_WEAK_SYMBOLS
  24 #pragma weak MPI_Win_shared_query = PMPI_Win_shared_query
  25 #endif
  26 #define MPI_Win_shared_query PMPI_Win_shared_query
  27 #endif
  28 
  29 static const char FUNC_NAME[] = "MPI_Win_shared_query";
  30 
  31 
  32 int MPI_Win_shared_query(MPI_Win win, int rank, MPI_Aint *size, int *disp_unit, void *baseptr)
  33 {
  34     int rc;
  35     size_t tsize;
  36 
  37     if (MPI_PARAM_CHECK) {
  38         OMPI_ERR_INIT_FINALIZE(FUNC_NAME);
  39 
  40         if (ompi_win_invalid(win)) {
  41             return OMPI_ERRHANDLER_INVOKE(MPI_COMM_WORLD, MPI_ERR_WIN, FUNC_NAME);
  42          } else if (MPI_PROC_NULL != rank && ompi_win_peer_invalid(win, rank)) {
  43             return OMPI_ERRHANDLER_INVOKE(win, MPI_ERR_RANK, FUNC_NAME);
  44          }
  45     }
  46 
  47     OPAL_CR_ENTER_LIBRARY();
  48 
  49     if (NULL != win->w_osc_module->osc_win_shared_query) {
  50         rc = win->w_osc_module->osc_win_shared_query(win, rank, &tsize, disp_unit, baseptr);
  51         *size = tsize;
  52     } else {
  53         rc = MPI_ERR_RMA_FLAVOR;
  54     }
  55     OMPI_ERRHANDLER_RETURN(rc, win, rc, FUNC_NAME);
  56 }

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