root/ompi/mpi/c/win_get_info.c

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

DEFINITIONS

This source file includes following definitions.
  1. MPI_Win_get_info

   1 /* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil -*- */
   2 /*
   3  * Copyright (c) 2013      Sandia National Laboratories.  All rights reserved.
   4  * Copyright (c) 2015      Los Alamos National Security, LLC. All rights
   5  *                         reserved.
   6  * Copyright (c) 2015      Research Organization for Information Science
   7  *                         and Technology (RIST). All rights reserved.
   8  * Copyright (c) 2016-2017 IBM Corporation. All rights reserved.
   9  * $COPYRIGHT$
  10  *
  11  * Additional copyrights may follow
  12  *
  13  * $HEADER$
  14  */
  15 
  16 #include "ompi_config.h"
  17 
  18 #include "ompi/mpi/c/bindings.h"
  19 #include "ompi/runtime/params.h"
  20 #include "ompi/errhandler/errhandler.h"
  21 #include "ompi/win/win.h"
  22 #include "opal/util/info.h"
  23 #include "opal/util/info_subscriber.h"
  24 
  25 #if OMPI_BUILD_MPI_PROFILING
  26 #if OPAL_HAVE_WEAK_SYMBOLS
  27 #pragma weak MPI_Win_get_info = PMPI_Win_get_info
  28 #endif
  29 #define MPI_Win_get_info PMPI_Win_get_info
  30 #endif
  31 
  32 static const char FUNC_NAME[] = "MPI_Win_get_info";
  33 
  34 int MPI_Win_get_info(MPI_Win win, MPI_Info *info_used)
  35 {
  36     int ret;
  37 
  38     OPAL_CR_NOOP_PROGRESS();
  39 
  40     if (MPI_PARAM_CHECK) {
  41         OMPI_ERR_INIT_FINALIZE(FUNC_NAME);
  42 
  43         if (ompi_win_invalid(win)) {
  44             return OMPI_ERRHANDLER_INVOKE(MPI_COMM_WORLD, MPI_ERR_WIN, FUNC_NAME);
  45         }
  46 
  47         if (NULL == info_used) {
  48             return OMPI_ERRHANDLER_INVOKE(win, MPI_ERR_ARG, FUNC_NAME);
  49         }
  50     }
  51 
  52     if (NULL == win->super.s_info) {
  53 /*
  54  * Setup any defaults if MPI_Win_set_info was never called
  55  */
  56         opal_infosubscribe_change_info(&win->super, &MPI_INFO_NULL->super);     
  57     }
  58 
  59     (*info_used) = OBJ_NEW(ompi_info_t);
  60     if (NULL == (*info_used)) {
  61        return OMPI_ERRHANDLER_INVOKE(win, MPI_ERR_NO_MEM, FUNC_NAME);
  62     }
  63     opal_info_t *opal_info_used = &(*info_used)->super;
  64 
  65     ret = opal_info_dup_mpistandard(win->super.s_info, &opal_info_used);
  66 
  67     OMPI_ERRHANDLER_RETURN(ret, win, ret, FUNC_NAME);
  68 }

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