This source file includes following definitions.
- MPI_Win_allocate_shared
   1 
   2 
   3 
   4 
   5 
   6 
   7 
   8 
   9 
  10 
  11 
  12 
  13 
  14 
  15 
  16 
  17 
  18 
  19 
  20 
  21 
  22 
  23 
  24 
  25 #include "ompi_config.h"
  26 
  27 #include <stdio.h>
  28 
  29 #include "ompi/mpi/c/bindings.h"
  30 #include "ompi/runtime/params.h"
  31 #include "ompi/communicator/communicator.h"
  32 #include "ompi/errhandler/errhandler.h"
  33 #include "ompi/info/info.h"
  34 #include "ompi/win/win.h"
  35 #include "ompi/memchecker.h"
  36 
  37 #if OMPI_BUILD_MPI_PROFILING
  38 #if OPAL_HAVE_WEAK_SYMBOLS
  39 #pragma weak MPI_Win_allocate_shared = PMPI_Win_allocate_shared
  40 #endif
  41 #define MPI_Win_allocate_shared PMPI_Win_allocate_shared
  42 #endif
  43 
  44 static const char FUNC_NAME[] = "MPI_Win_allocate_shared";
  45 
  46 
  47 int MPI_Win_allocate_shared(MPI_Aint size, int disp_unit, MPI_Info info,
  48                             MPI_Comm comm, void *baseptr, MPI_Win *win)
  49 {
  50     int ret = MPI_SUCCESS;
  51 
  52     MEMCHECKER(
  53         memchecker_comm(comm);
  54     );
  55     
  56     if (MPI_PARAM_CHECK) {
  57         OMPI_ERR_INIT_FINALIZE(FUNC_NAME);
  58 
  59         if (ompi_comm_invalid (comm)) {
  60             return OMPI_ERRHANDLER_INVOKE(MPI_COMM_WORLD, MPI_ERR_COMM,
  61                                           FUNC_NAME);
  62 
  63         } else if (NULL == info || ompi_info_is_freed(info)) {
  64             return OMPI_ERRHANDLER_INVOKE(comm, MPI_ERR_INFO,
  65                                           FUNC_NAME);
  66 
  67         } else if (NULL == win) {
  68             return OMPI_ERRHANDLER_INVOKE(comm, MPI_ERR_WIN, FUNC_NAME);
  69         } else if ( size < 0 ) {
  70             return OMPI_ERRHANDLER_INVOKE(comm, MPI_ERR_SIZE, FUNC_NAME);
  71         }
  72     }
  73 
  74     
  75     if (OMPI_COMM_IS_INTER(comm)) {
  76         return OMPI_ERRHANDLER_INVOKE(comm, MPI_ERR_COMM, FUNC_NAME);
  77     }
  78 
  79     OPAL_CR_ENTER_LIBRARY();
  80 
  81     
  82     ret = ompi_win_allocate_shared((size_t)size, disp_unit, &(info->super),
  83                                    comm, baseptr, win);
  84     if (OMPI_SUCCESS != ret) {
  85         *win = MPI_WIN_NULL;
  86         OPAL_CR_EXIT_LIBRARY();
  87         OMPI_ERRHANDLER_RETURN (ret, comm, ret, FUNC_NAME);
  88     }
  89 
  90     OPAL_CR_EXIT_LIBRARY();
  91     return MPI_SUCCESS;
  92 }