1
1
CID 1047284 Uninitialized scalar variable (UNINIT)
CID 1047285 Uninitialized scalar variable (UNINIT)
CID 1047286 Uninitialized scalar variable (UNINIT)

If a performance variable session has no handles we should be returning MPI_SUCCESS
for MPI_T_pvar_start, MPI_T_pvar_stop, and MPI_T_pvar_reset. The code was returning
an unitialized value. This commit also updates the error code to return the proper
error on failure.

Signed-off-by: Nathan Hjelm <hjelmn@me.com>
Этот коммит содержится в:
Nathan Hjelm 2015-06-02 09:04:10 -06:00
родитель 472e5635c7
Коммит 632f829eb7
4 изменённых файлов: 10 добавлений и 5 удалений

Просмотреть файл

@ -1,6 +1,6 @@
/* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil -*- */
/*
* Copyright (c) 2012-2013 Los Alamos National Security, LLC. All rights
* Copyright (c) 2012-2015 Los Alamos National Security, LLC. All rights
* reserved.
* Copyright (c) 2015 Research Organization for Information Science
* and Technology (RIST). All rights reserved.
@ -80,6 +80,11 @@ int ompit_var_type_to_datatype (mca_base_var_type_t type, MPI_Datatype *datatype
int ompit_opal_to_mpit_error (int rc)
{
if (rc >= 0) {
/* Already an MPI error (always >= 0) */
return rc;
}
switch (rc) {
case OPAL_SUCCESS:
return MPI_SUCCESS;

Просмотреть файл

@ -1,6 +1,6 @@
/* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil -*- */
/*
* Copyright (c) 2012-2013 Los Alamos National Security, LLC. All rights
* Copyright (c) 2012-2015 Los Alamos National Security, LLC. All rights
* reserved.
* Copyright (c) 2014 Cisco Systems, Inc. All rights reserved.
* $COPYRIGHT$
@ -23,7 +23,7 @@
int MPI_T_pvar_reset(MPI_T_pvar_session session, MPI_T_pvar_handle handle)
{
int ret;
int ret = MPI_SUCCESS;
if (!mpit_is_initialized ()) {
return MPI_T_ERR_NOT_INITIALIZED;

Просмотреть файл

@ -32,7 +32,7 @@ static int pvar_handle_start (mca_base_pvar_handle_t *handle)
int MPI_T_pvar_start(MPI_T_pvar_session session, MPI_T_pvar_handle handle)
{
int ret;
int ret = MPI_SUCCESS;
if (!mpit_is_initialized ()) {
return MPI_T_ERR_NOT_INITIALIZED;

Просмотреть файл

@ -32,7 +32,7 @@ static int pvar_handle_stop (mca_base_pvar_handle_t *handle)
int MPI_T_pvar_stop(MPI_T_pvar_session session, MPI_T_pvar_handle handle)
{
int ret;
int ret = MPI_SUCCESS;
if (!mpit_is_initialized ()) {
return MPI_T_ERR_NOT_INITIALIZED;