Merge pull request #4960 from jsquyres/pr/warnings-fixes
Coverity fix + compiler warning fixes
Этот коммит содержится в:
Коммит
871e5c76bc
@ -9,7 +9,7 @@
|
|||||||
* Copyright (c) 2004-2006 High Performance Computing Center Stuttgart,
|
* Copyright (c) 2004-2006 High Performance Computing Center Stuttgart,
|
||||||
* University of Stuttgart. All rights reserved.
|
* University of Stuttgart. All rights reserved.
|
||||||
* Copyright (c) 2009 Oak Ridge National Labs. All rights reserved.
|
* Copyright (c) 2009 Oak Ridge National Labs. All rights reserved.
|
||||||
* Copyright (c) 2010 Cisco Systems, Inc. All rights reserved.
|
* Copyright (c) 2010-2018 Cisco Systems, Inc. All rights reserved
|
||||||
* $COPYRIGHT$
|
* $COPYRIGHT$
|
||||||
*
|
*
|
||||||
* Additional copyrights may follow
|
* Additional copyrights may follow
|
||||||
@ -108,8 +108,12 @@ ompi_datatype_duplicate( const ompi_datatype_t* oldType, ompi_datatype_t** newTy
|
|||||||
the top level (specifically, MPI_TYPE_DUP). */
|
the top level (specifically, MPI_TYPE_DUP). */
|
||||||
new_ompi_datatype->d_keyhash = NULL;
|
new_ompi_datatype->d_keyhash = NULL;
|
||||||
new_ompi_datatype->args = NULL;
|
new_ompi_datatype->args = NULL;
|
||||||
snprintf (new_ompi_datatype->name, MPI_MAX_OBJECT_NAME, "Dup %s",
|
|
||||||
oldType->name);
|
char *new_name;
|
||||||
|
asprintf(&new_name, "Dup %s", oldType->name);
|
||||||
|
strncpy(new_ompi_datatype->name, new_name, MPI_MAX_OBJECT_NAME - 1);
|
||||||
|
new_ompi_datatype->name[MPI_MAX_OBJECT_NAME - 1] = '\0';
|
||||||
|
free(new_name);
|
||||||
|
|
||||||
return OMPI_SUCCESS;
|
return OMPI_SUCCESS;
|
||||||
}
|
}
|
||||||
|
@ -2,7 +2,7 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (c) 2004-2015 The Trustees of the University of Tennessee.
|
* Copyright (c) 2004-2015 The Trustees of the University of Tennessee.
|
||||||
* All rights reserved.
|
* All rights reserved.
|
||||||
* Copyright (c) 2010 Cisco Systems, Inc. All rights reserved.
|
* Copyright (c) 2010-2018 Cisco Systems, Inc. All rights reserved
|
||||||
* Copyright (c) 2015 Los Alamos National Security, LLC. All rights
|
* Copyright (c) 2015 Los Alamos National Security, LLC. All rights
|
||||||
* reserved.
|
* reserved.
|
||||||
* Copyright (c) 2016 Research Organization for Information Science
|
* Copyright (c) 2016 Research Organization for Information Science
|
||||||
@ -140,10 +140,15 @@ static int mca_pml_v_component_close(void)
|
|||||||
ompi_pml_v_output_close ();
|
ompi_pml_v_output_close ();
|
||||||
|
|
||||||
/* Mark that we have changed something */
|
/* Mark that we have changed something */
|
||||||
snprintf(mca_pml_base_selected_component.pmlm_version.mca_component_name,
|
char *new_name;
|
||||||
MCA_BASE_MAX_TYPE_NAME_LEN, "%s]v%s",
|
asprintf(&new_name, "%s]v%s",
|
||||||
mca_pml_v.host_pml_component.pmlm_version.mca_component_name,
|
mca_pml_v.host_pml_component.pmlm_version.mca_component_name,
|
||||||
mca_vprotocol_component.pmlm_version.mca_component_name);
|
mca_vprotocol_component.pmlm_version.mca_component_name);
|
||||||
|
size_t len = sizeof(mca_pml_base_selected_component.pmlm_version.mca_component_name);
|
||||||
|
strncpy(mca_pml_base_selected_component.pmlm_version.mca_component_name,
|
||||||
|
new_name, len - 1);
|
||||||
|
mca_pml_base_selected_component.pmlm_version.mca_component_name[len - 1] = '\0';
|
||||||
|
free(new_name);
|
||||||
|
|
||||||
/* Replace finalize */
|
/* Replace finalize */
|
||||||
mca_pml_base_selected_component.pmlm_finalize =
|
mca_pml_base_selected_component.pmlm_finalize =
|
||||||
|
@ -11,7 +11,7 @@
|
|||||||
* Copyright (c) 2004-2005 The Regents of the University of California.
|
* Copyright (c) 2004-2005 The Regents of the University of California.
|
||||||
* All rights reserved.
|
* All rights reserved.
|
||||||
* Copyright (c) 2006-2009 Sun Microsystems, Inc. All rights reserved.
|
* Copyright (c) 2006-2009 Sun Microsystems, Inc. All rights reserved.
|
||||||
* Copyright (c) 2008 Cisco Systems, Inc. All rights reserved.
|
* Copyright (c) 2008-2018 Cisco Systems, Inc. All rights reserved
|
||||||
* Copyright (c) 2013 Los Alamos National Security, LLC. All rights
|
* Copyright (c) 2013 Los Alamos National Security, LLC. All rights
|
||||||
* reserved.
|
* reserved.
|
||||||
* Copyright (c) 2015 Research Organization for Information Science
|
* Copyright (c) 2015 Research Organization for Information Science
|
||||||
@ -107,8 +107,12 @@ int MPI_Type_create_f90_complex(int p, int r, MPI_Datatype *newtype)
|
|||||||
*/
|
*/
|
||||||
datatype->super.flags |= OMPI_DATATYPE_FLAG_PREDEFINED;
|
datatype->super.flags |= OMPI_DATATYPE_FLAG_PREDEFINED;
|
||||||
/* Mark the datatype as a special F90 convenience type */
|
/* Mark the datatype as a special F90 convenience type */
|
||||||
snprintf(datatype->name, MPI_MAX_OBJECT_NAME, "COMBINER %s",
|
char *new_name;
|
||||||
(*newtype)->name);
|
asprintf(&new_name, "COMBINER %s", (*newtype)->name);
|
||||||
|
size_t max_len = MPI_MAX_OBJECT_NAME;
|
||||||
|
strncpy(datatype->name, new_name, max_len - 1);
|
||||||
|
datatype->name[max_len - 1] = '\0';
|
||||||
|
free(new_name);
|
||||||
|
|
||||||
a_i[0] = &p;
|
a_i[0] = &p;
|
||||||
a_i[1] = &r;
|
a_i[1] = &r;
|
||||||
|
@ -11,7 +11,7 @@
|
|||||||
* Copyright (c) 2004-2005 The Regents of the University of California.
|
* Copyright (c) 2004-2005 The Regents of the University of California.
|
||||||
* All rights reserved.
|
* All rights reserved.
|
||||||
* Copyright (c) 2006-2009 Sun Microsystems, Inc. All rights reserved.
|
* Copyright (c) 2006-2009 Sun Microsystems, Inc. All rights reserved.
|
||||||
* Copyright (c) 2008-2012 Cisco Systems, Inc. All rights reserved.
|
* Copyright (c) 2008-2018 Cisco Systems, Inc. All rights reserved
|
||||||
* Copyright (c) 2013 Los Alamos National Security, LLC. All rights
|
* Copyright (c) 2013 Los Alamos National Security, LLC. All rights
|
||||||
* reserved.
|
* reserved.
|
||||||
* Copyright (c) 2015 Research Organization for Information Science
|
* Copyright (c) 2015 Research Organization for Information Science
|
||||||
@ -103,8 +103,12 @@ int MPI_Type_create_f90_integer(int r, MPI_Datatype *newtype)
|
|||||||
*/
|
*/
|
||||||
datatype->super.flags |= OMPI_DATATYPE_FLAG_PREDEFINED;
|
datatype->super.flags |= OMPI_DATATYPE_FLAG_PREDEFINED;
|
||||||
/* Mark the datatype as a special F90 convenience type */
|
/* Mark the datatype as a special F90 convenience type */
|
||||||
snprintf(datatype->name, MPI_MAX_OBJECT_NAME, "COMBINER %s",
|
char *new_name;
|
||||||
(*newtype)->name);
|
asprintf(&new_name, "COMBINER %s", (*newtype)->name);
|
||||||
|
size_t max_len = MPI_MAX_OBJECT_NAME;
|
||||||
|
strncpy(datatype->name, new_name, max_len - 1);
|
||||||
|
datatype->name[max_len - 1] = '\0';
|
||||||
|
free(new_name);
|
||||||
|
|
||||||
a_i[0] = &r;
|
a_i[0] = &r;
|
||||||
ompi_datatype_set_args( datatype, 1, a_i, 0, NULL, 0, NULL, MPI_COMBINER_F90_INTEGER );
|
ompi_datatype_set_args( datatype, 1, a_i, 0, NULL, 0, NULL, MPI_COMBINER_F90_INTEGER );
|
||||||
|
@ -11,7 +11,7 @@
|
|||||||
* Copyright (c) 2004-2005 The Regents of the University of California.
|
* Copyright (c) 2004-2005 The Regents of the University of California.
|
||||||
* All rights reserved.
|
* All rights reserved.
|
||||||
* Copyright (c) 2006-2009 Sun Microsystems, Inc. All rights reserved.
|
* Copyright (c) 2006-2009 Sun Microsystems, Inc. All rights reserved.
|
||||||
* Copyright (c) 2008 Cisco Systems, Inc. All rights reserved.
|
* Copyright (c) 2008-2018 Cisco Systems, Inc. All rights reserved
|
||||||
* Copyright (c) 2013 Los Alamos National Security, LLC. All rights
|
* Copyright (c) 2013 Los Alamos National Security, LLC. All rights
|
||||||
* reserved.
|
* reserved.
|
||||||
* Copyright (c) 2015 Research Organization for Information Science
|
* Copyright (c) 2015 Research Organization for Information Science
|
||||||
@ -107,8 +107,12 @@ int MPI_Type_create_f90_real(int p, int r, MPI_Datatype *newtype)
|
|||||||
*/
|
*/
|
||||||
datatype->super.flags |= OMPI_DATATYPE_FLAG_PREDEFINED;
|
datatype->super.flags |= OMPI_DATATYPE_FLAG_PREDEFINED;
|
||||||
/* Mark the datatype as a special F90 convenience type */
|
/* Mark the datatype as a special F90 convenience type */
|
||||||
snprintf(datatype->name, MPI_MAX_OBJECT_NAME, "COMBINER %s",
|
char *new_name;
|
||||||
(*newtype)->name);
|
asprintf(&new_name, "COMBINER %s", (*newtype)->name);
|
||||||
|
size_t max_len = MPI_MAX_OBJECT_NAME;
|
||||||
|
strncpy(datatype->name, new_name, max_len - 1);
|
||||||
|
datatype->name[max_len - 1] = '\0';
|
||||||
|
free(new_name);
|
||||||
|
|
||||||
ompi_datatype_set_args( datatype, 2, a_i, 0, NULL, 0, NULL, MPI_COMBINER_F90_REAL );
|
ompi_datatype_set_args( datatype, 2, a_i, 0, NULL, 0, NULL, MPI_COMBINER_F90_REAL );
|
||||||
|
|
||||||
|
@ -15,7 +15,7 @@
|
|||||||
* Copyright (c) 2007 Mellanox Technologies. All rights reserved.
|
* Copyright (c) 2007 Mellanox Technologies. All rights reserved.
|
||||||
* Copyright (c) 2009 IBM Corporation. All rights reserved.
|
* Copyright (c) 2009 IBM Corporation. All rights reserved.
|
||||||
* Copyright (c) 2013 NVIDIA Corporation. All rights reserved.
|
* Copyright (c) 2013 NVIDIA Corporation. All rights reserved.
|
||||||
* Copyright (c) 2013 Cisco Systems, Inc. All rights reserved.
|
* Copyright (c) 2013-2018 Cisco Systems, Inc. All rights reserved
|
||||||
* Copyright (c) 2015-2018 Los Alamos National Security, LLC. All rights
|
* Copyright (c) 2015-2018 Los Alamos National Security, LLC. All rights
|
||||||
* reserved.
|
* reserved.
|
||||||
* Copyright (c) 2015 Research Organization for Information Science
|
* Copyright (c) 2015 Research Organization for Information Science
|
||||||
@ -107,7 +107,6 @@ int mca_rcache_base_vma_tree_iterate (mca_rcache_base_vma_module_t *vma_module,
|
|||||||
{
|
{
|
||||||
mca_rcache_base_vma_tree_iterate_helper_args_t args = {.callback_fn = callback_fn, .ctx = ctx};
|
mca_rcache_base_vma_tree_iterate_helper_args_t args = {.callback_fn = callback_fn, .ctx = ctx};
|
||||||
uintptr_t bound = (uintptr_t) base + size;
|
uintptr_t bound = (uintptr_t) base + size;
|
||||||
int rc;
|
|
||||||
|
|
||||||
return opal_interval_tree_traverse (&vma_module->tree, (uint64_t) (intptr_t) base, bound, partial_ok,
|
return opal_interval_tree_traverse (&vma_module->tree, (uint64_t) (intptr_t) base, bound, partial_ok,
|
||||||
mca_rcache_base_vma_tree_iterate_helper, &args);
|
mca_rcache_base_vma_tree_iterate_helper, &args);
|
||||||
|
@ -176,7 +176,7 @@ const char *opal_fd_get_peer_name(int fd)
|
|||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
else {
|
else {
|
||||||
ret = strdup("Unknown");
|
strncpy(str, "Unknown", len);
|
||||||
}
|
}
|
||||||
|
|
||||||
return ret;
|
return ret;
|
||||||
|
@ -2,7 +2,7 @@
|
|||||||
* Copyright (c) 2013 Mellanox Technologies, Inc.
|
* Copyright (c) 2013 Mellanox Technologies, Inc.
|
||||||
* All rights reserved.
|
* All rights reserved.
|
||||||
*
|
*
|
||||||
* Copyright (c) 2014-2017 Cisco Systems, Inc. All rights reserved
|
* Copyright (c) 2014-2018 Cisco Systems, Inc. All rights reserved
|
||||||
* Copyright (c) 2014-2017 Research Organization for Information Science
|
* Copyright (c) 2014-2017 Research Organization for Information Science
|
||||||
* and Technology (RIST). All rights reserved.
|
* and Technology (RIST). All rights reserved.
|
||||||
* Copyright (c) 2016-2017 IBM Corporation. All rights reserved.
|
* Copyright (c) 2016-2017 IBM Corporation. All rights reserved.
|
||||||
@ -416,13 +416,8 @@ void oshmem_info_do_config(bool want_all)
|
|||||||
MPI_MAX_INFO_VAL);
|
MPI_MAX_INFO_VAL);
|
||||||
opal_info_out_int("MPI_MAX_PORT_NAME", "options:mpi-max-port-name",
|
opal_info_out_int("MPI_MAX_PORT_NAME", "options:mpi-max-port-name",
|
||||||
MPI_MAX_PORT_NAME);
|
MPI_MAX_PORT_NAME);
|
||||||
#if OMPI_PROVIDE_MPI_FILE_INTERFACE
|
|
||||||
opal_info_out_int("MPI_MAX_DATAREP_STRING", "options:mpi-max-datarep-string",
|
opal_info_out_int("MPI_MAX_DATAREP_STRING", "options:mpi-max-datarep-string",
|
||||||
MPI_MAX_DATAREP_STRING);
|
MPI_MAX_DATAREP_STRING);
|
||||||
#else
|
|
||||||
opal_info_out("MPI_MAX_DATAREP_STRING", "options:mpi-max-datarep-string",
|
|
||||||
"IO interface not provided");
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/* This block displays all the options with which the current
|
/* This block displays all the options with which the current
|
||||||
* installation of oshmem was configured. */
|
* installation of oshmem was configured. */
|
||||||
|
Загрузка…
x
Ссылка в новой задаче
Block a user