1
1

Merge pull request #2672 from ggouaillardet/topic/misc_memory_leaks

Plug misc memory leaks
Этот коммит содержится в:
Gilles Gouaillardet 2017-01-10 13:16:04 +09:00 коммит произвёл GitHub
родитель b320882932 189d7b9480
Коммит 44c1ff60f1
52 изменённых файлов: 413 добавлений и 156 удалений

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

@ -16,7 +16,7 @@
* Copyright (c) 2011-2015 Los Alamos National Security, LLC. All rights
* reserved.
* Copyright (c) 2013-2016 Intel, Inc. All rights reserved.
* Copyright (c) 2014-2016 Research Organization for Information Science
* Copyright (c) 2014-2017 Research Organization for Information Science
* and Technology (RIST). All rights reserved.
* $COPYRIGHT$
*
@ -1182,8 +1182,8 @@ static int disconnect_waitall (int count, ompi_dpm_disconnect_obj **objs)
for (i=0; i< count; i++ ) {
if (NULL != objs[i]->reqs ) {
free(objs[i]->reqs );
free(objs[i]);
}
free(objs[i]);
}
free(reqs);

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

@ -14,6 +14,8 @@
* Copyright (c) 2012-2015 Los Alamos National Security, LLC.
* All rights reserved.
* Copyright (c) 2013-2015 Intel, Inc. All rights reserved
* Copyright (c) 2017 Research Organization for Information Science
* and Technology (RIST). All rights reserved.
* $COPYRIGHT$
*
* Additional copyrights may follow
@ -102,16 +104,24 @@ ompi_mtl_psm2_component_register(void)
static int
ompi_mtl_psm2_component_open(void)
{
int res;
glob_t globbuf;
globbuf.gl_offs = 0;
/* Component available only if Omni-Path hardware is present */
if ((glob("/dev/hfi1_[0-9]", GLOB_DOOFFS, NULL, &globbuf) != 0) &&
(glob("/dev/hfi1_[0-9][0-9]", GLOB_APPEND, NULL, &globbuf) != 0)) {
return OPAL_ERR_NOT_AVAILABLE;
res = glob("/dev/hfi1_[0-9]", GLOB_DOOFFS, NULL, &globbuf);
if (0 == res || GLOB_NOMATCH == res) {
globfree(&globbuf);
}
if (0 != res) {
res = glob("/dev/hfi1_[0-9][0-9]", GLOB_APPEND, NULL, &globbuf);
if (0 == res || GLOB_NOMATCH == res) {
globfree(&globbuf);
}
if (0 != res) {
return OPAL_ERR_NOT_AVAILABLE;
}
}
globfree(&globbuf);
/* Component available only if at least one hfi1 port is ACTIVE */
bool foundOnlineHfi1Port = false;

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

@ -14,7 +14,7 @@
* Copyright (c) 2012-2015 Los Alamos National Security, LLC. All rights
* reserved.
* Copyright (c) 2013-2015 Intel, Inc. All rights reserved
* Copyright (c) 2014-2016 Research Organization for Information Science
* Copyright (c) 2014-2017 Research Organization for Information Science
* and Technology (RIST). All rights reserved.
* Copyright (c) 2015 Mellanox Technologies. All rights reserved.
*
@ -43,6 +43,7 @@
#include "ompi/datatype/ompi_datatype.h"
#include "ompi/runtime/mpiruntime.h"
#include "ompi/runtime/params.h"
#include "ompi/mca/pml/pml.h"
opal_list_t ompi_proc_list = {{0}};
static opal_mutex_t ompi_proc_lock;
@ -374,7 +375,7 @@ int ompi_proc_complete_init(void)
int ompi_proc_finalize (void)
{
opal_list_item_t *item;
ompi_proc_t *proc;
/* Unregister the local proc from OPAL */
opal_proc_local_set(NULL);
@ -398,8 +399,11 @@ int ompi_proc_finalize (void)
* it is thread safe to do so...though it may not -appear- to be so
* without walking through the entire list/destructor sequence.
*/
while (opal_list_get_end(&ompi_proc_list) != (item = opal_list_get_first(&ompi_proc_list))) {
OBJ_RELEASE(item);
while ((ompi_proc_t *)opal_list_get_end(&ompi_proc_list) != (proc = (ompi_proc_t *)opal_list_get_first(&ompi_proc_list))) {
if (NULL != proc->proc_endpoints[OMPI_PROC_ENDPOINT_TAG_BML]) {
MCA_PML_CALL(del_procs(&proc, 1));
}
OBJ_RELEASE(proc);
}
/* now destruct the list and thread lock */
OBJ_DESTRUCT(&ompi_proc_list);
@ -703,7 +707,6 @@ ompi_proc_find_and_add(const ompi_process_name_t * name, bool* isnew)
*/
if (NULL == rproc) {
*isnew = true;
rproc = OBJ_NEW(ompi_proc_t);
ompi_proc_allocate (name->jobid, name->vpid, &rproc);
}

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

@ -10,7 +10,7 @@
* Copyright (c) 2004-2005 The Regents of the University of California.
* All rights reserved.
* Copyright (c) 2014-2015 Intel, Inc. All rights reserved.
* Copyright (c) 2015 Research Organization for Information Science
* Copyright (c) 2015-2017 Research Organization for Information Science
* and Technology (RIST). All rights reserved.
* $COPYRIGHT$
*
@ -289,7 +289,7 @@ int opal_value_unload(opal_value_t *kv,
return OPAL_ERR_TYPE_MISMATCH;
}
if (NULL == data ||
(NULL == *data && OPAL_STRING != type && OPAL_BYTE_OBJECT != type)) {
(OPAL_STRING != type && OPAL_BYTE_OBJECT != type && NULL == *data)) {
OPAL_ERROR_LOG(OPAL_ERR_BAD_PARAM);
return OPAL_ERR_BAD_PARAM;
}

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

@ -13,6 +13,8 @@
* Copyright (c) 2008-2013 Cisco Systems, Inc. All rights reserved.
* Copyright (c) 2012-2015 Los Alamos National Security, LLC. All rights
* reserved.
* Copyright (c) 2017 Research Organization for Information Science
* and Technology (RIST). All rights reserved.
* $COPYRIGHT$
*
* Additional copyrights may follow
@ -23,6 +25,7 @@
#include "opal_config.h"
#include "opal/mca/base/mca_base_var_enum.h"
#include "opal/mca/base/mca_base_vari.h"
#include "opal/mca/base/base.h"
#include "opal/util/argv.h"
@ -617,6 +620,7 @@ static void mca_base_var_enum_flag_constructor (mca_base_var_enum_flag_t *enumer
enumerator->super.string_from_value = enum_string_from_value_flag;
enumerator->super.dump = enum_dump_flag;
enumerator->super.enum_is_static = false;
enumerator->super.enum_name = NULL;
}
static void mca_base_var_enum_flag_destructor (mca_base_var_enum_flag_t *enumerator)
@ -628,4 +632,32 @@ static void mca_base_var_enum_flag_destructor (mca_base_var_enum_flag_t *enumera
}
free (enumerator->enum_flags);
}
if (NULL != enumerator->super.enum_name) {
free (enumerator->super.enum_name);
}
}
int mca_base_var_enum_register(const char *project_name, const char *framework_name,
const char *component_name, const char *enum_name,
void *storage)
{
int group_index;
/* Developer error. Storage can not be NULL */
assert (NULL != storage);
/* Create a new parameter entry */
group_index = mca_base_var_group_register (project_name, framework_name, component_name,
NULL);
if (-1 > group_index) {
return group_index;
}
if (0 <= group_index) {
mca_base_var_group_add_enum (group_index, storage);
}
return OPAL_SUCCESS;
/* All done */
}

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

@ -13,6 +13,8 @@
* Copyright (c) 2008-2011 Cisco Systems, Inc. All rights reserved.
* Copyright (c) 2012-2016 Los Alamos National Security, LLC. All rights
* reserved.
* Copyright (c) 2017 Research Organization for Information Science
* and Technology (RIST). All rights reserved.
* $COPYRIGHT$
*
* Additional copyrights may follow
@ -227,6 +229,9 @@ OPAL_DECLSPEC int mca_base_var_enum_create (const char *name, const mca_base_var
OPAL_DECLSPEC int mca_base_var_enum_create_flag (const char *name, const mca_base_var_enum_value_flag_t flags[],
mca_base_var_enum_flag_t **enumerator);
OPAL_DECLSPEC int mca_base_var_enum_register(const char *project_name, const char *framework_name,
const char *component_name, const char *enum_name,
void *storage);
/* standard enumerators. it is invalid to call OBJ_RELEASE on any of these enumerators */
/**
* Boolean enumerator

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

@ -13,6 +13,8 @@
* Copyright (c) 2008-2013 Cisco Systems, Inc. All rights reserved.
* Copyright (c) 2012-2015 Los Alamos National Security, LLC. All rights
* reserved.
* Copyright (c) 2017 Research Organization for Information Science
* and Technology (RIST). All rights reserved.
* $COPYRIGHT$
*
* Additional copyrights may follow
@ -330,6 +332,7 @@ int mca_base_var_group_deregister (int group_index)
mca_base_var_group_t *group;
int size, ret;
int *params, *subgroups;
opal_object_t ** enums;
ret = mca_base_var_group_get_internal (group_index, &group, false);
if (OPAL_SUCCESS != ret) {
@ -368,6 +371,12 @@ int mca_base_var_group_deregister (int group_index)
(void) mca_base_pvar_mark_invalid (params[i]);
}
size = opal_value_array_get_size(&group->group_enums);
enums = OPAL_VALUE_ARRAY_GET_BASE(&group->group_enums, opal_object_t *);
for (int i = 0 ; i < size ; ++i) {
OBJ_RELEASE (enums[i]);
}
size = opal_value_array_get_size(&group->group_subgroups);
subgroups = OPAL_VALUE_ARRAY_GET_BASE(&group->group_subgroups, int);
for (int i = 0 ; i < size ; ++i) {
@ -453,6 +462,34 @@ int mca_base_var_group_add_pvar (const int group_index, const int param_index)
return (int) opal_value_array_get_size (&group->group_pvars) - 1;
}
int mca_base_var_group_add_enum (const int group_index, const void * storage)
{
mca_base_var_group_t *group;
int size, i, ret;
void **params;
ret = mca_base_var_group_get_internal (group_index, &group, false);
if (OPAL_SUCCESS != ret) {
return ret;
}
size = opal_value_array_get_size(&group->group_enums);
params = OPAL_VALUE_ARRAY_GET_BASE(&group->group_enums, void *);
for (i = 0 ; i < size ; ++i) {
if (params[i] == storage) {
return i;
}
}
if (OPAL_SUCCESS !=
(ret = opal_value_array_append_item (&group->group_enums, storage))) {
return ret;
}
/* return the group index */
return (int) opal_value_array_get_size (&group->group_enums) - 1;
}
int mca_base_var_group_get (const int group_index, const mca_base_var_group_t **group)
{
return mca_base_var_group_get_internal (group_index, (mca_base_var_group_t **) group, false);
@ -495,6 +532,9 @@ static void mca_base_var_group_constructor (mca_base_var_group_t *group)
OBJ_CONSTRUCT(&group->group_pvars, opal_value_array_t);
opal_value_array_init (&group->group_pvars, sizeof (int));
OBJ_CONSTRUCT(&group->group_enums, opal_value_array_t);
opal_value_array_init (&group->group_enums, sizeof(void *));
}
static void mca_base_var_group_destructor (mca_base_var_group_t *group)
@ -517,6 +557,7 @@ static void mca_base_var_group_destructor (mca_base_var_group_t *group)
OBJ_DESTRUCT(&group->group_subgroups);
OBJ_DESTRUCT(&group->group_vars);
OBJ_DESTRUCT(&group->group_pvars);
OBJ_DESTRUCT(&group->group_enums);
}
int mca_base_var_group_get_count (void)

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

@ -13,6 +13,8 @@
* Copyright (c) 2008-2011 Cisco Systems, Inc. All rights reserved.
* Copyright (c) 2012-2013 Los Alamos National Security, LLC. All rights
* reserved.
* Copyright (c) 2017 Research Organization for Information Science
* and Technology (RIST). All rights reserved.
* $COPYRIGHT$
*
* Additional copyrights may follow
@ -52,6 +54,9 @@ struct mca_base_var_group_t {
/** Integer array of group performance variables */
opal_value_array_t group_pvars;
/** Pointer array of group enums */
opal_value_array_t group_enums;
};
typedef struct mca_base_var_group_t mca_base_var_group_t;

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

@ -13,6 +13,8 @@
* Copyright (c) 2008 Cisco Systems, Inc. All rights reserved.
* Copyright (c) 2012-2013 Los Alamos National Security, LLC. All rights
* reserved.
* Copyright (c) 2017 Research Organization for Information Science
* and Technology (RIST). All rights reserved.
* $COPYRIGHT$
*
* Additional copyrights may follow
@ -136,6 +138,13 @@ OPAL_DECLSPEC int mca_base_var_group_add_var (const int group_index, const int p
*/
OPAL_DECLSPEC int mca_base_var_group_add_pvar (const int group_index, const int param_index);
/**
* \internal
*
* Add an enum to a group
*/
OPAL_DECLSPEC int mca_base_var_group_add_enum (const int group_index, const void *storage);
/**
* \internal
*

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

@ -12,7 +12,7 @@
* All rights reserved.
* Copyright (c) 2006-2007 Sun Microsystems, Inc. All rights reserved.
* Copyright (c) 2008-2013 Cisco Systems, Inc. All rights reserved.
* Copyright (c) 2015 Research Organization for Information Science
* Copyright (c) 2015-2017 Research Organization for Information Science
* and Technology (RIST). All rights reserved.
* Copyright (c) 2016 Los Alamos National Security, LLC. All rights
* reserved.
@ -147,7 +147,11 @@ static int mca_btl_base_register(mca_base_register_flag_t flags)
&mca_btl_base_warn_component_unused);
(void) mca_base_var_enum_create_flag ("btl_flags", mca_btl_base_flag_enum_flags, &mca_btl_base_flag_enum);
(void) mca_base_var_enum_register("opal", "btl", "base", "btl_flags",
&mca_btl_base_flag_enum);
(void) mca_base_var_enum_create_flag ("btl_atomic_flags", mca_btl_base_atomic_enum_flags, &mca_btl_base_atomic_enum);
(void) mca_base_var_enum_register("opal", "btl", "base", "btl_atomic_flags",
&mca_btl_base_atomic_enum);
return OPAL_SUCCESS;
}
@ -204,14 +208,6 @@ static int mca_btl_base_close(void)
OBJ_DESTRUCT(&mca_btl_base_modules_initialized);
if (mca_btl_base_flag_enum) {
OBJ_RELEASE(mca_btl_base_flag_enum);
}
if (mca_btl_base_atomic_enum) {
OBJ_RELEASE(mca_btl_base_atomic_enum);
}
#if 0
/* restore event processing */
opal_event_enable();

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

@ -17,7 +17,7 @@
* reserved.
* Copyright (c) 2013-2015 NVIDIA Corporation. All rights reserved.
* Copyright (c) 2014-2015 Intel, Inc. All rights reserved.
* Copyright (c) 2014-2016 Research Organization for Information Science
* Copyright (c) 2014-2017 Research Organization for Information Science
* and Technology (RIST). All rights reserved.
* $COPYRIGHT$
*
@ -443,6 +443,11 @@ static int mca_btl_tcp_component_close(void)
OBJ_RELEASE(event);
}
if (NULL != mca_btl_tcp_component.tcp_local) {
opal_proc_table_remove_value(&mca_btl_tcp_component.tcp_procs, opal_proc_local_get()->proc_name);
OBJ_RELEASE(mca_btl_tcp_component.tcp_local);
}
/* release resources */
OBJ_DESTRUCT(&mca_btl_tcp_component.tcp_procs);
OBJ_DESTRUCT(&mca_btl_tcp_component.tcp_frag_eager);

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

@ -1,6 +1,8 @@
/*
* Copyright (c) 2010-2015 Cisco Systems, Inc. All rights reserved.
* Copyright (c) 2014-2015 Intel, Inc. All rights reserved.
* Copyright (c) 2017 Research Organization for Information Science
* and Technology (RIST). All rights reserved.
* $COPYRIGHT$
*
* Additional copyrights may follow
@ -54,13 +56,6 @@ MCA_BASE_FRAMEWORK_DECLARE(opal, event, NULL, NULL, opal_event_base_open,
opal_event_base_close, mca_event_base_static_components,
0);
static int opal_event_base_close(void)
{
/* cleanup components even though they are statically opened */
return mca_base_framework_components_close (&opal_event_base_framework,
NULL);
}
/*
* Globals
*/
@ -95,3 +90,21 @@ static int opal_event_base_open(mca_base_open_flag_t flags)
return rc;
}
static int opal_event_base_close(void)
{
int rc;
/* cleanup components even though they are statically opened */
if (OPAL_SUCCESS != (rc =mca_base_framework_components_close (&opal_event_base_framework,
NULL))) {
return rc;
}
opal_event_base_free(opal_sync_event_base);
/* finalize the lib */
return opal_event_finalize();
}

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

