root/ompi/mpi/tool/category_get_info.c

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

DEFINITIONS

This source file includes following definitions.
  1. MPI_T_category_get_info

   1 /* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil -*- */
   2 /*
   3  * Copyright (c) 2012-2013 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_category_get_info = PMPI_T_category_get_info
  18 #endif
  19 
  20 #if OMPI_PROFILING_DEFINES
  21 #include "ompi/mpi/tool/profile/defines.h"
  22 #endif
  23 
  24 
  25 int MPI_T_category_get_info(int cat_index, char *name, int *name_len,
  26                             char *desc, int *desc_len, int *num_cvars,
  27                             int *num_pvars, int *num_categories)
  28 {
  29     const mca_base_var_group_t *group;
  30     int rc = MPI_SUCCESS;
  31 
  32     if (!mpit_is_initialized ()) {
  33         return MPI_T_ERR_NOT_INITIALIZED;
  34     }
  35 
  36     ompi_mpit_lock ();
  37 
  38     do {
  39         rc = mca_base_var_group_get (cat_index, &group);
  40         if (0 > rc) {
  41             rc = (OPAL_ERR_NOT_FOUND == rc) ? MPI_T_ERR_INVALID_INDEX : MPI_ERR_OTHER;
  42             break;
  43         }
  44 
  45         if (NULL != num_pvars) {
  46             *num_pvars = opal_value_array_get_size ((opal_value_array_t *) &group->group_pvars);
  47         }
  48 
  49         if (NULL != num_cvars) {
  50             *num_cvars = opal_value_array_get_size ((opal_value_array_t *) &group->group_vars);
  51         }
  52 
  53         if (NULL != num_categories) {
  54             *num_categories = opal_value_array_get_size ((opal_value_array_t *) &group->group_subgroups);
  55         }
  56 
  57         mpit_copy_string (name, name_len, group->group_full_name);
  58         mpit_copy_string (desc, desc_len, group->group_description);
  59     } while (0);
  60 
  61     ompi_mpit_unlock ();
  62 
  63     return rc;
  64 }

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