Merge pull request #2193 from ggouaillardet/topic/pmix_misc_plugs_and_fixes
pmix3x: plugs misc memory leaks and misc fixes
Этот коммит содержится в:
Коммит
13d49c135f
@ -90,6 +90,7 @@ AC_DEFUN([PMIX_SETUP_CORE],[
|
||||
if test "$?" != "0"; then
|
||||
AC_MSG_ERROR([Cannot continue])
|
||||
fi
|
||||
AC_MSG_RESULT([$PMIX_MAJOR_VERSION])
|
||||
AC_SUBST(PMIX_MAJOR_VERSION)
|
||||
AC_DEFINE_UNQUOTED([PMIX_MAJOR_VERSION], [$PMIX_MAJOR_VERSION],
|
||||
[The library major version is always available, contrary to VERSION])
|
||||
@ -98,6 +99,7 @@ AC_DEFUN([PMIX_SETUP_CORE],[
|
||||
if test "$?" != "0"; then
|
||||
AC_MSG_ERROR([Cannot continue])
|
||||
fi
|
||||
AC_MSG_RESULT([$PMIX_MINOR_VERSION])
|
||||
AC_SUBST(PMIX_MINOR_VERSION)
|
||||
AC_DEFINE_UNQUOTED([PMIX_MINOR_VERSION], [$PMIX_MINOR_VERSION],
|
||||
[The library minor version is always available, contrary to VERSION])
|
||||
@ -106,6 +108,7 @@ AC_DEFUN([PMIX_SETUP_CORE],[
|
||||
if test "$?" != "0"; then
|
||||
AC_MSG_ERROR([Cannot continue])
|
||||
fi
|
||||
AC_MSG_RESULT([$PMIX_RELEASE_VERSION])
|
||||
AC_SUBST(PMIX_RELEASE_VERSION)
|
||||
AC_DEFINE_UNQUOTED([PMIX_RELEASE_VERSION], [$PMIX_RELEASE_VERSION],
|
||||
[The library release version is always available, contrary to VERSION])
|
||||
|
@ -15,6 +15,8 @@
|
||||
* Copyright (c) 2011 Oak Ridge National Labs. All rights reserved.
|
||||
* Copyright (c) 2013-2016 Intel, Inc. All rights reserved.
|
||||
* Copyright (c) 2015 Mellanox Technologies, Inc. All rights reserved.
|
||||
* Copyright (c) 2016 Research Organization for Information Science
|
||||
* and Technology (RIST). All rights reserved.
|
||||
* $COPYRIGHT$
|
||||
*
|
||||
* Additional copyrights may follow
|
||||
@ -46,7 +48,7 @@ int main(int argc, char **argv)
|
||||
uint32_t nprocs;
|
||||
char nsp2[PMIX_MAX_NSLEN+1];
|
||||
pmix_app_t *app;
|
||||
char hostname[MAXHOSTNAMELEN], dir[1024];
|
||||
char hostname[1024], dir[1024];
|
||||
pmix_proc_t *peers;
|
||||
size_t npeers, ntmp=0;
|
||||
char *nodelist;
|
||||
|
@ -10,7 +10,7 @@
|
||||
* Copyright (c) 2004-2005 The Regents of the University of California.
|
||||
* All rights reserved.
|
||||
* Copyright (c) 2015-2016 Intel, Inc. All rights reserved.
|
||||
* Copyright (c) 2015 Research Organization for Information Science
|
||||
* Copyright (c) 2015-2016 Research Organization for Information Science
|
||||
* and Technology (RIST). All rights reserved.
|
||||
* Copyright (c) 2016 Mellanox Technologies, Inc.
|
||||
* All rights reserved.
|
||||
@ -371,6 +371,29 @@ static inline int pmix_next_poweroftwo(int value)
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Loop over a hash table.
|
||||
*
|
||||
* @param[in] key Key for each item
|
||||
* @param[in] type Type of key (ui32|ui64|ptr)
|
||||
* @param[in] value Storage for each item
|
||||
* @param[in] ht Hash table to iterate over
|
||||
*
|
||||
* This macro provides a simple way to loop over the items in a pmix_hash_table_t. It
|
||||
* is not safe to call pmix_hash_table_remove* from within the loop.
|
||||
*
|
||||
* Example Usage:
|
||||
*
|
||||
* uint64_t key;
|
||||
* void * value;
|
||||
* PMIX_HASH_TABLE_FOREACH(key, uint64, value, ht) {
|
||||
* do_something(key, value);
|
||||
* }
|
||||
*/
|
||||
#define PMIX_HASH_TABLE_FOREACH(key, type, value, ht) \
|
||||
for (void *_nptr=NULL; \
|
||||
PMIX_SUCCESS == pmix_hash_table_get_next_key_##type(ht, &key, (void **)&value, _nptr, &_nptr);)
|
||||
|
||||
END_C_DECLS
|
||||
|
||||
#endif /* PMIX_HASH_TABLE_H */
|
||||
|
@ -188,6 +188,8 @@ static void job_data(struct pmix_peer_t *pr, pmix_usock_hdr_t *hdr,
|
||||
cb->active = false;
|
||||
return;
|
||||
}
|
||||
assert(NULL != nspace);
|
||||
free(nspace);
|
||||
/* decode it */
|
||||
pmix_client_process_nspace_blob(pmix_globals.myid.nspace, buf);
|
||||
cb->status = PMIX_SUCCESS;
|
||||
@ -1120,7 +1122,6 @@ void pmix_client_process_nspace_blob(const char *nspace, pmix_buffer_t *bptr)
|
||||
bo = &(kptr->value->data.bo);
|
||||
PMIX_CONSTRUCT(&buf2, pmix_buffer_t);
|
||||
PMIX_LOAD_BUFFER(&buf2, bo->bytes, bo->size);
|
||||
PMIX_RELEASE(kptr);
|
||||
/* start by unpacking the rank */
|
||||
cnt = 1;
|
||||
if (PMIX_SUCCESS != (rc = pmix_bfrop.unpack(&buf2, &rank, &cnt, PMIX_PROC_RANK))) {
|
||||
@ -1156,7 +1157,6 @@ void pmix_client_process_nspace_blob(const char *nspace, pmix_buffer_t *bptr)
|
||||
bo = &(kptr->value->data.bo);
|
||||
PMIX_CONSTRUCT(&buf2, pmix_buffer_t);
|
||||
PMIX_LOAD_BUFFER(&buf2, bo->bytes, bo->size);
|
||||
PMIX_RELEASE(kptr);
|
||||
/* start by unpacking the number of nodes */
|
||||
cnt = 1;
|
||||
if (PMIX_SUCCESS != (rc = pmix_bfrop.unpack(&buf2, &nnodes, &cnt, PMIX_SIZE))) {
|
||||
@ -1225,11 +1225,8 @@ void pmix_client_process_nspace_blob(const char *nspace, pmix_buffer_t *bptr)
|
||||
if (PMIX_SUCCESS != (rc = pmix_hash_store(&nsptr->internal, PMIX_RANK_WILDCARD, kptr))) {
|
||||
PMIX_ERROR_LOG(rc);
|
||||
}
|
||||
/* maintain accounting - but note that the kptr remains
|
||||
* alive and stored in the hash table! So we cannot reuse
|
||||
* it for some other purpose */
|
||||
PMIX_RELEASE(kptr);
|
||||
}
|
||||
PMIX_RELEASE(kptr);
|
||||
kptr = PMIX_NEW(pmix_kval_t);
|
||||
cnt = 1;
|
||||
}
|
||||
|
@ -337,6 +337,7 @@ static void reg_event_hdlr(int sd, short args, void *cbdata)
|
||||
}
|
||||
if (PMIX_ERR_WOULD_BLOCK == rc) {
|
||||
/* the callback will provide our response */
|
||||
PMIX_RELEASE(cd);
|
||||
return;
|
||||
}
|
||||
goto ack;
|
||||
@ -366,6 +367,7 @@ static void reg_event_hdlr(int sd, short args, void *cbdata)
|
||||
}
|
||||
if (PMIX_ERR_WOULD_BLOCK == rc) {
|
||||
/* the callback will provide our response */
|
||||
PMIX_RELEASE(cd);
|
||||
return;
|
||||
}
|
||||
goto ack;
|
||||
@ -395,7 +397,8 @@ static void reg_event_hdlr(int sd, short args, void *cbdata)
|
||||
goto ack;
|
||||
}
|
||||
if (PMIX_ERR_WOULD_BLOCK == rc) {
|
||||
/* the callback will provide our response */
|
||||
/* the callback will provide our response */
|
||||
PMIX_RELEASE(cd);
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -85,8 +85,21 @@ static void nscon(pmix_nspace_t *p)
|
||||
}
|
||||
static void nsdes(pmix_nspace_t *p)
|
||||
{
|
||||
uint64_t key;
|
||||
pmix_object_t *obj;
|
||||
|
||||
PMIX_LIST_DESTRUCT(&p->nodes);
|
||||
PMIX_HASH_TABLE_FOREACH(key, uint64, obj, &p->internal) {
|
||||
if (NULL != obj) {
|
||||
PMIX_RELEASE(obj);
|
||||
}
|
||||
}
|
||||
PMIX_DESTRUCT(&p->internal);
|
||||
PMIX_HASH_TABLE_FOREACH(key, uint64, obj, &p->modex) {
|
||||
if (NULL != obj) {
|
||||
PMIX_RELEASE(obj);
|
||||
}
|
||||
}
|
||||
PMIX_DESTRUCT(&p->modex);
|
||||
if (NULL != p->server) {
|
||||
PMIX_RELEASE(p->server);
|
||||
|
@ -2,6 +2,8 @@
|
||||
* Copyright (c) 2015 Intel, Inc. All rights reserved.
|
||||
* Copyright (c) 2015 Mellanox Technologies, Inc.
|
||||
* All rights reserved.
|
||||
* Copyright (c) 2016 Research Organization for Information Science
|
||||
* and Technology (RIST). All rights reserved.
|
||||
* $COPYRIGHT$
|
||||
*
|
||||
* Additional copyrights may follow
|
||||
@ -234,9 +236,7 @@ int launch_clients(int num_procs, char *binary, char *** client_env, char ***bas
|
||||
if (cli_info[counter].pid == 0) {
|
||||
if( !TEST_VERBOSE_GET() ){
|
||||
// Hide clients stdout
|
||||
// TODO: on some systems stdout is a constant, address this
|
||||
fclose(stdout);
|
||||
stdout = fopen("/dev/null","w");
|
||||
freopen("/dev/null","w", stdout);
|
||||
}
|
||||
execve(binary, client_argv, *client_env);
|
||||
/* Does not return */
|
||||
|
Загрузка…
x
Ссылка в новой задаче
Block a user