2013-04-24 19:59:23 +04:00
|
|
|
/* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil -*- */
|
|
|
|
/*
|
|
|
|
* Copyright (c) 2012-2013 Los Alamos National Security, LLC. All rights
|
|
|
|
* reserved.
|
2014-03-12 17:17:54 +04:00
|
|
|
* Copyright (c) 2014 Cisco Systems, Inc. All rights reserved.
|
2013-04-24 19:59:23 +04:00
|
|
|
* $COPYRIGHT$
|
|
|
|
*
|
|
|
|
* Additional copyrights may follow
|
|
|
|
*
|
|
|
|
* $HEADER$
|
|
|
|
*/
|
|
|
|
|
2013-07-16 20:03:33 +04:00
|
|
|
#include "ompi/mpi/tool/mpit-internal.h"
|
|
|
|
|
|
|
|
#if OPAL_HAVE_WEAK_SYMBOLS && OMPI_PROFILING_DEFINES
|
|
|
|
#pragma weak MPI_T_cvar_get_info = PMPI_T_cvar_get_info
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#if OMPI_PROFILING_DEFINES
|
|
|
|
#include "ompi/mpi/tool/profile/defines.h"
|
|
|
|
#endif
|
2013-04-24 19:59:23 +04:00
|
|
|
|
|
|
|
|
|
|
|
int MPI_T_cvar_get_info(int cvar_index, char *name, int *name_len, int *verbosity,
|
|
|
|
MPI_Datatype *datatype, MPI_T_enum *enumtype, char *desc,
|
|
|
|
int *desc_len, int *bind, int *scope)
|
|
|
|
{
|
|
|
|
const mca_base_var_t *var;
|
|
|
|
int rc = MPI_SUCCESS;
|
|
|
|
|
|
|
|
if (!mpit_is_initialized ()) {
|
|
|
|
return MPI_T_ERR_NOT_INITIALIZED;
|
|
|
|
}
|
|
|
|
|
|
|
|
mpit_lock ();
|
|
|
|
|
|
|
|
do {
|
|
|
|
rc = mca_base_var_get (cvar_index, &var);
|
|
|
|
if (OPAL_SUCCESS != rc) {
|
2014-07-09 01:17:47 +04:00
|
|
|
rc = (OPAL_ERR_VALUE_OUT_OF_BOUNDS == rc || OPAL_ERR_NOT_FOUND == rc) ? MPI_T_ERR_INVALID_INDEX :
|
2013-04-24 19:59:23 +04:00
|
|
|
MPI_ERR_OTHER;
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
|
|
|
|
mpit_copy_string (name, name_len, var->mbv_full_name);
|
|
|
|
mpit_copy_string (desc, desc_len, var->mbv_description);
|
|
|
|
|
|
|
|
/* find the corresponding mpi type for an mca type */
|
2013-07-16 20:02:13 +04:00
|
|
|
rc = ompit_var_type_to_datatype (var->mbv_type, datatype);
|
|
|
|
if (OMPI_SUCCESS != rc) {
|
2013-04-24 19:59:23 +04:00
|
|
|
break;
|
|
|
|
}
|
|
|
|
|
|
|
|
if (NULL != enumtype) {
|
|
|
|
*enumtype = var->mbv_enumerator ? (MPI_T_enum) var->mbv_enumerator : MPI_T_ENUM_NULL;
|
|
|
|
}
|
|
|
|
|
|
|
|
if (NULL != scope) {
|
|
|
|
*scope = var->mbv_scope;
|
|
|
|
}
|
|
|
|
|
|
|
|
/* XXX -- TODO -- All bindings are currently 0. Add support for variable binding. */
|
|
|
|
if (NULL != bind) {
|
|
|
|
*bind = var->mbv_bind;
|
|
|
|
}
|
2014-05-01 02:10:30 +04:00
|
|
|
|
|
|
|
if (NULL != verbosity) {
|
|
|
|
*verbosity = var->mbv_info_lvl;
|
|
|
|
}
|
2013-04-24 19:59:23 +04:00
|
|
|
} while (0);
|
|
|
|
|
|
|
|
mpit_unlock ();
|
|
|
|
|
|
|
|
return rc;
|
|
|
|
}
|