root/ompi/mpi/c/comm_get_info.c

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

DEFINITIONS

This source file includes following definitions.
  1. MPI_Comm_get_info

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

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