1
1
Signed-off-by: Ralph Castain <rhc@open-mpi.org>
Этот коммит содержится в:
Ralph Castain 2017-09-06 13:15:24 -07:00
родитель 41c7230bc4
Коммит cbc114e923
25 изменённых файлов: 648 добавлений и 254 удалений

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

@ -30,7 +30,7 @@ greek=
# command, or with the date (if "git describe" fails) in the form of # command, or with the date (if "git describe" fails) in the form of
# "date<date>". # "date<date>".
repo_rev=git3920e33 repo_rev=gitaffab34
# If tarball_version is not empty, it is used as the version string in # If tarball_version is not empty, it is used as the version string in
# the tarball filename, regardless of all other versions listed in # the tarball filename, regardless of all other versions listed in
@ -44,7 +44,7 @@ tarball_version=
# The date when this release was created # The date when this release was created
date="Sep 01, 2017" date="Sep 06, 2017"
# The shared library version of each of PMIx's public libraries. # The shared library version of each of PMIx's public libraries.
# These versions are maintained in accordance with the "Library # These versions are maintained in accordance with the "Library

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

@ -34,7 +34,14 @@ AC_DEFUN([PMIX_SETUP_CORE],[
AC_REQUIRE([AC_USE_SYSTEM_EXTENSIONS]) AC_REQUIRE([AC_USE_SYSTEM_EXTENSIONS])
AC_REQUIRE([AC_CANONICAL_TARGET]) AC_REQUIRE([AC_CANONICAL_TARGET])
AC_REQUIRE([AC_PROG_CC])
# AM_PROG_CC_C_O AC_REQUIREs AC_PROG_CC, so we have to be a little
# careful about ordering here, and AC_REQUIRE these things so that
# they get stamped out in the right order.
AC_REQUIRE([_PMIX_START_SETUP_CC])
AC_REQUIRE([_PMIX_PROG_CC])
AC_REQUIRE([AM_PROG_CC_C_O])
# If no prefix was defined, set a good value # If no prefix was defined, set a good value
m4_ifval([$1], m4_ifval([$1],

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

@ -16,7 +16,7 @@ dnl Copyright (c) 2012-2017 Los Alamos National Security, LLC. All rights
dnl reserved. dnl reserved.
dnl Copyright (c) 2015 Research Organization for Information Science dnl Copyright (c) 2015 Research Organization for Information Science
dnl and Technology (RIST). All rights reserved. dnl and Technology (RIST). All rights reserved.
dnl Copyright (c) 2015-2016 Intel, Inc. All rights reserved. dnl Copyright (c) 2015-2017 Intel, Inc. All rights reserved.
dnl $COPYRIGHT$ dnl $COPYRIGHT$
dnl dnl
dnl Additional copyrights may follow dnl Additional copyrights may follow
@ -29,22 +29,14 @@ dnl
# Do everything required to setup the C compiler. Safe to AC_REQUIRE # Do everything required to setup the C compiler. Safe to AC_REQUIRE
# this macro. # this macro.
AC_DEFUN([PMIX_SETUP_CC],[ AC_DEFUN([PMIX_SETUP_CC],[
# AM_PROG_CC_C_O AC_REQUIREs AC_PROG_CC, so we have to be a little
# careful about ordering here, and AC_REQUIRE these things so that
# they get stamped out in the right order.
AC_REQUIRE([_PMIX_START_SETUP_CC]) # We require a C99 compliant compiler
AC_REQUIRE([_PMIX_PROG_CC])
AC_REQUIRE([AM_PROG_CC_C_O])
# We require a C99 compiant compiler
# The result of AC_PROG_CC_C99 is stored in ac_cv_prog_cc_c99 # The result of AC_PROG_CC_C99 is stored in ac_cv_prog_cc_c99
if test "x$ac_cv_prog_cc_c99" = xno ; then if test "x$ac_cv_prog_cc_c99" = xno ; then
AC_MSG_WARN([PMIx requires a C99 compiler]) AC_MSG_WARN([PMIx requires a C99 compiler])
AC_MSG_ERROR([Aborting.]) AC_MSG_ERROR([Aborting.])
fi fi
PMIX_C_COMPILER_VENDOR([pmix_c_vendor]) PMIX_C_COMPILER_VENDOR([pmix_c_vendor])
# Check for standard headers, needed here because needed before # Check for standard headers, needed here because needed before
@ -309,6 +301,7 @@ AC_DEFUN([PMIX_SETUP_CC],[
AC_DEFUN([_PMIX_START_SETUP_CC],[ AC_DEFUN([_PMIX_START_SETUP_CC],[
pmix_show_subtitle "C compiler and preprocessor" pmix_show_subtitle "C compiler and preprocessor"
AC_REQUIRE([AC_PROG_CC])
# $%@#!@#% AIX!! This has to be called before anything invokes the C # $%@#!@#% AIX!! This has to be called before anything invokes the C
# compiler. # compiler.
dnl AC_AIX dnl AC_AIX

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

@ -334,7 +334,9 @@ int main(int argc, char **argv)
/* setup the executable */ /* setup the executable */
app[0].cmd = strdup("client"); app[0].cmd = strdup("client");
PMIX_ARGV_APPEND(rc, app[0].argv, "./client"); PMIX_ARGV_APPEND(rc, app[0].argv, "./client");
getcwd(cwd, 1024); // point us to our current directory if (NULL == getcwd(cwd, 1024)) { // point us to our current directory
goto done;
}
app[0].cwd = strdup(cwd); app[0].cwd = strdup(cwd);
app[0].maxprocs = 2; app[0].maxprocs = 2;
/* provide job-level directives so the apps do what the user requested */ /* provide job-level directives so the apps do what the user requested */

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

@ -482,15 +482,14 @@ PMIX_EXPORT pmix_status_t PMIx_Init(pmix_proc_t *proc,
if (NULL != evar) { if (NULL != evar) {
PMIX_INFO_LOAD(&ginfo, PMIX_GDS_MODULE, evar, PMIX_STRING); PMIX_INFO_LOAD(&ginfo, PMIX_GDS_MODULE, evar, PMIX_STRING);
pmix_client_globals.myserver->nptr->compat.gds = pmix_gds_base_assign_module(&ginfo, 1); pmix_client_globals.myserver->nptr->compat.gds = pmix_gds_base_assign_module(&ginfo, 1);
PMIX_INFO_DESTRUCT(&ginfo);
} else { } else {
pmix_client_globals.myserver->nptr->compat.gds = pmix_gds_base_assign_module(NULL, 0); pmix_client_globals.myserver->nptr->compat.gds = pmix_gds_base_assign_module(NULL, 0);
} }
if (NULL == pmix_client_globals.myserver->nptr->compat.gds) { if (NULL == pmix_client_globals.myserver->nptr->compat.gds) {
PMIX_INFO_DESTRUCT(&ginfo);
PMIX_RELEASE_THREAD(&pmix_global_lock); PMIX_RELEASE_THREAD(&pmix_global_lock);
return PMIX_ERR_INIT; return PMIX_ERR_INIT;
} }
PMIX_INFO_DESTRUCT(&ginfo);
/* now select a GDS module for our own internal use - the user may /* now select a GDS module for our own internal use - the user may
* have passed down a directive for this purpose. If they did, then * have passed down a directive for this purpose. If they did, then
* use it. Otherwise, we want the "hash" module */ * use it. Otherwise, we want the "hash" module */

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

@ -109,7 +109,7 @@ static pmix_status_t notify_server_of_event(pmix_status_t status,
pmix_op_cbfunc_t cbfunc, void *cbdata) pmix_op_cbfunc_t cbfunc, void *cbdata)
{ {
pmix_status_t rc; pmix_status_t rc;
pmix_buffer_t *msg; pmix_buffer_t *msg = NULL;
pmix_cmd_t cmd = PMIX_NOTIFY_CMD; pmix_cmd_t cmd = PMIX_NOTIFY_CMD;
pmix_cb_t *cb; pmix_cb_t *cb;
pmix_event_chain_t *chain; pmix_event_chain_t *chain;
@ -231,7 +231,7 @@ static pmix_status_t notify_server_of_event(pmix_status_t status,
PMIX_RELEASE(rbout); PMIX_RELEASE(rbout);
} }
if (PMIX_RANGE_PROC_LOCAL != range) { if (PMIX_RANGE_PROC_LOCAL != range && NULL != msg) {
/* create a callback object as we need to pass it to the /* create a callback object as we need to pass it to the
* recv routine so we know which callback to use when * recv routine so we know which callback to use when
* the server acks/nacks the register events request. The * the server acks/nacks the register events request. The
@ -263,7 +263,9 @@ static pmix_status_t notify_server_of_event(pmix_status_t status,
cleanup: cleanup:
pmix_output_verbose(2, pmix_globals.debug_output, pmix_output_verbose(2, pmix_globals.debug_output,
"client: notifying server - unable to send"); "client: notifying server - unable to send");
PMIX_RELEASE(msg); if (NULL != msg) {
PMIX_RELEASE(msg);
}
/* we were unable to send anything, so we just return the error */ /* we were unable to send anything, so we just return the error */
return rc; return rc;
} }

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

@ -428,7 +428,7 @@ static void reg_event_hdlr(int sd, short args, void *cbdata)
void *cbobject = NULL; void *cbobject = NULL;
pmix_data_range_t range = PMIX_RANGE_UNDEF; pmix_data_range_t range = PMIX_RANGE_UNDEF;
pmix_proc_t *parray = NULL; pmix_proc_t *parray = NULL;
size_t nprocs; size_t nprocs = 0;
/* need to acquire the object from its originating thread */ /* need to acquire the object from its originating thread */
PMIX_ACQUIRE_OBJECT(cd); PMIX_ACQUIRE_OBJECT(cd);
@ -527,7 +527,7 @@ static void reg_event_hdlr(int sd, short args, void *cbdata)
evhdlr->index = index; evhdlr->index = index;
++pmix_globals.events.nhdlrs; ++pmix_globals.events.nhdlrs;
evhdlr->rng.range = range; evhdlr->rng.range = range;
if (NULL != parray) { if (NULL != parray && 0 < nprocs) {
evhdlr->rng.nprocs = nprocs; evhdlr->rng.nprocs = nprocs;
PMIX_PROC_CREATE(evhdlr->rng.procs, nprocs); PMIX_PROC_CREATE(evhdlr->rng.procs, nprocs);
if (NULL == evhdlr->rng.procs) { if (NULL == evhdlr->rng.procs) {
@ -601,7 +601,7 @@ static void reg_event_hdlr(int sd, short args, void *cbdata)
evhdlr->precedence = location; evhdlr->precedence = location;
evhdlr->locator = locator; evhdlr->locator = locator;
evhdlr->rng.range = range; evhdlr->rng.range = range;
if (NULL != parray) { if (NULL != parray && 0 < nprocs) {
evhdlr->rng.nprocs = nprocs; evhdlr->rng.nprocs = nprocs;
PMIX_PROC_CREATE(evhdlr->rng.procs, nprocs); PMIX_PROC_CREATE(evhdlr->rng.procs, nprocs);
if (NULL == evhdlr->rng.procs) { if (NULL == evhdlr->rng.procs) {

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

@ -3,7 +3,7 @@
* Copyright (c) 2012-2015 Los Alamos National Security, LLC. All rights * Copyright (c) 2012-2015 Los Alamos National Security, LLC. All rights
* reserved. * reserved.
* Copyright (c) 2015 Cisco Systems, Inc. All rights reserved. * Copyright (c) 2015 Cisco Systems, Inc. All rights reserved.
* Copyright (c) 2016 Intel, Inc. All rights reserved * Copyright (c) 2016-2017 Intel, Inc. All rights reserved.
* $COPYRIGHT$ * $COPYRIGHT$
* *
* Additional copyrights may follow * Additional copyrights may follow
@ -81,8 +81,12 @@ int pmix_mca_base_framework_register (struct pmix_mca_base_framework_t *framewor
return ret; return ret;
} }
asprintf (&desc, "Default selection set of components for the %s framework (<none>" ret = asprintf (&desc, "Default selection set of components for the %s framework (<none>"
" means use all components that can be found)", framework->framework_name); " means use all components that can be found)", framework->framework_name);
if (0 > ret) {
return PMIX_ERR_OUT_OF_RESOURCE;
}
ret = pmix_mca_base_var_register (framework->framework_project, framework->framework_name, ret = pmix_mca_base_var_register (framework->framework_project, framework->framework_name,
NULL, NULL, desc, PMIX_MCA_BASE_VAR_TYPE_STRING, NULL, 0, NULL, NULL, desc, PMIX_MCA_BASE_VAR_TYPE_STRING, NULL, 0,
PMIX_MCA_BASE_VAR_FLAG_SETTABLE, PMIX_INFO_LVL_2, PMIX_MCA_BASE_VAR_FLAG_SETTABLE, PMIX_INFO_LVL_2,

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

@ -69,6 +69,7 @@ int pmix_mca_base_open(void)
pmix_output_stream_t lds; pmix_output_stream_t lds;
char hostname[64]; char hostname[64];
int var_id; int var_id;
int rc;
if (pmix_mca_base_opened++) { if (pmix_mca_base_opened++) {
return PMIX_SUCCESS; return PMIX_SUCCESS;
@ -77,17 +78,24 @@ int pmix_mca_base_open(void)
/* define the system and user default paths */ /* define the system and user default paths */
#if PMIX_WANT_HOME_CONFIG_FILES #if PMIX_WANT_HOME_CONFIG_FILES
pmix_mca_base_system_default_path = strdup(pmix_pinstall_dirs.pmixlibdir); pmix_mca_base_system_default_path = strdup(pmix_pinstall_dirs.pmixlibdir);
asprintf(&pmix_mca_base_user_default_path, "%s"PMIX_PATH_SEP".pmix"PMIX_PATH_SEP"components", pmix_home_directory()); rc = asprintf(&pmix_mca_base_user_default_path, "%s"PMIX_PATH_SEP".pmix"PMIX_PATH_SEP"components", pmix_home_directory());
#else #else
asprintf(&pmix_mca_base_system_default_path, "%s", pmix_pinstall_dirs.pmixlibdir); rc = asprintf(&pmix_mca_base_system_default_path, "%s", pmix_pinstall_dirs.pmixlibdir);
#endif #endif
if (0 > rc) {
return PMIX_ERR_OUT_OF_RESOURCE;
}
/* see if the user wants to override the defaults */ /* see if the user wants to override the defaults */
if (NULL == pmix_mca_base_user_default_path) { if (NULL == pmix_mca_base_user_default_path) {
value = strdup(pmix_mca_base_system_default_path); value = strdup(pmix_mca_base_system_default_path);
} else { } else {
asprintf(&value, "%s%c%s", pmix_mca_base_system_default_path, rc = asprintf(&value, "%s%c%s", pmix_mca_base_system_default_path,
PMIX_ENV_SEP, pmix_mca_base_user_default_path); PMIX_ENV_SEP, pmix_mca_base_user_default_path);
if (0 > rc) {
return PMIX_ERR_OUT_OF_RESOURCE;
}
} }
pmix_mca_base_component_path = value; pmix_mca_base_component_path = value;
@ -139,7 +147,10 @@ int pmix_mca_base_open(void)
set_defaults(&lds); set_defaults(&lds);
} }
gethostname(hostname, 64); gethostname(hostname, 64);
asprintf(&lds.lds_prefix, "[%s:%05d] ", hostname, getpid()); rc = asprintf(&lds.lds_prefix, "[%s:%05d] ", hostname, getpid());
if (0 > rc) {
return PMIX_ERR_OUT_OF_RESOURCE;
}
pmix_output_reopen(0, &lds); pmix_output_reopen(0, &lds);
pmix_output_verbose (PMIX_MCA_BASE_VERBOSE_COMPONENT, 0, pmix_output_verbose (PMIX_MCA_BASE_VERBOSE_COMPONENT, 0,
"mca: base: opening components at %s", pmix_mca_base_component_path); "mca: base: opening components at %s", pmix_mca_base_component_path);

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

@ -405,7 +405,13 @@ static void resolve_relative_paths(char **file_prefix, char *file_path, bool rel
} }
else { else {
/* Prepend the files to the search list */ /* Prepend the files to the search list */
asprintf(&tmp_str, "%s%c%s", *file_prefix, sep, *files); if (0 > asprintf(&tmp_str, "%s%c%s", *file_prefix, sep, *files)) {
pmix_output(0, "OUT OF MEM");
free(*files);
free(tmp_str);
*files = NULL;
return;
}
free (*files); free (*files);
*files = tmp_str; *files = tmp_str;
} }
@ -428,13 +434,16 @@ int pmix_mca_base_var_cache_files(bool rel_path_search)
} }
#if PMIX_WANT_HOME_CONFIG_FILES #if PMIX_WANT_HOME_CONFIG_FILES
asprintf(&pmix_mca_base_var_files, "%s"PMIX_PATH_SEP".pmix" PMIX_PATH_SEP ret = asprintf(&pmix_mca_base_var_files, "%s"PMIX_PATH_SEP".pmix" PMIX_PATH_SEP
"mca-params.conf%c%s" PMIX_PATH_SEP "pmix-mca-params.conf", "mca-params.conf%c%s" PMIX_PATH_SEP "pmix-mca-params.conf",
home, PMIX_ENV_SEP, pmix_pinstall_dirs.sysconfdir); home, PMIX_ENV_SEP, pmix_pinstall_dirs.sysconfdir);
#else #else
asprintf(&pmix_mca_base_var_files, "%s" PMIX_PATH_SEP "pmix-mca-params.conf", ret = asprintf(&pmix_mca_base_var_files, "%s" PMIX_PATH_SEP "pmix-mca-params.conf",
pmix_pinstall_dirs.sysconfdir); pmix_pinstall_dirs.sysconfdir);
#endif #endif
if (0 > ret) {
return PMIX_ERR_OUT_OF_RESOURCE;
}
/* Initialize a parameter that says where MCA param files can be found. /* Initialize a parameter that says where MCA param files can be found.
We may change this value so set the scope to PMIX_MCA_BASE_VAR_SCOPE_READONLY */ We may change this value so set the scope to PMIX_MCA_BASE_VAR_SCOPE_READONLY */
@ -536,8 +545,11 @@ int pmix_mca_base_var_cache_files(bool rel_path_search)
if (NULL != pmix_mca_base_param_file_path) { if (NULL != pmix_mca_base_param_file_path) {
char *tmp_str = pmix_mca_base_param_file_path; char *tmp_str = pmix_mca_base_param_file_path;
asprintf(&pmix_mca_base_param_file_path, "%s%c%s", force_agg_path, PMIX_ENV_SEP, tmp_str); ret = asprintf(&pmix_mca_base_param_file_path, "%s%c%s", force_agg_path, PMIX_ENV_SEP, tmp_str);
free(tmp_str); free(tmp_str);
if (0 > ret) {
return PMIX_ERR_OUT_OF_RESOURCE;
}
} else { } else {
pmix_mca_base_param_file_path = strdup(force_agg_path); pmix_mca_base_param_file_path = strdup(force_agg_path);
} }
@ -1021,7 +1033,7 @@ int pmix_mca_base_var_build_env(char ***env, int *num_env, bool internal)
{ {
pmix_mca_base_var_t *var; pmix_mca_base_var_t *var;
size_t i, len; size_t i, len;
int ret; int ret=0;
/* Check for bozo cases */ /* Check for bozo cases */
@ -1068,14 +1080,15 @@ int pmix_mca_base_var_build_env(char ***env, int *num_env, bool internal)
pmix_argv_append(num_env, env, str); pmix_argv_append(num_env, env, str);
free(str); free(str);
ret = PMIX_SUCCESS;
switch (var->mbv_source) { switch (var->mbv_source) {
case PMIX_MCA_BASE_VAR_SOURCE_FILE: case PMIX_MCA_BASE_VAR_SOURCE_FILE:
case PMIX_MCA_BASE_VAR_SOURCE_OVERRIDE: case PMIX_MCA_BASE_VAR_SOURCE_OVERRIDE:
asprintf (&str, "%sSOURCE_%s=FILE:%s", mca_prefix, var->mbv_full_name, ret = asprintf (&str, "%sSOURCE_%s=FILE:%s", mca_prefix, var->mbv_full_name,
pmix_mca_base_var_source_file (var)); pmix_mca_base_var_source_file (var));
break; break;
case PMIX_MCA_BASE_VAR_SOURCE_COMMAND_LINE: case PMIX_MCA_BASE_VAR_SOURCE_COMMAND_LINE:
asprintf (&str, "%sSOURCE_%s=COMMAND_LINE", mca_prefix, var->mbv_full_name); ret = asprintf (&str, "%sSOURCE_%s=COMMAND_LINE", mca_prefix, var->mbv_full_name);
break; break;
case PMIX_MCA_BASE_VAR_SOURCE_ENV: case PMIX_MCA_BASE_VAR_SOURCE_ENV:
case PMIX_MCA_BASE_VAR_SOURCE_SET: case PMIX_MCA_BASE_VAR_SOURCE_SET:
@ -1091,10 +1104,12 @@ int pmix_mca_base_var_build_env(char ***env, int *num_env, bool internal)
free(str); free(str);
} }
} }
if (ret < 0) {
ret = PMIX_ERR_OUT_OF_RESOURCE;
}
/* All done */ /* All done */
return ret;
return PMIX_SUCCESS;
/* Error condition */ /* Error condition */
@ -2110,29 +2125,46 @@ int pmix_mca_base_var_dump(int vari, char ***out, pmix_mca_base_var_dump_type_t
} }
/* build the message*/ /* build the message*/
asprintf(&tmp, "mca:%s:%s:param:%s:", framework, component, ret = asprintf(&tmp, "mca:%s:%s:param:%s:", framework, component, full_name);
full_name); if (0 > ret) {
return PMIX_ERR_OUT_OF_RESOURCE;
}
/* Output the value */ /* Output the value */
char *colon = strchr(value_string, ':'); char *colon = strchr(value_string, ':');
if (NULL != colon) { if (NULL != colon) {
asprintf(out[0] + line++, "%svalue:\"%s\"", tmp, value_string); ret = asprintf(out[0] + line++, "%svalue:\"%s\"", tmp, value_string);
} else { } else {
asprintf(out[0] + line++, "%svalue:%s", tmp, value_string); ret = asprintf(out[0] + line++, "%svalue:%s", tmp, value_string);
}
if (0 > ret) {
return PMIX_ERR_OUT_OF_RESOURCE;
} }
/* Output the source */ /* Output the source */
asprintf(out[0] + line++, "%ssource:%s", tmp, source_string); ret = asprintf(out[0] + line++, "%ssource:%s", tmp, source_string);
if (0 > ret) {
return PMIX_ERR_OUT_OF_RESOURCE;
}
/* Output whether it's read only or writable */ /* Output whether it's read only or writable */
asprintf(out[0] + line++, "%sstatus:%s", tmp, PMIX_VAR_IS_DEFAULT_ONLY(var[0]) ? "read-only" : "writeable"); ret = asprintf(out[0] + line++, "%sstatus:%s", tmp, PMIX_VAR_IS_DEFAULT_ONLY(var[0]) ? "read-only" : "writeable");
if (0 > ret) {
return PMIX_ERR_OUT_OF_RESOURCE;
}
/* Output the info level of this parametere */ /* Output the info level of this parametere */
asprintf(out[0] + line++, "%slevel:%d", tmp, var->mbv_info_lvl + 1); ret = asprintf(out[0] + line++, "%slevel:%d", tmp, var->mbv_info_lvl + 1);
if (0 > ret) {
return PMIX_ERR_OUT_OF_RESOURCE;
}
/* If it has a help message, output the help message */ /* If it has a help message, output the help message */
if (var->mbv_description) { if (var->mbv_description) {
asprintf(out[0] + line++, "%shelp:%s", tmp, var->mbv_description); ret = asprintf(out[0] + line++, "%shelp:%s", tmp, var->mbv_description);
}
if (0 > ret) {
return PMIX_ERR_OUT_OF_RESOURCE;
} }
if (NULL != var->mbv_enumerator) { if (NULL != var->mbv_enumerator) {
@ -2146,18 +2178,30 @@ int pmix_mca_base_var_dump(int vari, char ***out, pmix_mca_base_var_dump_type_t
continue; continue;
} }
asprintf(out[0] + line++, "%senumerator:value:%d:%s", tmp, enum_value, enum_string); ret = asprintf(out[0] + line++, "%senumerator:value:%d:%s", tmp, enum_value, enum_string);
if (0 > ret) {
return PMIX_ERR_OUT_OF_RESOURCE;
}
} }
} }
/* Is this variable deprecated? */ /* Is this variable deprecated? */
asprintf(out[0] + line++, "%sdeprecated:%s", tmp, PMIX_VAR_IS_DEPRECATED(var[0]) ? "yes" : "no"); ret = asprintf(out[0] + line++, "%sdeprecated:%s", tmp, PMIX_VAR_IS_DEPRECATED(var[0]) ? "yes" : "no");
if (0 > ret) {
return PMIX_ERR_OUT_OF_RESOURCE;
}
asprintf(out[0] + line++, "%stype:%s", tmp, pmix_var_type_names[var->mbv_type]); ret = asprintf(out[0] + line++, "%stype:%s", tmp, pmix_var_type_names[var->mbv_type]);
if (0 > ret) {
return PMIX_ERR_OUT_OF_RESOURCE;
}
/* Does this parameter have any synonyms or is it a synonym? */ /* Does this parameter have any synonyms or is it a synonym? */
if (PMIX_VAR_IS_SYNONYM(var[0])) { if (PMIX_VAR_IS_SYNONYM(var[0])) {
asprintf(out[0] + line++, "%ssynonym_of:name:%s", tmp, original->mbv_full_name); ret = asprintf(out[0] + line++, "%ssynonym_of:name:%s", tmp, original->mbv_full_name);
if (0 > ret) {
return PMIX_ERR_OUT_OF_RESOURCE;
}
} else if (pmix_value_array_get_size(&var->mbv_synonyms)) { } else if (pmix_value_array_get_size(&var->mbv_synonyms)) {
for (i = 0 ; i < synonym_count ; ++i) { for (i = 0 ; i < synonym_count ; ++i) {
pmix_mca_base_var_t *synonym; pmix_mca_base_var_t *synonym;
@ -2167,7 +2211,10 @@ int pmix_mca_base_var_dump(int vari, char ***out, pmix_mca_base_var_dump_type_t
continue; continue;
} }
asprintf(out[0] + line++, "%ssynonym:name:%s", tmp, synonym->mbv_full_name); ret = asprintf(out[0] + line++, "%ssynonym:name:%s", tmp, synonym->mbv_full_name);
if (0 > ret) {
return PMIX_ERR_OUT_OF_RESOURCE;
}
} }
} }
@ -2181,25 +2228,37 @@ int pmix_mca_base_var_dump(int vari, char ***out, pmix_mca_base_var_dump_type_t
return PMIX_ERR_OUT_OF_RESOURCE; return PMIX_ERR_OUT_OF_RESOURCE;
} }
asprintf (out[0], "%s \"%s\" (current value: \"%s\", data source: %s, level: %d %s, type: %s", ret = asprintf (out[0], "%s \"%s\" (current value: \"%s\", data source: %s, level: %d %s, type: %s",
PMIX_VAR_IS_DEFAULT_ONLY(var[0]) ? "informational" : "parameter", PMIX_VAR_IS_DEFAULT_ONLY(var[0]) ? "informational" : "parameter",
full_name, value_string, source_string, var->mbv_info_lvl + 1, full_name, value_string, source_string, var->mbv_info_lvl + 1,
info_lvl_strings[var->mbv_info_lvl], pmix_var_type_names[var->mbv_type]); info_lvl_strings[var->mbv_info_lvl], pmix_var_type_names[var->mbv_type]);
if (0 > ret) {
return PMIX_ERR_OUT_OF_RESOURCE;
}
tmp = out[0][0]; tmp = out[0][0];
if (PMIX_VAR_IS_DEPRECATED(var[0])) { if (PMIX_VAR_IS_DEPRECATED(var[0])) {
asprintf (out[0], "%s, deprecated", tmp); ret = asprintf (out[0], "%s, deprecated", tmp);
free (tmp); free (tmp);
if (0 > ret) {
return PMIX_ERR_OUT_OF_RESOURCE;
}
tmp = out[0][0]; tmp = out[0][0];
} }
/* Does this parameter have any synonyms or is it a synonym? */ /* Does this parameter have any synonyms or is it a synonym? */
if (PMIX_VAR_IS_SYNONYM(var[0])) { if (PMIX_VAR_IS_SYNONYM(var[0])) {
asprintf(out[0], "%s, synonym of: %s)", tmp, original->mbv_full_name); ret = asprintf(out[0], "%s, synonym of: %s)", tmp, original->mbv_full_name);
free (tmp); free (tmp);
if (0 > ret) {
return PMIX_ERR_OUT_OF_RESOURCE;
}
} else if (synonym_count) { } else if (synonym_count) {
asprintf(out[0], "%s, synonyms: ", tmp); ret = asprintf(out[0], "%s, synonyms: ", tmp);
free (tmp); free (tmp);
if (0 > ret) {
return PMIX_ERR_OUT_OF_RESOURCE;
}
for (i = 0 ; i < synonym_count ; ++i) { for (i = 0 ; i < synonym_count ; ++i) {
pmix_mca_base_var_t *synonym; pmix_mca_base_var_t *synonym;
@ -2211,21 +2270,30 @@ int pmix_mca_base_var_dump(int vari, char ***out, pmix_mca_base_var_dump_type_t
tmp = out[0][0]; tmp = out[0][0];
if (synonym_count == i+1) { if (synonym_count == i+1) {
asprintf(out[0], "%s%s)", tmp, synonym->mbv_full_name); ret = asprintf(out[0], "%s%s)", tmp, synonym->mbv_full_name);
} else { } else {
asprintf(out[0], "%s%s, ", tmp, synonym->mbv_full_name); ret = asprintf(out[0], "%s%s, ", tmp, synonym->mbv_full_name);
} }
free(tmp); free(tmp);
if (0 > ret) {
return PMIX_ERR_OUT_OF_RESOURCE;
}
} }
} else { } else {
asprintf(out[0], "%s)", tmp); ret = asprintf(out[0], "%s)", tmp);
free(tmp); free(tmp);
if (0 > ret) {
return PMIX_ERR_OUT_OF_RESOURCE;
}
} }
line++; line++;
if (var->mbv_description) { if (var->mbv_description) {
asprintf(out[0] + line++, "%s", var->mbv_description); ret = asprintf(out[0] + line++, "%s", var->mbv_description);
if (0 > ret) {
return PMIX_ERR_OUT_OF_RESOURCE;
}
} }
if (NULL != var->mbv_enumerator) { if (NULL != var->mbv_enumerator) {
@ -2233,8 +2301,11 @@ int pmix_mca_base_var_dump(int vari, char ***out, pmix_mca_base_var_dump_type_t
ret = var->mbv_enumerator->dump(var->mbv_enumerator, &values); ret = var->mbv_enumerator->dump(var->mbv_enumerator, &values);
if (PMIX_SUCCESS == ret) { if (PMIX_SUCCESS == ret) {
asprintf (out[0] + line++, "Valid values: %s", values); ret = asprintf (out[0] + line++, "Valid values: %s", values);
free (values); free (values);
if (0 > ret) {
return PMIX_ERR_OUT_OF_RESOURCE;
}
} }
} }
} else if (PMIX_MCA_BASE_VAR_DUMP_SIMPLE == output_type) { } else if (PMIX_MCA_BASE_VAR_DUMP_SIMPLE == output_type) {
@ -2245,7 +2316,10 @@ int pmix_mca_base_var_dump(int vari, char ***out, pmix_mca_base_var_dump_type_t
return PMIX_ERR_OUT_OF_RESOURCE; return PMIX_ERR_OUT_OF_RESOURCE;
} }
asprintf(out[0], "%s=%s (%s)", var->mbv_full_name, value_string, source_string); ret = asprintf(out[0], "%s=%s (%s)", var->mbv_full_name, value_string, source_string);
if (0 > ret) {
return PMIX_ERR_OUT_OF_RESOURCE;
}
} }
free (value_string); free (value_string);

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

@ -362,7 +362,10 @@ pmix_status_t pmix_bfrops_base_pack_float(pmix_buffer_t *buffer, const void *src
char *convert; char *convert;
for (i = 0; i < num_vals; ++i) { for (i = 0; i < num_vals; ++i) {
asprintf(&convert, "%f", ssrc[i]); ret = asprintf(&convert, "%f", ssrc[i]);
if (0 > ret) {
return PMIX_ERR_OUT_OF_RESOURCE;
}
if (PMIX_SUCCESS != (ret = pmix_bfrops_base_pack_string(buffer, &convert, 1, PMIX_STRING))) { if (PMIX_SUCCESS != (ret = pmix_bfrops_base_pack_string(buffer, &convert, 1, PMIX_STRING))) {
free(convert); free(convert);
return ret; return ret;
@ -383,7 +386,10 @@ pmix_status_t pmix_bfrops_base_pack_double(pmix_buffer_t *buffer, const void *sr
char *convert; char *convert;
for (i = 0; i < num_vals; ++i) { for (i = 0; i < num_vals; ++i) {
asprintf(&convert, "%f", ssrc[i]); ret = asprintf(&convert, "%f", ssrc[i]);
if (0 > ret) {
return PMIX_ERR_OUT_OF_RESOURCE;
}
if (PMIX_SUCCESS != (ret = pmix_bfrops_base_pack_string(buffer, &convert, 1, PMIX_STRING))) { if (PMIX_SUCCESS != (ret = pmix_bfrops_base_pack_string(buffer, &convert, 1, PMIX_STRING))) {
free(convert); free(convert);
return ret; return ret;

Разница между файлами не показана из-за своего большого размера Загрузить разницу

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

@ -47,6 +47,7 @@
/* Instantiate the global vars */ /* Instantiate the global vars */
pmix_gds_globals_t pmix_gds_globals = {{{0}}}; pmix_gds_globals_t pmix_gds_globals = {{{0}}};
int pmix_gds_base_output = -1;
static pmix_status_t pmix_gds_close(void) static pmix_status_t pmix_gds_close(void)
{ {
@ -74,13 +75,17 @@ static pmix_status_t pmix_gds_close(void)
static pmix_status_t pmix_gds_open(pmix_mca_base_open_flag_t flags) static pmix_status_t pmix_gds_open(pmix_mca_base_open_flag_t flags)
{ {
pmix_status_t rc;
/* initialize globals */ /* initialize globals */
pmix_gds_globals.initialized = true; pmix_gds_globals.initialized = true;
pmix_gds_globals.all_mods = NULL; pmix_gds_globals.all_mods = NULL;
PMIX_CONSTRUCT(&pmix_gds_globals.actives, pmix_list_t); PMIX_CONSTRUCT(&pmix_gds_globals.actives, pmix_list_t);
/* Open up all available components */ /* Open up all available components */
return pmix_mca_base_framework_components_open(&pmix_gds_base_framework, flags); rc = pmix_mca_base_framework_components_open(&pmix_gds_base_framework, flags);
pmix_gds_base_output = pmix_gds_base_framework.framework_output;
return rc;
} }
PMIX_MCA_BASE_FRAMEWORK_DECLARE(pmix, gds, "PMIx Generalized Data Store", PMIX_MCA_BASE_FRAMEWORK_DECLARE(pmix, gds, "PMIx Generalized Data Store",

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

@ -1945,7 +1945,7 @@ static pmix_status_t dstore_init(pmix_info_t info[], size_t ninfo)
pmix_status_t rc; pmix_status_t rc;
size_t n; size_t n;
char *dstor_tmpdir = NULL; char *dstor_tmpdir = NULL;
size_t tbl_idx; size_t tbl_idx=0;
ns_map_data_t *ns_map = NULL; ns_map_data_t *ns_map = NULL;
pmix_output_verbose(2, pmix_gds_base_framework.framework_output, pmix_output_verbose(2, pmix_gds_base_framework.framework_output,
@ -2679,7 +2679,7 @@ static pmix_status_t dstore_add_nspace(const char *nspace,
size_t ninfo) size_t ninfo)
{ {
pmix_status_t rc; pmix_status_t rc;
size_t tbl_idx; size_t tbl_idx=0;
uid_t jobuid = _jobuid; uid_t jobuid = _jobuid;
char setjobuid = _setjobuid; char setjobuid = _setjobuid;
size_t n; size_t n;

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

@ -46,6 +46,9 @@ BEGIN_C_DECLS
struct pmix_peer_t; struct pmix_peer_t;
struct pmix_nspace_t; struct pmix_nspace_t;
/* backdoor to base verbosity */
PMIX_EXPORT extern int pmix_gds_base_output;
/** /**
* Initialize the module. Returns an error if the module cannot * Initialize the module. Returns an error if the module cannot
* run, success if it can. * run, success if it can.
@ -78,13 +81,16 @@ typedef pmix_status_t (*pmix_gds_base_module_assemb_kvs_req_fn_t)(const pmix_pro
void *cbdata); void *cbdata);
/* define a macro for server keys answer based on peer */ /* define a macro for server keys answer based on peer */
#define PMIX_GDS_ASSEMB_KVS_REQ(s, p, r, k, b, c) \ #define PMIX_GDS_ASSEMB_KVS_REQ(s, p, r, k, b, c) \
do { \ do { \
pmix_gds_base_module_t *_g = (p)->nptr->compat.gds; \ pmix_gds_base_module_t *_g = (p)->nptr->compat.gds; \
(s) = PMIX_SUCCESS; \ (s) = PMIX_SUCCESS; \
if (NULL != _g->assemb_kvs_req) { \ if (NULL != _g->assemb_kvs_req) { \
(s) = _g->assemb_kvs_req(r, k, b, (void*)c); \ pmix_output_verbose(1, pmix_gds_base_output, \
} \ "[%s:%d] GDS ASSEMBLE REQ WITH %s", \
__FILE__, __LINE__, _g->name); \
(s) = _g->assemb_kvs_req(r, k, b, (void*)c); \
} \
} while(0) } while(0)
@ -97,6 +103,9 @@ typedef pmix_status_t (*pmix_gds_base_module_accept_kvs_resp_fn_t)(pmix_buffer_t
pmix_gds_base_module_t *_g = (p)->nptr->compat.gds; \ pmix_gds_base_module_t *_g = (p)->nptr->compat.gds; \
(s) = PMIX_SUCCESS; \ (s) = PMIX_SUCCESS; \
if (NULL != _g->accept_kvs_resp) { \ if (NULL != _g->accept_kvs_resp) { \
pmix_output_verbose(1, pmix_gds_base_output, \
"[%s:%d] GDS ACCEPT RESP WITH %s", \
__FILE__, __LINE__, _g->name); \
(s) = _g->accept_kvs_resp(b); \ (s) = _g->accept_kvs_resp(b); \
} \ } \
} while (0) } while (0)
@ -115,6 +124,9 @@ typedef pmix_status_t (*pmix_gds_base_module_cache_job_info_fn_t)(struct pmix_ns
#define PMIX_GDS_CACHE_JOB_INFO(s, p, n, i, ni) \ #define PMIX_GDS_CACHE_JOB_INFO(s, p, n, i, ni) \
do { \ do { \
pmix_gds_base_module_t *_g = (p)->nptr->compat.gds; \ pmix_gds_base_module_t *_g = (p)->nptr->compat.gds; \
pmix_output_verbose(1, pmix_gds_base_output, \
"[%s:%d] GDS CACHE JOB INFO WITH %s", \
__FILE__, __LINE__, _g->name); \
(s) = _g->cache_job_info((struct pmix_nspace_t*)(n), (i), (ni)); \ (s) = _g->cache_job_info((struct pmix_nspace_t*)(n), (i), (ni)); \
} while(0) } while(0)
@ -153,6 +165,9 @@ typedef pmix_status_t (*pmix_gds_base_module_register_job_info_fn_t)(struct pmix
#define PMIX_GDS_REGISTER_JOB_INFO(s, p, b) \ #define PMIX_GDS_REGISTER_JOB_INFO(s, p, b) \
do { \ do { \
pmix_gds_base_module_t *_g = (p)->nptr->compat.gds; \ pmix_gds_base_module_t *_g = (p)->nptr->compat.gds; \
pmix_output_verbose(1, pmix_gds_base_output, \
"[%s:%d] GDS REG JOB INFO WITH %s", \
__FILE__, __LINE__, _g->name); \
(s) = _g->register_job_info((struct pmix_peer_t*)(p), b); \ (s) = _g->register_job_info((struct pmix_peer_t*)(p), b); \
} while(0) } while(0)
@ -166,10 +181,13 @@ typedef pmix_status_t (*pmix_gds_base_module_store_job_info_fn_t)(const char *ns
pmix_buffer_t *buf); pmix_buffer_t *buf);
/* define a convenience macro for storing job info based on peer */ /* define a convenience macro for storing job info based on peer */
#define PMIX_GDS_STORE_JOB_INFO(s, p, n, b) \ #define PMIX_GDS_STORE_JOB_INFO(s, p, n, b) \
do { \ do { \
pmix_gds_base_module_t *_g = (p)->nptr->compat.gds; \ pmix_gds_base_module_t *_g = (p)->nptr->compat.gds; \
(s) = _g->store_job_info(n, b); \ pmix_output_verbose(1, pmix_gds_base_output, \
"[%s:%d] GDS STORE JOB INFO WITH %s", \
__FILE__, __LINE__, _g->name); \
(s) = _g->store_job_info(n, b); \
} while(0) } while(0)
@ -196,9 +214,12 @@ typedef pmix_status_t (*pmix_gds_base_module_store_fn_t)(const pmix_proc_t *proc
pmix_kval_t *kv); pmix_kval_t *kv);
/* define a convenience macro for storing key-val pairs based on peer */ /* define a convenience macro for storing key-val pairs based on peer */
#define PMIX_GDS_STORE_KV(s, p, pc, sc, k) \ #define PMIX_GDS_STORE_KV(s, p, pc, sc, k) \
do { \ do { \
pmix_gds_base_module_t *_g = (p)->nptr->compat.gds; \ pmix_gds_base_module_t *_g = (p)->nptr->compat.gds; \
pmix_output_verbose(1, pmix_gds_base_output, \
"[%s:%d] GDS STORE KV WITH %s", \
__FILE__, __LINE__, _g->name); \
(s) = _g->store(pc, sc, k); \ (s) = _g->store(pc, sc, k); \
} while(0) } while(0)
@ -237,7 +258,12 @@ typedef pmix_status_t (*pmix_gds_base_module_store_modex_fn_t)(struct pmix_nspac
* b - pointer to pmix_byte_object_t containing the data * b - pointer to pmix_byte_object_t containing the data
*/ */
#define PMIX_GDS_STORE_MODEX(r, n, l, b) \ #define PMIX_GDS_STORE_MODEX(r, n, l, b) \
(r) = (n)->compat.gds->store_modex((struct pmix_nspace_t*)n, l, b) do { \
pmix_output_verbose(1, pmix_gds_base_output, \
"[%s:%d] GDS STORE MODEX WITH %s", \
__FILE__, __LINE__, (n)->compat.gds->name); \
(r) = (n)->compat.gds->store_modex((struct pmix_nspace_t*)n, l, b); \
} while (0)
/** /**
* fetch value corresponding to provided key from within the defined * fetch value corresponding to provided key from within the defined
@ -292,6 +318,9 @@ typedef pmix_status_t (*pmix_gds_base_module_fetch_fn_t)(const pmix_proc_t *proc
#define PMIX_GDS_FETCH_KV(s, p, c) \ #define PMIX_GDS_FETCH_KV(s, p, c) \
do { \ do { \
pmix_gds_base_module_t *_g = (p)->nptr->compat.gds; \ pmix_gds_base_module_t *_g = (p)->nptr->compat.gds; \
pmix_output_verbose(1, pmix_gds_base_output, \
"[%s:%d] GDS FETCH KV WITH %s", \
__FILE__, __LINE__, _g->name); \
(s) = _g->fetch((c)->proc, (c)->scope, (c)->copy, \ (s) = _g->fetch((c)->proc, (c)->scope, (c)->copy, \
(c)->key, (c)->info, (c)->ninfo, \ (c)->key, (c)->info, (c)->ninfo, \
&(c)->kvs); \ &(c)->kvs); \

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

@ -52,6 +52,8 @@ static void do_pdlopen(const char *fname, int flags,
static int pdlopen_open(const char *fname, bool use_ext, bool private_namespace, static int pdlopen_open(const char *fname, bool use_ext, bool private_namespace,
pmix_pdl_handle_t **handle, char **err_msg) pmix_pdl_handle_t **handle, char **err_msg)
{ {
int rc;
assert(handle); assert(handle);
*handle = NULL; *handle = NULL;
@ -76,7 +78,10 @@ static int pdlopen_open(const char *fname, bool use_ext, bool private_namespace,
ext = mca_pdl_pdlopen_component.filename_suffixes[++i]) { ext = mca_pdl_pdlopen_component.filename_suffixes[++i]) {
char *name; char *name;
asprintf(&name, "%s%s", fname, ext); rc = asprintf(&name, "%s%s", fname, ext);
if (0 > rc) {
return PMIX_ERR_NOMEM;
}
if (NULL == name) { if (NULL == name) {
return PMIX_ERR_IN_ERRNO; return PMIX_ERR_IN_ERRNO;
} }
@ -184,7 +189,10 @@ static int pdlopen_foreachfile(const char *search_path,
/* Make the absolute path name */ /* Make the absolute path name */
char *abs_name = NULL; char *abs_name = NULL;
asprintf(&abs_name, "%s/%s", dirs[i], de->d_name); ret = asprintf(&abs_name, "%s/%s", dirs[i], de->d_name);
if (0 > ret) {
return PMIX_ERR_NOMEM;
}
if (NULL == abs_name) { if (NULL == abs_name) {
ret = PMIX_ERR_IN_ERRNO; ret = PMIX_ERR_IN_ERRNO;
goto error; goto error;

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

@ -4,7 +4,7 @@
* Copyright (c) 2007-2010 Cisco Systems, Inc. All rights reserved. * Copyright (c) 2007-2010 Cisco Systems, Inc. All rights reserved.
* Copyright (c) 2007 Sun Microsystem, Inc. All rights reserved. * Copyright (c) 2007 Sun Microsystem, Inc. All rights reserved.
* Copyright (c) 2010 Sandia National Laboratories. All rights reserved. * Copyright (c) 2010 Sandia National Laboratories. All rights reserved.
* Copyright (c) 2016 Intel, Inc. All rights reserved * Copyright (c) 2016-2017 Intel, Inc. All rights reserved.
* $COPYRIGHT$ * $COPYRIGHT$
* *
* Additional copyrights may follow * Additional copyrights may follow
@ -27,27 +27,31 @@
whatever the actual value of the shell variable is. */ whatever the actual value of the shell variable is. */
#define EXPAND_STRING(name) EXPAND_STRING2(name, name) #define EXPAND_STRING(name) EXPAND_STRING2(name, name)
#define EXPAND_STRING2(ompiname, fieldname) \ #define EXPAND_STRING2(ompiname, fieldname) \
do { \ do { \
if (NULL != (start_pos = strstr(retval, "${" #fieldname "}"))) { \ if (NULL != (start_pos = strstr(retval, "${" #fieldname "}"))) { \
tmp = retval; \ tmp = retval; \
*start_pos = '\0'; \ *start_pos = '\0'; \
end_pos = start_pos + strlen("${" #fieldname "}"); \ end_pos = start_pos + strlen("${" #fieldname "}"); \
asprintf(&retval, "%s%s%s", tmp, \ if (0 > asprintf(&retval, "%s%s%s", tmp, \
pmix_pinstall_dirs.ompiname + destdir_offset, \ pmix_pinstall_dirs.ompiname + destdir_offset, \
end_pos); \ end_pos)) { \
free(tmp); \ pmix_output(0, "NOMEM"); \
changed = true; \ } \
} else if (NULL != (start_pos = strstr(retval, "@{" #fieldname "}"))) { \ free(tmp); \
tmp = retval; \ changed = true; \
*start_pos = '\0'; \ } else if (NULL != (start_pos = strstr(retval, "@{" #fieldname "}"))) { \
end_pos = start_pos + strlen("@{" #fieldname "}"); \ tmp = retval; \
asprintf(&retval, "%s%s%s", tmp, \ *start_pos = '\0'; \
pmix_pinstall_dirs.ompiname + destdir_offset, \ end_pos = start_pos + strlen("@{" #fieldname "}"); \
end_pos); \ if (0 > asprintf(&retval, "%s%s%s", tmp, \
free(tmp); \ pmix_pinstall_dirs.ompiname + destdir_offset, \
changed = true; \ end_pos)) { \
} \ pmix_output(0, "NOMEM"); \
} \
free(tmp); \
changed = true; \
} \
} while (0) } while (0)

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

@ -115,7 +115,9 @@ static char* transports_print(uint64_t *unique_key)
* number if the system has a different sized long (8 would be for * number if the system has a different sized long (8 would be for
* sizeof(int) == 4)). * sizeof(int) == 4)).
*/ */
asprintf(&format, "%%0%dx", (int)(sizeof(unsigned int)) * 2); if (0 > asprintf(&format, "%%0%dx", (int)(sizeof(unsigned int)) * 2)) {
return NULL;
}
/* print the first number */ /* print the first number */
int_ptr = (unsigned int*) &unique_key[0]; int_ptr = (unsigned int*) &unique_key[0];

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

@ -553,14 +553,14 @@ static pmix_status_t setup_listener(pmix_info_t info[], size_t ninfo,
} else if (AF_INET6 == mca_ptl_tcp_component.connection.ss_family) { } else if (AF_INET6 == mca_ptl_tcp_component.connection.ss_family) {
prefix = "tcp6://"; prefix = "tcp6://";
myport = ntohs(((struct sockaddr_in6*) &mca_ptl_tcp_component.connection)->sin6_port); myport = ntohs(((struct sockaddr_in6*) &mca_ptl_tcp_component.connection)->sin6_port);
inet_ntop(AF_INET6, &((struct sockaddr_in6*) &mca_ptl_tcp_component.connection)->sin6_addr, inet_ntop(AF_INET6, &((struct sockaddr_in6*) &mca_ptl_tcp_component.connection)->sin6_addr,
myconnhost, PMIX_MAXHOSTNAMELEN); myconnhost, PMIX_MAXHOSTNAMELEN);
} else { } else {
goto sockerror; goto sockerror;
} }
asprintf(&lt->uri, "%s.%d;%s%s:%d", pmix_globals.myid.nspace, pmix_globals.myid.rank, prefix, myconnhost, myport); rc = asprintf(&lt->uri, "%s.%d;%s%s:%d", pmix_globals.myid.nspace, pmix_globals.myid.rank, prefix, myconnhost, myport);
if (NULL == lt->uri) { if (0 > rc || NULL == lt->uri) {
CLOSE_THE_SOCKET(lt->socket); CLOSE_THE_SOCKET(lt->socket);
goto sockerror; goto sockerror;
} }
@ -753,7 +753,7 @@ static void connection_handler(int sd, short args, void *cbdata)
pmix_pending_connection_t *pnd = (pmix_pending_connection_t*)cbdata; pmix_pending_connection_t *pnd = (pmix_pending_connection_t*)cbdata;
pmix_ptl_hdr_t hdr; pmix_ptl_hdr_t hdr;
pmix_peer_t *peer; pmix_peer_t *peer;
pmix_rank_t rank; pmix_rank_t rank=0;
pmix_status_t rc; pmix_status_t rc;
char *msg, *mg, *version; char *msg, *mg, *version;
char *sec, *bfrops, *gds; char *sec, *bfrops, *gds;
@ -949,7 +949,7 @@ static void connection_handler(int sd, short args, void *cbdata)
proc_type = PMIX_PROC_V20; proc_type = PMIX_PROC_V20;
bfrops = "v20"; bfrops = "v20";
bftype = pmix_bfrops_globals.default_type; // we can't know any better bftype = pmix_bfrops_globals.default_type; // we can't know any better
gds = "hash"; gds = NULL;
} else { } else {
proc_type = PMIX_PROC_V21; proc_type = PMIX_PROC_V21;
/* extract the name of the bfrops module they used */ /* extract the name of the bfrops module they used */
@ -1136,9 +1136,14 @@ static void connection_handler(int sd, short args, void *cbdata)
peer->nptr->compat.type = bftype; peer->nptr->compat.type = bftype;
/* set the gds module to match this peer */ /* set the gds module to match this peer */
PMIX_INFO_LOAD(&ginfo, PMIX_GDS_MODULE, gds, PMIX_STRING); if (NULL != gds) {
PMIX_INFO_LOAD(&ginfo, PMIX_GDS_MODULE, gds, PMIX_STRING);
peer->nptr->compat.gds = pmix_gds_base_assign_module(&ginfo, 1);
PMIX_INFO_DESTRUCT(&ginfo);
} else {
peer->nptr->compat.gds = pmix_gds_base_assign_module(NULL, 0);
}
free(msg); // can now release the data buffer free(msg); // can now release the data buffer
peer->nptr->compat.gds = pmix_gds_base_assign_module(&ginfo, 1);
if (NULL == peer->nptr->compat.gds) { if (NULL == peer->nptr->compat.gds) {
info->proc_cnt--; info->proc_cnt--;
pmix_pointer_array_set_item(&pmix_server_globals.clients, peer->index, NULL); pmix_pointer_array_set_item(&pmix_server_globals.clients, peer->index, NULL);

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

@ -128,6 +128,7 @@ static pmix_status_t connect_to_peer(struct pmix_peer_t *peer,
/* must use the v12 bfrops module */ /* must use the v12 bfrops module */
pmix_globals.mypeer->nptr->compat.bfrops = pmix_bfrops_base_assign_module("v12"); pmix_globals.mypeer->nptr->compat.bfrops = pmix_bfrops_base_assign_module("v12");
if (NULL == pmix_globals.mypeer->nptr->compat.bfrops) { if (NULL == pmix_globals.mypeer->nptr->compat.bfrops) {
pmix_argv_free(uri);
return PMIX_ERR_INIT; return PMIX_ERR_INIT;
} }
/* the server will be using the same */ /* the server will be using the same */
@ -515,11 +516,6 @@ void pmix_usock_send_handler(int sd, short flags, void *cbdata)
msg->hdr.tag = ntohl(msg->hdr.tag); msg->hdr.tag = ntohl(msg->hdr.tag);
nbytes = msg->hdr.nbytes; nbytes = msg->hdr.nbytes;
msg->hdr.nbytes = ntohl(nbytes); msg->hdr.nbytes = ntohl(nbytes);
} else {
msg->hdr.pindex = msg->hdr.pindex;
msg->hdr.tag = msg->hdr.tag;
nbytes = msg->hdr.nbytes;
msg->hdr.nbytes = nbytes;
} }
pmix_output_verbose(2, pmix_ptl_base_framework.framework_output, pmix_output_verbose(2, pmix_ptl_base_framework.framework_output,
"usock:send_handler SENDING HEADER WITH MSG IDX %d TAG %d SIZE %lu", "usock:send_handler SENDING HEADER WITH MSG IDX %d TAG %d SIZE %lu",

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

@ -645,7 +645,7 @@ static pmix_status_t _satisfy_request(pmix_nspace_t *nptr, pmix_rank_t rank,
PMIX_DESTRUCT(&cb); PMIX_DESTRUCT(&cb);
return rc; return rc;
} }
if (PMIX_PROC_IS_V1(peer)) { if (PMIX_PROC_IS_V1(cd->peer)) {
/* if the client is using v1, then it expects the /* if the client is using v1, then it expects the
* data returned to it in a different order than v2 * data returned to it in a different order than v2
* - so we have to do a little gyration */ * - so we have to do a little gyration */

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

@ -13,7 +13,7 @@
* Copyright (c) 2010 IBM Corporation. All rights reserved. * Copyright (c) 2010 IBM Corporation. All rights reserved.
* Copyright (c) 2012-2013 Los Alamos National Security, LLC. * Copyright (c) 2012-2013 Los Alamos National Security, LLC.
* All rights reserved. * All rights reserved.
* Copyright (c) 2014-2016 Intel, Inc. All rights reserved. * Copyright (c) 2014-2017 Intel, Inc. All rights reserved.
* Copyright (c) 2016 University of Houston. All rights reserved. * Copyright (c) 2016 University of Houston. All rights reserved.
* $COPYRIGHT$ * $COPYRIGHT$
* *
@ -401,7 +401,9 @@ char* pmix_find_absolute_path( char* app_name )
if( NULL != abs_app_name ) { if( NULL != abs_app_name ) {
char* resolved_path = (char*)malloc(PMIX_PATH_MAX); char* resolved_path = (char*)malloc(PMIX_PATH_MAX);
realpath( abs_app_name, resolved_path ); if (NULL == realpath( abs_app_name, resolved_path )) {
return NULL;
}
if( abs_app_name != app_name ) free(abs_app_name); if( abs_app_name != app_name ) free(abs_app_name);
return resolved_path; return resolved_path;
} }

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

@ -161,11 +161,15 @@ static int open_file(const char *base, const char *topic)
filename = pmix_os_path( false, search_dirs[i], base, NULL ); filename = pmix_os_path( false, search_dirs[i], base, NULL );
pmix_show_help_yyin = fopen(filename, "r"); pmix_show_help_yyin = fopen(filename, "r");
if (NULL == pmix_show_help_yyin) { if (NULL == pmix_show_help_yyin) {
asprintf(&err_msg, "%s: %s", filename, strerror(errno)); if (0 > asprintf(&err_msg, "%s: %s", filename, strerror(errno))) {
return PMIX_ERR_OUT_OF_RESOURCE;
}
base_len = strlen(base); base_len = strlen(base);
if (4 > base_len || 0 != strcmp(base + base_len - 4, ".txt")) { if (4 > base_len || 0 != strcmp(base + base_len - 4, ".txt")) {
free(filename); free(filename);
asprintf(&filename, "%s%s%s.txt", search_dirs[i], PMIX_PATH_SEP, base); if (0 > asprintf(&filename, "%s%s%s.txt", search_dirs[i], PMIX_PATH_SEP, base)) {
return PMIX_ERR_OUT_OF_RESOURCE;
}
pmix_show_help_yyin = fopen(filename, "r"); pmix_show_help_yyin = fopen(filename, "r");
} }
} }

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

@ -218,10 +218,14 @@ void parse_cmd(int argc, char **argv, test_params *params)
* <pmix-root-dir>/test/.libs/pmix_client * <pmix-root-dir>/test/.libs/pmix_client
* we need to do a step back in directory tree. * we need to do a step back in directory tree.
*/ */
asprintf(&params->binary, "%s/../pmix_client", argv[0]); if (0 > asprintf(&params->binary, "%s/../pmix_client", argv[0])) {
exit(1);
}
*basename = '/'; *basename = '/';
} else { } else {
asprintf(&params->binary, "pmix_client"); if (0 > asprintf(&params->binary, "pmix_client")) {
exit(1);
}
} }
} }

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

@ -1,5 +1,5 @@
/* /*
* Copyright (c) 2015 Intel, Inc. All rights reserved. * Copyright (c) 2015-2017 Intel, Inc. All rights reserved.
* Copyright (c) 2015-2017 Mellanox Technologies, Inc. * Copyright (c) 2015-2017 Mellanox Technologies, Inc.
* All rights reserved. * All rights reserved.
* Copyright (c) 2016 Research Organization for Information Science * Copyright (c) 2016 Research Organization for Information Science
@ -250,7 +250,9 @@ int launch_clients(int num_procs, char *binary, char *** client_env, char ***bas
if (cli_info[counter].pid == 0) { if (cli_info[counter].pid == 0) {
if( !TEST_VERBOSE_GET() ){ if( !TEST_VERBOSE_GET() ){
// Hide clients stdout // Hide clients stdout
freopen("/dev/null","w", stdout); if (NULL == freopen("/dev/null","w", stdout)) {
exit(1);
}
} }
execve(binary, client_argv, *client_env); execve(binary, client_argv, *client_env);
/* Does not return */ /* Does not return */