root/ompi/mpi/tool/cvar_get_index.c

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

DEFINITIONS

This source file includes following definitions.
  1. MPI_T_cvar_get_index

   1 /* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil -*- */
   2 /*
   3  * Copyright (c) 2012-2014 Los Alamos National Security, LLC. All rights
   4  *                         reserved.
   5  * Copyright (c) 2014 Cisco Systems, Inc.  All rights reserved.
   6  * Copyright (c) 2017      IBM Corporation. All rights reserved.
   7  * $COPYRIGHT$
   8  *
   9  * Additional copyrights may follow
  10  *
  11  * $HEADER$
  12  */
  13 
  14 #include "ompi/mpi/tool/mpit-internal.h"
  15 
  16 #if OPAL_HAVE_WEAK_SYMBOLS && OMPI_PROFILING_DEFINES
  17 #pragma weak MPI_T_cvar_get_index = PMPI_T_cvar_get_index
  18 #endif
  19 
  20 #if OMPI_PROFILING_DEFINES
  21 #include "ompi/mpi/tool/profile/defines.h"
  22 #endif
  23 
  24 
  25 int MPI_T_cvar_get_index (const char *name, int *cvar_index)
  26 {
  27     int ret;
  28 
  29     if (!mpit_is_initialized ()) {
  30         return MPI_T_ERR_NOT_INITIALIZED;
  31     }
  32 
  33     if (MPI_PARAM_CHECK && (NULL == cvar_index || NULL == name)) {
  34         return MPI_ERR_ARG;
  35     }
  36 
  37     ompi_mpit_lock ();
  38     ret = mca_base_var_find_by_name (name, cvar_index);
  39     ompi_mpit_unlock ();
  40     if (OPAL_SUCCESS != ret) {
  41         return MPI_T_ERR_INVALID_NAME;
  42     }
  43 
  44     return MPI_SUCCESS;
  45 }

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