Skip to content

Commit d9326ff

Browse files
committed
pmix/pmix4x: refresh to the latest PMIx master
refresh to openpmix/openpmix@186dca1 Signed-off-by: Gilles Gouaillardet <gilles@rist.or.jp>
1 parent a46e5da commit d9326ff

File tree

109 files changed

+6836
-1774
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

109 files changed

+6836
-1774
lines changed

opal/mca/pmix/pmix4x/pmix/VERSION

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

33-
repo_rev=gitbde4a8a5
33+
repo_rev=git186dca19
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="Apr 23, 2019"
47+
date="Jun 10, 2019"
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/pmix4x/pmix/bindings/python/Makefile.am

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
# $HEADER$
2222
#
2323

24-
helpers = setup.py client.py server.py pmix.pyx
24+
helpers = setup.py pmix.pyx
2525

2626
if WANT_PYTHON_BINDINGS
2727

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
@PMIX_PYTHON_PATH@
2+
3+
from pmix import *
4+
5+
def main():
6+
foo = PMIxClient()
7+
print("Testing PMIx ", foo.get_version())
8+
info = {PMIX_PROGRAMMING_MODEL: ('TEST', PMIX_STRING), PMIX_MODEL_LIBRARY_NAME: ("PMIX", PMIX_STRING)}
9+
my_result = foo.init(info)
10+
print("Init result ", my_result)
11+
if 0 != my_result:
12+
print("FAILED TO INIT")
13+
exit(1)
14+
# try putting something
15+
print("PUT")
16+
rc = foo.put(PMIX_GLOBAL, "mykey", (1, PMIX_INT32))
17+
print("Put result ", rc);
18+
# commit it
19+
print("COMMIT")
20+
rc = foo.commit()
21+
print ("Commit result ", rc)
22+
# execute fence
23+
print("FENCE")
24+
procs = []
25+
info = {}
26+
rc = foo.fence(procs, info)
27+
print("Fence result ", rc)
28+
# finalize
29+
info = {}
30+
foo.finalize(info)
31+
print("Client finalize complete")
32+
if __name__ == '__main__':
33+
main()
Lines changed: 107 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,107 @@
1+
@PMIX_PYTHON_PATH@
2+
3+
from pmix import *
4+
import signal, time
5+
import os
6+
import select
7+
import subprocess
8+
9+
global killer
10+
11+
class GracefulKiller:
12+
kill_now = False
13+
def __init__(self):
14+
signal.signal(signal.SIGINT, self.exit_gracefully)
15+
signal.signal(signal.SIGTERM, self.exit_gracefully)
16+
17+
def exit_gracefully(self,signum, frame):
18+
self.kill_now = True
19+
20+
def clientconnected(proc:tuple is not None):
21+
print("CLIENT CONNECTED", proc)
22+
return PMIX_SUCCESS
23+
24+
def clientfinalized(proc:tuple is not None):
25+
print("CLIENT FINALIZED", proc)
26+
return PMIX_SUCCESS
27+
28+
def clientfence(args:dict is not None):
29+
print("SERVER FENCE", args)
30+
return PMIX_SUCCESS
31+
32+
def main():
33+
try:
34+
foo = PMIxServer()
35+
except:
36+
print("FAILED TO CREATE SERVER")
37+
exit(1)
38+
print("Testing server version ", foo.get_version())
39+
args = {'FOOBAR': ('VAR', PMIX_STRING), 'BLAST': (7, PMIX_INT32)}
40+
map = {'clientconnected': clientconnected,
41+
'clientfinalized': clientfinalized,
42+
'fencenb': clientfence}
43+
my_result = foo.init(args, map)
44+
print("Testing PMIx_Initialized")
45+
rc = foo.initialized()
46+
print("Initialized: ", rc)
47+
vers = foo.get_version()
48+
print("Version: ", vers)
49+
# get our environment as a base
50+
env = os.environ.copy()
51+
# register an nspace for the client app
52+
darray = (PMIX_SIZE, [1, 2, 3, 4, 5])
53+
kvals = {'testkey': (darray, PMIX_DATA_ARRAY)}
54+
print("REGISTERING NSPACE")
55+
rc = foo.register_nspace("testnspace", 1, kvals)
56+
print("RegNspace ", rc)
57+
# register a client
58+
uid = os.getuid()
59+
gid = os.getgid()
60+
rc = foo.register_client(("testnspace", 0), uid, gid)
61+
print("RegClient ", rc)
62+
# setup the fork
63+
rc = foo.setup_fork(("testnspace", 0), env)
64+
print("SetupFrk", rc)
65+
# setup the client argv
66+
args = ["./client.py"]
67+
# open a subprocess with stdout and stderr
68+
# as distinct pipes so we can capture their
69+
# output as the process runs
70+
p = subprocess.Popen(args, env=env,
71+
stdout=subprocess.PIPE, stderr=subprocess.PIPE)
72+
# define storage to catch the output
73+
stdout = []
74+
stderr = []
75+
# loop until the pipes close
76+
while True:
77+
reads = [p.stdout.fileno(), p.stderr.fileno()]
78+
ret = select.select(reads, [], [])
79+
80+
stdout_done = True
81+
stderr_done = True
82+
83+
for fd in ret[0]:
84+
# if the data
85+
if fd == p.stdout.fileno():
86+
read = p.stdout.readline()
87+
if read:
88+
read = read.decode('utf-8').rstrip()
89+
print('stdout: ' + read)
90+
stdout_done = False
91+
elif fd == p.stderr.fileno():
92+
read = p.stderr.readline()
93+
if read:
94+
read = read.decode('utf-8').rstrip()
95+
print('stderr: ' + read)
96+
stderr_done = False
97+
98+
if stdout_done and stderr_done:
99+
break
100+
101+
print("FINALIZING")
102+
foo.finalize()
103+
104+
if __name__ == '__main__':
105+
global killer
106+
killer = GracefulKiller()
107+
main()

