root/ompi/mpi/tool/enum_get_info.c

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

DEFINITIONS

This source file includes following definitions.
  1. MPI_T_enum_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_enum_get_info = PMPI_T_enum_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_enum_get_info(MPI_T_enum enumtype, int *num, char *name, int *name_len)
  26 {
  27     int rc = MPI_SUCCESS;
  28 
  29     if (!mpit_is_initialized ()) {
  30         return MPI_T_ERR_NOT_INITIALIZED;
  31     }
  32 
  33     ompi_mpit_lock ();
  34 
  35     do {
  36         if (num) {
  37             rc = enumtype->get_count (enumtype, num);
  38             if (OPAL_SUCCESS != rc) {
  39                 rc = MPI_ERR_OTHER;
  40                 break;
  41             }
  42         }
  43 
  44         mpit_copy_string (name, name_len, enumtype->enum_name);
  45     } while (0);
  46 
  47     ompi_mpit_unlock ();
  48 
  49     return rc;
  50 }

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