@ -4,6 +4,8 @@
* Copyright (c) 2010 Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2012-2013 Los Alamos National Security, LLC.
* All rights reserved.
* Copyright (c) 2017 Research Organization for Information Science
* and Technology (RIST). All rights reserved.
*/
#include "opal_config.h"
#include "opal/constants.h"
@ -21,6 +23,11 @@ int opal_event_init(void)
return OPAL_SUCCESS;
}
int opal_event_finalize(void)
{
return OPAL_SUCCESS;
}
opal_event_t* opal_event_alloc(void)
{
opal_event_t *ev;

4
opal/mca/event/external/external.h поставляемый
Просмотреть файл

@ -2,7 +2,7 @@
* Copyright (c) 2011-2015 Cisco Systems, Inc. All rights reserved.
* Copyright (c) 2013 Los Alamos National Security, LLC. All rights reserved.
* Copyright (c) 2015 Intel, Inc. All rights reserved.
* Copyright (c) 2015 Research Organization for Information Science
* Copyright (c) 2015-2017 Research Organization for Information Science
* and Technology (RIST). All rights reserved.
*
* $COPYRIGHT$
@ -51,6 +51,8 @@ OPAL_DECLSPEC extern opal_event_base_t *opal_sync_event_base;
OPAL_DECLSPEC int opal_event_init(void);
OPAL_DECLSPEC int opal_event_finalize(void);
#define opal_event_reinit(b) event_reinit((b))
#define opal_event_base_init_common_timeout (b, t) event_base_init_common_timeout((b), (t))

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

@ -4,7 +4,8 @@
* Copyright (c) 2012-2013 Los Alamos National Security, LLC.
* All rights reserved.
* Copyright (c) 2015 Intel, Inc. All rights reserved.
*
* Copyright (c) 2017 Research Organization for Information Science
* and Technology (RIST). All rights reserved.
* $COPYRIGHT$
*
* Additional copyrights may follow
@ -86,6 +87,8 @@ OPAL_DECLSPEC opal_event_base_t* opal_event_base_create(void);
OPAL_DECLSPEC int opal_event_init(void);
OPAL_DECLSPEC int opal_event_finalize(void);
#define opal_event_reinit(b) event_reinit((b))
#define opal_event_base_init_common_timeout (b, t) event_base_init_common_timeout((b), (t))

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

@ -5,6 +5,11 @@
* Copyright (c) 2012-2013 Los Alamos National Security, LLC.
* All rights reserved
* Copyright (c) 2015 Intel, Inc. All rights reserved.
* Copyright (c) 2017 Research Organization for Information Science
* and Technology (RIST). All rights reserved.
* $COPYRIGHT$
*
* Additional copyrights may follow
*/
#include "opal_config.h"
#include "opal/constants.h"
@ -118,6 +123,12 @@ int opal_event_init(void)
return OPAL_SUCCESS;
}
int opal_event_finalize(void)
{
event_config_free(config);
return OPAL_SUCCESS;
}
opal_event_t* opal_event_alloc(void)
{
opal_event_t *ev;

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

@ -12,7 +12,7 @@
* All rights reserved.
* Copyright (c) 2007-2009 Cisco Systems, Inc. All rights reserved.
* Copyright (c) 2013 NVIDIA Corporation. All rights reserved.
* Copyright (c) 2014-2015 Research Organization for Information Science
* Copyright (c) 2014-2017 Research Organization for Information Science
* and Technology (RIST). All rights reserved.
* Copyright (c) 2015-2016 Los Alamos National Security, LLC. All rights
* reserved.
@ -129,6 +129,8 @@ static int mca_mpool_base_close(void)
OMPI RTE program, or [possibly] multiple if this is opal_info) */
(void) mca_base_framework_components_close(&opal_mpool_base_framework, NULL);
mca_mpool_base_tree_fini();
return OPAL_SUCCESS;
}

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