opal/mca/pmix/pmix4x/pmix/config/pmix.m4

Lines changed: 42 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -418,7 +418,8 @@ AC_DEFUN([PMIX_SETUP_CORE],[
418418
ioLib.h sockLib.h hostLib.h limits.h \
419419
sys/fcntl.h sys/statfs.h sys/statvfs.h \
420420
netdb.h ucred.h zlib.h sys/auxv.h \
421-
sys/sysctl.h])
421+
sys/sysctl.h termio.h termios.h pty.h \
422+
libutil.h util.h grp.h sys/cdefs.h utmp.h stropts.h])
422423

423424
AC_CHECK_HEADERS([sys/mount.h], [], [],
424425
[AC_INCLUDES_DEFAULT
@@ -663,7 +664,7 @@ AC_DEFUN([PMIX_SETUP_CORE],[
663664
# -lrt might be needed for clock_gettime
664665
PMIX_SEARCH_LIBS_CORE([clock_gettime], [rt])
665666

666-
AC_CHECK_FUNCS([asprintf snprintf vasprintf vsnprintf strsignal socketpair strncpy_s usleep statfs statvfs getpeereid getpeerucred strnlen posix_fallocate tcgetpgrp])
667+
AC_CHECK_FUNCS([asprintf snprintf vasprintf vsnprintf strsignal socketpair strncpy_s usleep statfs statvfs getpeereid getpeerucred strnlen posix_fallocate tcgetpgrp setpgid ptsname openpty])
667668

668669
# On some hosts, htonl is a define, so the AC_CHECK_FUNC will get
669670
# confused. On others, it's in the standard library, but stubbed with
@@ -909,6 +910,10 @@ AC_DEFUN([PMIX_SETUP_CORE],[
909910
pmix_config_prefix[src/tools/pps/Makefile]
910911
pmix_config_prefix[src/tools/pattrs/Makefile]
911912
)
913+
if test "$WANT_PYTHON_BINDINGS" = "1"; then
914+
AC_CONFIG_FILES(pmix_config_prefix[bindings/python/server.py], [chmod +x bindings/python/server.py])
915+
AC_CONFIG_FILES(pmix_config_prefix[bindings/python/client.py], [chmod +x bindings/python/client.py])
916+
fi
912917

913918
# publish any embedded flags so external wrappers can use them
914919
AC_SUBST(PMIX_EMBEDDED_LIBS)
@@ -1215,6 +1220,7 @@ if test "$WANT_PYTHON_BINDINGS" = "1"; then
12151220
fi
12161221
python_version=`python --version 2>&1`
12171222
PMIX_SUMMARY_ADD([[Bindings]],[[Python]], [pmix_python], [yes ($python_version)])
1223+
AC_SUBST([PMIX_PYTHON_PATH], [#!"$PYTHON"], "Full Python executable path")
12181224

12191225
AC_MSG_CHECKING([if Cython package installed])
12201226
have_cython=`$srcdir/config/pmix_check_cython.py 2> /dev/null`
@@ -1251,6 +1257,40 @@ fi
12511257
AS_IF([test -z "$enable_nonglobal_dlopen" && test "x$pmix_mode" = "xembedded" && test $WANT_INSTALL_HEADERS -eq 0 && test $pmix_need_libpmix -eq 1],
12521258
[pmix_need_libpmix=0])
12531259

1260+
#
1261+
# Do we want PTY support?
1262+
#
1263+
1264+
AC_MSG_CHECKING([if want pty support])
1265+
AC_ARG_ENABLE(pty-support,
1266+
AC_HELP_STRING([--enable-pty-support],
1267+
[Enable/disable PTY support for STDIO forwarding. (default: enabled)]))
1268+
if test "$enable_pty_support" = "no" ; then
1269+
AC_MSG_RESULT([no])
1270+
PMIX_ENABLE_PTY_SUPPORT=0
1271+
else
1272+
AC_MSG_RESULT([yes])
1273+
PMIX_ENABLE_PTY_SUPPORT=1
1274+
fi
1275+
AC_DEFINE_UNQUOTED([PMIX_ENABLE_PTY_SUPPORT], [$PMIX_ENABLE_PTY_SUPPORT],
1276+
[Whether user wants PTY support or not])
1277+
1278+
#
1279+
# psec/dummy_handshake
1280+
#
1281+
1282+
AC_MSG_CHECKING([if want build psec/dummy_handshake])
1283+
AC_ARG_ENABLE(dummy-handshake,
1284+
AC_HELP_STRING([--enable-dummy-handshake],
1285+
[Enables psec dummy component intended to check the PTL handshake scenario (default: disabled)]))
1286+
if test "$enable_dummy_handshake" != "yes"; then
1287+
AC_MSG_RESULT([no])
1288+
eval "DISABLE_psec_dummy_handshake=1"
1289+
else
1290+
AC_MSG_RESULT([yes])
1291+
eval "DISABLE_psec_dummy_handshake=0"
1292+
fi
1293+
AM_CONDITIONAL(MCA_BUILD_PSEC_DUMMY_HANDSHAKE, test "$DISABLE_psec_dummy_handshake" = "0")
12541294
])dnl
12551295

12561296
# This must be a standalone routine so that it can be called both by

opal/mca/pmix/pmix4x/pmix/config/pmix_check_psm2.m4

Lines changed: 0 additions & 89 deletions
This file was deleted.

opal/mca/pmix/pmix4x/pmix/configure.ac

Lines changed: 27 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
# Copyright (c) 2012 Oracle and/or its affiliates. All rights reserved.
2020
# Copyright (c) 2013 Mellanox Technologies, Inc.
2121
# All rights reserved.
22-
# Copyright (c) 2014-2018 Intel, Inc. All rights reserved.
22+
# Copyright (c) 2014-2019 Intel, Inc. All rights reserved.
2323
# Copyright (c) 2016 IBM Corporation. All rights reserved.
2424
# Copyright (c) 2016-2018 Research Organization for Information Science
2525
# and Technology (RIST). All rights reserved.
@@ -51,6 +51,11 @@ AC_CONFIG_AUX_DIR(./config)
5151
# -I in ACLOCAL_AMFLAGS in the top-level Makefile.am.
5252
AC_CONFIG_MACRO_DIR(./config)
5353

54+
# autotools expects to perform tests without interference
55+
# from user-provided CFLAGS, so preserve them here
56+
PMIX_CFLAGS_user=$CFLAGS
57+
CFLAGS=
58+
5459
PMIX_CAPTURE_CONFIGURE_CLI([PMIX_CONFIGURE_CLI])
5560

5661
# Get our platform support file. This has to be done very, very early
@@ -205,7 +210,17 @@ AS_IF([test -z "$CC_FOR_BUILD"],[
205210
AC_SUBST([CC_FOR_BUILD], [$CC])
206211
])
207212

213+
# restore any user-provided flags
214+
AS_IF([test ! -z "$PMIX_CFLAGS_user"], [CFLAGS="$CFLAGS $PMIX_CFLAGS_user"])
215+
216+
# Delay setting pickyness until here so we
217+
# don't break configure code tests
218+
#if test "$WANT_PICKY_COMPILER" = "1"; then
219+
# CFLAGS="$CFLAGS -Wall -Wextra -Werror"
220+
#fi
221+
208222
# Cleanup duplicate flags
223+
PMIX_FLAGS_UNIQ(CFLAGS)
209224
PMIX_FLAGS_UNIQ(CPPFLAGS)
210225
PMIX_FLAGS_UNIQ(LDFLAGS)
211226
PMIX_FLAGS_UNIQ(LIBS)
@@ -232,6 +247,17 @@ AC_MSG_RESULT([$LDFLAGS])
232247
AC_MSG_CHECKING([final LIBS])
233248
AC_MSG_RESULT([$LIBS])
234249

250+
####################################################################
251+
# -Werror for CI scripts
252+
####################################################################
253+
254+
AC_ARG_ENABLE(werror,
255+
AC_HELP_STRING([--enable-werror],
256+
[Treat compiler warnings as errors]),
257+
[
258+
CFLAGS="$CFLAGS -Werror"
259+
])
260+
235261
####################################################################
236262
# Version information
237263
####################################################################

0 commit comments

Comments
 (0)