Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 14 additions & 1 deletion opal/mca/pmix/pmix2x/pmix/NEWS
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,24 @@ example, a bug might be fixed in the master, and then moved to the
current release as well as the "stable" bug fix release branch.


2.1.3 -- TBD
2.1.4 -- 18 Sep 2018
----------------------
- Updated configury to silence warnings on older compilers
- Implement job control and sensor APIs
- Update sensor support
- Fix a few bugs in the event notification system and provide some
missing implementation (support for specifying target procs to
receive the event).
- Add PMIX_PROC_TERMINATED constant
- Properly deal with EOPNOTSUPP from getsockopt() on ARM


2.1.3 -- 23 Aug 2018
----------------------
- Fixed memory corruption bug in event notification
system due to uninitialized variable
- Add numeric version definition
- Transfer all cached data to client dstore upon first connect


2.1.2 -- 6 July 2018
Expand Down
10 changes: 5 additions & 5 deletions opal/mca/pmix/pmix2x/pmix/VERSION
Original file line number Diff line number Diff line change
Expand Up @@ -15,22 +15,22 @@

major=2
minor=1
release=3
release=4

# greek is used for alpha or beta release tags. If it is non-empty,
# it will be appended to the version number. It does not have to be
# numeric. Common examples include a1 (alpha release 1), b1 or (beta release 1).
# The only requirement is that it must be entirely printable ASCII
# characters and have no white space.

greek=rc1
greek=

# If repo_rev is empty, then the repository version number will be
# obtained during "make dist" via the "git describe --tags --always"
# command, or with the date (if "git describe" fails) in the form of
# "date<date>".

repo_rev=git1b0b577
repo_rev=git1d605654

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

# The date when this release was created

date="Jul 19, 2018"
date="Sep 18, 2018"

# The shared library version of each of PMIx's public libraries.
# These versions are maintained in accordance with the "Library
Expand Down Expand Up @@ -75,6 +75,6 @@ date="Jul 19, 2018"
# Version numbers are described in the Libtool current:revision:age
# format.

libpmix_so_version=3:13:1
libpmix_so_version=3:14:1
libpmi_so_version=1:0:0
libpmi2_so_version=1:0:0
72 changes: 44 additions & 28 deletions opal/mca/pmix/pmix2x/pmix/config/pmix_setup_cc.m4
Original file line number Diff line number Diff line change
Expand Up @@ -25,52 +25,44 @@ dnl $HEADER$
dnl

AC_DEFUN([PMIX_CC_HELPER],[
PMIX_VAR_SCOPE_PUSH([pmix_prog_cc_c11_helper_tmp])
PMIX_VAR_SCOPE_PUSH([pmix_cc_helper_result])
AC_MSG_CHECKING([$1])

pmix_prog_cc_c11_helper_tmp=0
AC_LINK_IFELSE([AC_LANG_PROGRAM([$3],[$4])],
[$2=1
pmix_cc_helper_result=yes],
[$2=0
pmix_cc_helper_result=no])

AC_LINK_IFELSE([AC_LANG_PROGRAM([$3],[$4])],[
$2=yes
pmix_prog_cc_c11_helper_tmp=1], [$2=no])

AC_DEFINE_UNQUOTED([$5], [$pmix_prog_cc_c11_helper_tmp], [$6])

AC_MSG_RESULT([$$2])
AC_MSG_RESULT([$pmix_cc_helper_result])
PMIX_VAR_SCOPE_POP
])