@ -16,6 +16,8 @@
* Copyright (c) 2010 IBM Corporation. All rights reserved.
* Copyright (c) 2011-2016 Los Alamos National Security, LLC. All rights
* reserved.
* Copyright (c) 2017 Research Organization for Information Science
* and Technology (RIST). All rights reserved.
*
* $COPYRIGHT$
*
@ -246,6 +248,7 @@ static void mca_mpool_hugepage_finalize (struct mca_mpool_base_module_t *mpool)
mca_mpool_hugepage_module_t *hugepage_module = (mca_mpool_hugepage_module_t *) mpool;
OBJ_DESTRUCT(&hugepage_module->lock);
OBJ_DESTRUCT(&hugepage_module->allocation_tree);
if (hugepage_module->allocator) {
(void) hugepage_module->allocator->alc_finalize (hugepage_module->allocator);

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

@ -3,11 +3,11 @@
* Copyright (c) 2012-2015 Los Alamos National Security, LLC. All rights
* reserved.
* Copyright (c) 2014-2015 Intel, Inc. All rights reserved.
* Copyright (c) 2014-2015 Research Organization for Information Science
* Copyright (c) 2014-2017 Research Organization for Information Science
* and Technology (RIST). All rights reserved.
* Copyright (c) 2016 Mellanox Technologies, Inc.
* All rights reserved.
* Copyright (c) 2016 Cisco Systems, Inc. All rights reserved.
* Copyright (c) 2016 Cisco Systems, Inc. All rights reserved.
* $COPYRIGHT$
*
* Additional copyrights may follow
@ -108,6 +108,9 @@ static void lookup_cbfunc(int status, opal_list_t *data, void *cbdata)
if (NULL != p) {
cd->pdat->proc = p->proc;
if (p->value.type == cd->pdat->value.type) {
if (NULL != cd->pdat->value.key) {
free(cd->pdat->value.key);
}
(void)opal_value_xfer(&cd->pdat->value, &p->value);
}
}
@ -149,11 +152,9 @@ int opal_pmix_base_exchange(opal_value_t *indat,
* of lookup isn't available, then we use the blocking
* form and trust that the underlying system will WAIT
* until the other side publishes its data */
OBJ_CONSTRUCT(&ilist, opal_list_t);
pdat = OBJ_NEW(opal_pmix_pdata_t);
pdat->value.key = strdup(outdat->value.key);
pdat->value.type = outdat->value.type;
opal_list_append(&ilist, &pdat->super);
/* setup the constraints */
OBJ_CONSTRUCT(&mlist, opal_list_t);
/* tell it to wait for the data to arrive */
@ -174,11 +175,13 @@ int opal_pmix_base_exchange(opal_value_t *indat,
/* if a non-blocking version of lookup isn't
* available, then use the blocking version */
if (NULL == opal_pmix.lookup_nb) {
OBJ_CONSTRUCT(&ilist, opal_list_t);
opal_list_append(&ilist, &pdat->super);
rc = opal_pmix.lookup(&ilist, &mlist);
OPAL_LIST_DESTRUCT(&mlist);
OPAL_LIST_DESTRUCT(&ilist);
if (OPAL_SUCCESS != rc) {
OPAL_ERROR_LOG(rc);
OPAL_LIST_DESTRUCT(&ilist);
return rc;
}
} else {
@ -189,7 +192,6 @@ int opal_pmix_base_exchange(opal_value_t *indat,
rc = opal_pmix.lookup_nb(keys, &mlist, lookup_cbfunc, &caddy);
if (OPAL_SUCCESS != rc) {
OPAL_ERROR_LOG(rc);
OPAL_LIST_DESTRUCT(&ilist);
OPAL_LIST_DESTRUCT(&mlist);
opal_argv_free(keys);
return rc;
@ -201,15 +203,15 @@ int opal_pmix_base_exchange(opal_value_t *indat,
OPAL_LIST_DESTRUCT(&mlist);
if (OPAL_SUCCESS != caddy.status) {
OPAL_ERROR_LOG(caddy.status);
OPAL_LIST_DESTRUCT(&ilist);
return caddy.status;
}
}
/* pass back the result */
outdat->proc = pdat->proc;
free(outdat->value.key);
rc = opal_value_xfer(&outdat->value, &pdat->value);
OPAL_LIST_DESTRUCT(&ilist);
OBJ_RELEASE(pdat);
return rc;
}

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

@ -1,8 +1,8 @@
/*
* Copyright (c) 2015 Intel, Inc. All rights reserved.
* Copyright (c) 2015 Research Organization for Information Science
* Copyright (c) 2015-2017 Research Organization for Information Science
* and Technology (RIST). All rights reserved.
* Copyright (c) 2015 Cisco Systems, Inc. All rights reserved.
* Copyright (c) 2015 Cisco Systems, Inc. All rights reserved.
* $COPYRIGHT$
*
* Additional copyrights may follow
@ -69,7 +69,7 @@ static int init(void)
static void finalize(void)
{
if (initialized) {
if (initialized && !refresh) {
free(my_cred.credential);
}
}
@ -95,7 +95,7 @@ static int get_my_cred(opal_process_name_t *my_id,
my_cred.size = strlen(my_cred.credential)+1;
}
cred->method = strdup("munge");
cred->credential = strdup(my_cred.credential);
cred->credential = my_cred.credential;
cred->size = my_cred.size;
} else {
rc = OPAL_ERROR;

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

@ -13,7 +13,7 @@
* Copyright (c) 2010-2015 Los Alamos National Security, LLC.
* All rights reserved.
* Copyright (c) 2013-2015 Intel, Inc. All rights reserved
* Copyright (c) 2016 Research Organization for Information Science
* Copyright (c) 2016-2017 Research Organization for Information Science
* and Technology (RIST). All rights reserved.
* $COPYRIGHT$
*
@ -55,6 +55,7 @@
#include "opal/runtime/opal_cr.h"
#include "opal/mca/crs/base/base.h"
#include "opal/threads/tsd.h"
extern int opal_initialized;
extern int opal_util_initialized;
@ -160,6 +161,9 @@ opal_finalize(void)
/* close the sec framework */
(void) mca_base_framework_close(&opal_sec_base_framework);
/* cleanup the main thread specific stuff */
opal_tsd_keys_destruct();
/* finalize util code */
opal_finalize_util();

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

@ -16,7 +16,7 @@
* Copyright (c) 2010-2015 Los Alamos National Security, LLC.
* All rights reserved.
* Copyright (c) 2013-2016 Intel, Inc. All rights reserved
* Copyright (c) 2015-2016 Research Organization for Information Science
* Copyright (c) 2015-2017 Research Organization for Information Science
* and Technology (RIST). All rights reserved.
* $COPYRIGHT$
*
@ -344,6 +344,8 @@ opal_init_util(int* pargc, char*** pargv)
return OPAL_SUCCESS;
}
opal_thread_set_main();
opal_init_called = true;
/* set the nodename right away so anyone who needs it has it. Note

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

@ -10,7 +10,7 @@
* Copyright (c) 2004-2005 The Regents of the University of California.
* All rights reserved.
* Copyright (c) 2010 Cisco Systems, Inc. All rights reserved.
* Copyright (c) 2015 Research Organization for Information Science
* Copyright (c) 2015-2017 Research Organization for Information Science
* and Technology (RIST). All rights reserved.
* $COPYRIGHT$
*
@ -22,12 +22,23 @@
#include "opal_config.h"
#include "opal/threads/threads.h"
#include "opal/threads/tsd.h"
#include "opal/constants.h"
bool opal_debug_threads = false;
static void opal_thread_construct(opal_thread_t *t);
static pthread_t opal_main_thread;
struct opal_tsd_key_value {
opal_tsd_key_t key;
opal_tsd_destructor_t destructor;
};
static struct opal_tsd_key_value *opal_tsd_key_values = NULL;
static int opal_tsd_key_values_count = 0;
OBJ_CLASS_INSTANCE(opal_thread_t,
opal_object_t,
opal_thread_construct, NULL);
@ -83,3 +94,39 @@ void opal_thread_kill(opal_thread_t *t, int sig)
{
pthread_kill(t->t_handle, sig);
}
int opal_tsd_key_create(opal_tsd_key_t *key,
opal_tsd_destructor_t destructor)
{
int rc;
rc = pthread_key_create(key, destructor);
if ((0 == rc) && (pthread_self() == opal_main_thread)) {
opal_tsd_key_values = (struct opal_tsd_key_value *)realloc(opal_tsd_key_values, (opal_tsd_key_values_count+1) * sizeof(struct opal_tsd_key_value));
opal_tsd_key_values[opal_tsd_key_values_count].key = *key;
opal_tsd_key_values[opal_tsd_key_values_count].destructor = destructor;
opal_tsd_key_values_count ++;
}
return rc;
}
int opal_tsd_keys_destruct()
{
int i;
void * ptr;
for (i=0; i<opal_tsd_key_values_count; i++) {
if(OPAL_SUCCESS == opal_tsd_getspecific(opal_tsd_key_values[i].key, &ptr)) {
if (NULL != opal_tsd_key_values[i].destructor) {
opal_tsd_key_values[i].destructor(ptr);
}
}
}
if (0 < opal_tsd_key_values_count) {
free(opal_tsd_key_values);
opal_tsd_key_values_count = 0;
}
return OPAL_SUCCESS;
}
void opal_thread_set_main() {
opal_main_thread = pthread_self();
}

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

@ -11,7 +11,7 @@
* All rights reserved.
* Copyright (c) 2010 Cisco Systems, Inc. All rights reserved.
* Copyright (c) 2010 Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2015 Research Organization for Information Science
* Copyright (c) 2015-2017 Research Organization for Information Science
* and Technology (RIST). All rights reserved.
* $COPYRIGHT$
*
@ -120,6 +120,7 @@ OPAL_DECLSPEC int opal_thread_join(opal_thread_t *, void **thread_return);
OPAL_DECLSPEC bool opal_thread_self_compare(opal_thread_t*);
OPAL_DECLSPEC opal_thread_t *opal_thread_get_self(void);
OPAL_DECLSPEC void opal_thread_kill(opal_thread_t *, int sig);
OPAL_DECLSPEC void opal_thread_set_main(void);
END_C_DECLS

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

@ -2,7 +2,7 @@
* Copyright (c) 2007-2013 Los Alamos National Security, LLC. All rights
* reserved.
* Copyright (c) 2008 Cisco Systems, Inc. All rights reserved.
* Copyright (c) 2015 Research Organization for Information Science
* Copyright (c) 2015-2017 Research Organization for Information Science
* and Technology (RIST). All rights reserved.
* $COPYRIGHT$
*
@ -45,36 +45,6 @@ typedef void (*opal_tsd_destructor_t)(void *value);
typedef void* opal_tsd_key_t;
/**
* Create thread-specific data key
*
* Create a thread-specific data key visible to all threads in the
* current process. The returned key is valid in all threads,
* although the values bound to the key by opal_tsd_setspecific() are
* allocated on a per-thread basis and persist for the life of the
* calling thread.
*
* Upon key creation, the value NULL is associated with the new key in
* all active threads. When a new thread is created, the value NULL
* is associated with all defined keys in the new thread.
*
* The destructor parameter may be NULL. At thread exit, if
* destructor is non-NULL AND the thread has a non-NULL value
* associated with the key, the function is called with the current
* value as its argument.
*
* @param key[out] The key for accessing thread-specific data
* @param destructor[in] Cleanup function to call when a thread exits
*
* @retval OPAL_SUCCESS Success
* @retval EAGAIN The system lacked the necessary resource to
* create another thread specific data key
* @retval ENOMEM Insufficient memory exists to create the key
*/
OPAL_DECLSPEC int opal_tsd_key_create(opal_tsd_key_t *key,
opal_tsd_destructor_t destructor);
/**
* Delete a thread-specific data key
*
@ -138,13 +108,6 @@ OPAL_DECLSPEC int opal_tsd_getspecific(opal_tsd_key_t key, void **valuep);
typedef pthread_key_t opal_tsd_key_t;
static inline int
opal_tsd_key_create(opal_tsd_key_t *key,
opal_tsd_destructor_t destructor)
{
return pthread_key_create(key, destructor);
}
static inline int
opal_tsd_key_delete(opal_tsd_key_t key)
{
@ -166,6 +129,50 @@ opal_tsd_getspecific(opal_tsd_key_t key, void **valuep)
#endif
/**
* Create thread-specific data key
*
* Create a thread-specific data key visible to all threads in the
* current process. The returned key is valid in all threads,
* although the values bound to the key by opal_tsd_setspecific() are
* allocated on a per-thread basis and persist for the life of the
* calling thread.
*
* Upon key creation, the value NULL is associated with the new key in
* all active threads. When a new thread is created, the value NULL
* is associated with all defined keys in the new thread.
*
* The destructor parameter may be NULL. At thread exit, if
* destructor is non-NULL AND the thread has a non-NULL value
* associated with the key, the function is called with the current
* value as its argument.
*
* @param key[out] The key for accessing thread-specific data
* @param destructor[in] Cleanup function to call when a thread exits
*
* @retval OPAL_SUCCESS Success
* @retval EAGAIN The system lacked the necessary resource to
* create another thread specific data key
* @retval ENOMEM Insufficient memory exists to create the key
*/
OPAL_DECLSPEC int opal_tsd_key_create(opal_tsd_key_t *key,
opal_tsd_destructor_t destructor);
/**
* Destruct all thread-specific data keys
*
* Destruct all thread-specific data keys and invoke the destructor
*
* This should only be invoked in the main thread.
* This is made necessary since destructors are not invoked on the
* keys of the main thread, since there is no such thing as
* pthread_join(main_thread)
*
* @retval OPAL_SUCCESS Success
*/
OPAL_DECLSPEC int opal_tsd_keys_destruct(void);
END_C_DECLS
#endif /* OPAL_MTHREADS_TSD_H */

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

@ -14,6 +14,8 @@
* Copyright (c) 2011-2013 Los Alamos National Security, LLC. All rights
* reserved.
* Copyright (c) 2013-2016 Intel, Inc. All rights reserved.
* Copyright (c) 2017 Research Organization for Information Science
* and Technology (RIST). All rights reserved.
* $COPYRIGHT$
*
* Additional copyrights may follow
@ -572,6 +574,9 @@ static int rte_init(void)
/* we are an hnp, so update the contact info field for later use */
orte_process_info.my_hnp_uri = orte_rml.get_contact_info();
if (NULL != proc->rml_uri) {
free(proc->rml_uri);
}
proc->rml_uri = strdup(orte_process_info.my_hnp_uri);
/* we are also officially a daemon, so better update that field too */
@ -775,6 +780,8 @@ static int rte_init(void)
static int rte_finalize(void)
{
char *contact_path;
orte_job_t *jdata;
uint32_t key;
if (signals_set) {
/* Remove the epipe handler */
@ -846,7 +853,14 @@ static int rte_finalize(void)
}
/* release the job hash table */
OPAL_HASH_TABLE_FOREACH(key, uint32, jdata, orte_job_data) {
OBJ_RELEASE(jdata);
}
OBJ_RELEASE(orte_job_data);
if (NULL != orte_process_info.super.proc_hostname) {
free(orte_process_info.super.proc_hostname);
}
return ORTE_SUCCESS;
}

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

@ -13,7 +13,7 @@
* Copyright (c) 2012-2013 Los Alamos National Security, LLC.
* All rights reserved.
* Copyright (c) 2013-2017 Intel, Inc. All rights reserved.
* Copyright (c) 2016 Research Organization for Information Science
* Copyright (c) 2016-2017 Research Organization for Information Science
* and Technology (RIST). All rights reserved.
* $COPYRIGHT$
*
@ -345,6 +345,7 @@ static int rte_init(void)
&pname, &val, OPAL_STRING);
if (OPAL_SUCCESS == ret && NULL != val) {
u16 = opal_hwloc_compute_relative_locality(mycpuset, val);
free(val);
} else {
/* all we can say is that it shares our node */
u16 = OPAL_PROC_ON_CLUSTER | OPAL_PROC_ON_CU | OPAL_PROC_ON_NODE;

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

@ -3,7 +3,7 @@
* All rights reserved
* Copyright (c) 2013 Cisco Systems, Inc. All rights reserved.
* Copyright (c) 2014-2016 Intel, Inc. All rights reserved.
* Copyright (c) 2015 Research Organization for Information Science
* Copyright (c) 2015-2017 Research Organization for Information Science
* and Technology (RIST). All rights reserved.
* $COPYRIGHT$
*
@ -145,7 +145,6 @@ static int raw_finalize(void)
{
opal_list_item_t *item;
orte_rml.recv_cancel(ORTE_NAME_WILDCARD, ORTE_RML_TAG_FILEM_BASE);
while (NULL != (item = opal_list_remove_first(&incoming_files))) {
OBJ_RELEASE(item);
}
@ -160,7 +159,6 @@ static int raw_finalize(void)
OBJ_RELEASE(item);
}
OBJ_DESTRUCT(&positioned_files);
orte_rml.recv_cancel(ORTE_NAME_WILDCARD, ORTE_RML_TAG_FILEM_BASE_RESP);
}
return ORTE_SUCCESS;

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

@ -13,7 +13,7 @@
* Copyright (c) 2011-2016 Los Alamos National Security, LLC. All rights
* reserved.
* Copyright (c) 2014-2016 Intel, Inc. All rights reserved.
* Copyright (c) 2015 Research Organization for Information Science
* Copyright (c) 2015-2017 Research Organization for Information Science
* and Technology (RIST). All rights reserved.
* $COPYRIGHT$
*
@ -59,6 +59,9 @@ static bool recv_issued = false;
static int orte_grpcomm_base_close(void)
{
orte_grpcomm_base_active_t *active;
void *key;
size_t size;
uint32_t *seq_number;
if (recv_issued) {
orte_rml.recv_cancel(ORTE_NAME_WILDCARD, ORTE_RML_TAG_XCAST);
@ -73,6 +76,10 @@ static int orte_grpcomm_base_close(void)
}
OPAL_LIST_DESTRUCT(&orte_grpcomm_base.actives);
OPAL_LIST_DESTRUCT(&orte_grpcomm_base.ongoing);
for (void *_nptr=NULL; \
OPAL_SUCCESS == opal_hash_table_get_next_key_ptr(&orte_grpcomm_base.sig_table, &key, &size, (void **)&seq_number, _nptr, &_nptr);) {
free(seq_number);
}
OBJ_DESTRUCT(&orte_grpcomm_base.sig_table);
return mca_base_framework_components_close(&orte_grpcomm_base_framework, NULL);
@ -105,7 +112,6 @@ static void scon(orte_grpcomm_signature_t *p)
{
p->signature = NULL;
p->sz = 0;
p->seq_num = 0;
}
static void sdes(orte_grpcomm_signature_t *p)
{

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

@ -13,6 +13,8 @@
* Copyright (c) 2011-2016 Los Alamos National Security, LLC. All rights
* reserved.
* Copyright (c) 2016 Intel, Inc. All rights reserved.
* Copyright (c) 2017 Research Organization for Information Science
* and Technology (RIST). All rights reserved.
* $COPYRIGHT$
*
* Additional copyrights may follow
@ -69,9 +71,15 @@ static void gccon(orte_grpcomm_caddy_t *p)
p->cbfunc = NULL;
p->cbdata = NULL;
}
static void gcdes(orte_grpcomm_caddy_t *p)
{
if (NULL != p->buf) {
OBJ_RELEASE(p->buf);
}
}
static OBJ_CLASS_INSTANCE(orte_grpcomm_caddy_t,
opal_object_t,
gccon, NULL);
gccon, gcdes);
int orte_grpcomm_API_xcast(orte_grpcomm_signature_t *sig,
orte_rml_tag_t tag,
@ -133,7 +141,7 @@ static void allgather_stub(int fd, short args, void *cbdata)
int rc;
orte_grpcomm_base_active_t *active;
orte_grpcomm_coll_t *coll;
void *seq_number;
uint32_t *seq_number;
OPAL_OUTPUT_VERBOSE((1, orte_grpcomm_base_framework.framework_output,
"%s grpcomm:base:allgather stub",
@ -142,11 +150,12 @@ static void allgather_stub(int fd, short args, void *cbdata)
/* retrieve an existing tracker, create it if not
* already found. The allgather module is responsible
* for releasing it upon completion of the collective */
ret = opal_hash_table_get_value_ptr(&orte_grpcomm_base.sig_table, (void *)cd->sig->signature, cd->sig->sz * sizeof(orte_process_name_t), &seq_number);
ret = opal_hash_table_get_value_ptr(&orte_grpcomm_base.sig_table, (void *)cd->sig->signature, cd->sig->sz * sizeof(orte_process_name_t), (void **)&seq_number);
if (OPAL_ERR_NOT_FOUND == ret) {
cd->sig->seq_num = 0;
seq_number = (uint32_t *)malloc(sizeof(uint32_t));
*seq_number = 0;
} else if (OPAL_SUCCESS == ret) {
cd->sig->seq_num = *((uint32_t *)(seq_number)) + 1;
*seq_number = *seq_number + 1;
} else {
OPAL_OUTPUT((orte_grpcomm_base_framework.framework_output,
"%s rpcomm:base:allgather cannot get signature from hash table",
@ -155,7 +164,7 @@ static void allgather_stub(int fd, short args, void *cbdata)
OBJ_RELEASE(cd);
return;
}
ret = opal_hash_table_set_value_ptr(&orte_grpcomm_base.sig_table, (void *)cd->sig->signature, cd->sig->sz * sizeof(orte_process_name_t), (void *)&cd->sig->seq_num);
ret = opal_hash_table_set_value_ptr(&orte_grpcomm_base.sig_table, (void *)cd->sig->signature, cd->sig->sz * sizeof(orte_process_name_t), (void *)seq_number);
if (OPAL_SUCCESS != ret) {
OPAL_OUTPUT((orte_grpcomm_base_framework.framework_output,
"%s rpcomm:base:allgather cannot add new signature to hash table",
@ -165,6 +174,7 @@ static void allgather_stub(int fd, short args, void *cbdata)
return;
}
coll = orte_grpcomm_base_get_tracker(cd->sig, true);
OBJ_RELEASE(cd->sig);
coll->cbfunc = cd->cbfunc;
coll->cbdata = cd->cbdata;

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

@ -6,7 +6,7 @@
* Copyright (c) 2011-2013 Los Alamos National Security, LLC. All
* rights reserved.
* Copyright (c) 2014-2016 Intel, Inc. All rights reserved.
* Copyright (c) 2014 Research Organization for Information Science
* Copyright (c) 2014-2017 Research Organization for Information Science
* and Technology (RIST). All rights reserved.
* $COPYRIGHT$
*
@ -98,9 +98,6 @@ static int init(void)
*/
static void finalize(void)
{
/* cancel the recv */
orte_rml.recv_cancel(ORTE_NAME_WILDCARD, ORTE_RML_TAG_XCAST);
OPAL_LIST_DESTRUCT(&tracker);
return;
}
@ -516,5 +513,6 @@ static void barrier_release(int status, orte_process_name_t* sender,
}
opal_list_remove_item(&orte_grpcomm_base.ongoing, &coll->super);
OBJ_RELEASE(coll);
OBJ_RELEASE(sig);
}

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

@ -12,6 +12,8 @@
* All rights reserved.
* Copyright (c) 2011-2016 Los Alamos National Security, LLC. All rights
* reserved.
* Copyright (c) 2016 Research Organization for Information Science
* and Technology (RIST). All rights reserved.
* $COPYRIGHT$
*
* Additional copyrights may follow
@ -59,7 +61,6 @@ typedef struct {
opal_object_t super;
orte_process_name_t *signature;
size_t sz;
uint32_t seq_num;
} orte_grpcomm_signature_t;
OBJ_CLASS_DECLARATION(orte_grpcomm_signature_t);

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

@ -12,7 +12,7 @@
* Copyright (c) 2013 Los Alamos National Security, LLC. All rights reserved.
* Copyright (c) 2013 Cisco Systems, Inc. All rights reserved.
* Copyright (c) 2015-2016 Intel, Inc. All rights reserved.
* Copyright (c) 2015 Research Organization for Information Science
* Copyright (c) 2015-2017 Research Organization for Information Science
* and Technology (RIST). All rights reserved.
* $COPYRIGHT$
*
@ -89,6 +89,12 @@ static int orte_iof_base_close(void)
orte_iof.finalize();
}
if (!ORTE_PROC_IS_DAEMON) {
OBJ_RELEASE(orte_iof_base.iof_write_stdout);
if (!orte_xml_output) {
OBJ_RELEASE(orte_iof_base.iof_write_stderr);
}
}
return mca_base_framework_components_close(&orte_iof_base_framework, NULL);
}

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

@ -13,7 +13,7 @@
* Copyright (c) 2007 Cisco Systems, Inc. All rights reserved.
* Copyright (c) 2011-2013 Los Alamos National Security, LLC. All rights
* reserved.
* Copyright (c) 2014 Research Organization for Information Science
* Copyright (c) 2014-2017 Research Organization for Information Science
* and Technology (RIST). All rights reserved.
* Copyright (c) 2016-2017 Intel, Inc. All rights reserved.
* $COPYRIGHT$
@ -480,7 +480,6 @@ static int finalize(void)
OBJ_RELEASE(proct);
}
OBJ_DESTRUCT(&mca_iof_hnp_component.procs);
orte_rml.recv_cancel(ORTE_NAME_WILDCARD, ORTE_RML_TAG_IOF_HNP);
return ORTE_SUCCESS;
}

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

@ -16,7 +16,7 @@
* Copyright (c) 2011 Oak Ridge National Labs. All rights reserved.
* Copyright (c) 2013-2016 Intel, Inc. All rights reserved.
* Copyright (c) 2014 NVIDIA Corporation. All rights reserved.
* Copyright (c) 2015-2016 Research Organization for Information Science
* Copyright (c) 2015-2017 Research Organization for Information Science
* and Technology (RIST). All rights reserved.
* $COPYRIGHT$
*
@ -1011,11 +1011,11 @@ void mca_oob_tcp_component_lost_connection(int fd, short args, void *cbdata)
/* Mark that we no longer support this peer */
memcpy(&ui64, (char*)&pop->peer, sizeof(uint64_t));
if (OPAL_SUCCESS != opal_hash_table_get_value_uint64(&orte_oob_base.peers,
ui64, (void**)&bpr) || NULL == bpr) {
bpr = OBJ_NEW(orte_oob_base_peer_t);
if (OPAL_SUCCESS == opal_hash_table_get_value_uint64(&orte_oob_base.peers,
ui64, (void**)&bpr) && NULL != bpr) {
opal_bitmap_clear_bit(&bpr->addressable, mca_oob_tcp_component.super.idx);
OBJ_RELEASE(bpr);
}
opal_bitmap_clear_bit(&bpr->addressable, mca_oob_tcp_component.super.idx);
if (OPAL_SUCCESS != (rc = opal_hash_table_set_value_uint64(&orte_oob_base.peers,
ui64, NULL))) {
ORTE_ERROR_LOG(rc);

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

@ -13,6 +13,8 @@
* Copyright (c) 2011 Los Alamos National Security, LLC.
* All rights reserved.
* Copyright (c) 2014-2016 Intel, Inc. All rights reserved.
* Copyright (c) 2017 Research Organization for Information Science
* and Technology (RIST). All rights reserved.
* $COPYRIGHT$
*
* Additional copyrights may follow
@ -101,10 +103,6 @@ int orte_plm_base_comm_stop(void)
"%s plm:base:receive stop comm",
ORTE_NAME_PRINT(ORTE_PROC_MY_NAME)));
orte_rml.recv_cancel(ORTE_NAME_WILDCARD, ORTE_RML_TAG_PLM);
if (ORTE_PROC_IS_HNP) {
orte_rml.recv_cancel(ORTE_NAME_WILDCARD, ORTE_RML_TAG_ORTED_CALLBACK);
}
recv_issued = false;
return ORTE_SUCCESS;

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

@ -15,7 +15,7 @@
* Copyright (c) 2008-2009 Sun Microsystems, Inc. All rights reserved.
* Copyright (c) 2011 IBM Corporation. All rights reserved.
* Copyright (c) 2014-2016 Intel, Inc. All rights reserved.
* Copyright (c) 2015-2016 Research Organization for Information Science
* Copyright (c) 2015-2017 Research Organization for Information Science
* and Technology (RIST). All rights reserved.
* $COPYRIGHT$
*
@ -1343,6 +1343,10 @@ static int rsh_finalize(void)
}
}
}
free(mca_plm_rsh_component.agent_path);
free(rsh_agent_path);
opal_argv_free(mca_plm_rsh_component.agent_argv);
opal_argv_free(rsh_agent_argv);
return rc;
}

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

@ -6,7 +6,7 @@
* reserved.
* Copyright (c) 2013 Cisco Systems, Inc. All rights reserved.
* Copyright (c) 2014-2016 Intel Corporation. All rights reserved.
* Copyright (c) 2015 Research Organization for Information Science
* Copyright (c) 2015-2017 Research Organization for Information Science
* and Technology (RIST). All rights reserved.
* $COPYRIGHT$
*
@ -289,9 +289,13 @@ static void send_req_cons(orte_rml_send_request_t *ptr)
{
OBJ_CONSTRUCT(&ptr->send, orte_rml_send_t);
}
static void send_req_des(orte_rml_send_request_t *ptr)
{
OBJ_DESTRUCT(&ptr->send);
}
OBJ_CLASS_INSTANCE(orte_rml_send_request_t,
opal_object_t,
send_req_cons, NULL);
send_req_cons, send_req_des);
static void recv_cons(orte_rml_recv_t *ptr)
{

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

@ -2,6 +2,8 @@
* Copyright (c) 2011-2012 Los Alamos National Security, LLC.
* All rights reserved.
* Copyright (c) 2014 Intel, Inc. All rights reserved
* Copyright (c) 2017 Research Organization for Information Science
* and Technology (RIST). All rights reserved.
* $COPYRIGHT$
*
* Additional copyrights may follow
@ -190,10 +192,9 @@ static int finalize(void)
opal_list_item_t *item;
/* cleanup the proc state machine */
while (NULL != (item = opal_list_remove_first(&orte_proc_states))) {
OBJ_RELEASE(item);
}
OBJ_DESTRUCT(&orte_proc_states);
OPAL_LIST_DESTRUCT(&orte_proc_states);
/* cleanup the job state machine */
OPAL_LIST_DESTRUCT(&orte_job_states);
return ORTE_SUCCESS;
}

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

