Skip to content

Commit afe7f69

Browse files
author
Ralph Castain
authored
Merge pull request #4184 from rhc54/topic/pmix
Update to track PMIx master
2 parents ff3ff28 + cbc114e commit afe7f69

File tree

25 files changed

+648
-254
lines changed

25 files changed

+648
-254
lines changed

opal/mca/pmix/pmix2x/pmix/VERSION

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ greek=
3030
# command, or with the date (if "git describe" fails) in the form of
3131
# "date<date>".
3232

33-
repo_rev=git3920e33
33+
repo_rev=gitaffab34
3434

3535
# If tarball_version is not empty, it is used as the version string in
3636
# the tarball filename, regardless of all other versions listed in
@@ -44,7 +44,7 @@ tarball_version=
4444

4545
# The date when this release was created
4646

47-
date="Sep 01, 2017"
47+
date="Sep 06, 2017"
4848

4949
# The shared library version of each of PMIx's public libraries.
5050
# These versions are maintained in accordance with the "Library

opal/mca/pmix/pmix2x/pmix/config/pmix.m4

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,14 @@ AC_DEFUN([PMIX_SETUP_CORE],[
3434

3535
AC_REQUIRE([AC_USE_SYSTEM_EXTENSIONS])
3636
AC_REQUIRE([AC_CANONICAL_TARGET])
37-
AC_REQUIRE([AC_PROG_CC])
37+
38+
# AM_PROG_CC_C_O AC_REQUIREs AC_PROG_CC, so we have to be a little
39+
# careful about ordering here, and AC_REQUIRE these things so that
40+
# they get stamped out in the right order.
41+
AC_REQUIRE([_PMIX_START_SETUP_CC])
42+
AC_REQUIRE([_PMIX_PROG_CC])
43+
AC_REQUIRE([AM_PROG_CC_C_O])
44+
3845

3946
# If no prefix was defined, set a good value
4047
m4_ifval([$1],

opal/mca/pmix/pmix2x/pmix/config/pmix_setup_cc.m4

Lines changed: 3 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ dnl Copyright (c) 2012-2017 Los Alamos National Security, LLC. All rights
1616
dnl reserved.
1717
dnl Copyright (c) 2015 Research Organization for Information Science
1818
dnl and Technology (RIST). All rights reserved.
19-
dnl Copyright (c) 2015-2016 Intel, Inc. All rights reserved.
19+
dnl Copyright (c) 2015-2017 Intel, Inc. All rights reserved.
2020
dnl $COPYRIGHT$
2121
dnl
2222
dnl Additional copyrights may follow
@@ -29,22 +29,14 @@ dnl
2929
# Do everything required to setup the C compiler. Safe to AC_REQUIRE
3030
# this macro.
3131
AC_DEFUN([PMIX_SETUP_CC],[
32-
# AM_PROG_CC_C_O AC_REQUIREs AC_PROG_CC, so we have to be a little
33-
# careful about ordering here, and AC_REQUIRE these things so that
34-
# they get stamped out in the right order.
3532

36-
AC_REQUIRE([_PMIX_START_SETUP_CC])
37-
AC_REQUIRE([_PMIX_PROG_CC])
38-
AC_REQUIRE([AM_PROG_CC_C_O])
39-
40-
# We require a C99 compiant compiler
33+
# We require a C99 compliant compiler
4134
# The result of AC_PROG_CC_C99 is stored in ac_cv_prog_cc_c99
4235
if test "x$ac_cv_prog_cc_c99" = xno ; then
4336
AC_MSG_WARN([PMIx requires a C99 compiler])
4437
AC_MSG_ERROR([Aborting.])
4538
fi
4639

47-
4840
PMIX_C_COMPILER_VENDOR([pmix_c_vendor])
4941

5042
# Check for standard headers, needed here because needed before
@@ -309,6 +301,7 @@ AC_DEFUN([PMIX_SETUP_CC],[
309301
AC_DEFUN([_PMIX_START_SETUP_CC],[
310302
pmix_show_subtitle "C compiler and preprocessor"
311303

304+
AC_REQUIRE([AC_PROG_CC])
312305
# $%@#!@#% AIX!! This has to be called before anything invokes the C
313306
# compiler.
314307
dnl AC_AIX

opal/mca/pmix/pmix2x/pmix/examples/debugger.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -334,7 +334,9 @@ int main(int argc, char **argv)
334334
/* setup the executable */
335335
app[0].cmd = strdup("client");
336336
PMIX_ARGV_APPEND(rc, app[0].argv, "./client");
337-
getcwd(cwd, 1024); // point us to our current directory
337+
if (NULL == getcwd(cwd, 1024)) { // point us to our current directory
338+
goto done;
339+
}
338340
app[0].cwd = strdup(cwd);
339341
app[0].maxprocs = 2;
340342
/* provide job-level directives so the apps do what the user requested */

opal/mca/pmix/pmix2x/pmix/src/client/pmix_client.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -482,15 +482,14 @@ PMIX_EXPORT pmix_status_t PMIx_Init(pmix_proc_t *proc,
482482
if (NULL != evar) {
483483
PMIX_INFO_LOAD(&ginfo, PMIX_GDS_MODULE, evar, PMIX_STRING);
484484
pmix_client_globals.myserver->nptr->compat.gds = pmix_gds_base_assign_module(&ginfo, 1);
485+
PMIX_INFO_DESTRUCT(&ginfo);
485486
} else {
486487
pmix_client_globals.myserver->nptr->compat.gds = pmix_gds_base_assign_module(NULL, 0);
487488
}
488489
if (NULL == pmix_client_globals.myserver->nptr->compat.gds) {
489-
PMIX_INFO_DESTRUCT(&ginfo);
490490
PMIX_RELEASE_THREAD(&pmix_global_lock);
491491
return PMIX_ERR_INIT;
492492
}
493-
PMIX_INFO_DESTRUCT(&ginfo);
494493
/* now select a GDS module for our own internal use - the user may
495494
* have passed down a directive for this purpose. If they did, then
496495
* use it. Otherwise, we want the "hash" module */

opal/mca/pmix/pmix2x/pmix/src/event/pmix_event_notification.c

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,7 @@ static pmix_status_t notify_server_of_event(pmix_status_t status,
109109
pmix_op_cbfunc_t cbfunc, void *cbdata)
110110
{
111111
pmix_status_t rc;
112-
pmix_buffer_t *msg;
112+
pmix_buffer_t *msg = NULL;
113113
pmix_cmd_t cmd = PMIX_NOTIFY_CMD;
114114
pmix_cb_t *cb;
115115
pmix_event_chain_t *chain;
@@ -231,7 +231,7 @@ static pmix_status_t notify_server_of_event(pmix_status_t status,
231231
PMIX_RELEASE(rbout);
232232
}
233233

234-
if (PMIX_RANGE_PROC_LOCAL != range) {
234+
if (PMIX_RANGE_PROC_LOCAL != range && NULL != msg) {
235235
/* create a callback object as we need to pass it to the
236236
* recv routine so we know which callback to use when
237237
* 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,
263263
cleanup:
264264
pmix_output_verbose(2, pmix_globals.debug_output,
265265
"client: notifying server - unable to send");
266-
PMIX_RELEASE(msg);
266+
if (NULL != msg) {
267+
PMIX_RELEASE(msg);
268+
}
267269
/* we were unable to send anything, so we just return the error */
268270
return rc;
269271
}

opal/mca/pmix/pmix2x/pmix/src/event/pmix_event_registration.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -428,7 +428,7 @@ static void reg_event_hdlr(int sd, short args, void *cbdata)
428428
void *cbobject = NULL;
429429
pmix_data_range_t range = PMIX_RANGE_UNDEF;
430430
pmix_proc_t *parray = NULL;
431-
size_t nprocs;
431+
size_t nprocs = 0;
432432

433433
/* need to acquire the object from its originating thread */
434434
PMIX_ACQUIRE_OBJECT(cd);
@@ -527,7 +527,7 @@ static void reg_event_hdlr(int sd, short args, void *cbdata)
527527
evhdlr->index = index;
528528
++pmix_globals.events.nhdlrs;
529529
evhdlr->rng.range = range;
530-
if (NULL != parray) {
530+
if (NULL != parray && 0 < nprocs) {
531531
evhdlr->rng.nprocs = nprocs;
532532
PMIX_PROC_CREATE(evhdlr->rng.procs, nprocs);
533533
if (NULL == evhdlr->rng.procs) {
@@ -601,7 +601,7 @@ static void reg_event_hdlr(int sd, short args, void *cbdata)
601601
evhdlr->precedence = location;
602602
evhdlr->locator = locator;
603603
evhdlr->rng.range = range;
604-
if (NULL != parray) {
604+
if (NULL != parray && 0 < nprocs) {
605605
evhdlr->rng.nprocs = nprocs;
606606
PMIX_PROC_CREATE(evhdlr->rng.procs, nprocs);
607607
if (NULL == evhdlr->rng.procs) {

opal/mca/pmix/pmix2x/pmix/src/mca/base/pmix_mca_base_framework.c

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
* Copyright (c) 2012-2015 Los Alamos National Security, LLC. All rights
44
* reserved.
55
* Copyright (c) 2015 Cisco Systems, Inc. All rights reserved.
6-
* Copyright (c) 2016 Intel, Inc. All rights reserved
6+
* Copyright (c) 2016-2017 Intel, Inc. All rights reserved.
77
* $COPYRIGHT$
88
*
99
* Additional copyrights may follow
@@ -81,8 +81,12 @@ int pmix_mca_base_framework_register (struct pmix_mca_base_framework_t *framewor
8181
return ret;
8282
}
8383

84-
asprintf (&desc, "Default selection set of components for the %s framework (<none>"
85-
" means use all components that can be found)", framework->framework_name);
84+
ret = asprintf (&desc, "Default selection set of components for the %s framework (<none>"
85+
" means use all components that can be found)", framework->framework_name);
86+
if (0 > ret) {
87+
return PMIX_ERR_OUT_OF_RESOURCE;
88+
}
89+
8690
ret = pmix_mca_base_var_register (framework->framework_project, framework->framework_name,
8791
NULL, NULL, desc, PMIX_MCA_BASE_VAR_TYPE_STRING, NULL, 0,
8892
PMIX_MCA_BASE_VAR_FLAG_SETTABLE, PMIX_INFO_LVL_2,

opal/mca/pmix/pmix2x/pmix/src/mca/base/pmix_mca_base_open.c

Lines changed: 16 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,7 @@ int pmix_mca_base_open(void)
6969
pmix_output_stream_t lds;
7070
char hostname[64];
7171
int var_id;
72+
int rc;
7273

7374
if (pmix_mca_base_opened++) {
7475
return PMIX_SUCCESS;
@@ -77,17 +78,24 @@ int pmix_mca_base_open(void)
7778
/* define the system and user default paths */
7879
#if PMIX_WANT_HOME_CONFIG_FILES
7980
pmix_mca_base_system_default_path = strdup(pmix_pinstall_dirs.pmixlibdir);
80-
asprintf(&pmix_mca_base_user_default_path, "%s"PMIX_PATH_SEP".pmix"PMIX_PATH_SEP"components", pmix_home_directory());
81+
rc = asprintf(&pmix_mca_base_user_default_path, "%s"PMIX_PATH_SEP".pmix"PMIX_PATH_SEP"components", pmix_home_directory());
8182
#else
82-
asprintf(&pmix_mca_base_system_default_path, "%s", pmix_pinstall_dirs.pmixlibdir);
83+
rc = asprintf(&pmix_mca_base_system_default_path, "%s", pmix_pinstall_dirs.pmixlibdir);
8384
#endif
8485

86+
if (0 > rc) {
87+
return PMIX_ERR_OUT_OF_RESOURCE;
88+
}
89+
8590
/* see if the user wants to override the defaults */
8691
if (NULL == pmix_mca_base_user_default_path) {
8792
value = strdup(pmix_mca_base_system_default_path);
8893
} else {
89-
asprintf(&value, "%s%c%s", pmix_mca_base_system_default_path,
90-
PMIX_ENV_SEP, pmix_mca_base_user_default_path);
94+
rc = asprintf(&value, "%s%c%s", pmix_mca_base_system_default_path,
95+
PMIX_ENV_SEP, pmix_mca_base_user_default_path);
96+
if (0 > rc) {
97+
return PMIX_ERR_OUT_OF_RESOURCE;
98+
}
9199
}
92100

93101
pmix_mca_base_component_path = value;
@@ -139,7 +147,10 @@ int pmix_mca_base_open(void)
139147
set_defaults(&lds);
140148
}
141149
gethostname(hostname, 64);
142-
asprintf(&lds.lds_prefix, "[%s:%05d] ", hostname, getpid());
150+
rc = asprintf(&lds.lds_prefix, "[%s:%05d] ", hostname, getpid());
151+
if (0 > rc) {
152+
return PMIX_ERR_OUT_OF_RESOURCE;
153+
}
143154
pmix_output_reopen(0, &lds);
144155
pmix_output_verbose (PMIX_MCA_BASE_VERBOSE_COMPONENT, 0,
145156
"mca: base: opening components at %s", pmix_mca_base_component_path);

0 commit comments

Comments
 (0)