AC_DEFUN([PMIX_PROG_CC_C11_HELPER],[
PMIX_VAR_SCOPE_PUSH([pmix_prog_cc_c11_helper_CFLAGS_save pmix_prog_cc_c11_helper__Thread_local_available pmix_prog_cc_c11_helper_atomic_var_available pmix_prog_cc_c11_helper__Atomic_available pmix_prog_cc_c11_helper__static_assert_available pmix_prog_cc_c11_helper__Generic_available])
PMIX_VAR_SCOPE_PUSH([pmix_prog_cc_c11_helper_CFLAGS_save])

pmix_prog_cc_c11_helper_CFLAGS_save=$CFLAGS
CFLAGS="$CFLAGS $1"

PMIX_CC_HELPER([if $CC $1 supports C11 _Thread_local], [pmix_prog_cc_c11_helper__Thread_local_available],
[],[[static _Thread_local int foo = 1;++foo;]], [PMIX_C_HAVE__THREAD_LOCAL],
[Whether C compiler supports __Thread_local])
[],[[static _Thread_local int foo = 1;++foo;]])

PMIX_CC_HELPER([if $CC $1 supports C11 atomic variables], [pmix_prog_cc_c11_helper_atomic_var_available],
[[#include <stdatomic.h>]], [[static atomic_long foo = 1;++foo;]], [PMIX_C_HAVE_ATOMIC_CONV_VAR],
[Whether C compiler support atomic convenience variables in stdatomic.h])
[[#include <stdatomic.h>]], [[static atomic_long foo = 1;++foo;]])

PMIX_CC_HELPER([if $CC $1 supports C11 _Atomic keyword], [pmix_prog_cc_c11_helper__Atomic_available],
[[#include <stdatomic.h>]],[[static _Atomic long foo = 1;++foo;]], [PMIX_C_HAVE__ATOMIC],
[Whether C compiler supports __Atomic keyword])
[[#include <stdatomic.h>]],[[static _Atomic long foo = 1;++foo;]])

PMIX_CC_HELPER([if $CC $1 supports C11 _Generic keyword], [pmix_prog_cc_c11_helper__Generic_available],
[[#define FOO(x) (_Generic (x, int: 1))]], [[static int x, y; y = FOO(x);]], [PMIX_C_HAVE__GENERIC],
[Whether C compiler supports __Generic keyword])
[[#define FOO(x) (_Generic (x, int: 1))]], [[static int x, y; y = FOO(x);]])

PMIX_CC_HELPER([if $CC $1 supports C11 _Static_assert], [pmix_prog_cc_c11_helper__static_assert_available],
[[#include <stdint.h>]],[[_Static_assert(sizeof(int64_t) == 8, "WTH");]], [PMIX_C_HAVE__STATIC_ASSERT],
[Whether C compiler support _Static_assert keyword])
[[#include <stdint.h>]],[[_Static_assert(sizeof(int64_t) == 8, "WTH");]])

dnl At this time Open MPI only needs thread local and the atomic convenience types for C11 support. These
dnl will likely be required in the future.
AS_IF([test "x$pmix_prog_cc_c11_helper__Thread_local_available" = "xyes" && test "x$pmix_prog_cc_c11_helper_atomic_var_available" = "xyes"],
[$2], [$3])
AS_IF([test $pmix_prog_cc_c11_helper__Thread_local_available -eq 1 && test $pmix_prog_cc_c11_helper_atomic_var_available -eq 1],
[$2],
[$3])

CFLAGS=$pmix_prog_cc_c11_helper_CFLAGS_save

Expand Down Expand Up @@ -136,6 +128,8 @@ AC_DEFUN([PMIX_SETUP_CC],[
AC_REQUIRE([_PMIX_PROG_CC])
AC_REQUIRE([AM_PROG_CC_C_O])

PMIX_VAR_SCOPE_PUSH([pmix_prog_cc_c11_helper__Thread_local_available pmix_prog_cc_c11_helper_atomic_var_available pmix_prog_cc_c11_helper__Atomic_available pmix_prog_cc_c11_helper__static_assert_available pmix_prog_cc_c11_helper__Generic_available pmix_prog_cc__thread_available])

PMIX_PROG_CC_C11

if test $pmix_cv_c11_supported = no ; then
Expand All @@ -157,11 +151,32 @@ AC_DEFUN([PMIX_SETUP_CC],[
fi

# Check if compiler support __thread
PMIX_VAR_SCOPE_PUSH([pmix_prog_cc__thread_available])
PMIX_CC_HELPER([if $CC $1 supports __thread], [pmix_prog_cc__thread_available],
[],[[static __thread int foo = 1;++foo;]], [PMIX_C_HAVE___THREAD],
[Whether C compiler supports __thread])
PMIX_VAR_SCOPE_POP
[],[[static __thread int foo = 1;++foo;]])


PMIX_CC_HELPER([if $CC $1 supports C11 _Thread_local], [pmix_prog_cc_c11_helper__Thread_local_available],
[],[[static _Thread_local int foo = 1;++foo;]])

dnl At this time, PMIx only needs thread local and the atomic convenience tyes for C11 suport. These
dnl will likely be required in the future.
AC_DEFINE_UNQUOTED([PMIX_C_HAVE__THREAD_LOCAL], [$pmix_prog_cc_c11_helper__Thread_local_available],
[Whether C compiler supports __Thread_local])

AC_DEFINE_UNQUOTED([PMIX_C_HAVE_ATOMIC_CONV_VAR], [$pmix_prog_cc_c11_helper_atomic_var_available],
[Whether C compiler supports atomic convenience variables in stdatomic.h])

AC_DEFINE_UNQUOTED([PMIX_C_HAVE__ATOMIC], [$pmix_prog_cc_c11_helper__Atomic_available],
[Whether C compiler supports __Atomic keyword])

AC_DEFINE_UNQUOTED([PMIX_C_HAVE__GENERIC], [$pmix_prog_cc_c11_helper__Generic_available],
[Whether C compiler supports __Generic keyword])

AC_DEFINE_UNQUOTED([PMIX_C_HAVE__STATIC_ASSERT], [$pmix_prog_cc_c11_helper__static_assert_available],
[Whether C compiler supports _Static_assert keyword])

AC_DEFINE_UNQUOTED([PMIX_C_HAVE___THREAD], [$pmix_prog_cc__thread_available],
[Whether C compiler supports __thread])

PMIX_C_COMPILER_VENDOR([pmix_c_vendor])

Expand Down Expand Up @@ -456,6 +471,7 @@ AC_DEFUN([PMIX_SETUP_CC],[
PMIX_ENSURE_CONTAINS_OPTFLAGS(["$CFLAGS"])
AC_MSG_RESULT([$co_result])
CFLAGS="$co_result"
PMIX_VAR_SCOPE_POP
])


Expand Down
2 changes: 1 addition & 1 deletion opal/mca/pmix/pmix2x/pmix/contrib/pmix.spec
Original file line number Diff line number Diff line change
Expand Up @@ -192,7 +192,7 @@

Summary: An extended/exascale implementation of PMI
Name: %{?_name:%{_name}}%{!?_name:pmix}
Version: 2.1.3rc1
Version: 2.1.4
Release: 1%{?dist}
License: BSD
Group: Development/Libraries
Expand Down
27 changes: 22 additions & 5 deletions opal/mca/pmix/pmix2x/pmix/include/pmix_common.h.in
Original file line number Diff line number Diff line change
Expand Up @@ -591,6 +591,7 @@ typedef int pmix_status_t;
/* monitoring */
#define PMIX_MONITOR_HEARTBEAT_ALERT (PMIX_ERR_V2X_BASE - 9)
#define PMIX_MONITOR_FILE_ALERT (PMIX_ERR_V2X_BASE - 10)
#define PMIX_PROC_TERMINATED (PMIX_ERR_V2X_BASE - 11)

/* define a starting point for operational error constants so
* we avoid renumbering when making additions */
Expand All @@ -602,6 +603,9 @@ typedef int pmix_status_t;
#define PMIX_ERR_UPDATE_ENDPOINTS (PMIX_ERR_OP_BASE - 16)
#define PMIX_MODEL_DECLARED (PMIX_ERR_OP_BASE - 17)
#define PMIX_GDS_ACTION_COMPLETE (PMIX_ERR_OP_BASE - 18)
/* gap created by v3 definitions */
#define PMIX_OPERATION_SUCCEEDED (PMIX_ERR_OP_BASE - 27)
/* gap for group codes */

/* define a starting point for system error constants so
* we avoid renumbering when making additions */
Expand Down Expand Up @@ -750,6 +754,19 @@ typedef uint8_t pmix_alloc_directive_t;
#define PMIX_ALLOC_EXTERNAL 128


/* declare a convenience macro for checking keys */
#define PMIX_CHECK_KEY(a, b) \
(0 == strncmp((a)->key, (b), PMIX_MAX_KEYLEN))

/* define a convenience macro for checking nspaces */
#define PMIX_CHECK_NSPACE(a, b) \
(0 == strncmp((a), (b), PMIX_MAX_NSLEN))

/* define a convenience macro for checking names */
#define PMIX_CHECK_PROCID(a, b) \
(PMIX_CHECK_NSPACE((a)->nspace, (b)->nspace) && ((a)->rank == (b)->rank || (PMIX_RANK_WILDCARD == (a)->rank || PMIX_RANK_WILDCARD == (b)->rank)))


/**** PMIX BYTE OBJECT ****/
typedef struct pmix_byte_object {
char *bytes;
Expand Down Expand Up @@ -1086,11 +1103,11 @@ struct pmix_info_t {
(void)strncpy((m)->key, (k), PMIX_MAX_KEYLEN); \
pmix_value_load(&((m)->value), (v), (t)); \
} while (0)
#define PMIX_INFO_XFER(d, s) \
do { \
(void)strncpy((d)->key, (s)->key, PMIX_MAX_KEYLEN); \
(d)->flags = (s)->flags; \
pmix_value_xfer(&(d)->value, &(s)->value); \
#define PMIX_INFO_XFER(d, s) \
do { \
(void)strncpy((d)->key, (s)->key, PMIX_MAX_KEYLEN); \
(d)->flags = (s)->flags; \
pmix_value_xfer(&(d)->value, (pmix_value_t*)&(s)->value); \
} while(0)

#define PMIX_INFO_REQUIRED(m) \
Expand Down
9 changes: 2 additions & 7 deletions opal/mca/pmix/pmix2x/pmix/src/client/pmix_client.c
Original file line number Diff line number Diff line change
Expand Up @@ -167,14 +167,9 @@ static void pmix_client_notify_recv(struct pmix_peer_t *peer,
PMIX_RELEASE(chain);
goto error;
}
/* check for non-default flag */
for (cnt=0; cnt < (int)ninfo; cnt++) {
if (0 == strncmp(chain->info[cnt].key, PMIX_EVENT_NON_DEFAULT, PMIX_MAX_KEYLEN)) {
chain->nondefault = PMIX_INFO_TRUE(&chain->info[cnt]);
break;
}
}
}
/* prep the chain for processing */
pmix_prep_event_chain(chain, chain->info, ninfo, false);

pmix_output_verbose(2, pmix_globals.debug_output,
"[%s:%d] pmix:client_notify_recv - processing event %d, calling errhandler",
Expand Down
51 changes: 36 additions & 15 deletions opal/mca/pmix/pmix2x/pmix/src/common/pmix_control.c
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil -*- */
/*
* Copyright (c) 2014-2017 Intel, Inc. All rights reserved.
* Copyright (c) 2014-2018 Intel, Inc. All rights reserved.
* Copyright (c) 2016 Mellanox Technologies, Inc.
* All rights reserved.
* Copyright (c) 2016 IBM Corporation. All rights reserved.
Expand Down Expand Up @@ -84,7 +84,7 @@ static void query_cbfunc(struct pmix_peer_t *peer,
/* unpack any returned data */
cnt = 1;
PMIX_BFROPS_UNPACK(rc, peer, buf, &results->ninfo, &cnt, PMIX_SIZE);
if (PMIX_SUCCESS != rc) {
if (PMIX_SUCCESS != rc && PMIX_ERR_UNPACK_READ_PAST_END_OF_BUFFER != rc) {
PMIX_ERROR_LOG(rc);
goto complete;
}
Expand Down Expand Up @@ -127,16 +127,10 @@ PMIX_EXPORT pmix_status_t PMIx_Job_control_nb(const pmix_proc_t targets[], size_
return PMIX_ERR_INIT;
}

/* if we aren't connected, don't attempt to send */
if (!PMIX_PROC_IS_SERVER(pmix_globals.mypeer) && !pmix_globals.connected) {
PMIX_RELEASE_THREAD(&pmix_global_lock);
return PMIX_ERR_UNREACH;
}
PMIX_RELEASE_THREAD(&pmix_global_lock);

/* if we are the server, then we just issue the request and
* return the response */
if (PMIX_PROC_IS_SERVER(pmix_globals.mypeer)) {
PMIX_RELEASE_THREAD(&pmix_global_lock);
if (NULL == pmix_host_server.job_control) {
/* nothing we can do */
return PMIX_ERR_NOT_SUPPORTED;
Expand All @@ -150,6 +144,13 @@ PMIX_EXPORT pmix_status_t PMIx_Job_control_nb(const pmix_proc_t targets[], size_
return rc;
}

/* we need to send, so check for connection */
if (!pmix_globals.connected) {
PMIX_RELEASE_THREAD(&pmix_global_lock);
return PMIX_ERR_UNREACH;
}
PMIX_RELEASE_THREAD(&pmix_global_lock);

/* if we are a client, then relay this request to the server */
msg = PMIX_NEW(pmix_buffer_t);
/* pack the cmd */
Expand All @@ -171,7 +172,7 @@ PMIX_EXPORT pmix_status_t PMIx_Job_control_nb(const pmix_proc_t targets[], size_
}
/* remember, the targets can be NULL to indicate that the operation
* is to be done against all members of our nspace */
if (0 < ntargets) {
if (NULL != targets && 0 < ntargets) {
/* pack the targets */
PMIX_BFROPS_PACK(rc, pmix_client_globals.myserver,
msg, targets, ntargets, PMIX_PROC);
Expand All @@ -190,7 +191,7 @@ PMIX_EXPORT pmix_status_t PMIx_Job_control_nb(const pmix_proc_t targets[], size_
PMIX_RELEASE(msg);
return rc;
}
if (0 < ndirs) {
if (NULL != directives && 0 < ndirs) {
PMIX_BFROPS_PACK(rc, pmix_client_globals.myserver,
msg, directives, ndirs, PMIX_INFO);
if (PMIX_SUCCESS != rc) {
Expand Down Expand Up @@ -237,16 +238,16 @@ PMIX_EXPORT pmix_status_t PMIx_Process_monitor_nb(const pmix_info_t *monitor, pm
return PMIX_ERR_INIT;
}

/* if we aren't connected, don't attempt to send */
if (!PMIX_PROC_IS_SERVER(pmix_globals.mypeer) && !pmix_globals.connected) {
/* sanity check */
if (NULL == monitor) {
PMIX_RELEASE_THREAD(&pmix_global_lock);
return PMIX_ERR_UNREACH;
return PMIX_ERR_BAD_PARAM;
}
PMIX_RELEASE_THREAD(&pmix_global_lock);

/* if we are the server, then we just issue the request and
* return the response */
if (PMIX_PROC_IS_SERVER(pmix_globals.mypeer)) {
PMIX_RELEASE_THREAD(&pmix_global_lock);
if (NULL == pmix_host_server.monitor) {
/* nothing we can do */
return PMIX_ERR_NOT_SUPPORTED;
Expand All @@ -258,6 +259,26 @@ PMIX_EXPORT pmix_status_t PMIx_Process_monitor_nb(const pmix_info_t *monitor, pm
return rc;
}

/* we need to send, so check for connection */
if (!pmix_globals.connected) {
PMIX_RELEASE_THREAD(&pmix_global_lock);
return PMIX_ERR_UNREACH;
}
PMIX_RELEASE_THREAD(&pmix_global_lock);

/* if the monitor is PMIX_SEND_HEARTBEAT, then send it */
if (0 == strncmp(monitor->key, PMIX_SEND_HEARTBEAT, PMIX_MAX_KEYLEN)) {
msg = PMIX_NEW(pmix_buffer_t);
if (NULL == msg) {
return PMIX_ERR_NOMEM;
}
PMIX_PTL_SEND_ONEWAY(rc, pmix_client_globals.myserver, msg, PMIX_PTL_TAG_HEARTBEAT);
if (PMIX_SUCCESS != rc) {
PMIX_RELEASE(msg);
}
return rc;
}

/* if we are a client, then relay this request to the server */
msg = PMIX_NEW(pmix_buffer_t);
/* pack the cmd */
Expand Down
Loading