@ -17,7 +17,7 @@
* et Automatique. All rights reserved.
* Copyright (c) 2010 Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2013-2016 Intel, Inc. All rights reserved.
* Copyright (c) 2015-2016 Research Organization for Information Science
* Copyright (c) 2015-2017 Research Organization for Information Science
* and Technology (RIST). All rights reserved.
* $COPYRIGHT$
*
@ -879,6 +879,7 @@ int orte_daemon(int argc, char *argv[])
/* cleanup and leave */
orte_finalize();
opal_finalize_util();
if (orte_debug_flag) {
fprintf(stderr, "exiting with status %d\n", orte_exit_status);

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

@ -15,7 +15,7 @@
* Copyright (c) 2007-2016 Los Alamos National Security, LLC. All rights
* reserved.
* Copyright (c) 2013-2017 Intel, Inc. All rights reserved.
* Copyright (c) 2015-2016 Research Organization for Information Science
* Copyright (c) 2015-2017 Research Organization for Information Science
* and Technology (RIST). All rights reserved.
* $COPYRIGHT$
*
@ -55,6 +55,7 @@
#ifdef HAVE_SYS_STAT_H
#include <sys/stat.h>
#endif
#include <poll.h>
#include "opal/dss/dss.h"
#include "opal/mca/event/event.h"
@ -589,8 +590,6 @@ void orte_submit_finalize(void)
trackr_t *trk;
int i;
orte_rml.recv_cancel(ORTE_NAME_WILDCARD, ORTE_RML_TAG_LAUNCH_RESP);
orte_rml.recv_cancel(ORTE_NAME_WILDCARD, ORTE_RML_TAG_NOTIFY_COMPLETE);
for (i=0; i < tool_jobs.size; i++) {
if (NULL != (trk = (trackr_t*)opal_pointer_array_get_item(&tool_jobs, i))) {
OBJ_RELEASE(trk);
@ -612,6 +611,10 @@ void orte_submit_finalize(void)
close(orte_debugger_attach_fd);
unlink(MPIR_attach_fifo);
}
if (NULL != orte_cmd_options.prefix) {
free(orte_cmd_options.prefix);
}
}
int orte_submit_cancel(int index) {
@ -703,6 +706,9 @@ int orte_submit_job(char *argv[], int *index,
/* reset the globals every time thru as the argv
* will modify them */
if (NULL != orte_cmd_options.prefix) {
free(orte_cmd_options.prefix);
}
memset(&orte_cmd_options, 0, sizeof(orte_cmd_options));
argc = opal_argv_count(argv);
@ -1282,12 +1288,18 @@ static int parse_locals(orte_job_t *jdata, int argc, char* argv[])
* region.
* So we make a copy of the variable.
*/
char *s = strdup(env[j]);
char *value, *s = strdup(env[j]);
if (NULL == s) {
return OPAL_ERR_OUT_OF_RESOURCE;
}
putenv(s);
value = strchr(s, '=');
if (NULL != value) {
value++;
}
opal_setenv(s, value, true, &environ);
free(s);
}
}

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

@ -16,7 +16,7 @@
* Copyright (c) 2013-2016 Intel, Inc. All rights reserved.
* Copyright (c) 2014 Mellanox Technologies, Inc.
* All rights reserved.
* Copyright (c) 2014 Research Organization for Information Science
* Copyright (c) 2014-2017 Research Organization for Information Science
* and Technology (RIST). All rights reserved.
* $COPYRIGHT$
*
@ -116,8 +116,10 @@ int pmix_server_fencenb_fn(opal_list_t *procs, opal_list_t *info,
/* pass along any data that was collected locally */
if (ORTE_SUCCESS != (rc = orte_grpcomm.allgather(cd->sig, buf, pmix_server_release, cd))) {
ORTE_ERROR_LOG(rc);
OBJ_RELEASE(buf);
return rc;
}
OBJ_RELEASE(buf);
return ORTE_SUCCESS;
}

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

@ -206,12 +206,6 @@ int orte_dt_compare_sig(orte_grpcomm_signature_t *value1, orte_grpcomm_signature
}
if (value2->sz > value1->sz) {
return OPAL_VALUE2_GREATER;
}
if (value1->seq_num > value2->seq_num) {
return OPAL_VALUE1_GREATER;
}
if (value2->seq_num > value1->seq_num) {
return OPAL_VALUE2_GREATER;
}
/* same size - check contents */
if (0 == memcmp(value1->signature, value2->signature, value1->sz*sizeof(orte_process_name_t))) {

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

@ -319,7 +319,6 @@ int orte_dt_copy_sig(orte_grpcomm_signature_t **dest, orte_grpcomm_signature_t *
}
(*dest)->sz = src->sz;
(*dest)->signature = (orte_process_name_t*)malloc(src->sz * sizeof(orte_process_name_t));
(*dest)->seq_num = src->seq_num;
if (NULL == (*dest)->signature) {
ORTE_ERROR_LOG(ORTE_ERR_OUT_OF_RESOURCE);
OBJ_RELEASE(*dest);

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

@ -846,11 +846,6 @@ int orte_dt_pack_sig(opal_buffer_t *buffer, const void *src, int32_t num_vals,
ORTE_ERROR_LOG(rc);
return rc;
}
/* pack the sequence number */
if (OPAL_SUCCESS != (rc = opal_dss.pack(buffer, &ptr[i]->seq_num, 1, OPAL_UINT32))) {
ORTE_ERROR_LOG(rc);
return rc;
}
if (0 < ptr[i]->sz) {
/* pack the array */
if (OPAL_SUCCESS != (rc = opal_dss.pack(buffer, ptr[i]->signature, ptr[i]->sz, ORTE_NAME))) {

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

@ -853,13 +853,13 @@ int orte_dt_print_sig(char **output, char *prefix, orte_grpcomm_signature_t *src
}
if (NULL == src->signature) {
asprintf(output, "%sORTE_SIG SeqNumber:%d Procs: NULL", prefx, src->seq_num);
asprintf(output, "%sORTE_SIG Procs: NULL", prefx);
free(prefx);
return ORTE_SUCCESS;
}
/* there must be at least one proc in the signature */
asprintf(&tmp, "%sORTE_SIG SeqNumber:%d Procs: ", prefx, src->seq_num);
asprintf(&tmp, "%sORTE_SIG Procs: ", prefx);
for (i=0; i < src->sz; i++) {
asprintf(&tmp2, "%s%s", tmp, ORTE_NAME_PRINT(&src->signature[i]));

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

@ -933,10 +933,6 @@ int orte_dt_unpack_sig(opal_buffer_t *buffer, void *dest, int32_t *num_vals,
ORTE_ERROR_LOG(rc);
return rc;
}
if (OPAL_SUCCESS != (rc = opal_dss.unpack(buffer, &ptr[i]->seq_num, &cnt, OPAL_UINT32))) {
ORTE_ERROR_LOG(rc);
return rc;
}
if (0 < ptr[i]->sz) {
/* allocate space for the array */
ptr[i]->signature = (orte_process_name_t*)malloc(ptr[i]->sz * sizeof(orte_process_name_t));

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

@ -13,6 +13,8 @@
* Copyright (c) 2012-2016 Los Alamos National Security, LLC.
* All rights reserved
* Copyright (c) 2015-2016 Intel, Inc. All rights reserved.
* Copyright (c) 2017 Research Organization for Information Science
* and Technology (RIST). All rights reserved.
* $COPYRIGHT$
*
* Additional copyrights may follow
@ -149,8 +151,6 @@ void orte_data_server_finalize(void)
}
initialized = false;
orte_rml.recv_cancel(ORTE_NAME_WILDCARD, ORTE_RML_TAG_DATA_SERVER);
for (i=0; i < orte_data_server_store.size; i++) {
if (NULL != (data = (orte_data_object_t*)opal_pointer_array_get_item(&orte_data_server_store, i))) {
OBJ_RELEASE(data);

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

@ -13,6 +13,8 @@
* Copyright (c) 2011-2013 Los Alamos National Security, LLC.
* All rights reserved.
* Copyright (c) 2014-2016 Intel, Inc. All rights reserved.
* Copyright (c) 2017 Research Organization for Information Science
* and Technology (RIST). All rights reserved.
* $COPYRIGHT$
*
* Additional copyrights may follow
@ -87,6 +89,10 @@ int orte_finalize(void)
/* Close the general debug stream */
opal_output_close(orte_debug_output);
if (NULL != orte_fork_agent) {
opal_argv_free(orte_fork_agent);
}
/* finalize the opal utilities */
rc = opal_finalize();

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

@ -1,6 +1,6 @@
/*
* Copyright (c) 2014-2016 Intel, Inc. All rights reserved
* Copyright (c) 2014-2016 Research Organization for Information Science
* Copyright (c) 2014-2017 Research Organization for Information Science
* and Technology (RIST). All rights reserved.
* $COPYRIGHT$
*
@ -497,8 +497,8 @@ static int orte_attr_unload(orte_attribute_t *kv,
return OPAL_ERR_TYPE_MISMATCH;
}
if (NULL == data ||
(NULL == *data && OPAL_STRING != type && OPAL_BYTE_OBJECT != type &&
OPAL_BUFFER != type && OPAL_PTR != type)) {
(OPAL_STRING != type && OPAL_BYTE_OBJECT != type &&
OPAL_BUFFER != type && OPAL_PTR != type && NULL == *data)) {
assert(0);
OPAL_ERROR_LOG(OPAL_ERR_BAD_PARAM);
return OPAL_ERR_BAD_PARAM;

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

@ -13,7 +13,7 @@
* reserved.
* Copyright (c) 2011 Cisco Systems, Inc. All rights reserved.
* Copyright (c) 2013-2014 Intel, Inc. All rights reserved.
* Copyright (c) 2015-2016 Research Organization for Information Science
* Copyright (c) 2015-2017 Research Organization for Information Science
* and Technology (RIST). All rights reserved.
* Copyright (c) 2016 IBM Corporation. All rights reserved.
* $COPYRIGHT$
@ -515,6 +515,7 @@ static int hostfile_parse(const char *hostfile, opal_list_t* updates,
}
fclose(orte_util_hostfile_in);
orte_util_hostfile_in = NULL;
orte_util_hostfile_lex_destroy();
unlock:
cur_hostfile_name = NULL;

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

@ -10,7 +10,7 @@
* University of Stuttgart. All rights reserved.
* Copyright (c) 2004-2005 The Regents of the University of California.
* All rights reserved.
* Copyright (c) 2016 Research Organization for Information Science
* Copyright (c) 2016-2017 Research Organization for Information Science
* and Technology (RIST). All rights reserved.
* Copyright (c) 2011 Cisco Systems, Inc. All rights reserved.
* $COPYRIGHT$
@ -47,6 +47,7 @@ extern FILE *orte_util_hostfile_in;
extern int orte_util_hostfile_line;
extern bool orte_util_hostfile_done;
extern orte_hostfile_value_t orte_util_hostfile_value;
extern int orte_util_hostfile_lex_destroy (void );
/*
* Make lex-generated files not issue compiler warnings