Sync with PMIx tarball, bringing across the warning fixes pointed out by Gilles
Этот коммит содержится в:
родитель
7e6a213465
Коммит
bcabd1e282
@ -30,7 +30,7 @@ greek=a1
|
|||||||
# 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=gitebb9a6a
|
repo_rev=git11e7b06
|
||||||
|
|
||||||
# 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="Aug 28, 2015"
|
date="Aug 30, 2015"
|
||||||
|
|
||||||
# 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
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
# PMIx copyrights:
|
# PMIx copyrights:
|
||||||
# Copyright (c) 2013 Intel, Inc. All rights reserved
|
# Copyright (c) 2013-2015 Intel, Inc. All rights reserved
|
||||||
#
|
#
|
||||||
#########################
|
#########################
|
||||||
#
|
#
|
||||||
@ -9,22 +9,23 @@
|
|||||||
# Copyright (c) 2004-2005 The University of Tennessee and The University
|
# Copyright (c) 2004-2005 The University of Tennessee and The University
|
||||||
# of Tennessee Research Foundation. All rights
|
# of Tennessee Research Foundation. All rights
|
||||||
# reserved.
|
# reserved.
|
||||||
# Copyright (c) 2004-2005 High Performance Computing Center Stuttgart,
|
# Copyright (c) 2004-2005 High Performance Computing Center Stuttgart,
|
||||||
# University of Stuttgart. All rights reserved.
|
# University of Stuttgart. All rights reserved.
|
||||||
# Copyright (c) 2004-2005 The Regents of the University of California.
|
# Copyright (c) 2004-2005 The Regents of the University of California.
|
||||||
# All rights reserved.
|
# All rights reserved.
|
||||||
# Copyright (c) 2006-2010 Cisco Systems, Inc. All rights reserved.
|
# Copyright (c) 2006-2010 Cisco Systems, Inc. All rights reserved.
|
||||||
# Copyright (c) 2010 Oracle and/or its affiliates. All rights
|
# Copyright (c) 2010 Oracle and/or its affiliates. All rights
|
||||||
# reserved.
|
# reserved.
|
||||||
#########################
|
#########################
|
||||||
# $COPYRIGHT$
|
# $COPYRIGHT$
|
||||||
#
|
#
|
||||||
# Additional copyrights may follow
|
# Additional copyrights may follow
|
||||||
#
|
#
|
||||||
# $HEADER$
|
# $HEADER$
|
||||||
#
|
#
|
||||||
|
|
||||||
EXTRA_DIST += \
|
EXTRA_DIST += \
|
||||||
|
config/c_get_alignment.m4 \
|
||||||
config/pmix_get_version.sh \
|
config/pmix_get_version.sh \
|
||||||
config/distscript.sh \
|
config/distscript.sh \
|
||||||
config/pmix_check_attributes.m4 \
|
config/pmix_check_attributes.m4 \
|
||||||
|
72
opal/mca/pmix/pmix1xx/pmix/config/c_get_alignment.m4
Обычный файл
72
opal/mca/pmix/pmix1xx/pmix/config/c_get_alignment.m4
Обычный файл
@ -0,0 +1,72 @@
|
|||||||
|
dnl -*- shell-script -*-
|
||||||
|
dnl
|
||||||
|
dnl Copyright (c) 2004-2005 The Trustees of Indiana University and Indiana
|
||||||
|
dnl University Research and Technology
|
||||||
|
dnl Corporation. All rights reserved.
|
||||||
|
dnl Copyright (c) 2004-2005 The University of Tennessee and The University
|
||||||
|
dnl of Tennessee Research Foundation. All rights
|
||||||
|
dnl reserved.
|
||||||
|
dnl Copyright (c) 2004-2005 High Performance Computing Center Stuttgart,
|
||||||
|
dnl University of Stuttgart. All rights reserved.
|
||||||
|
dnl Copyright (c) 2004-2005 The Regents of the University of California.
|
||||||
|
dnl All rights reserved.
|
||||||
|
dnl Copyright (c) 2009 Sun Microsystems, Inc. All rights reserved.
|
||||||
|
dnl Copyright (c) 2014-2015 Intel, Inc. All rights reserved.
|
||||||
|
dnl Copyright (c) 2015 Research Organization for Information Science
|
||||||
|
dnl and Technology (RIST). All rights reserved.
|
||||||
|
dnl $COPYRIGHT$
|
||||||
|
dnl
|
||||||
|
dnl Additional copyrights may follow
|
||||||
|
dnl
|
||||||
|
dnl $HEADER$
|
||||||
|
dnl
|
||||||
|
|
||||||
|
# PMIX_C_GET_ALIGN(type, config_var)
|
||||||
|
# ----------------------------------
|
||||||
|
# Determine datatype alignment.
|
||||||
|
# First arg is type, 2nd arg is config var to define.
|
||||||
|
# Now that we require C99 compilers, we include stdbool.h
|
||||||
|
# in the alignment test so that we can find the definition
|
||||||
|
# of "bool" when we test for its alignment. We might be able
|
||||||
|
# to avoid this if we test for alignment of _Bool, but
|
||||||
|
# since we use "bool" in the code, let's be safe and check
|
||||||
|
# what we use. Yes, they should be the same - but "should" and
|
||||||
|
# "are" frequently differ
|
||||||
|
AC_DEFUN([PMIX_C_GET_ALIGNMENT],[
|
||||||
|
AC_CACHE_CHECK([alignment of $1],
|
||||||
|
[AS_TR_SH([pmix_cv_c_align_$1])],
|
||||||
|
[AC_RUN_IFELSE([AC_LANG_PROGRAM([AC_INCLUDES_DEFAULT
|
||||||
|
#include <stdbool.h> ],
|
||||||
|
[[
|
||||||
|
struct foo { char c; $1 x; };
|
||||||
|
struct foo *p = (struct foo *) malloc(sizeof(struct foo));
|
||||||
|
int diff;
|
||||||
|
FILE *f=fopen("conftestval", "w");
|
||||||
|
if (!f) exit(1);
|
||||||
|
diff = ((char *)&p->x) - ((char *)&p->c);
|
||||||
|
fprintf(f, "%d\n", (diff >= 0) ? diff : -diff);
|
||||||
|
]])], [AS_TR_SH([pmix_cv_c_align_$1])=`cat conftestval`],
|
||||||
|
[AC_MSG_WARN([*** Problem running configure test!])
|
||||||
|
AC_MSG_WARN([*** See config.log for details.])
|
||||||
|
AC_MSG_ERROR([*** Cannot continue.])],
|
||||||
|
[ # cross compile - do a non-executable test. Trick
|
||||||
|
# taken from the Autoconf 2.59c. Switch to using
|
||||||
|
# AC_CHECK_ALIGNOF when we can require Autoconf 2.60.
|
||||||
|
_AC_COMPUTE_INT([(long int) offsetof (pmix__type_alignof_, y)],
|
||||||
|
[AS_TR_SH([pmix_cv_c_align_$1])],
|
||||||
|
[AC_INCLUDES_DEFAULT
|
||||||
|
#include <stdbool.h>
|
||||||
|
|
||||||
|
#ifndef offsetof
|
||||||
|
# define offsetof(type, member) ((char *) &((type *) 0)->member - (char *) 0)
|
||||||
|
#endif
|
||||||
|
typedef struct { char x; $1 y; } pmix__type_alignof_;
|
||||||
|
],
|
||||||
|
[AC_MSG_WARN([*** Problem running configure test!])
|
||||||
|
AC_MSG_WARN([*** See config.log for details.])
|
||||||
|
AC_MSG_ERROR([*** Cannot continue.])])])])
|
||||||
|
|
||||||
|
AC_DEFINE_UNQUOTED([$2], [$AS_TR_SH([pmix_cv_c_align_$1])], [Alignment of type $1])
|
||||||
|
eval "$2=$AS_TR_SH([pmix_cv_c_align_$1])"
|
||||||
|
|
||||||
|
rm -rf conftest* ]) dnl
|
@ -146,7 +146,6 @@ AC_DEFUN([PMIX_SETUP_CORE],[
|
|||||||
##################################
|
##################################
|
||||||
# Does the compiler support "ident"-like constructs?
|
# Does the compiler support "ident"-like constructs?
|
||||||
PMIX_CHECK_IDENT([CC], [CFLAGS], [c], [C])
|
PMIX_CHECK_IDENT([CC], [CFLAGS], [c], [C])
|
||||||
PMIX_SETUP_CC
|
|
||||||
|
|
||||||
#
|
#
|
||||||
# Check for some types
|
# Check for some types
|
||||||
@ -193,6 +192,31 @@ AC_DEFUN([PMIX_SETUP_CORE],[
|
|||||||
|
|
||||||
AC_CHECK_SIZEOF(pid_t)
|
AC_CHECK_SIZEOF(pid_t)
|
||||||
|
|
||||||
|
#
|
||||||
|
# Check for type alignments
|
||||||
|
#
|
||||||
|
|
||||||
|
PMIX_C_GET_ALIGNMENT(bool, PMIX_ALIGNMENT_BOOL)
|
||||||
|
PMIX_C_GET_ALIGNMENT(int8_t, PMIX_ALIGNMENT_INT8)
|
||||||
|
PMIX_C_GET_ALIGNMENT(int16_t, PMIX_ALIGNMENT_INT16)
|
||||||
|
PMIX_C_GET_ALIGNMENT(int32_t, PMIX_ALIGNMENT_INT32)
|
||||||
|
PMIX_C_GET_ALIGNMENT(int64_t, PMIX_ALIGNMENT_INT64)
|
||||||
|
PMIX_C_GET_ALIGNMENT(char, PMIX_ALIGNMENT_CHAR)
|
||||||
|
PMIX_C_GET_ALIGNMENT(short, PMIX_ALIGNMENT_SHORT)
|
||||||
|
PMIX_C_GET_ALIGNMENT(wchar_t, PMIX_ALIGNMENT_WCHAR)
|
||||||
|
PMIX_C_GET_ALIGNMENT(int, PMIX_ALIGNMENT_INT)
|
||||||
|
PMIX_C_GET_ALIGNMENT(long, PMIX_ALIGNMENT_LONG)
|
||||||
|
if test "$ac_cv_type_long_long" = yes; then
|
||||||
|
PMIX_C_GET_ALIGNMENT(long long, PMIX_ALIGNMENT_LONG_LONG)
|
||||||
|
fi
|
||||||
|
PMIX_C_GET_ALIGNMENT(float, PMIX_ALIGNMENT_FLOAT)
|
||||||
|
PMIX_C_GET_ALIGNMENT(double, PMIX_ALIGNMENT_DOUBLE)
|
||||||
|
if test "$ac_cv_type_long_double" = yes; then
|
||||||
|
PMIX_C_GET_ALIGNMENT(long double, PMIX_ALIGNMENT_LONG_DOUBLE)
|
||||||
|
fi
|
||||||
|
PMIX_C_GET_ALIGNMENT(void *, PMIX_ALIGNMENT_VOID_P)
|
||||||
|
PMIX_C_GET_ALIGNMENT(size_t, PMIX_ALIGNMENT_SIZE_T)
|
||||||
|
|
||||||
|
|
||||||
#
|
#
|
||||||
# Does the C compiler native support "bool"? (i.e., without
|
# Does the C compiler native support "bool"? (i.e., without
|
||||||
@ -265,18 +289,18 @@ AC_DEFUN([PMIX_SETUP_CORE],[
|
|||||||
pmix_show_title "Header file tests"
|
pmix_show_title "Header file tests"
|
||||||
|
|
||||||
AC_CHECK_HEADERS([arpa/inet.h \
|
AC_CHECK_HEADERS([arpa/inet.h \
|
||||||
fcntl.h inttypes.h libgen.h \
|
fcntl.h inttypes.h libgen.h \
|
||||||
netinet/in.h \
|
netinet/in.h \
|
||||||
stdint.h stddef.h \
|
stdint.h stddef.h \
|
||||||
stdlib.h string.h strings.h \
|
stdlib.h string.h strings.h \
|
||||||
sys/param.h \
|
sys/param.h \
|
||||||
sys/select.h sys/socket.h \
|
sys/select.h sys/socket.h \
|
||||||
stdarg.h sys/stat.h sys/time.h \
|
stdarg.h sys/stat.h sys/time.h \
|
||||||
sys/types.h sys/un.h sys/uio.h net/uio.h \
|
sys/types.h sys/un.h sys/uio.h net/uio.h \
|
||||||
sys/wait.h syslog.h \
|
sys/wait.h syslog.h \
|
||||||
time.h unistd.h \
|
time.h unistd.h \
|
||||||
crt_externs.h signal.h \
|
crt_externs.h signal.h \
|
||||||
ioLib.h sockLib.h hostLib.h limits.h])
|
ioLib.h sockLib.h hostLib.h limits.h])
|
||||||
|
|
||||||
# Note that sometimes we have <stdbool.h>, but it doesn't work (e.g.,
|
# Note that sometimes we have <stdbool.h>, but it doesn't work (e.g.,
|
||||||
# have both Portland and GNU installed; using pgcc will find GNU's
|
# have both Portland and GNU installed; using pgcc will find GNU's
|
||||||
@ -547,7 +571,7 @@ AC_DEFUN([PMIX_SETUP_CORE],[
|
|||||||
# final compiler config
|
# final compiler config
|
||||||
############################################################################
|
############################################################################
|
||||||
|
|
||||||
pmix_show_subtitle "Compiler flags"
|
pmix_show_subtitle "Set path-related compiler flags"
|
||||||
|
|
||||||
#
|
#
|
||||||
# This is needed for VPATH builds, so that it will -I the appropriate
|
# This is needed for VPATH builds, so that it will -I the appropriate
|
||||||
@ -569,14 +593,6 @@ AC_DEFUN([PMIX_SETUP_CORE],[
|
|||||||
CPPFLAGS='-I$(PMIX_top_srcdir) -I$(PMIX_top_srcdir)/src -I$(PMIX_top_srcdir)/include'" $CPPFLAGS"
|
CPPFLAGS='-I$(PMIX_top_srcdir) -I$(PMIX_top_srcdir)/src -I$(PMIX_top_srcdir)/include'" $CPPFLAGS"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
#
|
|
||||||
# Delayed the substitution of CFLAGS and CXXFLAGS until now because
|
|
||||||
# they may have been modified throughout the course of this script.
|
|
||||||
#
|
|
||||||
|
|
||||||
AC_SUBST(CFLAGS)
|
|
||||||
AC_SUBST(CPPFLAGS)
|
|
||||||
|
|
||||||
# pmixdatadir, pmixlibdir, and pmixinclude are essentially the same as
|
# pmixdatadir, pmixlibdir, and pmixinclude are essentially the same as
|
||||||
# pkg*dir, but will always be */pmix.
|
# pkg*dir, but will always be */pmix.
|
||||||
pmixdatadir='${datadir}/pmix'
|
pmixdatadir='${datadir}/pmix'
|
||||||
@ -639,7 +655,7 @@ else
|
|||||||
WANT_PICKY_COMPILER=0
|
WANT_PICKY_COMPILER=0
|
||||||
fi
|
fi
|
||||||
#################### Early development override ####################
|
#################### Early development override ####################
|
||||||
if test "$WANT_PICKY_COMPILER" = "0" -a -z "$enable_picky" -a "$PMIX_DEVEL" = 1; then
|
if test "$WANT_PICKY_COMPILER" = "0" -a -z "$enable_picky" -a "$PMIX_DEVEL" = "1"; then
|
||||||
WANT_PICKY_COMPILER=1
|
WANT_PICKY_COMPILER=1
|
||||||
echo "--> developer override: enable picky compiler by default"
|
echo "--> developer override: enable picky compiler by default"
|
||||||
fi
|
fi
|
||||||
|
@ -1,12 +1,5 @@
|
|||||||
dnl -*- shell-script -*-
|
dnl -*- shell-script -*-
|
||||||
dnl
|
dnl
|
||||||
dnl PMIx copyrights:
|
|
||||||
dnl Copyright (c) 2013 Intel, Inc. All rights reserved
|
|
||||||
dnl
|
|
||||||
dnl########################
|
|
||||||
dnl This code has been adapted from pmix_setup_cc.m4 in the Open MPI
|
|
||||||
dnl code base - per the Open MPI license, all copyrights are retained below.
|
|
||||||
dnl
|
|
||||||
dnl Copyright (c) 2004-2005 The Trustees of Indiana University and Indiana
|
dnl Copyright (c) 2004-2005 The Trustees of Indiana University and Indiana
|
||||||
dnl University Research and Technology
|
dnl University Research and Technology
|
||||||
dnl Corporation. All rights reserved.
|
dnl Corporation. All rights reserved.
|
||||||
@ -21,7 +14,9 @@ dnl Copyright (c) 2007-2009 Sun Microsystems, Inc. All rights reserved.
|
|||||||
dnl Copyright (c) 2008-2015 Cisco Systems, Inc. All rights reserved.
|
dnl Copyright (c) 2008-2015 Cisco Systems, Inc. All rights reserved.
|
||||||
dnl Copyright (c) 2012 Los Alamos National Security, LLC. All rights
|
dnl Copyright (c) 2012 Los Alamos National Security, LLC. All rights
|
||||||
dnl reserved.
|
dnl reserved.
|
||||||
dnl########################
|
dnl Copyright (c) 2015 Research Organization for Information Science
|
||||||
|
dnl and Technology (RIST). All rights reserved.
|
||||||
|
dnl Copyright (c) 2015 Intel, Inc. All rights reserved
|
||||||
dnl $COPYRIGHT$
|
dnl $COPYRIGHT$
|
||||||
dnl
|
dnl
|
||||||
dnl Additional copyrights may follow
|
dnl Additional copyrights may follow
|
||||||
@ -42,11 +37,11 @@ AC_DEFUN([PMIX_SETUP_CC],[
|
|||||||
AC_REQUIRE([_PMIX_PROG_CC])
|
AC_REQUIRE([_PMIX_PROG_CC])
|
||||||
AC_REQUIRE([AM_PROG_CC_C_O])
|
AC_REQUIRE([AM_PROG_CC_C_O])
|
||||||
|
|
||||||
# require a C99 compiant compiler
|
# We require a C99 compiant compiler
|
||||||
AC_PROG_CC_C99
|
AC_PROG_CC_C99
|
||||||
# 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([Open MPI requires a C99 compiler])
|
AC_MSG_WARN([PMIx requires a C99 compiler])
|
||||||
AC_MSG_ERROR([Aborting.])
|
AC_MSG_ERROR([Aborting.])
|
||||||
fi
|
fi
|
||||||
|
|
||||||
@ -73,55 +68,9 @@ AC_DEFUN([PMIX_SETUP_CC],[
|
|||||||
#endif])
|
#endif])
|
||||||
AC_DEFINE([_GNU_SOURCE])])
|
AC_DEFINE([_GNU_SOURCE])])
|
||||||
|
|
||||||
# Do we want code coverage
|
|
||||||
if test "$WANT_COVERAGE" = "1"; then
|
|
||||||
if test "$pmix_c_vendor" = "gnu" ; then
|
|
||||||
# For compilers > gcc-4.x, use --coverage for
|
|
||||||
# compiling and linking to circumvent trouble with
|
|
||||||
# libgcov.
|
|
||||||
CFLAGS_orig="$CFLAGS"
|
|
||||||
LDFLAGS_orig="$LDFLAGS"
|
|
||||||
|
|
||||||
CFLAGS="$CFLAGS_orig --coverage"
|
|
||||||
LDFLAGS="$LDFLAGS_orig --coverage"
|
|
||||||
PMIX_COVERAGE_FLAGS=
|
|
||||||
|
|
||||||
AC_CACHE_CHECK([if $CC supports --coverage],
|
|
||||||
[pmix_cv_cc_coverage],
|
|
||||||
[AC_TRY_COMPILE([], [],
|
|
||||||
[pmix_cv_cc_coverage="yes"],
|
|
||||||
[pmix_cv_cc_coverage="no"])])
|
|
||||||
|
|
||||||
if test "$pmix_cv_cc_coverage" = "yes" ; then
|
|
||||||
PMIX_COVERAGE_FLAGS="--coverage"
|
|
||||||
CLEANFILES="*.gcno ${CLEANFILES}"
|
|
||||||
CONFIG_CLEAN_FILES="*.gcda *.gcov ${CONFIG_CLEAN_FILES}"
|
|
||||||
else
|
|
||||||
PMIX_COVERAGE_FLAGS="-ftest-coverage -fprofile-arcs"
|
|
||||||
CLEANFILES="*.bb *.bbg ${CLEANFILES}"
|
|
||||||
CONFIG_CLEAN_FILES="*.da *.*.gcov ${CONFIG_CLEAN_FILES}"
|
|
||||||
fi
|
|
||||||
CFLAGS="$CFLAGS_orig $PMIX_COVERAGE_FLAGS"
|
|
||||||
LDFLAGS="$LDFLAGS_orig $PMIX_COVERAGE_FLAGS"
|
|
||||||
|
|
||||||
PMIX_UNIQ(CFLAGS)
|
|
||||||
PMIX_UNIQ(LDFLAGS)
|
|
||||||
AC_MSG_WARN([$PMIX_COVERAGE_FLAGS has been added to CFLAGS (--enable-coverage)])
|
|
||||||
|
|
||||||
WANT_DEBUG=1
|
|
||||||
else
|
|
||||||
AC_MSG_WARN([Code coverage functionality is currently available only with GCC])
|
|
||||||
AC_MSG_ERROR([Configure: Cannot continue])
|
|
||||||
fi
|
|
||||||
fi
|
|
||||||
|
|
||||||
# Do we want debugging?
|
# Do we want debugging?
|
||||||
if test "$WANT_DEBUG" = "1" -a "$enable_debug_symbols" != "no" ; then
|
if test "$WANT_DEBUG" = "1" && test "$enable_debug_symbols" != "no" ; then
|
||||||
if test "$pmix_c_vendor" = "gnu"; then
|
CFLAGS="$CFLAGS -g"
|
||||||
CFLAGS="$CFLAGS -g" # keep the -g3 for when it will become a standard option.
|
|
||||||
else
|
|
||||||
CFLAGS="$CFLAGS -g"
|
|
||||||
fi
|
|
||||||
|
|
||||||
PMIX_UNIQ(CFLAGS)
|
PMIX_UNIQ(CFLAGS)
|
||||||
AC_MSG_WARN([-g has been added to CFLAGS (--enable-debug)])
|
AC_MSG_WARN([-g has been added to CFLAGS (--enable-debug)])
|
||||||
@ -130,13 +79,65 @@ AC_DEFUN([PMIX_SETUP_CC],[
|
|||||||
# These flags are generally gcc-specific; even the
|
# These flags are generally gcc-specific; even the
|
||||||
# gcc-impersonating compilers won't accept them.
|
# gcc-impersonating compilers won't accept them.
|
||||||
PMIX_CFLAGS_BEFORE_PICKY="$CFLAGS"
|
PMIX_CFLAGS_BEFORE_PICKY="$CFLAGS"
|
||||||
if test "$WANT_PICKY_COMPILER" = 1 -a "$pmix_c_vendor" = "gnu" ; then
|
|
||||||
add="-Wall -Wundef -Wsign-compare"
|
|
||||||
add="$add -Wmissing-prototypes -Wstrict-prototypes"
|
|
||||||
add="$add -Wcomment -pedantic"
|
|
||||||
add="$add -Werror-implicit-function-declaration "
|
|
||||||
|
|
||||||
CFLAGS="$CFLAGS $add"
|
if test $WANT_PICKY_COMPILER -eq 1; then
|
||||||
|
CFLAGS_orig=$CFLAGS
|
||||||
|
add=
|
||||||
|
|
||||||
|
# These flags are likely GCC-specific (or, more specifically,
|
||||||
|
# we don't have general tests for each one, and we know they
|
||||||
|
# work with all versions of GCC that we have used throughout
|
||||||
|
# the years, so we'll keep them limited just to GCC).
|
||||||
|
if test "$pmix_c_vendor" = "gnu" ; then
|
||||||
|
add="$add -Wall -Wundef -Wno-long-long -Wsign-compare"
|
||||||
|
add="$add -Wmissing-prototypes -Wstrict-prototypes"
|
||||||
|
add="$add -Wcomment -pedantic"
|
||||||
|
fi
|
||||||
|
|
||||||
|
# see if -Wno-long-double works...
|
||||||
|
# Starting with GCC-4.4, the compiler complains about not
|
||||||
|
# knowing -Wno-long-double, only if -Wstrict-prototypes is set, too.
|
||||||
|
#
|
||||||
|
# Actually, this is not real fix, as GCC will pass on any -Wno- flag,
|
||||||
|
# have fun with the warning: -Wno-britney
|
||||||
|
CFLAGS="$CFLAGS_orig $add -Wno-long-double -Wstrict-prototypes"
|
||||||
|
|
||||||
|
AC_CACHE_CHECK([if $CC supports -Wno-long-double],
|
||||||
|
[pmix_cv_cc_wno_long_double],
|
||||||
|
[AC_TRY_COMPILE([], [],
|
||||||
|
[
|
||||||
|
dnl So -Wno-long-double did not produce any errors...
|
||||||
|
dnl We will try to extract a warning regarding
|
||||||
|
dnl unrecognized or ignored options
|
||||||
|
AC_TRY_COMPILE([], [long double test;],
|
||||||
|
[
|
||||||
|
pmix_cv_cc_wno_long_double="yes"
|
||||||
|
if test -s conftest.err ; then
|
||||||
|
dnl Yes, it should be "ignor", in order to catch ignoring and ignore
|
||||||
|
for i in unknown invalid ignor unrecognized ; do
|
||||||
|
$GREP -iq $i conftest.err
|
||||||
|
if test "$?" = "0" ; then
|
||||||
|
pmix_cv_cc_wno_long_double="no"
|
||||||
|
break;
|
||||||
|
fi
|
||||||
|
done
|
||||||
|
fi
|
||||||
|
],
|
||||||
|
[pmix_cv_cc_wno_long_double="no"])],
|
||||||
|
[pmix_cv_cc_wno_long_double="no"])
|
||||||
|
])
|
||||||
|
|
||||||
|
if test "$pmix_cv_cc_wno_long_double" = "yes" ; then
|
||||||
|
add="$add -Wno-long-double"
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Per above, we know that this flag works with GCC / haven't
|
||||||
|
# really tested it elsewhere.
|
||||||
|
if test "$pmix_c_vendor" = "gnu" ; then
|
||||||
|
add="$add -Werror-implicit-function-declaration "
|
||||||
|
fi
|
||||||
|
|
||||||
|
CFLAGS="$CFLAGS_orig $add"
|
||||||
PMIX_UNIQ(CFLAGS)
|
PMIX_UNIQ(CFLAGS)
|
||||||
AC_MSG_WARN([$add has been added to CFLAGS (--enable-picky)])
|
AC_MSG_WARN([$add has been added to CFLAGS (--enable-picky)])
|
||||||
unset add
|
unset add
|
||||||
@ -147,12 +148,27 @@ AC_DEFUN([PMIX_SETUP_CC],[
|
|||||||
if test "$GCC" = "yes"; then
|
if test "$GCC" = "yes"; then
|
||||||
CFLAGS_orig="$CFLAGS"
|
CFLAGS_orig="$CFLAGS"
|
||||||
|
|
||||||
|
# Note: Some versions of clang (at least >= 3.5 -- perhaps
|
||||||
|
# older versions, too?) will *warn* about -finline-functions,
|
||||||
|
# but still allow it. This is very annoying, so check for
|
||||||
|
# that warning, too. The clang warning looks like this:
|
||||||
|
# clang: warning: optimization flag '-finline-functions' is not supported
|
||||||
|
# clang: warning: argument unused during compilation: '-finline-functions'
|
||||||
CFLAGS="$CFLAGS_orig -finline-functions"
|
CFLAGS="$CFLAGS_orig -finline-functions"
|
||||||
add=
|
add=
|
||||||
AC_CACHE_CHECK([if $CC supports -finline-functions],
|
AC_CACHE_CHECK([if $CC supports -finline-functions],
|
||||||
[pmix_cv_cc_finline_functions],
|
[pmix_cv_cc_finline_functions],
|
||||||
[AC_TRY_COMPILE([], [],
|
[AC_TRY_COMPILE([], [],
|
||||||
[pmix_cv_cc_finline_functions="yes"],
|
[pmix_cv_cc_finline_functions="yes"
|
||||||
|
if test -s conftest.err ; then
|
||||||
|
for i in unused 'not supported' ; do
|
||||||
|
if $GREP -iq "$i" conftest.err; then
|
||||||
|
pmix_cv_cc_finline_functions="no"
|
||||||
|
break;
|
||||||
|
fi
|
||||||
|
done
|
||||||
|
fi
|
||||||
|
],
|
||||||
[pmix_cv_cc_finline_functions="no"])])
|
[pmix_cv_cc_finline_functions="no"])])
|
||||||
if test "$pmix_cv_cc_finline_functions" = "yes" ; then
|
if test "$pmix_cv_cc_finline_functions" = "yes" ; then
|
||||||
add=" -finline-functions"
|
add=" -finline-functions"
|
||||||
@ -287,7 +303,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"
|
||||||
|
|
||||||
# $%@#!@#% 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
|
||||||
])
|
])
|
||||||
@ -297,13 +313,15 @@ AC_DEFUN([_PMIX_PROG_CC],[
|
|||||||
#
|
#
|
||||||
# Check for the compiler
|
# Check for the compiler
|
||||||
#
|
#
|
||||||
|
PMIX_VAR_SCOPE_PUSH([pmix_cflags_save dummy pmix_cc_arvgv0])
|
||||||
pmix_cflags_save="$CFLAGS"
|
pmix_cflags_save="$CFLAGS"
|
||||||
AC_PROG_CC
|
AC_PROG_CC
|
||||||
BASECC="`basename $CC`"
|
BASECC="`basename $CC`"
|
||||||
CFLAGS="$pmix_cflags_save"
|
CFLAGS="$pmix_cflags_save"
|
||||||
AC_DEFINE_UNQUOTED(PMIX_CC, "$CC", [PMIX underlying C compiler])
|
AC_DEFINE_UNQUOTED(PMIX_CC, "$CC", [PMIx underlying C compiler])
|
||||||
set dummy $CC
|
set dummy $CC
|
||||||
pmix_cc_argv0=[$]2
|
pmix_cc_argv0=[$]2
|
||||||
PMIX_WHICH([$pmix_cc_argv0], [PMIX_CC_ABSOLUTE])
|
PMIX_WHICH([$pmix_cc_argv0], [PMIX_CC_ABSOLUTE])
|
||||||
AC_SUBST(PMIX_CC_ABSOLUTE)
|
AC_SUBST(PMIX_CC_ABSOLUTE)
|
||||||
|
PMIX_VAR_SCOPE_POP
|
||||||
])
|
])
|
||||||
|
@ -39,7 +39,7 @@ AC_DEFUN([_PMIX_HWLOC_EMBEDDED_MODE],[
|
|||||||
AC_MSG_CHECKING([for hwloc])
|
AC_MSG_CHECKING([for hwloc])
|
||||||
AC_MSG_RESULT([assumed available (embedded mode)])
|
AC_MSG_RESULT([assumed available (embedded mode)])
|
||||||
|
|
||||||
PMIX_HWLOC_HEADER=$with_hwloc_header
|
PMIX_HWLOC_HEADER="$with_hwloc_header"
|
||||||
PMIX_HWLOC_CPPFLAGS=
|
PMIX_HWLOC_CPPFLAGS=
|
||||||
PMIX_HWLOC_LIB=
|
PMIX_HWLOC_LIB=
|
||||||
PMIX_HWLOC_LDFLAGS=
|
PMIX_HWLOC_LDFLAGS=
|
||||||
|
@ -39,12 +39,13 @@ AC_DEFUN([_PMIX_LIBEVENT_EMBEDDED_MODE],[
|
|||||||
AC_MSG_CHECKING([for libevent])
|
AC_MSG_CHECKING([for libevent])
|
||||||
AC_MSG_RESULT([assumed available (embedded mode)])
|
AC_MSG_RESULT([assumed available (embedded mode)])
|
||||||
|
|
||||||
PMIX_EVENT_HEADER=$with_libevent_header
|
PMIX_EVENT_HEADER="$with_libevent_header"
|
||||||
PMIX_EVENT2_THREAD_HEADER=$with_libevent_header
|
PMIX_EVENT2_THREAD_HEADER="$with_libevent_header"
|
||||||
PMIX_EVENT_CPPFLAGS=
|
PMIX_EVENT_CPPFLAGS=
|
||||||
PMIX_EVENT_LIB=
|
PMIX_EVENT_LIB=
|
||||||
PMIX_EVENT_LDFLAGS=
|
PMIX_EVENT_LDFLAGS=
|
||||||
])
|
|
||||||
|
])
|
||||||
|
|
||||||
AC_DEFUN([_PMIX_LIBEVENT_EXTERNAL],[
|
AC_DEFUN([_PMIX_LIBEVENT_EXTERNAL],[
|
||||||
PMIX_VAR_SCOPE_PUSH([pmix_event_dir pmix_event_libdir])
|
PMIX_VAR_SCOPE_PUSH([pmix_event_dir pmix_event_libdir])
|
||||||
|
@ -146,19 +146,6 @@ LT_INIT()
|
|||||||
LT_LANG([C])
|
LT_LANG([C])
|
||||||
LT_LANG([C++])
|
LT_LANG([C++])
|
||||||
|
|
||||||
####################################################################
|
|
||||||
# Setup C compiler
|
|
||||||
####################################################################
|
|
||||||
|
|
||||||
CFLAGS_save="$CFLAGS"
|
|
||||||
AC_PROG_CC
|
|
||||||
CFLAGS="$CFLAGS_save"
|
|
||||||
|
|
||||||
AC_ARG_VAR(CC_FOR_BUILD,[build system C compiler])
|
|
||||||
AS_IF([test -z "$CC_FOR_BUILD"],[
|
|
||||||
AC_SUBST([CC_FOR_BUILD], [$CC])
|
|
||||||
])
|
|
||||||
|
|
||||||
############################################################################
|
############################################################################
|
||||||
# Configuration options
|
# Configuration options
|
||||||
############################################################################
|
############################################################################
|
||||||
@ -182,6 +169,37 @@ PMIX_SETUP_CORE([])
|
|||||||
# Run the AM_CONDITIONALs
|
# Run the AM_CONDITIONALs
|
||||||
PMIX_DO_AM_CONDITIONALS
|
PMIX_DO_AM_CONDITIONALS
|
||||||
|
|
||||||
|
####################################################################
|
||||||
|
# Setup C compiler
|
||||||
|
####################################################################
|
||||||
|
|
||||||
|
CFLAGS_save="$CFLAGS"
|
||||||
|
AC_PROG_CC
|
||||||
|
CFLAGS="$CFLAGS_save"
|
||||||
|
|
||||||
|
AC_ARG_VAR(CC_FOR_BUILD,[build system C compiler])
|
||||||
|
AS_IF([test -z "$CC_FOR_BUILD"],[
|
||||||
|
AC_SUBST([CC_FOR_BUILD], [$CC])
|
||||||
|
])
|
||||||
|
|
||||||
|
PMIX_SETUP_CC
|
||||||
|
|
||||||
|
#
|
||||||
|
# Delayed the substitution of CFLAGS and CXXFLAGS until now because
|
||||||
|
# they may have been modified throughout the course of this script.
|
||||||
|
#
|
||||||
|
|
||||||
|
AC_SUBST(CFLAGS)
|
||||||
|
AC_SUBST(CPPFLAGS)
|
||||||
|
|
||||||
|
pmix_show_title "Final compiler flags"
|
||||||
|
|
||||||
|
AC_MSG_CHECKING([final CPPFLAGS])
|
||||||
|
AC_MSG_RESULT([$CPPFLAGS])
|
||||||
|
|
||||||
|
AC_MSG_CHECKING([final CFLAGS])
|
||||||
|
AC_MSG_RESULT([$CFLAGS])
|
||||||
|
|
||||||
####################################################################
|
####################################################################
|
||||||
# Version information
|
# Version information
|
||||||
####################################################################
|
####################################################################
|
||||||
@ -197,4 +215,7 @@ AC_SUBST([libpmix_so_version])
|
|||||||
AC_CONFIG_FILES(pmix_config_prefix[test/Makefile]
|
AC_CONFIG_FILES(pmix_config_prefix[test/Makefile]
|
||||||
pmix_config_prefix[test/simple/Makefile]
|
pmix_config_prefix[test/simple/Makefile]
|
||||||
pmix_config_prefix[examples/Makefile])
|
pmix_config_prefix[examples/Makefile])
|
||||||
|
|
||||||
|
pmix_show_title "Configuration complete"
|
||||||
|
|
||||||
AC_OUTPUT
|
AC_OUTPUT
|
||||||
|
@ -24,6 +24,8 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
#include <pmix/autogen/config.h>
|
#include <pmix/autogen/config.h>
|
||||||
|
|
||||||
|
#define _GNU_SOURCE
|
||||||
#include <stdbool.h>
|
#include <stdbool.h>
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
@ -45,26 +47,26 @@ int main(int argc, char **argv)
|
|||||||
|
|
||||||
/* init us */
|
/* init us */
|
||||||
if (PMIX_SUCCESS != (rc = PMIx_Init(&myproc))) {
|
if (PMIX_SUCCESS != (rc = PMIx_Init(&myproc))) {
|
||||||
pmix_output(0, "Client ns %s rank %d: PMIx_Init failed: %d", myproc.nspace, myproc.rank, rc);
|
fprintf(stderr, "Client ns %s rank %d: PMIx_Init failed: %d\n", myproc.nspace, myproc.rank, rc);
|
||||||
exit(0);
|
exit(0);
|
||||||
}
|
}
|
||||||
pmix_output(0, "Client ns %s rank %d: Running", myproc.nspace, myproc.rank);
|
fprintf(stderr, "Client ns %s rank %d: Running\n", myproc.nspace, myproc.rank);
|
||||||
|
|
||||||
/* get our universe size */
|
/* get our universe size */
|
||||||
if (PMIX_SUCCESS != (rc = PMIx_Get(&myproc, PMIX_UNIV_SIZE, NULL, 0, &val))) {
|
if (PMIX_SUCCESS != (rc = PMIx_Get(&myproc, PMIX_UNIV_SIZE, NULL, 0, &val))) {
|
||||||
pmix_output(0, "Client ns %s rank %d: PMIx_Get universe size failed: %d", myproc.nspace, myproc.rank, rc);
|
fprintf(stderr, "Client ns %s rank %d: PMIx_Get universe size failed: %d\n", myproc.nspace, myproc.rank, rc);
|
||||||
goto done;
|
goto done;
|
||||||
}
|
}
|
||||||
nprocs = val->data.uint32;
|
nprocs = val->data.uint32;
|
||||||
PMIX_VALUE_RELEASE(val);
|
PMIX_VALUE_RELEASE(val);
|
||||||
pmix_output(0, "Client %s:%d universe size %d", myproc.nspace, myproc.rank, nprocs);
|
fprintf(stderr, "Client %s:%d universe size %d\n", myproc.nspace, myproc.rank, nprocs);
|
||||||
|
|
||||||
/* put a few values */
|
/* put a few values */
|
||||||
(void)asprintf(&tmp, "%s-%d-internal", myproc.nspace, myproc.rank);
|
(void)asprintf(&tmp, "%s-%d-internal", myproc.nspace, myproc.rank);
|
||||||
value.type = PMIX_UINT32;
|
value.type = PMIX_UINT32;
|
||||||
value.data.uint32 = 1234;
|
value.data.uint32 = 1234;
|
||||||
if (PMIX_SUCCESS != (rc = PMIx_Store_internal(&myproc, tmp, &value))) {
|
if (PMIX_SUCCESS != (rc = PMIx_Store_internal(&myproc, tmp, &value))) {
|
||||||
pmix_output(0, "Client ns %s rank %d: PMIx_Store_internal failed: %d", myproc.nspace, myproc.rank, rc);
|
fprintf(stderr, "Client ns %s rank %d: PMIx_Store_internal failed: %d\n", myproc.nspace, myproc.rank, rc);
|
||||||
goto done;
|
goto done;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -72,7 +74,7 @@ int main(int argc, char **argv)
|
|||||||
value.type = PMIX_UINT64;
|
value.type = PMIX_UINT64;
|
||||||
value.data.uint64 = 1234;
|
value.data.uint64 = 1234;
|
||||||
if (PMIX_SUCCESS != (rc = PMIx_Put(PMIX_LOCAL, tmp, &value))) {
|
if (PMIX_SUCCESS != (rc = PMIx_Put(PMIX_LOCAL, tmp, &value))) {
|
||||||
pmix_output(0, "Client ns %s rank %d: PMIx_Put internal failed: %d", myproc.nspace, myproc.rank, rc);
|
fprintf(stderr, "Client ns %s rank %d: PMIx_Put internal failed: %d\n", myproc.nspace, myproc.rank, rc);
|
||||||
goto done;
|
goto done;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -80,12 +82,12 @@ int main(int argc, char **argv)
|
|||||||
value.type = PMIX_STRING;
|
value.type = PMIX_STRING;
|
||||||
value.data.string = "1234";
|
value.data.string = "1234";
|
||||||
if (PMIX_SUCCESS != (rc = PMIx_Put(PMIX_REMOTE, tmp, &value))) {
|
if (PMIX_SUCCESS != (rc = PMIx_Put(PMIX_REMOTE, tmp, &value))) {
|
||||||
pmix_output(0, "Client ns %s rank %d: PMIx_Put internal failed: %d", myproc.nspace, myproc.rank, rc);
|
fprintf(stderr, "Client ns %s rank %d: PMIx_Put internal failed: %d\n", myproc.nspace, myproc.rank, rc);
|
||||||
goto done;
|
goto done;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (PMIX_SUCCESS != (rc = PMIx_Commit())) {
|
if (PMIX_SUCCESS != (rc = PMIx_Commit())) {
|
||||||
pmix_output(0, "Client ns %s rank %d: PMIx_Commit failed: %d", myproc.nspace, myproc.rank, rc);
|
fprintf(stderr, "Client ns %s rank %d: PMIx_Commit failed: %d\n", myproc.nspace, myproc.rank, rc);
|
||||||
goto done;
|
goto done;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -96,7 +98,7 @@ int main(int argc, char **argv)
|
|||||||
PMIX_INFO_CREATE(info, 1);
|
PMIX_INFO_CREATE(info, 1);
|
||||||
(void)strncpy(info->key, PMIX_COLLECT_DATA, PMIX_MAX_KEYLEN);
|
(void)strncpy(info->key, PMIX_COLLECT_DATA, PMIX_MAX_KEYLEN);
|
||||||
if (PMIX_SUCCESS != (rc = PMIx_Fence(&proc, 1, info, 1))) {
|
if (PMIX_SUCCESS != (rc = PMIx_Fence(&proc, 1, info, 1))) {
|
||||||
pmix_output(0, "Client ns %s rank %d: PMIx_Fence failed: %d", myproc.nspace, myproc.rank, rc);
|
fprintf(stderr, "Client ns %s rank %d: PMIx_Fence failed: %d\n", myproc.nspace, myproc.rank, rc);
|
||||||
goto done;
|
goto done;
|
||||||
}
|
}
|
||||||
PMIX_INFO_FREE(info, 1);
|
PMIX_INFO_FREE(info, 1);
|
||||||
@ -105,49 +107,49 @@ int main(int argc, char **argv)
|
|||||||
for (n=0; n < nprocs; n++) {
|
for (n=0; n < nprocs; n++) {
|
||||||
(void)asprintf(&tmp, "%s-%d-local", myproc.nspace, myproc.rank);
|
(void)asprintf(&tmp, "%s-%d-local", myproc.nspace, myproc.rank);
|
||||||
if (PMIX_SUCCESS != (rc = PMIx_Get(&myproc, tmp, NULL, 0, &val))) {
|
if (PMIX_SUCCESS != (rc = PMIx_Get(&myproc, tmp, NULL, 0, &val))) {
|
||||||
pmix_output(0, "Client ns %s rank %d: PMIx_Get %s failed: %d", myproc.nspace, myproc.rank, tmp, rc);
|
fprintf(stderr, "Client ns %s rank %d: PMIx_Get %s failed: %d\n", myproc.nspace, myproc.rank, tmp, rc);
|
||||||
goto done;
|
goto done;
|
||||||
}
|
}
|
||||||
if (PMIX_UINT64 != val->type) {
|
if (PMIX_UINT64 != val->type) {
|
||||||
pmix_output(0, "Client ns %s rank %d: PMIx_Get %s returned wrong type: %d", myproc.nspace, myproc.rank, tmp, val->type);
|
fprintf(stderr, "Client ns %s rank %d: PMIx_Get %s returned wrong type: %d\n", myproc.nspace, myproc.rank, tmp, val->type);
|
||||||
PMIX_VALUE_RELEASE(val);
|
PMIX_VALUE_RELEASE(val);
|
||||||
free(tmp);
|
free(tmp);
|
||||||
goto done;
|
goto done;
|
||||||
}
|
}
|
||||||
if (1234 != val->data.uint64) {
|
if (1234 != val->data.uint64) {
|
||||||
pmix_output(0, "Client ns %s rank %d: PMIx_Get %s returned wrong value: %d", myproc.nspace, myproc.rank, tmp, (int)val->data.uint64);
|
fprintf(stderr, "Client ns %s rank %d: PMIx_Get %s returned wrong value: %d\n", myproc.nspace, myproc.rank, tmp, (int)val->data.uint64);
|
||||||
PMIX_VALUE_RELEASE(val);
|
PMIX_VALUE_RELEASE(val);
|
||||||
free(tmp);
|
free(tmp);
|
||||||
goto done;
|
goto done;
|
||||||
}
|
}
|
||||||
pmix_output(0, "Client ns %s rank %d: PMIx_Get %s returned correct", myproc.nspace, myproc.rank, tmp);
|
fprintf(stderr, "Client ns %s rank %d: PMIx_Get %s returned correct\n", myproc.nspace, myproc.rank, tmp);
|
||||||
PMIX_VALUE_RELEASE(val);
|
PMIX_VALUE_RELEASE(val);
|
||||||
free(tmp);
|
free(tmp);
|
||||||
(void)asprintf(&tmp, "%s-%d-remote", myproc.nspace, myproc.rank);
|
(void)asprintf(&tmp, "%s-%d-remote", myproc.nspace, myproc.rank);
|
||||||
if (PMIX_SUCCESS != (rc = PMIx_Get(&myproc, tmp, NULL, 0, &val))) {
|
if (PMIX_SUCCESS != (rc = PMIx_Get(&myproc, tmp, NULL, 0, &val))) {
|
||||||
pmix_output(0, "Client ns %s rank %d: PMIx_Get %s failed: %d", myproc.nspace, myproc.rank, tmp, rc);
|
fprintf(stderr, "Client ns %s rank %d: PMIx_Get %s failed: %d\n", myproc.nspace, myproc.rank, tmp, rc);
|
||||||
goto done;
|
goto done;
|
||||||
}
|
}
|
||||||
if (PMIX_STRING != val->type) {
|
if (PMIX_STRING != val->type) {
|
||||||
pmix_output(0, "Client ns %s rank %d: PMIx_Get %s returned wrong type: %d", myproc.nspace, myproc.rank, tmp, val->type);
|
fprintf(stderr, "Client ns %s rank %d: PMIx_Get %s returned wrong type: %d\n", myproc.nspace, myproc.rank, tmp, val->type);
|
||||||
PMIX_VALUE_RELEASE(val);
|
PMIX_VALUE_RELEASE(val);
|
||||||
free(tmp);
|
free(tmp);
|
||||||
goto done;
|
goto done;
|
||||||
}
|
}
|
||||||
if (0 != strcmp(val->data.string, "1234")) {
|
if (0 != strcmp(val->data.string, "1234")) {
|
||||||
pmix_output(0, "Client ns %s rank %d: PMIx_Get %s returned wrong value: %s", myproc.nspace, myproc.rank, tmp, val->data.string);
|
fprintf(stderr, "Client ns %s rank %d: PMIx_Get %s returned wrong value: %s\n", myproc.nspace, myproc.rank, tmp, val->data.string);
|
||||||
PMIX_VALUE_RELEASE(val);
|
PMIX_VALUE_RELEASE(val);
|
||||||
free(tmp);
|
free(tmp);
|
||||||
goto done;
|
goto done;
|
||||||
}
|
}
|
||||||
pmix_output(0, "Client ns %s rank %d: PMIx_Get %s returned correct", myproc.nspace, myproc.rank, tmp);
|
fprintf(stderr, "Client ns %s rank %d: PMIx_Get %s returned correct\n", myproc.nspace, myproc.rank, tmp);
|
||||||
PMIX_VALUE_RELEASE(val);
|
PMIX_VALUE_RELEASE(val);
|
||||||
free(tmp);
|
free(tmp);
|
||||||
}
|
}
|
||||||
|
|
||||||
done:
|
done:
|
||||||
/* finalize us */
|
/* finalize us */
|
||||||
pmix_output(0, "Client ns %s rank %d: Finalizing", myproc.nspace, myproc.rank);
|
fprintf(stderr, "Client ns %s rank %d: Finalizing\n", myproc.nspace, myproc.rank);
|
||||||
if (PMIX_SUCCESS != (rc = PMIx_Finalize())) {
|
if (PMIX_SUCCESS != (rc = PMIx_Finalize())) {
|
||||||
fprintf(stderr, "Client ns %s rank %d:PMIx_Finalize failed: %d\n", myproc.nspace, myproc.rank, rc);
|
fprintf(stderr, "Client ns %s rank %d:PMIx_Finalize failed: %d\n", myproc.nspace, myproc.rank, rc);
|
||||||
} else {
|
} else {
|
||||||
|
@ -25,7 +25,10 @@
|
|||||||
|
|
||||||
#include <pmix/autogen/config.h>
|
#include <pmix/autogen/config.h>
|
||||||
#include <stdbool.h>
|
#include <stdbool.h>
|
||||||
|
|
||||||
|
#define _GNU_SOURCE
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
|
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#include <unistd.h>
|
#include <unistd.h>
|
||||||
#include <time.h>
|
#include <time.h>
|
||||||
@ -47,7 +50,7 @@ static void opcbfunc(pmix_status_t status, void *cbdata)
|
|||||||
{
|
{
|
||||||
bool *active = (bool*)cbdata;
|
bool *active = (bool*)cbdata;
|
||||||
|
|
||||||
pmix_output(0, "%s:%d completed fence_nb", myproc.nspace, myproc.rank);
|
fprintf(stderr, "%s:%d completed fence_nb\n", myproc.nspace, myproc.rank);
|
||||||
*active = false;
|
*active = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -59,29 +62,29 @@ static void valcbfunc(pmix_status_t status,
|
|||||||
if (PMIX_SUCCESS == status) {
|
if (PMIX_SUCCESS == status) {
|
||||||
if (NULL != strstr(key, "local")) {
|
if (NULL != strstr(key, "local")) {
|
||||||
if (PMIX_UINT64 != val->type) {
|
if (PMIX_UINT64 != val->type) {
|
||||||
pmix_output(0, "%s:%d: PMIx_Get_nb Key %s returned wrong type: %d", myproc.nspace, myproc.rank, key, val->type);
|
fprintf(stderr, "%s:%d: PMIx_Get_nb Key %s returned wrong type: %d\n", myproc.nspace, myproc.rank, key, val->type);
|
||||||
goto done;
|
goto done;
|
||||||
}
|
}
|
||||||
if (1234 != val->data.uint64) {
|
if (1234 != val->data.uint64) {
|
||||||
pmix_output(0, "%s:%d: PMIx_Get_nb Key %s returned wrong value: %d", myproc.nspace, myproc.rank, key, (int)val->data.uint64);
|
fprintf(stderr, "%s:%d: PMIx_Get_nb Key %s returned wrong value: %d\n", myproc.nspace, myproc.rank, key, (int)val->data.uint64);
|
||||||
goto done;
|
goto done;
|
||||||
}
|
}
|
||||||
} else if (NULL != strstr(key, "remote")) {
|
} else if (NULL != strstr(key, "remote")) {
|
||||||
if (PMIX_STRING != val->type) {
|
if (PMIX_STRING != val->type) {
|
||||||
pmix_output(0, "%s:%d: PMIx_Get_nb Key %s returned wrong type: %d", myproc.nspace, myproc.rank, key, val->type);
|
fprintf(stderr, "%s:%d: PMIx_Get_nb Key %s returned wrong type: %d\n", myproc.nspace, myproc.rank, key, val->type);
|
||||||
goto done;
|
goto done;
|
||||||
}
|
}
|
||||||
if (0 != strcmp(val->data.string, "1234")) {
|
if (0 != strcmp(val->data.string, "1234")) {
|
||||||
pmix_output(0, "%s:%d: PMIx_Get_nb Key %s returned wrong value: %s", myproc.nspace, myproc.rank, key, val->data.string);
|
fprintf(stderr, "%s:%d: PMIx_Get_nb Key %s returned wrong value: %s\n", myproc.nspace, myproc.rank, key, val->data.string);
|
||||||
goto done;
|
goto done;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
pmix_output(0, "%s:%d PMIx_Get_nb returned wrong key: %s", myproc.nspace, myproc.rank, key);
|
fprintf(stderr, "%s:%d PMIx_Get_nb returned wrong key: %s\n", myproc.nspace, myproc.rank, key);
|
||||||
goto done;
|
goto done;
|
||||||
}
|
}
|
||||||
pmix_output(0, "%s:%d PMIx_Get_nb Key %s returned correctly", myproc.nspace, myproc.rank, key);
|
fprintf(stderr, "%s:%d PMIx_Get_nb Key %s returned correctly\n", myproc.nspace, myproc.rank, key);
|
||||||
} else {
|
} else {
|
||||||
pmix_output(0, "%s:%d PMIx_Get_nb Key %s failed", myproc.nspace, myproc.rank, key);
|
fprintf(stderr, "%s:%d PMIx_Get_nb Key %s failed\n", myproc.nspace, myproc.rank, key);
|
||||||
}
|
}
|
||||||
done:
|
done:
|
||||||
free(key);
|
free(key);
|
||||||
@ -100,26 +103,26 @@ int main(int argc, char **argv)
|
|||||||
|
|
||||||
/* init us */
|
/* init us */
|
||||||
if (PMIX_SUCCESS != (rc = PMIx_Init(&myproc))) {
|
if (PMIX_SUCCESS != (rc = PMIx_Init(&myproc))) {
|
||||||
pmix_output(0, "Client ns %s rank %d: PMIx_Init failed: %d", myproc.nspace, myproc.rank, rc);
|
fprintf(stderr, "Client ns %s rank %d: PMIx_Init failed: %d\n", myproc.nspace, myproc.rank, rc);
|
||||||
exit(0);
|
exit(0);
|
||||||
}
|
}
|
||||||
pmix_output(0, "Client ns %s rank %d: Running", myproc.nspace, myproc.rank);
|
fprintf(stderr, "Client ns %s rank %d: Running\n", myproc.nspace, myproc.rank);
|
||||||
|
|
||||||
/* get our universe size */
|
/* get our universe size */
|
||||||
if (PMIX_SUCCESS != (rc = PMIx_Get(&myproc, PMIX_UNIV_SIZE, NULL, 0, &val))) {
|
if (PMIX_SUCCESS != (rc = PMIx_Get(&myproc, PMIX_UNIV_SIZE, NULL, 0, &val))) {
|
||||||
pmix_output(0, "Client ns %s rank %d: PMIx_Get universe size failed: %d", myproc.nspace, myproc.rank, rc);
|
fprintf(stderr, "Client ns %s rank %d: PMIx_Get universe size failed: %d\n", myproc.nspace, myproc.rank, rc);
|
||||||
goto done;
|
goto done;
|
||||||
}
|
}
|
||||||
nprocs = val->data.uint32;
|
nprocs = val->data.uint32;
|
||||||
PMIX_VALUE_RELEASE(val);
|
PMIX_VALUE_RELEASE(val);
|
||||||
pmix_output(0, "Client %s:%d universe size %d", myproc.nspace, myproc.rank, nprocs);
|
fprintf(stderr, "Client %s:%d universe size %d\n", myproc.nspace, myproc.rank, nprocs);
|
||||||
|
|
||||||
/* put a few values */
|
/* put a few values */
|
||||||
(void)asprintf(&tmp, "%s-%d-internal", myproc.nspace, myproc.rank);
|
(void)asprintf(&tmp, "%s-%d-internal", myproc.nspace, myproc.rank);
|
||||||
value.type = PMIX_UINT32;
|
value.type = PMIX_UINT32;
|
||||||
value.data.uint32 = 1234;
|
value.data.uint32 = 1234;
|
||||||
if (PMIX_SUCCESS != (rc = PMIx_Store_internal(&myproc, tmp, &value))) {
|
if (PMIX_SUCCESS != (rc = PMIx_Store_internal(&myproc, tmp, &value))) {
|
||||||
pmix_output(0, "Client ns %s rank %d: PMIx_Store_internal failed: %d", myproc.nspace, myproc.rank, rc);
|
fprintf(stderr, "Client ns %s rank %d: PMIx_Store_internal failed: %d\n", myproc.nspace, myproc.rank, rc);
|
||||||
goto done;
|
goto done;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -127,7 +130,7 @@ int main(int argc, char **argv)
|
|||||||
value.type = PMIX_UINT64;
|
value.type = PMIX_UINT64;
|
||||||
value.data.uint64 = 1234;
|
value.data.uint64 = 1234;
|
||||||
if (PMIX_SUCCESS != (rc = PMIx_Put(PMIX_LOCAL, tmp, &value))) {
|
if (PMIX_SUCCESS != (rc = PMIx_Put(PMIX_LOCAL, tmp, &value))) {
|
||||||
pmix_output(0, "Client ns %s rank %d: PMIx_Put internal failed: %d", myproc.nspace, myproc.rank, rc);
|
fprintf(stderr, "Client ns %s rank %d: PMIx_Put internal failed: %d\n", myproc.nspace, myproc.rank, rc);
|
||||||
goto done;
|
goto done;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -135,7 +138,7 @@ int main(int argc, char **argv)
|
|||||||
value.type = PMIX_STRING;
|
value.type = PMIX_STRING;
|
||||||
value.data.string = "1234";
|
value.data.string = "1234";
|
||||||
if (PMIX_SUCCESS != (rc = PMIx_Put(PMIX_REMOTE, tmp, &value))) {
|
if (PMIX_SUCCESS != (rc = PMIx_Put(PMIX_REMOTE, tmp, &value))) {
|
||||||
pmix_output(0, "Client ns %s rank %d: PMIx_Put internal failed: %d", myproc.nspace, myproc.rank, rc);
|
fprintf(stderr, "Client ns %s rank %d: PMIx_Put internal failed: %d\n", myproc.nspace, myproc.rank, rc);
|
||||||
goto done;
|
goto done;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -147,7 +150,7 @@ int main(int argc, char **argv)
|
|||||||
|
|
||||||
/* commit the data to the server */
|
/* commit the data to the server */
|
||||||
if (PMIX_SUCCESS != (rc = PMIx_Commit())) {
|
if (PMIX_SUCCESS != (rc = PMIx_Commit())) {
|
||||||
pmix_output(0, "Client ns %s rank %d: PMIx_Commit failed: %d", myproc.nspace, myproc.rank, rc);
|
fprintf(stderr, "Client ns %s rank %d: PMIx_Commit failed: %d\n", myproc.nspace, myproc.rank, rc);
|
||||||
goto done;
|
goto done;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -157,7 +160,7 @@ int main(int argc, char **argv)
|
|||||||
proc.rank = PMIX_RANK_WILDCARD;
|
proc.rank = PMIX_RANK_WILDCARD;
|
||||||
active = true;
|
active = true;
|
||||||
if (PMIX_SUCCESS != (rc = PMIx_Fence_nb(&proc, 1, NULL, 0, opcbfunc, &active))) {
|
if (PMIX_SUCCESS != (rc = PMIx_Fence_nb(&proc, 1, NULL, 0, opcbfunc, &active))) {
|
||||||
pmix_output(0, "Client ns %s rank %d: PMIx_Fence failed: %d", myproc.nspace, myproc.rank, rc);
|
fprintf(stderr, "Client ns %s rank %d: PMIx_Fence failed: %d\n", myproc.nspace, myproc.rank, rc);
|
||||||
goto done;
|
goto done;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -169,7 +172,7 @@ int main(int argc, char **argv)
|
|||||||
proc.rank = n;
|
proc.rank = n;
|
||||||
if (PMIX_SUCCESS != (rc = PMIx_Get_nb(&proc, tmp,
|
if (PMIX_SUCCESS != (rc = PMIx_Get_nb(&proc, tmp,
|
||||||
NULL, 0, valcbfunc, tmp))) {
|
NULL, 0, valcbfunc, tmp))) {
|
||||||
pmix_output(0, "Client ns %s rank %d: PMIx_Get %s failed: %d", myproc.nspace, n, tmp, rc);
|
fprintf(stderr, "Client ns %s rank %d: PMIx_Get %s failed: %d\n", myproc.nspace, n, tmp, rc);
|
||||||
goto done;
|
goto done;
|
||||||
}
|
}
|
||||||
++num_gets;
|
++num_gets;
|
||||||
@ -177,7 +180,7 @@ int main(int argc, char **argv)
|
|||||||
(void)strncpy(proc.nspace, tmp, PMIX_MAX_NSLEN);
|
(void)strncpy(proc.nspace, tmp, PMIX_MAX_NSLEN);
|
||||||
if (PMIX_SUCCESS != (rc = PMIx_Get_nb(&proc, tmp,
|
if (PMIX_SUCCESS != (rc = PMIx_Get_nb(&proc, tmp,
|
||||||
NULL, 0, valcbfunc, tmp))) {
|
NULL, 0, valcbfunc, tmp))) {
|
||||||
pmix_output(0, "Client ns %s rank %d: PMIx_Get %s failed: %d", myproc.nspace, n, tmp, rc);
|
fprintf(stderr, "Client ns %s rank %d: PMIx_Get %s failed: %d\n", myproc.nspace, n, tmp, rc);
|
||||||
goto done;
|
goto done;
|
||||||
}
|
}
|
||||||
++num_gets;
|
++num_gets;
|
||||||
@ -198,13 +201,13 @@ int main(int argc, char **argv)
|
|||||||
(void)strncpy(proc.nspace, myproc.nspace, PMIX_MAX_NSLEN);
|
(void)strncpy(proc.nspace, myproc.nspace, PMIX_MAX_NSLEN);
|
||||||
proc.rank = PMIX_RANK_WILDCARD;
|
proc.rank = PMIX_RANK_WILDCARD;
|
||||||
if (PMIX_SUCCESS != (rc = PMIx_Fence(&proc, 1, NULL, 0))) {
|
if (PMIX_SUCCESS != (rc = PMIx_Fence(&proc, 1, NULL, 0))) {
|
||||||
pmix_output(0, "Client ns %s rank %d: PMIx_Fence failed: %d", myproc.nspace, myproc.rank, rc);
|
fprintf(stderr, "Client ns %s rank %d: PMIx_Fence failed: %d\n", myproc.nspace, myproc.rank, rc);
|
||||||
goto done;
|
goto done;
|
||||||
}
|
}
|
||||||
|
|
||||||
done:
|
done:
|
||||||
/* finalize us */
|
/* finalize us */
|
||||||
pmix_output(0, "Client ns %s rank %d: Finalizing", myproc.nspace, myproc.rank);
|
fprintf(stderr, "Client ns %s rank %d: Finalizing", myproc.nspace, myproc.rank);
|
||||||
if (PMIX_SUCCESS != (rc = PMIx_Finalize())) {
|
if (PMIX_SUCCESS != (rc = PMIx_Finalize())) {
|
||||||
fprintf(stderr, "Client ns %s rank %d:PMIx_Finalize failed: %d\n", myproc.nspace, myproc.rank, rc);
|
fprintf(stderr, "Client ns %s rank %d:PMIx_Finalize failed: %d\n", myproc.nspace, myproc.rank, rc);
|
||||||
} else {
|
} else {
|
||||||
|
@ -25,6 +25,8 @@
|
|||||||
|
|
||||||
#include <pmix/autogen/config.h>
|
#include <pmix/autogen/config.h>
|
||||||
#include <stdbool.h>
|
#include <stdbool.h>
|
||||||
|
|
||||||
|
#define _GNU_SOURCE
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#include <unistd.h>
|
#include <unistd.h>
|
||||||
@ -32,6 +34,7 @@
|
|||||||
|
|
||||||
#include <pmix.h>
|
#include <pmix.h>
|
||||||
|
|
||||||
|
|
||||||
static pmix_proc_t myproc;
|
static pmix_proc_t myproc;
|
||||||
|
|
||||||
int main(int argc, char **argv)
|
int main(int argc, char **argv)
|
||||||
@ -47,43 +50,48 @@ int main(int argc, char **argv)
|
|||||||
pmix_proc_t *peers;
|
pmix_proc_t *peers;
|
||||||
size_t npeers, ntmp=0;
|
size_t npeers, ntmp=0;
|
||||||
char *nodelist;
|
char *nodelist;
|
||||||
|
|
||||||
gethostname(hostname, 1024);
|
gethostname(hostname, 1024);
|
||||||
|
|
||||||
/* init us */
|
/* init us */
|
||||||
if (PMIX_SUCCESS != (rc = PMIx_Init(&myproc))) {
|
if (PMIX_SUCCESS != (rc = PMIx_Init(&myproc))) {
|
||||||
pmix_output(0, "Client ns %s rank %d: PMIx_Init failed: %d", myproc.nspace, myproc.rank, rc);
|
fprintf(stderr, "Client ns %s rank %d: PMIx_Init failed: %d\n", myproc.nspace, myproc.rank, rc);
|
||||||
exit(0);
|
exit(0);
|
||||||
}
|
}
|
||||||
pmix_output(0, "Client ns %s rank %d: Running", myproc.nspace, myproc.rank);
|
fprintf(stderr, "Client ns %s rank %d: Running\n", myproc.nspace, myproc.rank);
|
||||||
|
|
||||||
/* get our universe size */
|
/* get our universe size */
|
||||||
if (PMIX_SUCCESS != (rc = PMIx_Get(&myproc, PMIX_UNIV_SIZE, NULL, 0, &val))) {
|
if (PMIX_SUCCESS != (rc = PMIx_Get(&myproc, PMIX_UNIV_SIZE, NULL, 0, &val))) {
|
||||||
pmix_output(0, "Client ns %s rank %d: PMIx_Get universe size failed: %d", myproc.nspace, myproc.rank, rc);
|
fprintf(stderr, "Client ns %s rank %d: PMIx_Get universe size failed: %d\n", myproc.nspace, myproc.rank, rc);
|
||||||
goto done;
|
goto done;
|
||||||
}
|
}
|
||||||
nprocs = val->data.uint32;
|
nprocs = val->data.uint32;
|
||||||
PMIX_VALUE_RELEASE(val);
|
PMIX_VALUE_RELEASE(val);
|
||||||
pmix_output(0, "Client %s:%d universe size %d", myproc.nspace, myproc.rank, nprocs);
|
fprintf(stderr, "Client %s:%d universe size %d\n", myproc.nspace, myproc.rank, nprocs);
|
||||||
|
|
||||||
/* call fence to sync */
|
/* call fence to sync */
|
||||||
PMIX_PROC_CONSTRUCT(&proc);
|
PMIX_PROC_CONSTRUCT(&proc);
|
||||||
(void)strncpy(proc.nspace, myproc.nspace, PMIX_MAX_NSLEN);
|
(void)strncpy(proc.nspace, myproc.nspace, PMIX_MAX_NSLEN);
|
||||||
proc.rank = PMIX_RANK_WILDCARD;
|
proc.rank = PMIX_RANK_WILDCARD;
|
||||||
if (PMIX_SUCCESS != (rc = PMIx_Fence(&proc, 1, NULL, 0))) {
|
if (PMIX_SUCCESS != (rc = PMIx_Fence(&proc, 1, NULL, 0))) {
|
||||||
pmix_output(0, "Client ns %s rank %d: PMIx_Fence failed: %d", myproc.nspace, myproc.rank, rc);
|
fprintf(stderr, "Client ns %s rank %d: PMIx_Fence failed: %d\n", myproc.nspace, myproc.rank, rc);
|
||||||
goto done;
|
goto done;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* rank=0 calls spawn */
|
/* rank=0 calls spawn */
|
||||||
if (0 == myproc.rank) {
|
if (0 == myproc.rank) {
|
||||||
PMIX_APP_CREATE(app, 1);
|
PMIX_APP_CREATE(app, 1);
|
||||||
app->cmd = strdup("gumby");
|
app->cmd = strdup("gumby");
|
||||||
app->maxprocs = 2;
|
app->maxprocs = 2;
|
||||||
pmix_argv_append(&app->argc, &app->argv, "gumby");
|
app->argc = 3;
|
||||||
pmix_argv_append(&app->argc, &app->argv, "-n");
|
app->argv = (char**)malloc(4 * sizeof(char*));
|
||||||
pmix_argv_append(&app->argc, &app->argv, "2");
|
app->argv[0] = strdup("gumby");
|
||||||
pmix_setenv("PMIX_ENV_VALUE", "3", true, &app->env);
|
app->argv[1] = strdup("-n");
|
||||||
|
app->argv[2] = strdup("2");
|
||||||
|
app->argv[3] = NULL;
|
||||||
|
app->env = (char**)malloc(2 * sizeof(char*));
|
||||||
|
app->env[0] = strdup("PMIX_ENV_VALUE=3");
|
||||||
|
app->env[1] = NULL;
|
||||||
PMIX_INFO_CREATE(app->info, 2);
|
PMIX_INFO_CREATE(app->info, 2);
|
||||||
(void)strncpy(app->info[0].key, "DARTH", PMIX_MAX_KEYLEN);
|
(void)strncpy(app->info[0].key, "DARTH", PMIX_MAX_KEYLEN);
|
||||||
app->info[0].value.type = PMIX_INT8;
|
app->info[0].value.type = PMIX_INT8;
|
||||||
@ -92,19 +100,19 @@ int main(int argc, char **argv)
|
|||||||
app->info[1].value.type = PMIX_DOUBLE;
|
app->info[1].value.type = PMIX_DOUBLE;
|
||||||
app->info[1].value.data.dval = 12.34;
|
app->info[1].value.data.dval = 12.34;
|
||||||
|
|
||||||
pmix_output(0, "Client ns %s rank %d: calling PMIx_Spawn", myproc.nspace, myproc.rank);
|
fprintf(stderr, "Client ns %s rank %d: calling PMIx_Spawn\n", myproc.nspace, myproc.rank);
|
||||||
if (PMIX_SUCCESS != (rc = PMIx_Spawn(NULL, 0, app, 1, nsp2))) {
|
if (PMIX_SUCCESS != (rc = PMIx_Spawn(NULL, 0, app, 1, nsp2))) {
|
||||||
pmix_output(0, "Client ns %s rank %d: PMIx_Spawn failed: %d", myproc.nspace, myproc.rank, rc);
|
fprintf(stderr, "Client ns %s rank %d: PMIx_Spawn failed: %d\n", myproc.nspace, myproc.rank, rc);
|
||||||
goto done;
|
goto done;
|
||||||
}
|
}
|
||||||
PMIX_APP_FREE(app, 1);
|
PMIX_APP_FREE(app, 1);
|
||||||
|
|
||||||
/* check to see if we got the expected info back */
|
/* check to see if we got the expected info back */
|
||||||
if (0 != strncmp(nsp2, "DYNSPACE", PMIX_MAX_NSLEN)) {
|
if (0 != strncmp(nsp2, "DYNSPACE", PMIX_MAX_NSLEN)) {
|
||||||
pmix_output(0, "Client ns %s rank %d: PMIx_Spawn returned incorrect nspace: %s", myproc.nspace, myproc.rank, nsp2);
|
fprintf(stderr, "Client ns %s rank %d: PMIx_Spawn returned incorrect nspace: %s\n", myproc.nspace, myproc.rank, nsp2);
|
||||||
goto done;
|
goto done;
|
||||||
} else {
|
} else {
|
||||||
pmix_output(0, "Client ns %s rank %d: PMIx_Spawn succeeded returning nspace: %s", myproc.nspace, myproc.rank, nsp2);
|
fprintf(stderr, "Client ns %s rank %d: PMIx_Spawn succeeded returning nspace: %s\n", myproc.nspace, myproc.rank, nsp2);
|
||||||
}
|
}
|
||||||
/* get their universe size */
|
/* get their universe size */
|
||||||
val = NULL;
|
val = NULL;
|
||||||
@ -112,76 +120,76 @@ int main(int argc, char **argv)
|
|||||||
proc.rank = PMIX_RANK_WILDCARD;
|
proc.rank = PMIX_RANK_WILDCARD;
|
||||||
if (PMIX_SUCCESS != (rc = PMIx_Get(&proc, PMIX_UNIV_SIZE, NULL, 0, &val)) ||
|
if (PMIX_SUCCESS != (rc = PMIx_Get(&proc, PMIX_UNIV_SIZE, NULL, 0, &val)) ||
|
||||||
NULL == val) {
|
NULL == val) {
|
||||||
pmix_output(0, "Client ns %s rank %d: PMIx_Get universe size failed: %d", myproc.nspace, myproc.rank, rc);
|
fprintf(stderr, "Client ns %s rank %d: PMIx_Get universe size failed: %d\n", myproc.nspace, myproc.rank, rc);
|
||||||
goto done;
|
goto done;
|
||||||
}
|
}
|
||||||
ntmp = val->data.uint32;
|
ntmp = val->data.uint32;
|
||||||
PMIX_VALUE_RELEASE(val);
|
PMIX_VALUE_RELEASE(val);
|
||||||
pmix_output(0, "Client %s:%d universe %s size %d", myproc.nspace, myproc.rank, nsp2, (int)ntmp);
|
fprintf(stderr, "Client %s:%d universe %s size %d\n", myproc.nspace, myproc.rank, nsp2, (int)ntmp);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* just cycle the connect/disconnect functions */
|
/* just cycle the connect/disconnect functions */
|
||||||
(void)strncpy(proc.nspace, myproc.nspace, PMIX_MAX_NSLEN);
|
(void)strncpy(proc.nspace, myproc.nspace, PMIX_MAX_NSLEN);
|
||||||
proc.rank = PMIX_RANK_WILDCARD;
|
proc.rank = PMIX_RANK_WILDCARD;
|
||||||
if (PMIX_SUCCESS != (rc = PMIx_Connect(&proc, 1, NULL, 0))) {
|
if (PMIX_SUCCESS != (rc = PMIx_Connect(&proc, 1, NULL, 0))) {
|
||||||
pmix_output(0, "Client ns %s rank %d: PMIx_Connect failed: %d", myproc.nspace, myproc.rank, rc);
|
fprintf(stderr, "Client ns %s rank %d: PMIx_Connect failed: %d\n", myproc.nspace, myproc.rank, rc);
|
||||||
goto done;
|
goto done;
|
||||||
}
|
}
|
||||||
pmix_output(0, "Client ns %s rank %d: PMIx_Connect succeeded", myproc.nspace, myproc.rank);
|
fprintf(stderr, "Client ns %s rank %d: PMIx_Connect succeeded\n", myproc.nspace, myproc.rank);
|
||||||
if (PMIX_SUCCESS != (rc = PMIx_Disconnect(&proc, 1, NULL, 0))) {
|
if (PMIX_SUCCESS != (rc = PMIx_Disconnect(&proc, 1, NULL, 0))) {
|
||||||
pmix_output(0, "Client ns %s rank %d: PMIx_Disonnect failed: %d", myproc.nspace, myproc.rank, rc);
|
fprintf(stderr, "Client ns %s rank %d: PMIx_Disonnect failed: %d\n", myproc.nspace, myproc.rank, rc);
|
||||||
goto done;
|
goto done;
|
||||||
}
|
}
|
||||||
pmix_output(0, "Client ns %s rank %d: PMIx_Disconnect succeeded", myproc.nspace, myproc.rank);
|
fprintf(stderr, "Client ns %s rank %d: PMIx_Disconnect succeeded\n", myproc.nspace, myproc.rank);
|
||||||
|
|
||||||
/* finally, test the resolve functions */
|
/* finally, test the resolve functions */
|
||||||
if (0 == myproc.rank) {
|
if (0 == myproc.rank) {
|
||||||
if (PMIX_SUCCESS != (rc = PMIx_Resolve_peers(hostname, NULL, &peers, &npeers))) {
|
if (PMIX_SUCCESS != (rc = PMIx_Resolve_peers(hostname, NULL, &peers, &npeers))) {
|
||||||
pmix_output(0, "Client ns %s rank %d: PMIx_Resolve_peers failed for nspace %s: %d", myproc.nspace, myproc.rank, nsp2, rc);
|
fprintf(stderr, "Client ns %s rank %d: PMIx_Resolve_peers failed for nspace %s: %d\n", myproc.nspace, myproc.rank, nsp2, rc);
|
||||||
goto done;
|
goto done;
|
||||||
}
|
}
|
||||||
if ((nprocs+ntmp) != npeers) {
|
if ((nprocs+ntmp) != npeers) {
|
||||||
pmix_output(0, "Client ns %s rank %d: PMIx_Resolve_peers returned incorrect npeers: %d vs %d", myproc.nspace, myproc.rank, (int)(nprocs+ntmp), (int)npeers);
|
fprintf(stderr, "Client ns %s rank %d: PMIx_Resolve_peers returned incorrect npeers: %d vs %d\n", myproc.nspace, myproc.rank, (int)(nprocs+ntmp), (int)npeers);
|
||||||
goto done;
|
goto done;
|
||||||
}
|
}
|
||||||
pmix_output(0, "Client ns %s rank %d: PMIx_Resolve_peers returned %d npeers", myproc.nspace, myproc.rank, (int)npeers);
|
fprintf(stderr, "Client ns %s rank %d: PMIx_Resolve_peers returned %d npeers\n", myproc.nspace, myproc.rank, (int)npeers);
|
||||||
if (PMIX_SUCCESS != (rc = PMIx_Resolve_nodes(nsp2, &nodelist))) {
|
if (PMIX_SUCCESS != (rc = PMIx_Resolve_nodes(nsp2, &nodelist))) {
|
||||||
pmix_output(0, "Client ns %s rank %d: PMIx_Resolve_nodes failed for nspace %s: %d", myproc.nspace, myproc.rank, nsp2, rc);
|
fprintf(stderr, "Client ns %s rank %d: PMIx_Resolve_nodes failed for nspace %s: %d\n", myproc.nspace, myproc.rank, nsp2, rc);
|
||||||
goto done;
|
goto done;
|
||||||
}
|
}
|
||||||
pmix_output(0, "Client ns %s rank %d: PMIx_Resolve_nodes %s", myproc.nspace, myproc.rank, nodelist);
|
fprintf(stderr, "Client ns %s rank %d: PMIx_Resolve_nodes %s", myproc.nspace, myproc.rank, nodelist);
|
||||||
} else {
|
} else {
|
||||||
if (PMIX_SUCCESS != (rc = PMIx_Resolve_peers(hostname, myproc.nspace, &peers, &npeers))) {
|
if (PMIX_SUCCESS != (rc = PMIx_Resolve_peers(hostname, myproc.nspace, &peers, &npeers))) {
|
||||||
pmix_output(0, "Client ns %s rank %d: PMIx_Resolve_peers failed for nspace %s: %d", myproc.nspace, myproc.rank, myproc.nspace, rc);
|
fprintf(stderr, "Client ns %s rank %d: PMIx_Resolve_peers failed for nspace %s: %d\n", myproc.nspace, myproc.rank, myproc.nspace, rc);
|
||||||
goto done;
|
goto done;
|
||||||
}
|
}
|
||||||
if (nprocs != npeers) {
|
if (nprocs != npeers) {
|
||||||
pmix_output(0, "Client ns %s rank %d: PMIx_Resolve_peers returned incorrect npeers: %d vs %d", myproc.nspace, myproc.rank, nprocs, (int)npeers);
|
fprintf(stderr, "Client ns %s rank %d: PMIx_Resolve_peers returned incorrect npeers: %d vs %d\n", myproc.nspace, myproc.rank, nprocs, (int)npeers);
|
||||||
goto done;
|
goto done;
|
||||||
}
|
}
|
||||||
pmix_output(0, "Client ns %s rank %d: PMIx_Resolve_peers returned %d npeers", myproc.nspace, myproc.rank, (int)npeers);
|
fprintf(stderr, "Client ns %s rank %d: PMIx_Resolve_peers returned %d npeers\n", myproc.nspace, myproc.rank, (int)npeers);
|
||||||
if (PMIX_SUCCESS != (rc = PMIx_Resolve_nodes(myproc.nspace, &nodelist))) {
|
if (PMIX_SUCCESS != (rc = PMIx_Resolve_nodes(myproc.nspace, &nodelist))) {
|
||||||
pmix_output(0, "Client ns %s rank %d: PMIx_Resolve_nodes failed: %d", myproc.nspace, myproc.rank, rc);
|
fprintf(stderr, "Client ns %s rank %d: PMIx_Resolve_nodes failed: %d\n", myproc.nspace, myproc.rank, rc);
|
||||||
goto done;
|
goto done;
|
||||||
}
|
}
|
||||||
pmix_output(0, "Client ns %s rank %d: PMIx_Resolve_nodes %s", myproc.nspace, myproc.rank, nodelist);
|
fprintf(stderr, "Client ns %s rank %d: PMIx_Resolve_nodes %s\n", myproc.nspace, myproc.rank, nodelist);
|
||||||
}
|
}
|
||||||
PMIX_PROC_FREE(peers, npeers);
|
PMIX_PROC_FREE(peers, npeers);
|
||||||
free(nodelist);
|
free(nodelist);
|
||||||
|
|
||||||
done:
|
done:
|
||||||
/* call fence to sync */
|
/* call fence to sync */
|
||||||
PMIX_PROC_CONSTRUCT(&proc);
|
PMIX_PROC_CONSTRUCT(&proc);
|
||||||
(void)strncpy(proc.nspace, myproc.nspace, PMIX_MAX_NSLEN);
|
(void)strncpy(proc.nspace, myproc.nspace, PMIX_MAX_NSLEN);
|
||||||
proc.rank = PMIX_RANK_WILDCARD;
|
proc.rank = PMIX_RANK_WILDCARD;
|
||||||
if (PMIX_SUCCESS != (rc = PMIx_Fence(&proc, 1, NULL, 0))) {
|
if (PMIX_SUCCESS != (rc = PMIx_Fence(&proc, 1, NULL, 0))) {
|
||||||
pmix_output(0, "Client ns %s rank %d: PMIx_Fence failed: %d", myproc.nspace, myproc.rank, rc);
|
fprintf(stderr, "Client ns %s rank %d: PMIx_Fence failed: %d\n", myproc.nspace, myproc.rank, rc);
|
||||||
goto done;
|
goto done;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* finalize us */
|
/* finalize us */
|
||||||
pmix_output(0, "Client ns %s rank %d: Finalizing", myproc.nspace, myproc.rank);
|
fprintf(stderr, "Client ns %s rank %d: Finalizing\n", myproc.nspace, myproc.rank);
|
||||||
|
|
||||||
if (PMIX_SUCCESS != (rc = PMIx_Finalize())) {
|
if (PMIX_SUCCESS != (rc = PMIx_Finalize())) {
|
||||||
fprintf(stderr, "Client ns %s rank %d:PMIx_Finalize failed: %d\n", myproc.nspace, myproc.rank, rc);
|
fprintf(stderr, "Client ns %s rank %d:PMIx_Finalize failed: %d\n", myproc.nspace, myproc.rank, rc);
|
||||||
} else {
|
} else {
|
||||||
|
@ -39,7 +39,7 @@ static void notification_fn(pmix_status_t status,
|
|||||||
pmix_proc_t procs[], size_t nprocs,
|
pmix_proc_t procs[], size_t nprocs,
|
||||||
pmix_info_t info[], size_t ninfo)
|
pmix_info_t info[], size_t ninfo)
|
||||||
{
|
{
|
||||||
pmix_output(0, "Client %s:%d NOTIFIED with status %d", myproc.nspace, myproc.rank, status);
|
fprintf(stderr, "Client %s:%d NOTIFIED with status %d\n", myproc.nspace, myproc.rank, status);
|
||||||
completed = true;
|
completed = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -50,41 +50,41 @@ int main(int argc, char **argv)
|
|||||||
pmix_value_t *val = &value;
|
pmix_value_t *val = &value;
|
||||||
pmix_proc_t proc;
|
pmix_proc_t proc;
|
||||||
uint32_t nprocs;
|
uint32_t nprocs;
|
||||||
|
|
||||||
/* init us */
|
/* init us */
|
||||||
if (PMIX_SUCCESS != (rc = PMIx_Init(&myproc))) {
|
if (PMIX_SUCCESS != (rc = PMIx_Init(&myproc))) {
|
||||||
pmix_output(0, "Client ns %s rank %d: PMIx_Init failed: %d", myproc.nspace, myproc.rank, rc);
|
fprintf(stderr, "Client ns %s rank %d: PMIx_Init failed: %d\n", myproc.nspace, myproc.rank, rc);
|
||||||
exit(0);
|
exit(0);
|
||||||
}
|
}
|
||||||
pmix_output(0, "Client ns %s rank %d: Running", myproc.nspace, myproc.rank);
|
fprintf(stderr, "Client ns %s rank %d: Running\n", myproc.nspace, myproc.rank);
|
||||||
|
|
||||||
/* get our universe size */
|
/* get our universe size */
|
||||||
if (PMIX_SUCCESS != (rc = PMIx_Get(&myproc, PMIX_UNIV_SIZE, NULL, 0, &val))) {
|
if (PMIX_SUCCESS != (rc = PMIx_Get(&myproc, PMIX_UNIV_SIZE, NULL, 0, &val))) {
|
||||||
pmix_output(0, "Client ns %s rank %d: PMIx_Get universe size failed: %d", myproc.nspace, myproc.rank, rc);
|
fprintf(stderr, "Client ns %s rank %d: PMIx_Get universe size failed: %d\n", myproc.nspace, myproc.rank, rc);
|
||||||
goto done;
|
goto done;
|
||||||
}
|
}
|
||||||
nprocs = val->data.uint32;
|
nprocs = val->data.uint32;
|
||||||
PMIX_VALUE_RELEASE(val);
|
PMIX_VALUE_RELEASE(val);
|
||||||
pmix_output(0, "Client %s:%d universe size %d", myproc.nspace, myproc.rank, nprocs);
|
fprintf(stderr, "Client %s:%d universe size %d\n", myproc.nspace, myproc.rank, nprocs);
|
||||||
completed = false;
|
completed = false;
|
||||||
|
|
||||||
/* register our errhandler */
|
/* register our errhandler */
|
||||||
PMIx_Register_errhandler(NULL, 0, notification_fn);
|
PMIx_Register_errhandler(NULL, 0, notification_fn);
|
||||||
|
|
||||||
/* call fence to sync */
|
/* call fence to sync */
|
||||||
PMIX_PROC_CONSTRUCT(&proc);
|
PMIX_PROC_CONSTRUCT(&proc);
|
||||||
(void)strncpy(proc.nspace, myproc.nspace, PMIX_MAX_NSLEN);
|
(void)strncpy(proc.nspace, myproc.nspace, PMIX_MAX_NSLEN);
|
||||||
proc.rank = PMIX_RANK_WILDCARD;
|
proc.rank = PMIX_RANK_WILDCARD;
|
||||||
if (PMIX_SUCCESS != (rc = PMIx_Fence(&proc, 1, NULL, 0))) {
|
if (PMIX_SUCCESS != (rc = PMIx_Fence(&proc, 1, NULL, 0))) {
|
||||||
pmix_output(0, "Client ns %s rank %d: PMIx_Fence failed: %d", myproc.nspace, myproc.rank, rc);
|
fprintf(stderr, "Client ns %s rank %d: PMIx_Fence failed: %d\n", myproc.nspace, myproc.rank, rc);
|
||||||
goto done;
|
goto done;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* rank=0 calls abort */
|
/* rank=0 calls abort */
|
||||||
if (0 == myproc.rank) {
|
if (0 == myproc.rank) {
|
||||||
PMIx_Abort(PMIX_ERR_OUT_OF_RESOURCE, "Eat rocks",
|
PMIx_Abort(PMIX_ERR_OUT_OF_RESOURCE, "Eat rocks",
|
||||||
&proc, 1);
|
&proc, 1);
|
||||||
pmix_output(0, "Client ns %s rank %d: Abort called", myproc.nspace, myproc.rank);
|
fprintf(stderr, "Client ns %s rank %d: Abort called\n", myproc.nspace, myproc.rank);
|
||||||
}
|
}
|
||||||
/* everyone simply waits */
|
/* everyone simply waits */
|
||||||
while (!completed) {
|
while (!completed) {
|
||||||
@ -96,9 +96,9 @@ int main(int argc, char **argv)
|
|||||||
|
|
||||||
done:
|
done:
|
||||||
/* finalize us */
|
/* finalize us */
|
||||||
pmix_output(0, "Client ns %s rank %d: Finalizing", myproc.nspace, myproc.rank);
|
fprintf(stderr, "Client ns %s rank %d: Finalizing\n", myproc.nspace, myproc.rank);
|
||||||
PMIx_Deregister_errhandler();
|
PMIx_Deregister_errhandler();
|
||||||
|
|
||||||
if (PMIX_SUCCESS != (rc = PMIx_Finalize())) {
|
if (PMIX_SUCCESS != (rc = PMIx_Finalize())) {
|
||||||
fprintf(stderr, "Client ns %s rank %d:PMIx_Finalize failed: %d\n", myproc.nspace, myproc.rank, rc);
|
fprintf(stderr, "Client ns %s rank %d:PMIx_Finalize failed: %d\n", myproc.nspace, myproc.rank, rc);
|
||||||
} else {
|
} else {
|
||||||
|
@ -45,29 +45,29 @@ int main(int argc, char **argv)
|
|||||||
|
|
||||||
/* init us */
|
/* init us */
|
||||||
if (PMIX_SUCCESS != (rc = PMIx_Init(&myproc))) {
|
if (PMIX_SUCCESS != (rc = PMIx_Init(&myproc))) {
|
||||||
pmix_output(0, "Client ns %s rank %d: PMIx_Init failed: %d", myproc.nspace, myproc.rank, rc);
|
fprintf(stderr, "Client ns %s rank %d: PMIx_Init failed: %d\n", myproc.nspace, myproc.rank, rc);
|
||||||
exit(0);
|
exit(0);
|
||||||
}
|
}
|
||||||
pmix_output(0, "Client ns %s rank %d: Running", myproc.nspace, myproc.rank);
|
fprintf(stderr, "Client ns %s rank %d: Running\n", myproc.nspace, myproc.rank);
|
||||||
|
|
||||||
/* get our universe size */
|
/* get our universe size */
|
||||||
if (PMIX_SUCCESS != (rc = PMIx_Get(&myproc, PMIX_UNIV_SIZE, NULL, 0, &val))) {
|
if (PMIX_SUCCESS != (rc = PMIx_Get(&myproc, PMIX_UNIV_SIZE, NULL, 0, &val))) {
|
||||||
pmix_output(0, "Client ns %s rank %d: PMIx_Get universe size failed: %d", myproc.nspace, myproc.rank, rc);
|
fprintf(stderr, "Client ns %s rank %d: PMIx_Get universe size failed: %d\n", myproc.nspace, myproc.rank, rc);
|
||||||
goto done;
|
goto done;
|
||||||
}
|
}
|
||||||
nprocs = val->data.uint32;
|
nprocs = val->data.uint32;
|
||||||
PMIX_VALUE_RELEASE(val);
|
PMIX_VALUE_RELEASE(val);
|
||||||
pmix_output(0, "Client %s:%d universe size %d", myproc.nspace, myproc.rank, nprocs);
|
fprintf(stderr, "Client %s:%d universe size %d\n", myproc.nspace, myproc.rank, nprocs);
|
||||||
|
|
||||||
/* call fence to ensure the data is received */
|
/* call fence to ensure the data is received */
|
||||||
PMIX_PROC_CONSTRUCT(&proc);
|
PMIX_PROC_CONSTRUCT(&proc);
|
||||||
(void)strncpy(proc.nspace, myproc.nspace, PMIX_MAX_NSLEN);
|
(void)strncpy(proc.nspace, myproc.nspace, PMIX_MAX_NSLEN);
|
||||||
proc.rank = PMIX_RANK_WILDCARD;
|
proc.rank = PMIX_RANK_WILDCARD;
|
||||||
if (PMIX_SUCCESS != (rc = PMIx_Fence(&proc, 1, NULL, 0))) {
|
if (PMIX_SUCCESS != (rc = PMIx_Fence(&proc, 1, NULL, 0))) {
|
||||||
pmix_output(0, "Client ns %s rank %d: PMIx_Fence failed: %d", myproc.nspace, myproc.rank, rc);
|
fprintf(stderr, "Client ns %s rank %d: PMIx_Fence failed: %d\n", myproc.nspace, myproc.rank, rc);
|
||||||
goto done;
|
goto done;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* publish something */
|
/* publish something */
|
||||||
if (0 == myproc.rank) {
|
if (0 == myproc.rank) {
|
||||||
PMIX_INFO_CREATE(info, 2);
|
PMIX_INFO_CREATE(info, 2);
|
||||||
@ -78,7 +78,7 @@ int main(int argc, char **argv)
|
|||||||
info[1].value.type = PMIX_SIZE;
|
info[1].value.type = PMIX_SIZE;
|
||||||
info[1].value.data.size = 123456;
|
info[1].value.data.size = 123456;
|
||||||
if (PMIX_SUCCESS != (rc = PMIx_Publish(PMIX_NAMESPACE, PMIX_PERSIST_APP, info, 2))) {
|
if (PMIX_SUCCESS != (rc = PMIx_Publish(PMIX_NAMESPACE, PMIX_PERSIST_APP, info, 2))) {
|
||||||
pmix_output(0, "Client ns %s rank %d: PMIx_Publish failed: %d", myproc.nspace, myproc.rank, rc);
|
fprintf(stderr, "Client ns %s rank %d: PMIx_Publish failed: %d\n", myproc.nspace, myproc.rank, rc);
|
||||||
goto done;
|
goto done;
|
||||||
}
|
}
|
||||||
PMIX_INFO_FREE(info, 2);
|
PMIX_INFO_FREE(info, 2);
|
||||||
@ -87,7 +87,7 @@ int main(int argc, char **argv)
|
|||||||
/* call fence again so all procs know the data
|
/* call fence again so all procs know the data
|
||||||
* has been published */
|
* has been published */
|
||||||
if (PMIX_SUCCESS != (rc = PMIx_Fence(&proc, 1, NULL, 0))) {
|
if (PMIX_SUCCESS != (rc = PMIx_Fence(&proc, 1, NULL, 0))) {
|
||||||
pmix_output(0, "Client ns %s rank %d: PMIx_Fence failed: %d", myproc.nspace, myproc.rank, rc);
|
fprintf(stderr, "Client ns %s rank %d: PMIx_Fence failed: %d\n", myproc.nspace, myproc.rank, rc);
|
||||||
goto done;
|
goto done;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -96,61 +96,65 @@ int main(int argc, char **argv)
|
|||||||
PMIX_PDATA_CREATE(pdata, 1);
|
PMIX_PDATA_CREATE(pdata, 1);
|
||||||
(void)strncpy(pdata[0].key, "FOOBAR", PMIX_MAX_KEYLEN);
|
(void)strncpy(pdata[0].key, "FOOBAR", PMIX_MAX_KEYLEN);
|
||||||
if (PMIX_SUCCESS != (rc = PMIx_Lookup(PMIX_NAMESPACE, NULL, 0, pdata, 1))) {
|
if (PMIX_SUCCESS != (rc = PMIx_Lookup(PMIX_NAMESPACE, NULL, 0, pdata, 1))) {
|
||||||
pmix_output(0, "Client ns %s rank %d: PMIx_Lookup failed: %d", myproc.nspace, myproc.rank, rc);
|
fprintf(stderr, "Client ns %s rank %d: PMIx_Lookup failed: %d\n", myproc.nspace, myproc.rank, rc);
|
||||||
goto done;
|
goto done;
|
||||||
}
|
}
|
||||||
/* check the return for value and source */
|
/* check the return for value and source */
|
||||||
if (0 != strncmp(myproc.nspace, pdata[0].proc.nspace, PMIX_MAX_NSLEN)) {
|
if (0 != strncmp(myproc.nspace, pdata[0].proc.nspace, PMIX_MAX_NSLEN)) {
|
||||||
pmix_output(0, "Client ns %s rank %d: PMIx_Lookup returned wrong nspace: %s",
|
fprintf(stderr, "Client ns %s rank %d: PMIx_Lookup returned wrong nspace: %s\n",
|
||||||
myproc.nspace, myproc.rank, pdata[0].proc.nspace);
|
myproc.nspace, myproc.rank, pdata[0].proc.nspace);
|
||||||
goto done;
|
goto done;
|
||||||
}
|
}
|
||||||
if (0 != pdata[0].proc.rank) {
|
if (0 != pdata[0].proc.rank) {
|
||||||
pmix_output(0, "Client ns %s rank %d: PMIx_Lookup returned wrong rank: %d",
|
fprintf(stderr, "Client ns %s rank %d: PMIx_Lookup returned wrong rank: %d\n",
|
||||||
myproc.nspace, myproc.rank, pdata[0].proc.rank);
|
myproc.nspace, myproc.rank, pdata[0].proc.rank);
|
||||||
goto done;
|
goto done;
|
||||||
}
|
}
|
||||||
if (PMIX_UINT8 != pdata[0].value.type) {
|
if (PMIX_UINT8 != pdata[0].value.type) {
|
||||||
pmix_output(0, "Client ns %s rank %d: PMIx_Lookup returned wrong type: %d",
|
fprintf(stderr, "Client ns %s rank %d: PMIx_Lookup returned wrong type: %d\n",
|
||||||
myproc.nspace, myproc.rank, pdata[0].value.type);
|
myproc.nspace, myproc.rank, pdata[0].value.type);
|
||||||
goto done;
|
goto done;
|
||||||
}
|
}
|
||||||
if (1 != pdata[0].value.data.uint8) {
|
if (1 != pdata[0].value.data.uint8) {
|
||||||
pmix_output(0, "Client ns %s rank %d: PMIx_Lookup returned wrong value: %d",
|
fprintf(stderr, "Client ns %s rank %d: PMIx_Lookup returned wrong value: %d\n",
|
||||||
myproc.nspace, myproc.rank, (int)pdata[0].value.data.uint8);
|
myproc.nspace, myproc.rank, (int)pdata[0].value.data.uint8);
|
||||||
goto done;
|
goto done;
|
||||||
}
|
}
|
||||||
PMIX_PDATA_FREE(pdata, 1);
|
PMIX_PDATA_FREE(pdata, 1);
|
||||||
pmix_output(0, "PUBLISH-LOOKUP SUCCEEDED");
|
fprintf(stderr, "PUBLISH-LOOKUP SUCCEEDED\n");
|
||||||
}
|
}
|
||||||
|
|
||||||
/* call fence again so rank 0 waits before leaving */
|
/* call fence again so rank 0 waits before leaving */
|
||||||
if (PMIX_SUCCESS != (rc = PMIx_Fence(&proc, 1, NULL, 0))) {
|
if (PMIX_SUCCESS != (rc = PMIx_Fence(&proc, 1, NULL, 0))) {
|
||||||
pmix_output(0, "Client ns %s rank %d: PMIx_Fence failed: %d", myproc.nspace, myproc.rank, rc);
|
fprintf(stderr, "Client ns %s rank %d: PMIx_Fence failed: %d\n", myproc.nspace, myproc.rank, rc);
|
||||||
goto done;
|
goto done;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (0 == myproc.rank) {
|
if (0 == myproc.rank) {
|
||||||
char **keys = NULL;
|
char **keys;
|
||||||
pmix_argv_append_nosize(&keys, "FOOBAR");
|
keys = (char**)malloc(3 * sizeof(char*));
|
||||||
pmix_argv_append_nosize(&keys, "PANDA");
|
keys[0] = "FOOBAR";
|
||||||
|
keys[1] = "PANDA";
|
||||||
|
keys[2] = NULL;
|
||||||
|
|
||||||
if (PMIX_SUCCESS != (rc = PMIx_Unpublish(PMIX_NAMESPACE, keys))) {
|
if (PMIX_SUCCESS != (rc = PMIx_Unpublish(PMIX_NAMESPACE, keys))) {
|
||||||
pmix_output(0, "Client ns %s rank %d: PMIx_Unpublish failed: %d", myproc.nspace, myproc.rank, rc);
|
fprintf(stderr, "Client ns %s rank %d: PMIx_Unpublish failed: %d\n", myproc.nspace, myproc.rank, rc);
|
||||||
|
free(keys);
|
||||||
goto done;
|
goto done;
|
||||||
}
|
}
|
||||||
pmix_output(0, "UNPUBLISH SUCCEEDED");
|
free(keys);
|
||||||
|
fprintf(stderr, "UNPUBLISH SUCCEEDED\n");
|
||||||
}
|
}
|
||||||
|
|
||||||
/* call fence again so everyone waits for rank 0 before leaving */
|
/* call fence again so everyone waits for rank 0 before leaving */
|
||||||
if (PMIX_SUCCESS != (rc = PMIx_Fence(&proc, 1, NULL, 0))) {
|
if (PMIX_SUCCESS != (rc = PMIx_Fence(&proc, 1, NULL, 0))) {
|
||||||
pmix_output(0, "Client ns %s rank %d: PMIx_Fence failed: %d", myproc.nspace, myproc.rank, rc);
|
fprintf(stderr, "Client ns %s rank %d: PMIx_Fence failed: %d\n", myproc.nspace, myproc.rank, rc);
|
||||||
goto done;
|
goto done;
|
||||||
}
|
}
|
||||||
|
|
||||||
done:
|
done:
|
||||||
/* finalize us */
|
/* finalize us */
|
||||||
pmix_output(0, "Client ns %s rank %d: Finalizing", myproc.nspace, myproc.rank);
|
fprintf(stderr, "Client ns %s rank %d: Finalizing\n", myproc.nspace, myproc.rank);
|
||||||
if (PMIX_SUCCESS != (rc = PMIx_Finalize())) {
|
if (PMIX_SUCCESS != (rc = PMIx_Finalize())) {
|
||||||
fprintf(stderr, "Client ns %s rank %d:PMIx_Finalize failed: %d\n", myproc.nspace, myproc.rank, rc);
|
fprintf(stderr, "Client ns %s rank %d:PMIx_Finalize failed: %d\n", myproc.nspace, myproc.rank, rc);
|
||||||
} else {
|
} else {
|
||||||
|
@ -300,7 +300,6 @@ int main(int argc, char **argv)
|
|||||||
static void set_namespace(int nprocs, char *ranks, char *nspace,
|
static void set_namespace(int nprocs, char *ranks, char *nspace,
|
||||||
pmix_op_cbfunc_t cbfunc, myxfer_t *x)
|
pmix_op_cbfunc_t cbfunc, myxfer_t *x)
|
||||||
{
|
{
|
||||||
size_t ninfo = 6;
|
|
||||||
char *regex, *ppn;
|
char *regex, *ppn;
|
||||||
char hostname[1024];
|
char hostname[1024];
|
||||||
|
|
||||||
|
@ -119,7 +119,6 @@ BEGIN_C_DECLS
|
|||||||
#define PMIX_NODE_RANK "pmix.nrank" // (uint16_t) rank on this node spanning all jobs
|
#define PMIX_NODE_RANK "pmix.nrank" // (uint16_t) rank on this node spanning all jobs
|
||||||
#define PMIX_LOCALLDR "pmix.lldr" // (uint64_t) opal_identifier of lowest rank on this node within this job
|
#define PMIX_LOCALLDR "pmix.lldr" // (uint64_t) opal_identifier of lowest rank on this node within this job
|
||||||
#define PMIX_APPLDR "pmix.aldr" // (uint32_t) lowest rank in this app within this job
|
#define PMIX_APPLDR "pmix.aldr" // (uint32_t) lowest rank in this app within this job
|
||||||
#define PMIX_LOCALITY "pmix.loc" // (uint16_t) relative locality of two procs
|
|
||||||
|
|
||||||
/* proc location-related info */
|
/* proc location-related info */
|
||||||
/* For PMIX_HOSTNAME, three use-cases exist for PMIx_Get:
|
/* For PMIX_HOSTNAME, three use-cases exist for PMIx_Get:
|
||||||
|
@ -409,6 +409,9 @@ void pmix_value_load(pmix_value_t *v, void *data,
|
|||||||
switch(type) {
|
switch(type) {
|
||||||
case PMIX_UNDEF:
|
case PMIX_UNDEF:
|
||||||
break;
|
break;
|
||||||
|
case PMIX_BOOL:
|
||||||
|
memcpy(&(v->data.flag), data, 1);
|
||||||
|
break;
|
||||||
case PMIX_BYTE:
|
case PMIX_BYTE:
|
||||||
memcpy(&(v->data.byte), data, 1);
|
memcpy(&(v->data.byte), data, 1);
|
||||||
break;
|
break;
|
||||||
@ -498,6 +501,10 @@ int pmix_value_unload(pmix_value_t *kv, void **data,
|
|||||||
case PMIX_UNDEF:
|
case PMIX_UNDEF:
|
||||||
rc = PMIX_ERR_UNKNOWN_DATA_TYPE;
|
rc = PMIX_ERR_UNKNOWN_DATA_TYPE;
|
||||||
break;
|
break;
|
||||||
|
case PMIX_BOOL:
|
||||||
|
memcpy(*data, &(kv->data.flag), 1);
|
||||||
|
*sz = 1;
|
||||||
|
break;
|
||||||
case PMIX_BYTE:
|
case PMIX_BYTE:
|
||||||
memcpy(*data, &(kv->data.byte), 1);
|
memcpy(*data, &(kv->data.byte), 1);
|
||||||
*sz = 1;
|
*sz = 1;
|
||||||
|
@ -146,7 +146,7 @@ int pmix_bfrop_unpack_buffer(pmix_buffer_t *buffer, void *dst, int32_t *num_vals
|
|||||||
int pmix_bfrop_unpack_bool(pmix_buffer_t *buffer, void *dest,
|
int pmix_bfrop_unpack_bool(pmix_buffer_t *buffer, void *dest,
|
||||||
int32_t *num_vals, pmix_data_type_t type)
|
int32_t *num_vals, pmix_data_type_t type)
|
||||||
{
|
{
|
||||||
int32_t i, k;
|
int32_t i;
|
||||||
uint8_t *src;
|
uint8_t *src;
|
||||||
bool *dst;
|
bool *dst;
|
||||||
|
|
||||||
|
@ -12,8 +12,6 @@
|
|||||||
* All rights reserved.
|
* All rights reserved.
|
||||||
* Copyright (c) 2007 Cisco Systems, Inc. All rights reserved.
|
* Copyright (c) 2007 Cisco Systems, Inc. All rights reserved.
|
||||||
* Copyright (c) 2013-2015 Intel, Inc. All rights reserved
|
* Copyright (c) 2013-2015 Intel, Inc. All rights reserved
|
||||||
* Copyright (c) 2015 Research Organization for Information Science
|
|
||||||
* and Technology (RIST). All rights reserved.
|
|
||||||
* $COPYRIGHT$
|
* $COPYRIGHT$
|
||||||
*
|
*
|
||||||
* Additional copyrights may follow
|
* Additional copyrights may follow
|
||||||
@ -129,7 +127,6 @@
|
|||||||
|
|
||||||
#include "include/pmix/rename.h"
|
#include "include/pmix/rename.h"
|
||||||
|
|
||||||
|
|
||||||
BEGIN_C_DECLS
|
BEGIN_C_DECLS
|
||||||
|
|
||||||
#if PMIX_ENABLE_DEBUG
|
#if PMIX_ENABLE_DEBUG
|
||||||
|
@ -856,7 +856,6 @@ void pmix_client_process_nspace_blob(const char *nspace, pmix_buffer_t *bptr)
|
|||||||
pmix_nspace_t *nsptr, *nsptr2;
|
pmix_nspace_t *nsptr, *nsptr2;
|
||||||
pmix_nrec_t *nrec, *nr2;
|
pmix_nrec_t *nrec, *nr2;
|
||||||
char **procs;
|
char **procs;
|
||||||
pmix_value_t *val;
|
|
||||||
|
|
||||||
/* cycle across our known nspaces */
|
/* cycle across our known nspaces */
|
||||||
nsptr = NULL;
|
nsptr = NULL;
|
||||||
|
@ -542,7 +542,6 @@ pmix_status_t PMIx_server_register_nspace(const char nspace[], int nlocalprocs,
|
|||||||
pmix_op_cbfunc_t cbfunc, void *cbdata)
|
pmix_op_cbfunc_t cbfunc, void *cbdata)
|
||||||
{
|
{
|
||||||
pmix_setup_caddy_t *cd;
|
pmix_setup_caddy_t *cd;
|
||||||
size_t i;
|
|
||||||
|
|
||||||
cd = PMIX_NEW(pmix_setup_caddy_t);
|
cd = PMIX_NEW(pmix_setup_caddy_t);
|
||||||
(void)strncpy(cd->proc.nspace, nspace, PMIX_MAX_NSLEN);
|
(void)strncpy(cd->proc.nspace, nspace, PMIX_MAX_NSLEN);
|
||||||
@ -552,7 +551,7 @@ pmix_status_t PMIx_server_register_nspace(const char nspace[], int nlocalprocs,
|
|||||||
/* copy across the info array, if given */
|
/* copy across the info array, if given */
|
||||||
if (0 < ninfo) {
|
if (0 < ninfo) {
|
||||||
cd->ninfo = ninfo;
|
cd->ninfo = ninfo;
|
||||||
cd->info = info;
|
cd->info = info;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* we have to push this into our event library to avoid
|
/* we have to push this into our event library to avoid
|
||||||
@ -569,7 +568,7 @@ static void _execute_collective(int sd, short args, void *cbdata)
|
|||||||
pmix_server_trkr_t *trk = tcd->trk;
|
pmix_server_trkr_t *trk = tcd->trk;
|
||||||
char *data = NULL;
|
char *data = NULL;
|
||||||
size_t sz = 0;
|
size_t sz = 0;
|
||||||
pmix_buffer_t bucket, pbkt, xfer;
|
pmix_buffer_t bucket, xfer;
|
||||||
pmix_rank_info_t *info;
|
pmix_rank_info_t *info;
|
||||||
pmix_value_t *val;
|
pmix_value_t *val;
|
||||||
|
|
||||||
@ -653,8 +652,6 @@ static void _register_client(int sd, short args, void *cbdata)
|
|||||||
pmix_nspace_t *nptr, *tmp;
|
pmix_nspace_t *nptr, *tmp;
|
||||||
pmix_server_trkr_t *trk;
|
pmix_server_trkr_t *trk;
|
||||||
pmix_trkr_caddy_t *tcd;
|
pmix_trkr_caddy_t *tcd;
|
||||||
bool found;
|
|
||||||
pmix_dmdx_local_t *lcd, *lcdnext;
|
|
||||||
|
|
||||||
pmix_output_verbose(2, pmix_globals.debug_output,
|
pmix_output_verbose(2, pmix_globals.debug_output,
|
||||||
"pmix:server _register_client for nspace %s rank %d",
|
"pmix:server _register_client for nspace %s rank %d",
|
||||||
@ -781,7 +778,7 @@ static void _dmodex_req(int sd, short args, void *cbdata)
|
|||||||
pmix_setup_caddy_t *cd = (pmix_setup_caddy_t*)cbdata;
|
pmix_setup_caddy_t *cd = (pmix_setup_caddy_t*)cbdata;
|
||||||
pmix_rank_info_t *info, *iptr;
|
pmix_rank_info_t *info, *iptr;
|
||||||
pmix_nspace_t *nptr, *ns;
|
pmix_nspace_t *nptr, *ns;
|
||||||
pmix_buffer_t pbkt, xfer;
|
pmix_buffer_t pbkt;
|
||||||
pmix_value_t *val;
|
pmix_value_t *val;
|
||||||
char *data = NULL;
|
char *data = NULL;
|
||||||
size_t sz = 0;
|
size_t sz = 0;
|
||||||
@ -1567,7 +1564,6 @@ static void _mdxcbfunc(int sd, short argc, void *cbdata)
|
|||||||
pmix_buffer_t xfer, *bptr, *databuf, *bpscope, *reply;
|
pmix_buffer_t xfer, *bptr, *databuf, *bpscope, *reply;
|
||||||
pmix_nspace_t *nptr, *ns;
|
pmix_nspace_t *nptr, *ns;
|
||||||
pmix_server_caddy_t *cd;
|
pmix_server_caddy_t *cd;
|
||||||
pmix_kval_t *kp;
|
|
||||||
char *nspace;
|
char *nspace;
|
||||||
int rank, rc;
|
int rank, rc;
|
||||||
int32_t cnt = 1;
|
int32_t cnt = 1;
|
||||||
|
@ -362,7 +362,7 @@ static void connection_handler(int sd, short flags, void* cbdata)
|
|||||||
pmix_status_t pmix_server_authenticate(int sd, int *out_rank, pmix_peer_t **peer,
|
pmix_status_t pmix_server_authenticate(int sd, int *out_rank, pmix_peer_t **peer,
|
||||||
pmix_buffer_t **reply)
|
pmix_buffer_t **reply)
|
||||||
{
|
{
|
||||||
char *msg, *nspace, *version, *cred, *ptr;
|
char *msg, *nspace, *version, *cred;
|
||||||
int rc, rank;
|
int rc, rank;
|
||||||
pmix_usock_hdr_t hdr;
|
pmix_usock_hdr_t hdr;
|
||||||
pmix_nspace_t *nptr, *tmp;
|
pmix_nspace_t *nptr, *tmp;
|
||||||
|
@ -80,8 +80,8 @@ static void relfn(void *cbdata)
|
|||||||
free(data);
|
free(data);
|
||||||
}
|
}
|
||||||
|
|
||||||
pmix_status_t _satisfy_local_req(pmix_nspace_t *nptr, pmix_rank_info_t *info,
|
static pmix_status_t _satisfy_local_req(pmix_nspace_t *nptr, pmix_rank_info_t *info,
|
||||||
pmix_modex_cbfunc_t cbfunc, void *cbdata)
|
pmix_modex_cbfunc_t cbfunc, void *cbdata)
|
||||||
{
|
{
|
||||||
int rc;
|
int rc;
|
||||||
pmix_buffer_t pbkt, xfer;
|
pmix_buffer_t pbkt, xfer;
|
||||||
@ -114,8 +114,8 @@ pmix_status_t _satisfy_local_req(pmix_nspace_t *nptr, pmix_rank_info_t *info,
|
|||||||
return PMIX_ERR_NOT_FOUND;
|
return PMIX_ERR_NOT_FOUND;
|
||||||
}
|
}
|
||||||
|
|
||||||
pmix_status_t _satisfy_remote_req(pmix_nspace_t *nptr, int rank,
|
static pmix_status_t _satisfy_remote_req(pmix_nspace_t *nptr, int rank,
|
||||||
pmix_modex_cbfunc_t cbfunc, void *cbdata)
|
pmix_modex_cbfunc_t cbfunc, void *cbdata)
|
||||||
{
|
{
|
||||||
int rc;
|
int rc;
|
||||||
pmix_buffer_t pbkt, xfer;
|
pmix_buffer_t pbkt, xfer;
|
||||||
@ -152,10 +152,6 @@ pmix_status_t pmix_pending_request(pmix_nspace_t *nptr, int rank,
|
|||||||
{
|
{
|
||||||
pmix_dmdx_local_t *lcd = NULL, *cd;
|
pmix_dmdx_local_t *lcd = NULL, *cd;
|
||||||
pmix_rank_info_t *iptr, *rkinfo;
|
pmix_rank_info_t *iptr, *rkinfo;
|
||||||
pmix_buffer_t pbkt, xfer;
|
|
||||||
pmix_value_t *val;
|
|
||||||
char *data;
|
|
||||||
size_t sz;
|
|
||||||
int rc;
|
int rc;
|
||||||
|
|
||||||
/* 1. Try to satisfy the request right now */
|
/* 1. Try to satisfy the request right now */
|
||||||
@ -292,7 +288,7 @@ pmix_status_t pmix_pending_resolve(pmix_nspace_t *nptr, int rank, pmix_dmdx_loca
|
|||||||
if( NULL == lcd ){
|
if( NULL == lcd ){
|
||||||
PMIX_LIST_FOREACH(cd, &pmix_server_globals.local_reqs, pmix_dmdx_local_t) {
|
PMIX_LIST_FOREACH(cd, &pmix_server_globals.local_reqs, pmix_dmdx_local_t) {
|
||||||
if (0 != strncmp(nptr->nspace, cd->proc.nspace, PMIX_MAX_NSLEN) ||
|
if (0 != strncmp(nptr->nspace, cd->proc.nspace, PMIX_MAX_NSLEN) ||
|
||||||
rank != cd->proc.rank) {
|
rank != cd->proc.rank) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
lcd = cd;
|
lcd = cd;
|
||||||
@ -510,10 +506,8 @@ static pmix_server_trkr_t* get_tracker(pmix_proc_t *procs,
|
|||||||
size_t nprocs, pmix_cmd_t type)
|
size_t nprocs, pmix_cmd_t type)
|
||||||
{
|
{
|
||||||
pmix_server_trkr_t *trk;
|
pmix_server_trkr_t *trk;
|
||||||
pmix_rank_info_t *iptr, *info;
|
|
||||||
size_t i;
|
size_t i;
|
||||||
bool match, all_def;
|
bool match;
|
||||||
pmix_nspace_t *nptr, *ns;
|
|
||||||
|
|
||||||
pmix_output_verbose(5, pmix_globals.debug_output,
|
pmix_output_verbose(5, pmix_globals.debug_output,
|
||||||
"get_tracker called with %d procs", (int)nprocs);
|
"get_tracker called with %d procs", (int)nprocs);
|
||||||
@ -578,7 +572,7 @@ static pmix_server_trkr_t* new_tracker(pmix_proc_t *procs,
|
|||||||
pmix_server_trkr_t *trk;
|
pmix_server_trkr_t *trk;
|
||||||
pmix_rank_info_t *iptr, *info;
|
pmix_rank_info_t *iptr, *info;
|
||||||
size_t i;
|
size_t i;
|
||||||
bool match, all_def;
|
bool all_def;
|
||||||
pmix_nspace_t *nptr, *ns;
|
pmix_nspace_t *nptr, *ns;
|
||||||
|
|
||||||
pmix_output_verbose(5, pmix_globals.debug_output,
|
pmix_output_verbose(5, pmix_globals.debug_output,
|
||||||
@ -878,7 +872,7 @@ static void _process_dmdx_reply(int fd, short args, void *cbdata)
|
|||||||
PMIX_ERROR_LOG(PMIX_ERR_NOT_FOUND);
|
PMIX_ERROR_LOG(PMIX_ERR_NOT_FOUND);
|
||||||
caddy->status = PMIX_ERR_NOT_FOUND;
|
caddy->status = PMIX_ERR_NOT_FOUND;
|
||||||
PMIX_RELEASE(caddy);
|
PMIX_RELEASE(caddy);
|
||||||
return;
|
goto cleanup;
|
||||||
}
|
}
|
||||||
|
|
||||||
kp = PMIX_NEW(pmix_kval_t);
|
kp = PMIX_NEW(pmix_kval_t);
|
||||||
|
@ -33,7 +33,7 @@
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
||||||
#if PMIX_COMPILE_TIMING
|
#if PMIX_ENABLE_TIMING
|
||||||
|
|
||||||
#include "src/class/pmix_pointer_array.h"
|
#include "src/class/pmix_pointer_array.h"
|
||||||
#include "src/class/pmix_list.h"
|
#include "src/class/pmix_list.h"
|
||||||
|
@ -41,8 +41,6 @@
|
|||||||
|
|
||||||
int main(int argc, char **argv)
|
int main(int argc, char **argv)
|
||||||
{
|
{
|
||||||
char nspace[PMIX_MAX_NSLEN+1];
|
|
||||||
int rank;
|
|
||||||
int rc;
|
int rc;
|
||||||
pmix_value_t value;
|
pmix_value_t value;
|
||||||
pmix_value_t *val = &value;
|
pmix_value_t *val = &value;
|
||||||
@ -62,7 +60,7 @@ int main(int argc, char **argv)
|
|||||||
|
|
||||||
/* init us */
|
/* init us */
|
||||||
if (PMIX_SUCCESS != (rc = PMIx_Init(&myproc))) {
|
if (PMIX_SUCCESS != (rc = PMIx_Init(&myproc))) {
|
||||||
TEST_ERROR(("Client ns %s rank %d: PMIx_Init failed: %d", params.nspace, rank, rc));
|
TEST_ERROR(("Client ns %s rank %d: PMIx_Init failed: %d", params.nspace, params.rank, rc));
|
||||||
FREE_TEST_PARAMS(params);
|
FREE_TEST_PARAMS(params);
|
||||||
exit(0);
|
exit(0);
|
||||||
}
|
}
|
||||||
@ -73,7 +71,7 @@ int main(int argc, char **argv)
|
|||||||
exit(0);
|
exit(0);
|
||||||
}
|
}
|
||||||
if ( NULL != params.prefix && -1 != params.ns_id) {
|
if ( NULL != params.prefix && -1 != params.ns_id) {
|
||||||
TEST_SET_FILE(params.prefix, params.ns_id, rank);
|
TEST_SET_FILE(params.prefix, params.ns_id, params.rank);
|
||||||
}
|
}
|
||||||
TEST_VERBOSE((" Client ns %s rank %d: PMIx_Init success", myproc.nspace, myproc.rank));
|
TEST_VERBOSE((" Client ns %s rank %d: PMIx_Init success", myproc.nspace, myproc.rank));
|
||||||
|
|
||||||
|
@ -70,6 +70,8 @@ static pmix_status_t connect_fn(const pmix_proc_t procs[], size_t nprocs,
|
|||||||
static pmix_status_t disconnect_fn(const pmix_proc_t procs[], size_t nprocs,
|
static pmix_status_t disconnect_fn(const pmix_proc_t procs[], size_t nprocs,
|
||||||
const pmix_info_t info[], size_t ninfo,
|
const pmix_info_t info[], size_t ninfo,
|
||||||
pmix_op_cbfunc_t cbfunc, void *cbdata);
|
pmix_op_cbfunc_t cbfunc, void *cbdata);
|
||||||
|
static pmix_status_t register_event_fn(const pmix_info_t info[], size_t ninfo,
|
||||||
|
pmix_op_cbfunc_t cbfunc, void *cbdata);
|
||||||
static pmix_status_t listener_fn(int listening_sd,
|
static pmix_status_t listener_fn(int listening_sd,
|
||||||
pmix_connection_cbfunc_t cbfunc);
|
pmix_connection_cbfunc_t cbfunc);
|
||||||
|
|
||||||
@ -85,7 +87,8 @@ static pmix_server_module_t mymodule = {
|
|||||||
spawn_fn,
|
spawn_fn,
|
||||||
connect_fn,
|
connect_fn,
|
||||||
disconnect_fn,
|
disconnect_fn,
|
||||||
NULL
|
register_event_fn,
|
||||||
|
listener_fn
|
||||||
};
|
};
|
||||||
|
|
||||||
typedef struct {
|
typedef struct {
|
||||||
@ -601,6 +604,11 @@ static int disconnect_fn(const pmix_proc_t procs[], size_t nprocs,
|
|||||||
return PMIX_SUCCESS;
|
return PMIX_SUCCESS;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static pmix_status_t register_event_fn(const pmix_info_t info[], size_t ninfo,
|
||||||
|
pmix_op_cbfunc_t cbfunc, void *cbdata)
|
||||||
|
{
|
||||||
|
return PMIX_SUCCESS;
|
||||||
|
}
|
||||||
|
|
||||||
static int listener_fn(int listening_sd,
|
static int listener_fn(int listening_sd,
|
||||||
pmix_connection_cbfunc_t cbfunc)
|
pmix_connection_cbfunc_t cbfunc)
|
||||||
|
@ -205,7 +205,7 @@ void parse_cmd(int argc, char **argv, test_params *params)
|
|||||||
char *rankno = getenv("SLURM_LOCALID");
|
char *rankno = getenv("SLURM_LOCALID");
|
||||||
if( NULL != ranklist && NULL != rankno ){
|
if( NULL != ranklist && NULL != rankno ){
|
||||||
char **argv = pmix_argv_split(ranklist, ',');
|
char **argv = pmix_argv_split(ranklist, ',');
|
||||||
int i, count = pmix_argv_count(argv);
|
int count = pmix_argv_count(argv);
|
||||||
int rankidx = strtoul(rankno, NULL, 10);
|
int rankidx = strtoul(rankno, NULL, 10);
|
||||||
if( rankidx >= count ){
|
if( rankidx >= count ){
|
||||||
fprintf(stderr, "It feels like we are running under SLURM:\n\t"
|
fprintf(stderr, "It feels like we are running under SLURM:\n\t"
|
||||||
|
Загрузка…
x
Ссылка в новой задаче
Block a user