root/ompi/mpi/c/win_create_dynamic.c

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

DEFINITIONS

This source file includes following definitions.
  1. MPI_Win_create_dynamic

   1 /*
   2  * Copyright (c) 2004-2007 The Trustees of Indiana University and Indiana
   3  *                         University Research and Technology
   4  *                         Corporation.  All rights reserved.
   5  * Copyright (c) 2004-2005 The University of Tennessee and The University
   6  *                         of Tennessee Research Foundation.  All rights
   7  *                         reserved.
   8  * Copyright (c) 2004-2008 High Performance Computing Center Stuttgart,
   9  *                         University of Stuttgart.  All rights reserved.
  10  * Copyright (c) 2004-2005 The Regents of the University of California.
  11  *                         All rights reserved.
  12  * Copyright (c) 2006      Cisco Systems, Inc.  All rights reserved.
  13  * Copyright (c) 2015      Research Organization for Information Science
  14  *                         and Technology (RIST). All rights reserved.
  15  * Copyright (c) 2017      IBM Corporation. All rights reserved.
  16  * $COPYRIGHT$
  17  *
  18  * Additional copyrights may follow
  19  *
  20  * $HEADER$
  21  */
  22 
  23 #include "ompi_config.h"
  24 
  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/info/info.h"
  32 #include "ompi/win/win.h"
  33 #include "ompi/memchecker.h"
  34 
  35 #if OMPI_BUILD_MPI_PROFILING
  36 #if OPAL_HAVE_WEAK_SYMBOLS
  37 #pragma weak MPI_Win_create_dynamic = PMPI_Win_create_dynamic
  38 #endif
  39 #define MPI_Win_create_dynamic PMPI_Win_create_dynamic
  40 #endif
  41 
  42 static const char FUNC_NAME[] = "MPI_Win_create_dynamic";
  43 
  44 
  45 int MPI_Win_create_dynamic(MPI_Info info, MPI_Comm comm, MPI_Win *win)
  46 {
  47     int ret = MPI_SUCCESS;
  48 
  49     MEMCHECKER(
  50         memchecker_comm(comm);
  51     );
  52     /* argument checking */
  53     if (MPI_PARAM_CHECK) {
  54         OMPI_ERR_INIT_FINALIZE(FUNC_NAME);
  55 
  56         if (ompi_comm_invalid (comm)) {
  57             return OMPI_ERRHANDLER_INVOKE(MPI_COMM_WORLD, MPI_ERR_COMM,
  58                                           FUNC_NAME);
  59 
  60         } else if (NULL == info || ompi_info_is_freed(info)) {
  61             return OMPI_ERRHANDLER_INVOKE(comm, MPI_ERR_INFO,
  62                                           FUNC_NAME);
  63 
  64         } else if (NULL == win) {
  65             return OMPI_ERRHANDLER_INVOKE(comm, MPI_ERR_WIN, FUNC_NAME);
  66         }
  67     }
  68 
  69     /* communicator must be an intracommunicator */
  70     if (OMPI_COMM_IS_INTER(comm)) {
  71         return OMPI_ERRHANDLER_INVOKE(comm, MPI_ERR_COMM, FUNC_NAME);
  72     }
  73 
  74     OPAL_CR_ENTER_LIBRARY();
  75 
  76     /* create_dynamic window and return */
  77     ret = ompi_win_create_dynamic(&(info->super), comm, win);
  78     if (OMPI_SUCCESS != ret) {
  79         *win = MPI_WIN_NULL;
  80         OPAL_CR_EXIT_LIBRARY();
  81         return OMPI_ERRHANDLER_INVOKE(comm, MPI_ERR_WIN, FUNC_NAME);
  82     }
  83 
  84     OPAL_CR_EXIT_LIBRARY();
  85     return MPI_SUCCESS;
  86 }

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