1
1
Signed-off-by: Ralph Castain <rhc@pmix.org>
Этот коммит содержится в:
Ralph Castain 2019-03-19 10:27:12 -07:00
родитель 836c80c442
Коммит c4be211741
123 изменённых файлов: 8088 добавлений и 3362 удалений

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

@ -23,14 +23,14 @@ release=0
# The only requirement is that it must be entirely printable ASCII # The only requirement is that it must be entirely printable ASCII
# characters and have no white space. # characters and have no white space.
greek= greek=a1
# If repo_rev is empty, then the repository version number will be # If repo_rev is empty, then the repository version number will be
# obtained during "make dist" via the "git describe --tags --always" # obtained during "make dist" via the "git describe --tags --always"
# 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=gita1212af2 repo_rev=git0c93c13f
# 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="Feb 04, 2019" date="Mar 19, 2019"
# 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,4 +1,4 @@
# Copyright (c) 2013-2016 Intel, Inc. All rights reserved # Copyright (c) 2013-2019 Intel, Inc. All rights reserved.
# Copyright (c) 2016 Research Organization for Information Science # Copyright (c) 2016 Research Organization for Information Science
# and Technology (RIST). All rights reserved. # and Technology (RIST). All rights reserved.
# Copyright (c) 2006-2016 Cisco Systems, Inc. All rights reserved. # Copyright (c) 2006-2016 Cisco Systems, Inc. All rights reserved.
@ -42,7 +42,6 @@ EXTRA_DIST = \
pmix.m4 \ pmix.m4 \
pmix_search_libs.m4 \ pmix_search_libs.m4 \
pmix_setup_cc.m4 \ pmix_setup_cc.m4 \
pmix_setup_zlib.m4 \
pmix_setup_libevent.m4 \ pmix_setup_libevent.m4 \
pmix_mca_priority_sort.pl pmix_mca_priority_sort.pl

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

@ -18,8 +18,8 @@ dnl reserved.
dnl Copyright (c) 2009-2011 Oak Ridge National Labs. All rights reserved. dnl Copyright (c) 2009-2011 Oak Ridge National Labs. All rights reserved.
dnl Copyright (c) 2011-2013 NVIDIA Corporation. All rights reserved. dnl Copyright (c) 2011-2013 NVIDIA Corporation. All rights reserved.
dnl Copyright (c) 2013-2019 Intel, Inc. All rights reserved. dnl Copyright (c) 2013-2019 Intel, Inc. All rights reserved.
dnl Copyright (c) 2015-2017 Research Organization for Information Science dnl Copyright (c) 2015-2019 Research Organization for Information Science
dnl and Technology (RIST). All rights reserved. dnl and Technology (RIST). All rights reserved.
dnl Copyright (c) 2016 Mellanox Technologies, Inc. dnl Copyright (c) 2016 Mellanox Technologies, Inc.
dnl All rights reserved. dnl All rights reserved.
dnl dnl
@ -120,9 +120,11 @@ AC_DEFUN([PMIX_SETUP_CORE],[
pmixmajor=${PMIX_MAJOR_VERSION}L pmixmajor=${PMIX_MAJOR_VERSION}L
pmixminor=${PMIX_MINOR_VERSION}L pmixminor=${PMIX_MINOR_VERSION}L
pmixrelease=${PMIX_RELEASE_VERSION}L pmixrelease=${PMIX_RELEASE_VERSION}L
pmixnumeric=$(printf 0x%4.4x%2.2x%2.2x $PMIX_MAJOR_VERSION $PMIX_MINOR_VERSION $PMIX_RELEASE_VERSION)
AC_SUBST(pmixmajor) AC_SUBST(pmixmajor)
AC_SUBST(pmixminor) AC_SUBST(pmixminor)
AC_SUBST(pmixrelease) AC_SUBST(pmixrelease)
AC_SUBST(pmixnumeric)
AC_CONFIG_FILES(pmix_config_prefix[include/pmix_version.h]) AC_CONFIG_FILES(pmix_config_prefix[include/pmix_version.h])
PMIX_GREEK_VERSION="`$PMIX_top_srcdir/config/pmix_get_version.sh $PMIX_top_srcdir/VERSION --greek`" PMIX_GREEK_VERSION="`$PMIX_top_srcdir/config/pmix_get_version.sh $PMIX_top_srcdir/VERSION --greek`"
@ -414,7 +416,7 @@ AC_DEFUN([PMIX_SETUP_CORE],[
time.h unistd.h dirent.h \ time.h unistd.h dirent.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 \
sys/statfs.h sys/statvfs.h \ sys/fcntl.h sys/statfs.h sys/statvfs.h \
netdb.h ucred.h zlib.h sys/auxv.h \ netdb.h ucred.h zlib.h sys/auxv.h \
sys/sysctl.h]) sys/sysctl.h])
@ -752,10 +754,24 @@ AC_DEFUN([PMIX_SETUP_CORE],[
################################## ##################################
# Libevent # Libevent
################################## ##################################
pmix_show_title "Libevent" pmix_show_title "Event libraries"
PMIX_LIBEV_CONFIG
PMIX_LIBEVENT_CONFIG PMIX_LIBEVENT_CONFIG
AS_IF([test $pmix_libevent_support -eq 1 && test $pmix_libev_support -eq 1],
[AC_MSG_WARN([Both libevent and libev support have been specified.])
AC_MSG_WARN([Only one can be configured against at a time. Please])
AC_MSG_WARN([remove one from the configure command line.])
AC_MSG_ERROR([Cannot continue])])
AS_IF([test $pmix_libevent_support -eq 0 && test $pmix_libev_support -eq 0],
[AC_MSG_WARN([Either libevent or libev support is required, but neither])
AC_MSG_WARN([was found. Please use the configure options to point us])
AC_MSG_WARN([to where we can find one or the other library])
AC_MSG_ERROR([Cannot continue])])
################################## ##################################
# HWLOC # HWLOC
################################## ##################################
@ -764,13 +780,6 @@ AC_DEFUN([PMIX_SETUP_CORE],[
PMIX_HWLOC_CONFIG PMIX_HWLOC_CONFIG
##################################
# ZLIB COMPRESSION
##################################
pmix_show_title "ZLIB"
PMIX_ZLIB_CONFIG
################################## ##################################
# MCA # MCA
################################## ##################################
@ -874,6 +883,7 @@ AC_DEFUN([PMIX_SETUP_CORE],[
pmix_config_prefix[src/tools/pmix_info/Makefile] pmix_config_prefix[src/tools/pmix_info/Makefile]
pmix_config_prefix[src/tools/plookup/Makefile] pmix_config_prefix[src/tools/plookup/Makefile]
pmix_config_prefix[src/tools/pps/Makefile] pmix_config_prefix[src/tools/pps/Makefile]
pmix_config_prefix[src/tools/pattrs/Makefile]
) )
# publish any embedded flags so external wrappers can use them # publish any embedded flags so external wrappers can use them

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

@ -11,7 +11,7 @@ dnl University of Stuttgart. All rights reserved.
dnl Copyright (c) 2004-2005 The Regents of the University of California. dnl Copyright (c) 2004-2005 The Regents of the University of California.
dnl All rights reserved. dnl All rights reserved.
dnl Copyright (c) 2010-2015 Cisco Systems, Inc. All rights reserved. dnl Copyright (c) 2010-2015 Cisco Systems, Inc. All rights reserved.
dnl Copyright (c) 2013-2018 Intel, Inc. All rights reserved. dnl Copyright (c) 2013-2019 Intel, Inc. All rights reserved.
dnl $COPYRIGHT$ dnl $COPYRIGHT$
dnl dnl
dnl Additional copyrights may follow dnl Additional copyrights may follow
@ -262,11 +262,6 @@ AC_DEFUN([PMIX_MCA],[
[MCA_pmix_]mca_framework[_CONFIG](mca_framework), [MCA_pmix_]mca_framework[_CONFIG](mca_framework),
[MCA_CONFIGURE_FRAMEWORK(mca_framework, 1)])])]) [MCA_CONFIGURE_FRAMEWORK(mca_framework, 1)])])])
# note that mca_wrapper_extra_* is a running list, and we take checkpoints at the end of our project
pmix_mca_wrapper_extra_cppflags="$mca_wrapper_extra_cppflags"
pmix_mca_wrapper_extra_ldflags="$mca_wrapper_extra_ldflags"
pmix_mca_wrapper_extra_libs="$mca_wrapper_extra_libs"
AC_SUBST(MCA_pmix_FRAMEWORKS) AC_SUBST(MCA_pmix_FRAMEWORKS)
AC_SUBST(MCA_pmix_FRAMEWORKS_SUBDIRS) AC_SUBST(MCA_pmix_FRAMEWORKS_SUBDIRS)
AC_SUBST(MCA_pmix_FRAMEWORK_COMPONENT_ALL_SUBDIRS) AC_SUBST(MCA_pmix_FRAMEWORK_COMPONENT_ALL_SUBDIRS)
@ -622,14 +617,6 @@ AC_DEFUN([MCA_CONFIGURE_ALL_CONFIG_COMPONENTS],[
AC_MSG_WARN([MCA component configure script told me to abort]) AC_MSG_WARN([MCA component configure script told me to abort])
AC_MSG_ERROR([cannot continue]) AC_MSG_ERROR([cannot continue])
fi fi
m4_foreach(flags, [LDFLAGS, LIBS],
[[line="`$GREP WRAPPER_EXTRA_]flags[= $infile | cut -d= -f2-`"]
eval "line=$line"
if test -n "$line"; then
$2[_]$3[_WRAPPER_EXTRA_]flags[="$line"]
fi
])dnl
fi fi
MCA_PROCESS_COMPONENT($1, $component, $2, $3, $4, $5, $compile_mode) MCA_PROCESS_COMPONENT($1, $component, $2, $3, $4, $5, $compile_mode)
@ -754,38 +741,6 @@ AC_MSG_ERROR([*** $1 component $2 was supposed to be direct-called, but
*** Aborting]) *** Aborting])
fi fi
fi fi
# if the component is building, add it's WRAPPER_EXTRA_LDFLAGS and
# WRAPPER_EXTRA_LIBS. If the component doesn't specify it's
# WRAPPER_EXTRA_LIBS and WRAPPER_EXTRA_LDFLAGS, try using LDFLAGS and LIBS if
# component didn't have it's own configure script (in which case,
# we know it didn't set LDFLAGS and LIBS because it can't) Don't
# have to do this if the component is building dynamically,
# because it will link against these (without a dependency from
# libmpi.so to these flags)
if test "$7" = "static"; then
AS_LITERAL_IF([$2],
[m4_foreach(flags, [LDFLAGS, LIBS],
[AS_IF([test "$$1_$2_WRAPPER_EXTRA_]flags[" = ""],
[PMIX_FLAGS_APPEND_UNIQ([mca_wrapper_extra_]m4_tolower(flags), [$$1_$2_]flags)],
[PMIX_FLAGS_APPEND_UNIQ([mca_wrapper_extra_]m4_tolower(flags), [$$1_$2_WRAPPER_EXTRA_]flags)])
])],
[m4_foreach(flags, [LDFLAGS, LIBS],
[[str="line=\$$1_$2_WRAPPER_EXTRA_]flags["]
eval "$str"
PMIX_FLAGS_APPEND_UNIQ([mca_wrapper_extra_]m4_tolower(flags), [$line])])])
fi
# if needed, copy over WRAPPER_EXTRA_CPPFLAGS. Since a configure script
# component can never be used in a STOP_AT_FIRST framework, we
# don't have to implement the else clause in the literal check...
AS_LITERAL_IF([$2],
[AS_IF([test "$$1_$2_WRAPPER_EXTRA_CPPFLAGS" != ""],
[m4_if(PMIX_EVAL_ARG([MCA_pmix_$1_CONFIGURE_MODE]), [STOP_AT_FIRST], [stop_at_first=1], [stop_at_first=0])
AS_IF([test "$7" = "static" && test "$stop_at_first" = "1"],
[AS_IF([test "$with_devel_headers" = "yes"],
[PMIX_FLAGS_APPEND_UNIQ([mca_wrapper_extra_cppflags], [$$1_$2_WRAPPER_EXTRA_CPPFLAGS])])],
[AC_MSG_WARN([ignoring $1_$2_WRAPPER_EXTRA_CPPFLAGS ($$1_$2_WRAPPER_EXTRA_CPPFLAGS): component conditions not met])])])])
]) ])

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

@ -16,7 +16,7 @@ dnl Copyright (c) 2012-2017 Los Alamos National Security, LLC. All rights
dnl reserved. dnl reserved.
dnl Copyright (c) 2015-2019 Research Organization for Information Science dnl Copyright (c) 2015-2019 Research Organization for Information Science
dnl and Technology (RIST). All rights reserved. dnl and Technology (RIST). All rights reserved.
dnl Copyright (c) 2018-2019 Intel, Inc. All rights reserved. dnl Copyright (c) 2018 Intel, Inc. All rights reserved.
dnl $COPYRIGHT$ dnl $COPYRIGHT$
dnl dnl
dnl Additional copyrights may follow dnl Additional copyrights may follow

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

@ -0,0 +1,96 @@
# -*- shell-script -*-
#
# Copyright (c) 2009-2015 Cisco Systems, Inc. All rights reserved.
# Copyright (c) 2013 Los Alamos National Security, LLC. All rights reserved.
# Copyright (c) 2013-2019 Intel, Inc. All rights reserved.
# Copyright (c) 2017-2019 Research Organization for Information Science
# and Technology (RIST). All rights reserved.
# $COPYRIGHT$
#
# Additional copyrights may follow
#
# $HEADER$
#
# MCA_libev_CONFIG([action-if-found], [action-if-not-found])
# --------------------------------------------------------------------
AC_DEFUN([PMIX_LIBEV_CONFIG],[
PMIX_VAR_SCOPE_PUSH([pmix_libev_dir pmix_libev_libdir pmix_libev_standard_header_location pmix_libev_standard_lib_location])
AC_ARG_WITH([libev],
[AC_HELP_STRING([--with-libev=DIR],
[Search for libev headers and libraries in DIR ])])
PMIX_CHECK_WITHDIR([libev], [$with_libev], [include/event.h])
AC_ARG_WITH([libev-libdir],
[AC_HELP_STRING([--with-libev-libdir=DIR],
[Search for libev libraries in DIR ])])
PMIX_CHECK_WITHDIR([libev-libdir], [$with_livev_libdir], [libev.*])
pmix_libev_support=0
AS_IF([test -n "$with_libev" && test "$with_libev" != "no"],
[AC_MSG_CHECKING([for libev in])
pmix_check_libev_save_CPPFLAGS="$CPPFLAGS"
pmix_check_libeve_save_LDFLAGS="$LDFLAGS"
pmix_check_libev_save_LIBS="$LIBS"
if test "$with_libev" != "yes"; then
pmix_libev_dir=$with_libev/include
pmix_libev_standard_header_location=no
pmix_libev_standard_lib_location=no
AS_IF([test -z "$with_libev_libdir" || test "$with_libev_libdir" = "yes"],
[if test -d $with_libev/lib; then
pmix_libev_libdir=$with_libev/lib
elif test -d $with_libev/lib64; then
pmix_libev_libdir=$with_libev/lib64
else
AC_MSG_RESULT([Could not find $with_libev/lib or $with_libev/lib64])
AC_MSG_ERROR([Can not continue])
fi
AC_MSG_RESULT([$pmix_libev_dir and $pmix_libev_libdir])],
[AC_MSG_RESULT([$with_libev_libdir])])
else
AC_MSG_RESULT([(default search paths)])
pmix_libev_standard_header_location=yes
pmix_libev_standard_lib_location=yes
fi
AS_IF([test ! -z "$with_libev_libdir" && test "$with_libev_libdir" != "yes"],
[pmix_libev_libdir="$with_libev_libdir"
pmix_libev_standard_lib_location=no])
PMIX_CHECK_PACKAGE([pmix_libev],
[event.h],
[ev],
[event_base_new],
[],
[$pmix_libev_dir],
[$pmix_libev_libdir],
[pmix_libev_support=1],
[pmix_libev_support=0])
CPPFLAGS="$pmix_check_libev_save_CPPFLAGS"
LDFLAGS="$pmix_check_libev_save_LDFLAGS"
LIBS="$pmix_check_libev_save_LIBS"])
AS_IF([test $pmix_libev_support -eq 1],
[LIBS="$LIBS $pmix_libev_LIBS"
AS_IF([test "$pmix_libev_standard_header_location" != "yes"],
[CPPFLAGS="$CPPFLAGS $pmix_libev_CPPFLAGS"])
AS_IF([test "$pmix_libev_standard_lib_location" != "yes"],
[LDFLAGS="$LDFLAGS $pmix_libev_LDFLAGS"])])
AC_MSG_CHECKING([will libev support be built])
if test $pmix_libev_support -eq 1; then
AC_MSG_RESULT([yes])
PMIX_EVENT_HEADER="<event.h>"
AC_DEFINE_UNQUOTED([PMIX_EVENT_HEADER], [$PMIX_EVENT_HEADER],
[Location of event.h])
PMIX_SUMMARY_ADD([[External Packages]],[[libev]],[libev],[$pmix_libev_dir])
else
AC_MSG_RESULT([no])
fi
AC_DEFINE_UNQUOTED([PMIX_HAVE_LIBEV], [$pmix_libev_support], [Whether we are building against libev])
PMIX_VAR_SCOPE_POP
])dnl

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

@ -3,8 +3,8 @@
# Copyright (c) 2009-2015 Cisco Systems, Inc. All rights reserved. # Copyright (c) 2009-2015 Cisco Systems, Inc. All rights reserved.
# Copyright (c) 2013 Los Alamos National Security, LLC. All rights reserved. # Copyright (c) 2013 Los Alamos National Security, LLC. All rights reserved.
# Copyright (c) 2013-2019 Intel, Inc. All rights reserved. # Copyright (c) 2013-2019 Intel, Inc. All rights reserved.
# Copyright (c) 2017 Research Organization for Information Science # Copyright (c) 2017-2019 Research Organization for Information Science
# and Technology (RIST). All rights reserved. # and Technology (RIST). All rights reserved.
# $COPYRIGHT$ # $COPYRIGHT$
# #
# Additional copyrights may follow # Additional copyrights may follow
@ -19,20 +19,25 @@ AC_DEFUN([PMIX_LIBEVENT_CONFIG],[
[AC_HELP_STRING([--with-libevent-header=HEADER], [AC_HELP_STRING([--with-libevent-header=HEADER],
[The value that should be included in C files to include event.h])]) [The value that should be included in C files to include event.h])])
pmix_libevent_support=0
AS_IF([test "$pmix_mode" = "embedded"], AS_IF([test "$pmix_mode" = "embedded"],
[_PMIX_LIBEVENT_EMBEDDED_MODE], [_PMIX_LIBEVENT_EMBEDDED_MODE],
[_PMIX_LIBEVENT_EXTERNAL]) [AS_IF([test $pmix_libev_support -eq 0],
[_PMIX_LIBEVENT_EXTERNAL])])
AC_MSG_CHECKING([libevent header]) if test $pmix_libevent_support -eq 1; then
AC_DEFINE_UNQUOTED([PMIX_EVENT_HEADER], [$PMIX_EVENT_HEADER], AC_MSG_CHECKING([libevent header])
[Location of event.h]) AC_DEFINE_UNQUOTED([PMIX_EVENT_HEADER], [$PMIX_EVENT_HEADER],
AC_MSG_RESULT([$PMIX_EVENT_HEADER]) [Location of event.h])
AC_MSG_CHECKING([libevent2/thread header]) AC_MSG_RESULT([$PMIX_EVENT_HEADER])
AC_DEFINE_UNQUOTED([PMIX_EVENT2_THREAD_HEADER], [$PMIX_EVENT2_THREAD_HEADER], AC_MSG_CHECKING([libevent2/thread header])
[Location of event2/thread.h]) AC_DEFINE_UNQUOTED([PMIX_EVENT2_THREAD_HEADER], [$PMIX_EVENT2_THREAD_HEADER],
AC_MSG_RESULT([$PMIX_EVENT2_THREAD_HEADER]) [Location of event2/thread.h])
AC_MSG_RESULT([$PMIX_EVENT2_THREAD_HEADER])
PMIX_SUMMARY_ADD([[External Packages]],[[Libevent]], [pmix_libevent], [yes ($pmix_libevent_source)]) PMIX_SUMMARY_ADD([[External Packages]],[[Libevent]], [pmix_libevent], [yes ($pmix_libevent_source)])
fi
]) ])
AC_DEFUN([_PMIX_LIBEVENT_EMBEDDED_MODE],[ AC_DEFUN([_PMIX_LIBEVENT_EMBEDDED_MODE],[
@ -46,7 +51,8 @@ AC_DEFUN([_PMIX_LIBEVENT_EMBEDDED_MODE],[
PMIX_EVENT2_THREAD_HEADER="$with_libevent_header"]) PMIX_EVENT2_THREAD_HEADER="$with_libevent_header"])
pmix_libevent_source=embedded pmix_libevent_source=embedded
]) pmix_libevent_support=1
])
AC_DEFUN([_PMIX_LIBEVENT_EXTERNAL],[ AC_DEFUN([_PMIX_LIBEVENT_EXTERNAL],[
PMIX_VAR_SCOPE_PUSH([pmix_event_dir pmix_event_libdir pmix_event_defaults]) PMIX_VAR_SCOPE_PUSH([pmix_event_dir pmix_event_libdir pmix_event_defaults])
@ -55,88 +61,109 @@ AC_DEFUN([_PMIX_LIBEVENT_EXTERNAL],[
[AC_HELP_STRING([--with-libevent=DIR], [AC_HELP_STRING([--with-libevent=DIR],
[Search for libevent headers and libraries in DIR ])]) [Search for libevent headers and libraries in DIR ])])
# Bozo check
AS_IF([test "$with_libevent" = "no"],
[AC_MSG_WARN([It is not possible to configure PMIx --without-libevent])
AC_MSG_ERROR([Cannot continue])])
AC_ARG_WITH([libevent-libdir], AC_ARG_WITH([libevent-libdir],
[AC_HELP_STRING([--with-libevent-libdir=DIR], [AC_HELP_STRING([--with-libevent-libdir=DIR],
[Search for libevent libraries in DIR ])]) [Search for libevent libraries in DIR ])])
pmix_check_libevent_save_CPPFLAGS="$CPPFLAGS"
pmix_check_libevent_save_LDFLAGS="$LDFLAGS"
pmix_check_libevent_save_LIBS="$LIBS"
# get rid of the trailing slash(es) # get rid of the trailing slash(es)
libevent_prefix=$(echo $with_libevent | sed -e 'sX/*$XXg') libevent_prefix=$(echo $with_libevent | sed -e 'sX/*$XXg')
libeventdir_prefix=$(echo $with_libevent_libdir | sed -e 'sX/*$XXg') libeventdir_prefix=$(echo $with_libevent_libdir | sed -e 'sX/*$XXg')
AC_MSG_CHECKING([for libevent in]) if test "$libevent_prefix" != "no"; then
if test ! -z "$libevent_prefix" && test "$libevent_prefix" != "yes"; then AC_MSG_CHECKING([for libevent in])
pmix_event_defaults=no if test ! -z "$libevent_prefix" && test "$libevent_prefix" != "yes"; then
pmix_event_dir=$libevent_prefix pmix_event_defaults=no
if test -d $libevent_prefix/lib; then pmix_event_dir=$libevent_prefix/include
pmix_event_libdir=$libevent_prefix/lib if test -d $libevent_prefix/lib; then
elif test -d $libevent_prefix/lib64; then pmix_event_libdir=$libevent_prefix/lib
pmix_event_libdir=$libevent_prefix/lib64 elif test -d $libevent_prefix/lib64; then
elif test -d $libevent_prefix; then pmix_event_libdir=$libevent_prefix/lib64
pmix_event_libdir=$libevent_prefix elif test -d $libevent_prefix; then
pmix_event_libdir=$libevent_prefix
else
AC_MSG_RESULT([Could not find $libevent_prefix/lib, $libevent_prefix/lib64, or $libevent_prefix])
AC_MSG_ERROR([Can not continue])
fi
AC_MSG_RESULT([$pmix_event_dir and $pmix_event_libdir])
else else
AC_MSG_RESULT([Could not find $libevent_prefix/lib, $libevent_prefix/lib64, or $libevent_prefix]) pmix_event_defaults=yes
AC_MSG_ERROR([Can not continue]) pmix_event_dir=/usr/include
if test -d /usr/lib; then
pmix_event_libdir=/usr/lib
AC_MSG_RESULT([(default search paths)])
elif test -d /usr/lib64; then
pmix_event_libdir=/usr/lib64
AC_MSG_RESULT([(default search paths)])
else
AC_MSG_RESULT([default paths not found])
pmix_libevent_support=0
fi
fi fi
AC_MSG_RESULT([$pmix_event_dir and $pmix_event_libdir]) AS_IF([test ! -z "$libeventdir_prefix" && "$libeventdir_prefix" != "yes"],
else [pmix_event_libdir="$libeventdir_prefix"])
pmix_event_defaults=yes
pmix_event_dir=/usr/include PMIX_CHECK_PACKAGE([pmix_libevent],
if test -d /usr/lib; then [event.h],
pmix_event_libdir=/usr/lib [event],
elif test -d /usr/lib64; then [event_config_new],
pmix_event_libdir=/usr/lib64 [-levent -levent_pthreads],
else [$pmix_event_dir],
AC_MSG_RESULT([not found]) [$pmix_event_libdir],
AC_MSG_WARN([Could not find /usr/lib or /usr/lib64 - you may]) [pmix_libevent_support=1],
AC_MSG_WARN([need to specify --with-libevent-libdir=<path>]) [pmix_libevent_support=0])
AC_MSG_ERROR([Can not continue])
AS_IF([test "$pmix_event_defaults" = "no"],
[PMIX_FLAGS_APPEND_UNIQ(CPPFLAGS, $pmix_libevent_CPPFLAGS)
PMIX_FLAGS_APPEND_UNIQ(LDFLAGS, $pmix_libevent_LDFLAGS)])
PMIX_FLAGS_APPEND_UNIQ(LIBS, $pmix_libevent_LIBS)
if test $pmix_libevent_support -eq 1; then
# Ensure that this libevent has the symbol
# "evthread_set_lock_callbacks", which will only exist if
# libevent was configured with thread support.
AC_CHECK_LIB([event], [evthread_set_lock_callbacks],
[],
[AC_MSG_WARN([External libevent does not have thread support])
AC_MSG_WARN([PMIx requires libevent to be compiled with])
AC_MSG_WARN([thread support enabled])
pmix_libevent_support=0])
fi
if test $pmix_libevent_support -eq 1; then
AC_CHECK_LIB([event_pthreads], [evthread_use_pthreads],
[],
[AC_MSG_WARN([External libevent does not have thread support])
AC_MSG_WARN([PMIx requires libevent to be compiled with])
AC_MSG_WARN([thread support enabled])
pmix_libevent_support=0])
fi fi
AC_MSG_RESULT([(default search paths)])
fi fi
AS_IF([test ! -z "$libeventdir_prefix" && "$libeventdir_prefix" != "yes"],
[pmix_event_libdir="$libeventdir_prefix"])
PMIX_CHECK_PACKAGE([pmix_libevent], CPPFLAGS="$pmix_check_libevent_save_CPPFLAGS"
[event.h], LDFLAGS="$pmix_check_libevent_save_LDFLAGS"
[event], LIBS="$pmix_check_libevent_save_LIBS"
[event_config_new],
[-levent -levent_pthreads],
[$pmix_event_dir],
[$pmix_event_libdir],
[],
[AC_MSG_WARN([LIBEVENT SUPPORT NOT FOUND])
AC_MSG_ERROR([CANNOT CONTINUE])])
AS_IF([test "$pmix_event_defaults" = "no"], AC_MSG_CHECKING([will libevent support be built])
[PMIX_FLAGS_APPEND_UNIQ(CPPFLAGS, $pmix_libevent_CPPFLAGS) if test $pmix_libevent_support -eq 1; then
PMIX_FLAGS_APPEND_UNIQ(LDFLAGS, $pmix_libevent_LDFLAGS)]) AC_MSG_RESULT([yes])
PMIX_FLAGS_APPEND_UNIQ(LIBS, $pmix_libevent_LIBS) # Set output variables
PMIX_EVENT_HEADER="<event.h>"
PMIX_EVENT2_THREAD_HEADER="<event2/thread.h>"
AC_DEFINE_UNQUOTED([PMIX_EVENT_HEADER], [$PMIX_EVENT_HEADER],
[Location of event.h])
pmix_libevent_source=$pmix_event_dir
AS_IF([test "$pmix_event_defaults" = "no"],
[PMIX_FLAGS_APPEND_UNIQ(CPPFLAGS, $pmix_libevent_CPPFLAGS)
PMIX_FLAGS_APPEND_UNIQ(LDFLAGS, $pmix_libevent_LDFLAGS)])
PMIX_FLAGS_APPEND_UNIQ(LIBS, $pmix_libevent_LIBS)
else
AC_MSG_RESULT([no])
fi
# Ensure that this libevent has the symbol AC_DEFINE_UNQUOTED([PMIX_HAVE_LIBEVENT], [$pmix_libevent_support], [Whether we are building against libevent])
# "evthread_set_lock_callbacks", which will only exist if
# libevent was configured with thread support.
AC_CHECK_LIB([event], [evthread_set_lock_callbacks],
[],
[AC_MSG_WARN([External libevent does not have thread support])
AC_MSG_WARN([PMIx requires libevent to be compiled with])
AC_MSG_WARN([thread support enabled])
AC_MSG_ERROR([Cannot continue])])
AC_CHECK_LIB([event_pthreads], [evthread_use_pthreads],
[],
[AC_MSG_WARN([External libevent does not have thread support])
AC_MSG_WARN([PMIx requires libevent to be compiled with])
AC_MSG_WARN([thread support enabled])
AC_MSG_ERROR([Cannot continue])])
# Set output variables
PMIX_EVENT_HEADER="<event.h>"
PMIX_EVENT2_THREAD_HEADER="<event2/thread.h>"
pmix_libevent_source=$pmix_event_dir
PMIX_VAR_SCOPE_POP PMIX_VAR_SCOPE_POP
])dnl ])dnl

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

@ -12,7 +12,7 @@
# Copyright (c) 2006-2016 Cisco Systems, Inc. All rights reserved. # Copyright (c) 2006-2016 Cisco Systems, Inc. All rights reserved.
# Copyright (c) 2013 Mellanox Technologies, Inc. # Copyright (c) 2013 Mellanox Technologies, Inc.
# All rights reserved. # All rights reserved.
# Copyright (c) 2015-2019 Intel, Inc. All rights reserved. # Copyright (c) 2015-2018 Intel, Inc. All rights reserved.
# Copyright (c) 2015 Research Organization for Information Science # Copyright (c) 2015 Research Organization for Information Science
# and Technology (RIST). All rights reserved. # and Technology (RIST). All rights reserved.
# $COPYRIGHT$ # $COPYRIGHT$
@ -192,7 +192,7 @@
Summary: An extended/exascale implementation of PMI Summary: An extended/exascale implementation of PMI
Name: %{?_name:%{_name}}%{!?_name:pmix} Name: %{?_name:%{_name}}%{!?_name:pmix}
Version: 4.0.0 Version: 4.0.0a1
Release: 1%{?dist} Release: 1%{?dist}
License: BSD License: BSD
Group: Development/Libraries Group: Development/Libraries
@ -204,6 +204,7 @@ Prefix: %{_prefix}
Provides: pmix Provides: pmix
Provides: pmix = %{version} Provides: pmix = %{version}
BuildRoot: /var/tmp/%{name}-%{version}-%{release}-root BuildRoot: /var/tmp/%{name}-%{version}-%{release}-root
BuildRequires: libevent-devel
%if %{disable_auto_requires} %if %{disable_auto_requires}
AutoReq: no AutoReq: no
%endif %endif

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

@ -13,7 +13,7 @@
* All rights reserved. * All rights reserved.
* Copyright (c) 2009-2012 Cisco Systems, Inc. All rights reserved. * Copyright (c) 2009-2012 Cisco Systems, Inc. All rights reserved.
* Copyright (c) 2011 Oak Ridge National Labs. All rights reserved. * Copyright (c) 2011 Oak Ridge National Labs. All rights reserved.
* Copyright (c) 2013-2018 Intel, Inc. All rights reserved. * Copyright (c) 2013-2019 Intel, Inc. All rights reserved.
* Copyright (c) 2015 Research Organization for Information Science * Copyright (c) 2015 Research Organization for Information Science
* and Technology (RIST). All rights reserved. * and Technology (RIST). All rights reserved.
* Copyright (c) 2016 IBM Corporation. All rights reserved. * Copyright (c) 2016 IBM Corporation. All rights reserved.
@ -42,8 +42,6 @@
#include <sys/stat.h> #include <sys/stat.h>
#include <dirent.h> #include <dirent.h>
#include PMIX_EVENT_HEADER
#include "src/class/pmix_list.h" #include "src/class/pmix_list.h"
#include "src/util/pmix_environ.h" #include "src/util/pmix_environ.h"
#include "src/util/output.h" #include "src/util/output.h"
@ -266,9 +264,9 @@ int main(int argc, char **argv)
/* setup to see sigchld on the forked tests */ /* setup to see sigchld on the forked tests */
PMIX_CONSTRUCT(&children, pmix_list_t); PMIX_CONSTRUCT(&children, pmix_list_t);
event_assign(&handler, pmix_globals.evbase, SIGCHLD, pmix_event_assign(&handler, pmix_globals.evbase, SIGCHLD,
EV_SIGNAL|EV_PERSIST,wait_signal_callback, &handler); EV_SIGNAL|EV_PERSIST,wait_signal_callback, &handler);
event_add(&handler, NULL); pmix_event_add(&handler, NULL);
/* see if we were passed the number of procs to run or /* see if we were passed the number of procs to run or
* the executable to use */ * the executable to use */
@ -871,7 +869,7 @@ static void wait_signal_callback(int fd, short event, void *arg)
pid_t pid; pid_t pid;
wait_tracker_t *t2; wait_tracker_t *t2;
if (SIGCHLD != event_get_signal(sig)) { if (SIGCHLD != pmix_event_get_signal(sig)) {
return; return;
} }

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

@ -694,7 +694,7 @@ PMIX_EXPORT pmix_status_t PMIx_IOF_deregister(size_t iofhdlr,
pmix_op_cbfunc_t cbfunc, void *cbdata); pmix_op_cbfunc_t cbfunc, void *cbdata);
/* Push data collected locally (typically from stdin) to /* Push data collected locally (typically from stdin) to
* target recipients. * stdin of target recipients.
* *
* targets - array of process identifiers to which the data is to be delivered. Note * targets - array of process identifiers to which the data is to be delivered. Note
* that a WILDCARD rank indicates that all procs in the given nspace are * that a WILDCARD rank indicates that all procs in the given nspace are
@ -768,7 +768,7 @@ PMIX_EXPORT pmix_status_t PMIx_IOF_push(const pmix_proc_t targets[], size_t ntar
* Any participant that returns PMIX_GROUP_CONSTRUCT_ABORT from the leader failed * Any participant that returns PMIX_GROUP_CONSTRUCT_ABORT from the leader failed
* event handler will cause the construct process to abort. Those processes * event handler will cause the construct process to abort. Those processes
* engaged in the blocking construct will return from the call with the * engaged in the blocking construct will return from the call with the
* PMIX_GROUP_CONSTRUCT_ABORT status. Non-blocking partipants will have * PMIX_GROUP_CONSTRUCT_ABORT status. Non-blocking participants will have
* their callback function executed with that status. * their callback function executed with that status.
* *
* Some relevant attributes for this operation: * Some relevant attributes for this operation:
@ -790,7 +790,6 @@ PMIX_EXPORT pmix_status_t PMIx_IOF_push(const pmix_proc_t targets[], size_t ntar
* specified number of seconds. Targets the scenario where a * specified number of seconds. Targets the scenario where a
* process fails to call PMIx_Group_connect due to hanging * process fails to call PMIx_Group_connect due to hanging
* *
* Recognizing
*/ */
PMIX_EXPORT pmix_status_t PMIx_Group_construct(const char grp[], PMIX_EXPORT pmix_status_t PMIx_Group_construct(const char grp[],
const pmix_proc_t procs[], size_t nprocs, const pmix_proc_t procs[], size_t nprocs,

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

@ -4,7 +4,7 @@
* Copyright (c) 2016-2018 Research Organization for Information Science * Copyright (c) 2016-2018 Research Organization for Information Science
* and Technology (RIST). All rights reserved. * and Technology (RIST). All rights reserved.
* Copyright (c) 2016 IBM Corporation. All rights reserved. * Copyright (c) 2016 IBM Corporation. All rights reserved.
* Copyright (c) 2016-2018 Mellanox Technologies, Inc. * Copyright (c) 2016-2019 Mellanox Technologies, Inc.
* All rights reserved. * All rights reserved.
* *
* Redistribution and use in source and binary forms, with or without * Redistribution and use in source and binary forms, with or without
@ -265,6 +265,9 @@ typedef uint32_t pmix_rank_t;
#define PMIX_PARENT_ID "pmix.parent" // (pmix_proc_t*) identifier of the process that called PMIx_Spawn #define PMIX_PARENT_ID "pmix.parent" // (pmix_proc_t*) identifier of the process that called PMIx_Spawn
// to launch this proc's application // to launch this proc's application
#define PMIX_EXIT_CODE "pmix.exit.code" // (int) exit code returned when proc terminated #define PMIX_EXIT_CODE "pmix.exit.code" // (int) exit code returned when proc terminated
#define PMIX_NETWORK_COORDINATE "pmix.net.coord" // (pmix_coord_t*) Network coordinate of the specified process
#define PMIX_NETWORK_COORD_SYSTEM "pmix.net.coordsys" // (pmix_coord_system_t) Network coordinate system being employed to
// describe the specified network plane
/* size info */ /* size info */
@ -275,6 +278,7 @@ typedef uint32_t pmix_rank_t;
#define PMIX_LOCAL_SIZE "pmix.local.size" // (uint32_t) #procs in this job on this node #define PMIX_LOCAL_SIZE "pmix.local.size" // (uint32_t) #procs in this job on this node
#define PMIX_NODE_SIZE "pmix.node.size" // (uint32_t) #procs across all jobs on this node #define PMIX_NODE_SIZE "pmix.node.size" // (uint32_t) #procs across all jobs on this node
#define PMIX_MAX_PROCS "pmix.max.size" // (uint32_t) max #procs for this job #define PMIX_MAX_PROCS "pmix.max.size" // (uint32_t) max #procs for this job
#define PMIX_NUM_SLOTS "pmix.num.slots" // (uint32_t) #slots allocated
#define PMIX_NUM_NODES "pmix.num.nodes" // (uint32_t) #nodes in this nspace #define PMIX_NUM_NODES "pmix.num.nodes" // (uint32_t) #nodes in this nspace
@ -451,6 +455,24 @@ typedef uint32_t pmix_rank_t;
// in the specified range (defaults to session) // in the specified range (defaults to session)
#define PMIX_QUERY_PSET_NAMES "pmix.qry.psets" // (char*) return a comma-delimited list of the names of the #define PMIX_QUERY_PSET_NAMES "pmix.qry.psets" // (char*) return a comma-delimited list of the names of the
// psets defined in the specified range (defaults to session) // psets defined in the specified range (defaults to session)
#define PMIX_QUERY_ATTRIBUTE_SUPPORT "pmix.qry.attrs" // (bool) query attribute support for specified functions
#define PMIX_CLIENT_FUNCTIONS "pmix.client.fns" // (bool) query the list of supported PMIx client functions
#define PMIX_SERVER_FUNCTIONS "pmix.srvr.fns" // (bool) query the list of supported PMIx server functions
#define PMIX_TOOL_FUNCTIONS "pmix.tool.fns" // (bool) query the list of supported PMIx tool functions
#define PMIX_HOST_FUNCTIONS "pmix.host.fns" // (bool) query the list of PMIx functions supported by the host environment
#define PMIX_CLIENT_ATTRIBUTES "pmix.client.attrs" // (char*) comma-delimited list of functions, including "all"
// when used in a query, indicates whether or not to include
// attributes supported by the PMIx client library
#define PMIX_SERVER_ATTRIBUTES "pmix.srvr.attrs" // (char*) comma-delimited list of functions, including "all"
// when used in a query, indicates whether or not to include
// attributes supported by the PMIx server library
#define PMIX_HOST_ATTRIBUTES "pmix.host.attrs" // (char*) comma-delimited list of functions, including "all"
// when used in a query, indicates whether or not to include
// attributes supported by the host environment
#define PMIX_TOOL_ATTRIBUTES "pmix.tool.attrs" // (char*) comma-delimited list of functions, including "all"
// when used in a query, indicates whether or not to include
// attributes supported by the PMIx tool library
/* information retrieval attributes */ /* information retrieval attributes */
#define PMIX_SESSION_INFO "pmix.ssn.info" // (bool) Return information about the specified session. If information #define PMIX_SESSION_INFO "pmix.ssn.info" // (bool) Return information about the specified session. If information
@ -863,6 +885,9 @@ typedef int pmix_status_t;
#define PMIX_GROUP_LEADER_SELECTED -167 #define PMIX_GROUP_LEADER_SELECTED -167
#define PMIX_GROUP_LEADER_FAILED -168 #define PMIX_GROUP_LEADER_FAILED -168
#define PMIX_GROUP_CONTEXT_ID_ASSIGNED -169 #define PMIX_GROUP_CONTEXT_ID_ASSIGNED -169
#define PMIX_ERR_REPEAT_ATTR_REGISTRATION -170
#define PMIX_ERR_IOF_FAILURE -171
#define PMIX_ERR_IOF_COMPLETE -172
/* system failures */ /* system failures */
#define PMIX_ERR_NODE_DOWN -231 #define PMIX_ERR_NODE_DOWN -231
@ -941,6 +966,8 @@ typedef uint16_t pmix_data_type_t;
// Hole left by deprecation/removal of PMIX_INFO_ARRAY // Hole left by deprecation/removal of PMIX_INFO_ARRAY
#define PMIX_IOF_CHANNEL 45 #define PMIX_IOF_CHANNEL 45
#define PMIX_ENVAR 46 #define PMIX_ENVAR 46
#define PMIX_COORD 47
#define PMIX_REGATTR 48
/********************/ /********************/
/* define a boundary for implementers so they can add their own data types */ /* define a boundary for implementers so they can add their own data types */
@ -1038,14 +1065,28 @@ typedef enum {
} pmix_group_operation_t; } pmix_group_operation_t;
/* define a structure for a proc's network coordinate */
typedef struct pmix_coord {
int x;
int y;
int z;
} pmix_coord_t;
/* define coordinate system values */
typedef uint8_t pmix_coord_system_t;
#define PMIX_COORD_CARTESIAN 0x00
#define PMIX_COORD_TOROID 0x01
#define PMIX_COORD_CYLINDRICAL 0x02
/* declare a convenience macro for checking keys */ /* declare a convenience macro for checking keys */
#define PMIX_CHECK_KEY(a, b) \ #define PMIX_CHECK_KEY(a, b) \
(0 == strncmp((a)->key, (b), PMIX_MAX_KEYLEN)) (0 == strncmp((a)->key, (b), PMIX_MAX_KEYLEN))
#define PMIX_LOAD_KEY(a, b) \ #define PMIX_LOAD_KEY(a, b) \
do { \ do { \
memset((a), 0, PMIX_MAX_KEYLEN+1); \ memset((a), 0, PMIX_MAX_KEYLEN+1); \
pmix_strncpy((a), (b), PMIX_MAX_KEYLEN); \ pmix_strncpy((char*)(a), (const char*)(b), PMIX_MAX_KEYLEN); \
}while(0) }while(0)
/* define a convenience macro for loading nspaces */ /* define a convenience macro for loading nspaces */
@ -1362,6 +1403,11 @@ typedef struct pmix_data_array {
/**** AVOID CIRCULAR DEPENDENCIES ****/ /**** AVOID CIRCULAR DEPENDENCIES ****/
/* we cannot forward-declare the pmix_regattr_t struct
* as Cython doesn't know what to do with it. Thus, we
* will utilize the void* entry of the pmix_value_t to
* hold the point to pmix_regattr_t */
/**** PMIX VALUE STRUCT ****/ /**** PMIX VALUE STRUCT ****/
/* NOTE: operations can supply a collection of values under /* NOTE: operations can supply a collection of values under
@ -1404,6 +1450,7 @@ typedef struct pmix_value {
void *ptr; void *ptr;
pmix_alloc_directive_t adir; pmix_alloc_directive_t adir;
pmix_envar_t envar; pmix_envar_t envar;
pmix_coord_t *coord;
} data; } data;
} pmix_value_t; } pmix_value_t;
/* allocate and initialize a specified number of value structs */ /* allocate and initialize a specified number of value structs */
@ -1506,26 +1553,6 @@ typedef struct pmix_value {
} \ } \
} while(0) } while(0)
#define PMIX_VALUE_COMPRESSED_STRING_UNPACK(s) \
do { \
char *tmp; \
/* if this is a compressed string, then uncompress it */ \
if (PMIX_COMPRESSED_STRING == (s)->type) { \
pmix_util_uncompress_string(&tmp, (uint8_t*)(s)->data.bo.bytes, \
(s)->data.bo.size); \
if (NULL == tmp) { \
PMIX_ERROR_LOG(PMIX_ERR_NOMEM); \
rc = PMIX_ERR_NOMEM; \
PMIX_VALUE_RELEASE(s); \
val = NULL; \
} else { \
PMIX_VALUE_DESTRUCT(s); \
(s)->data.string = tmp; \
(s)->type = PMIX_STRING; \
} \
} \
} while(0)
/**** PMIX INFO STRUCT ****/ /**** PMIX INFO STRUCT ****/
typedef struct pmix_info { typedef struct pmix_info {
pmix_key_t key; pmix_key_t key;
@ -1538,8 +1565,10 @@ typedef struct pmix_info {
do { \ do { \
pmix_info_t *_i; \ pmix_info_t *_i; \
(m) = (pmix_info_t*)calloc((n), sizeof(pmix_info_t)); \ (m) = (pmix_info_t*)calloc((n), sizeof(pmix_info_t)); \
_i = (pmix_info_t*)(m); \ if (NULL != (m)) { \
_i[(n)-1].flags = PMIX_INFO_ARRAY_END; \ _i = (pmix_info_t*)(m); \
_i[(n)-1].flags = PMIX_INFO_ARRAY_END; \
} \
} while (0) } while (0)
#define PMIX_INFO_CONSTRUCT(m) \ #define PMIX_INFO_CONSTRUCT(m) \
@ -1814,6 +1843,97 @@ typedef struct pmix_query {
} \ } \
} while (0) } while (0)
/**** ATTRIBUTE REGISTRATION STRUCT ****/
typedef struct pmix_regattr_t {
char *name;
pmix_key_t string;
pmix_data_type_t type;
pmix_info_t *info;
size_t ninfo;
char **description;
} pmix_regattr_t;
#define PMIX_REGATTR_CONSTRUCT(a) \
do { \
if (NULL != (a)) { \
(a)->name = NULL; \
memset((a)->string, 0, PMIX_MAX_KEYLEN+1); \
(a)->type = PMIX_UNDEF; \
(a)->info = NULL; \
(a)->ninfo = 0; \
(a)->description = NULL; \
} \
} while(0)
#define PMIX_REGATTR_LOAD(a, n, k, t, ni, v) \
do { \
pmix_status_t _rgl; \
if (NULL != (n)) { \
(a)->name = strdup((n)); \
} \
if (NULL != (k)) { \
PMIX_LOAD_KEY((a)->string, (k)); \
} \
(a)->type = (t); \
if (0 < (ni)) { \
PMIX_INFO_CREATE((a)->info, (ni)); \
(a)->ninfo = (ni); \
} \
if (NULL != (v)) { \
PMIX_ARGV_APPEND(_rgl, &(a)->description, (v)); \
} \
} while(0)
#define PMIX_REGATTR_DESTRUCT(a) \
do { \
if (NULL != (a)) { \
if (NULL != (a)->name) { \
free((a)->name); \
} \
if (NULL != (a)->description) { \
PMIX_ARGV_FREE((a)->description); \
} \
} \
} while(0)
#define PMIX_REGATTR_CREATE(m, n) \
do { \
(m) = (pmix_regattr_t*)calloc((n) , sizeof(pmix_regattr_t)); \
} while (0)
#define PMIX_REGATTR_FREE(m, n) \
do { \
size_t _ra; \
if (NULL != (m)) { \
for (_ra=0; _ra < (n); _ra++) { \
PMIX_REGATTR_DESTRUCT(&((m)[_ra])); \
} \
free((m)); \
(m) = NULL; \
} \
} while (0)
#define PMIX_REGATTR_XFER(a, b) \
do { \
size_t _n; \
PMIX_REGATTR_CONSTRUCT((a)); \
if (NULL != ((b)->name)) { \
(a)->name = strdup((b)->name); \
} \
PMIX_LOAD_KEY((a)->string, (b)->string); \
(a)->type = (b)->type; \
if (0 < (b)->ninfo) { \
(a)->ninfo = (b)->ninfo; \
PMIX_INFO_CREATE((a)->info, (a)->ninfo); \
for (_n=0; _n < (a)->ninfo; _n++) { \
PMIX_INFO_XFER(&(a)->info[_n], &(b)->info[_n]); \
} \
} \
if (NULL != (b)->description) { \
PMIX_ARGV_COPY((a)->description, (b)->description); \
} \
} while(0)
/**** GENERIC HELPER MACROS ****/ /**** GENERIC HELPER MACROS ****/
@ -2183,8 +2303,11 @@ typedef void (*pmix_validation_cbfunc_t)(pmix_status_t status,
pmix_info_t info[], size_t ninfo, pmix_info_t info[], size_t ninfo,
void *cbdata); void *cbdata);
/****************************************/
/**** COMMON SUPPORT FUNCTIONS ****/ /**** COMMON SUPPORT FUNCTIONS ****/
/****************************************/
/****** EVENT NOTIFICATION SUPPORT ******/
/* Register an event handler to report events. Three types of events /* Register an event handler to report events. Three types of events
* can be reported: * can be reported:
* *
@ -2278,6 +2401,8 @@ PMIX_EXPORT pmix_status_t PMIx_Notify_event(pmix_status_t status,
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);
/****** PRETTY-PRINT DEFINED VALUE TYPES ******/
/* Provide a string representation for several types of value. Note /* Provide a string representation for several types of value. Note
* that the provided string is statically defined and must NOT be * that the provided string is statically defined and must NOT be
* free'd. Supported value types: * free'd. Supported value types:
@ -2311,6 +2436,8 @@ PMIX_EXPORT const char* PMIx_Get_version(void);
PMIX_EXPORT pmix_status_t PMIx_Store_internal(const pmix_proc_t *proc, PMIX_EXPORT pmix_status_t PMIx_Store_internal(const pmix_proc_t *proc,
const pmix_key_t key, pmix_value_t *val); const pmix_key_t key, pmix_value_t *val);
/****** DATA BUFFER PACK/UNPACK SUPPORT ******/
/** /**
* Top-level interface function to pack one or more values into a * Top-level interface function to pack one or more values into a
* buffer. * buffer.
@ -2539,6 +2666,7 @@ PMIX_EXPORT pmix_status_t PMIx_Data_copy_payload(pmix_data_buffer_t *dest,
pmix_data_buffer_t *src); pmix_data_buffer_t *src);
/******** STANDARD MACROS FOR DARRAY AND VALUE SUPPORT ********/
static inline void pmix_darray_destruct(pmix_data_array_t *m); static inline void pmix_darray_destruct(pmix_data_array_t *m);
static inline void pmix_value_destruct(pmix_value_t * m) static inline void pmix_value_destruct(pmix_value_t * m)
@ -2595,7 +2723,8 @@ static inline void pmix_darray_destruct(pmix_data_array_t *m)
} else if (PMIX_APP == m->type) { } else if (PMIX_APP == m->type) {
pmix_app_t *_a = (pmix_app_t*)m->array; pmix_app_t *_a = (pmix_app_t*)m->array;
PMIX_APP_FREE(_a, m->size); PMIX_APP_FREE(_a, m->size);
} else if (PMIX_BYTE_OBJECT == m->type) { } else if (PMIX_BYTE_OBJECT == m->type ||
PMIX_COMPRESSED_STRING == m->type) {
pmix_byte_object_t *_b = (pmix_byte_object_t*)m->array; pmix_byte_object_t *_b = (pmix_byte_object_t*)m->array;
PMIX_BYTE_OBJECT_FREE(_b, m->size); PMIX_BYTE_OBJECT_FREE(_b, m->size);
} else if (PMIX_STRING == m->type) { } else if (PMIX_STRING == m->type) {
@ -2633,7 +2762,8 @@ static inline void pmix_darray_destruct(pmix_data_array_t *m)
PMIX_QUERY_CREATE((m)->array, (n)); \ PMIX_QUERY_CREATE((m)->array, (n)); \
} else if (PMIX_APP == (t)) { \ } else if (PMIX_APP == (t)) { \
PMIX_APP_CREATE((m)->array, (n)); \ PMIX_APP_CREATE((m)->array, (n)); \
} else if (PMIX_BYTE_OBJECT == (t)) { \ } else if (PMIX_BYTE_OBJECT == (t) || \
PMIX_COMPRESSED_STRING == (t)) { \
PMIX_BYTE_OBJECT_CREATE((m)->array, (n)); \ PMIX_BYTE_OBJECT_CREATE((m)->array, (n)); \
} else if (PMIX_ALLOC_DIRECTIVE == (t) || \ } else if (PMIX_ALLOC_DIRECTIVE == (t) || \
PMIX_PROC_STATE == (t) || \ PMIX_PROC_STATE == (t) || \
@ -2642,7 +2772,8 @@ static inline void pmix_darray_destruct(pmix_data_array_t *m)
PMIX_DATA_RANGE == (t) || \ PMIX_DATA_RANGE == (t) || \
PMIX_BYTE == (t) || \ PMIX_BYTE == (t) || \
PMIX_INT8 == (t) || \ PMIX_INT8 == (t) || \
PMIX_UINT8 == (t)) { \ PMIX_UINT8 == (t) || \
PMIX_POINTER == (t)) { \
(m)->array = calloc((n), sizeof(int8_t)); \ (m)->array = calloc((n), sizeof(int8_t)); \
} else if (PMIX_STRING == (t)) { \ } else if (PMIX_STRING == (t)) { \
(m)->array = calloc((n), sizeof(char*)); \ (m)->array = calloc((n), sizeof(char*)); \
@ -2675,6 +2806,12 @@ static inline void pmix_darray_destruct(pmix_data_array_t *m)
(m)->array = calloc((n), sizeof(struct timeval)); \ (m)->array = calloc((n), sizeof(struct timeval)); \
} else if (PMIX_TIME == (t)) { \ } else if (PMIX_TIME == (t)) { \
(m)->array = calloc((n), sizeof(time_t)); \ (m)->array = calloc((n), sizeof(time_t)); \
} else if (PMIX_REGATTR == (t)) { \
PMIX_REGATTR_CREATE((m)->array, (n)); \
} else if (PMIX_BOOL == (t)) { \
(m)->array = calloc((n), sizeof(bool)); \
} else if (PMIX_COORD == (t)) { \
(m)->array = calloc((n), sizeof(pmix_coord_t)); \
} \ } \
} else { \ } else { \
(m)->array = NULL; \ (m)->array = NULL; \
@ -2709,21 +2846,21 @@ static inline void pmix_darray_destruct(pmix_data_array_t *m)
* @param len Size of the dest array - 1 * @param len Size of the dest array - 1
* *
*/ */
static inline void pmix_strncpy(char *dest, const char *src, size_t len) static inline void pmix_strncpy(char *dest,
const char *src,
size_t len)
{ {
size_t i, k; size_t i;
char *new_dest = dest;
/* use an algorithm that also protects against /* use an algorithm that also protects against
* non-NULL-terminated src strings */ * non-NULL-terminated src strings */
for (i=0, k=0; i <= len; ++i, ++src, ++new_dest) { for (i=0; i < len; ++i, ++src, ++dest) {
++k; *dest = *src;
*new_dest = *src;
if ('\0' == *src) { if ('\0' == *src) {
break; break;
} }
} }
dest[k-1] = '\0'; *dest = '\0';
} }
#include <pmix_extend.h> #include <pmix_extend.h>

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

@ -1,5 +1,5 @@
/* /*
* Copyright (c) 2013-2018 Intel, Inc. All rights reserved. * Copyright (c) 2013-2019 Intel, Inc. All rights reserved.
* Copyright (c) 2015 Artem Y. Polyakov <artpol84@gmail.com>. * Copyright (c) 2015 Artem Y. Polyakov <artpol84@gmail.com>.
* All rights reserved. * All rights reserved.
* Copyright (c) 2015 Research Organization for Information Science * Copyright (c) 2015 Research Organization for Information Science
@ -779,6 +779,28 @@ PMIX_EXPORT pmix_status_t PMIx_server_deliver_inventory(pmix_info_t info[], size
pmix_info_t directives[], size_t ndirs, pmix_info_t directives[], size_t ndirs,
pmix_op_cbfunc_t cbfunc, void *cbdata); pmix_op_cbfunc_t cbfunc, void *cbdata);
/****** ATTRIBUTE REGISTRATION ******/
/**
* This function is used by the host environment to register with its
* server library the attributes it supports for each pmix_server_module_t
* function.
*
* Parameters include:
*
* function - the string name of the server module function
* (e.g., "register_events", "validate_credential",
* or "allocate") whose attributes are being registered.
*
* attrs - array of pmix_regattr_t describing the attributes supported
* by the host environment for the specified function
*
* nattrs - number of elements in the attrs array
*
*/
PMIX_EXPORT pmix_status_t PMIx_Register_attributes(char *function,
pmix_regattr_t attrs[], size_t nattrs);
#if defined(c_plusplus) || defined(__cplusplus) #if defined(c_plusplus) || defined(__cplusplus)
} }
#endif #endif

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

@ -3,6 +3,8 @@
* All rights reserved. * All rights reserved.
* Copyright (c) 2018 IBM Corporation. All rights reserved. * Copyright (c) 2018 IBM Corporation. All rights reserved.
* Copyright (c) 2018 Intel, Inc. All rights reserved. * Copyright (c) 2018 Intel, Inc. All rights reserved.
* Copyright (c) 2019 Research Organization for Information Science
* and Technology (RIST). All rights reserved.
* $COPYRIGHT$ * $COPYRIGHT$
* *
* Additional copyrights may follow * Additional copyrights may follow
@ -19,5 +21,5 @@
#define PMIX_VERSION_MINOR @pmixminor@ #define PMIX_VERSION_MINOR @pmixminor@
#define PMIX_VERSION_RELEASE @pmixrelease@ #define PMIX_VERSION_RELEASE @pmixrelease@
#define PMIX_NUMERIC_VERSION 0x00040000 #define PMIX_NUMERIC_VERSION @pmixnumeric@
#endif #endif

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

@ -13,7 +13,7 @@
* Copyright (c) 2010-2017 IBM Corporation. All rights reserved. * Copyright (c) 2010-2017 IBM Corporation. All rights reserved.
* Copyright (c) 2015-2018 Los Alamos National Security, LLC. All rights * Copyright (c) 2015-2018 Los Alamos National Security, LLC. All rights
* reserved. * reserved.
* Copyright (c) 2018 Intel, Inc. All rights reserved. * Copyright (c) 2018-2019 Intel, Inc. All rights reserved.
* $COPYRIGHT$ * $COPYRIGHT$
* *
* Additional copyrights may follow * Additional copyrights may follow
@ -99,27 +99,7 @@ void pmix_atomic_isync(void)
ISYNC(); ISYNC();
} }
#elif PMIX_XLC_INLINE_ASSEMBLY /* end PMIX_GCC_INLINE_ASSEMBLY */ #endif /* end PMIX_GCC_INLINE_ASSEMBLY */
/* Yeah, I don't know who thought this was a reasonable syntax for
* inline assembly. Do these because they are used so often and they
* are fairly simple (aka: there is a tech pub on IBM's web site
* containing the right hex for the instructions).
*/
#undef PMIX_HAVE_INLINE_ATOMIC_MEM_BARRIER
#define PMIX_HAVE_INLINE_ATOMIC_MEM_BARRIER 0
#pragma mc_func pmix_atomic_mb { "7c0004ac" } /* sync */
#pragma reg_killed_by pmix_atomic_mb /* none */
#pragma mc_func pmix_atomic_rmb { "7c2004ac" } /* lwsync */
#pragma reg_killed_by pmix_atomic_rmb /* none */
#pragma mc_func pmix_atomic_wmb { "7c2004ac" } /* lwsync */
#pragma reg_killed_by pmix_atomic_wmb /* none */
#endif
/********************************************************************** /**********************************************************************
* *
@ -297,7 +277,7 @@ static inline bool pmix_atomic_compare_exchange_strong_64 (pmix_atomic_int64_t *
#define pmix_atomic_sc_64(addr, value, ret) \ #define pmix_atomic_sc_64(addr, value, ret) \
do { \ do { \
pmix_atomic_int64_t *_addr = (addr); \ pmix_atomic_int64_t *_addr = (addr); \
int64_t _foo, _newval = (int64_t) value; \ int64_t _newval = (int64_t) value; \
int32_t _ret; \ int32_t _ret; \
\ \
__asm__ __volatile__ (" stdcx. %2, 0, %1 \n\t" \ __asm__ __volatile__ (" stdcx. %2, 0, %1 \n\t" \

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

@ -3,6 +3,8 @@
* Copyright (c) 2012-2016 Cisco Systems, Inc. All rights reserved. * Copyright (c) 2012-2016 Cisco Systems, Inc. All rights reserved.
* Copyright (c) 2012 Los Alamos National Security, LLC. All rights reserved * Copyright (c) 2012 Los Alamos National Security, LLC. All rights reserved
* Copyright (c) 2015-2019 Intel, Inc. All rights reserved. * Copyright (c) 2015-2019 Intel, Inc. All rights reserved.
* Copyright (c) 2019 Research Organization for Information Science
* and Technology (RIST). All rights reserved.
* $COPYRIGHT$ * $COPYRIGHT$
* *
* Additional copyrights may follow * Additional copyrights may follow
@ -53,9 +55,9 @@
#define PMIX_HOTEL_H #define PMIX_HOTEL_H
#include <src/include/pmix_config.h> #include <src/include/pmix_config.h>
#include "src/include/types.h"
#include "src/include/prefetch.h" #include "src/include/prefetch.h"
#include "pmix_common.h" #include "pmix_common.h"
#include "src/include/types.h"
#include "src/class/pmix_object.h" #include "src/class/pmix_object.h"
#include PMIX_EVENT_HEADER #include PMIX_EVENT_HEADER
@ -306,7 +308,7 @@ static inline void pmix_hotel_checkout_and_return_occupant(pmix_hotel_t *hotel,
*occupant = room->occupant; *occupant = room->occupant;
room->occupant = NULL; room->occupant = NULL;
if (NULL != hotel->evbase) { if (NULL != hotel->evbase) {
event_del(&(room->eviction_timer_event)); pmix_event_del(&(room->eviction_timer_event));
} }
hotel->last_unoccupied_room++; hotel->last_unoccupied_room++;
assert(hotel->last_unoccupied_room < hotel->num_rooms); assert(hotel->last_unoccupied_room < hotel->num_rooms);

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

@ -1,8 +1,8 @@
/* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil -*- */ /* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil -*- */
/* /*
* Copyright (c) 2014-2018 Intel, Inc. All rights reserved. * Copyright (c) 2014-2018 Intel, Inc. All rights reserved.
* Copyright (c) 2014 Research Organization for Information Science * Copyright (c) 2014-2019 Research Organization for Information Science
* and Technology (RIST). All rights reserved. * and Technology (RIST). All rights reserved.
* Copyright (c) 2016 Mellanox Technologies, Inc. * Copyright (c) 2016 Mellanox Technologies, Inc.
* All rights reserved. * All rights reserved.
* $COPYRIGHT$ * $COPYRIGHT$
@ -14,8 +14,6 @@
#include <src/include/pmix_config.h> #include <src/include/pmix_config.h>
#include <src/include/types.h>
#include <pmix.h> #include <pmix.h>
#include <pmi.h> #include <pmi.h>

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

@ -1,8 +1,8 @@
/* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil -*- */ /* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil -*- */
/* /*
* Copyright (c) 2014-2018 Intel, Inc. All rights reserved. * Copyright (c) 2014-2018 Intel, Inc. All rights reserved.
* Copyright (c) 2015 Research Organization for Information Science * Copyright (c) 2015-2019 Research Organization for Information Science
* and Technology (RIST). All rights reserved. * and Technology (RIST). All rights reserved.
* Copyright (c) 2016 Mellanox Technologies, Inc. * Copyright (c) 2016 Mellanox Technologies, Inc.
* All rights reserved. * All rights reserved.
* $COPYRIGHT$ * $COPYRIGHT$
@ -14,8 +14,6 @@
#include <src/include/pmix_config.h> #include <src/include/pmix_config.h>
#include <src/include/types.h>
#ifdef HAVE_STRING_H #ifdef HAVE_STRING_H
#include <string.h> #include <string.h>
#endif #endif

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

@ -1,8 +1,8 @@
/* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil -*- */ /* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil -*- */
/* /*
* Copyright (c) 2014-2018 Intel, Inc. All rights reserved. * Copyright (c) 2014-2019 Intel, Inc. All rights reserved.
* Copyright (c) 2014-2018 Research Organization for Information Science * Copyright (c) 2014-2019 Research Organization for Information Science
* and Technology (RIST). All rights reserved. * and Technology (RIST). All rights reserved.
* Copyright (c) 2014 Artem Y. Polyakov <artpol84@gmail.com>. * Copyright (c) 2014 Artem Y. Polyakov <artpol84@gmail.com>.
* All rights reserved. * All rights reserved.
* Copyright (c) 2016-2017 Mellanox Technologies, Inc. * Copyright (c) 2016-2017 Mellanox Technologies, Inc.
@ -17,7 +17,6 @@
#include <src/include/pmix_config.h> #include <src/include/pmix_config.h>
#include <src/include/types.h>
#include <src/include/pmix_stdint.h> #include <src/include/pmix_stdint.h>
#include <src/include/pmix_socket_errno.h> #include <src/include/pmix_socket_errno.h>
@ -46,11 +45,10 @@
#include <sys/types.h> #include <sys/types.h>
#endif #endif
#if PMIX_HAVE_ZLIB
#include <zlib.h>
#endif
#include PMIX_EVENT_HEADER #include PMIX_EVENT_HEADER
#ifdef PMIX_EVENT2_THREAD_HEADER
#include PMIX_EVENT2_THREAD_HEADER #include PMIX_EVENT2_THREAD_HEADER
#endif
static const char pmix_version_string[] = PMIX_VERSION; static const char pmix_version_string[] = PMIX_VERSION;
static pmix_status_t pmix_init_result = PMIX_ERR_INIT; static pmix_status_t pmix_init_result = PMIX_ERR_INIT;
@ -58,7 +56,6 @@ static pmix_status_t pmix_init_result = PMIX_ERR_INIT;
#include "src/class/pmix_list.h" #include "src/class/pmix_list.h"
#include "src/event/pmix_event.h" #include "src/event/pmix_event.h"
#include "src/util/argv.h" #include "src/util/argv.h"
#include "src/util/compress.h"
#include "src/util/error.h" #include "src/util/error.h"
#include "src/util/hash.h" #include "src/util/hash.h"
#include "src/util/name_fns.h" #include "src/util/name_fns.h"
@ -67,10 +64,12 @@ static pmix_status_t pmix_init_result = PMIX_ERR_INIT;
#include "src/runtime/pmix_rte.h" #include "src/runtime/pmix_rte.h"
#include "src/threads/threads.h" #include "src/threads/threads.h"
#include "src/mca/bfrops/base/base.h" #include "src/mca/bfrops/base/base.h"
#include "src/mca/pcompress/base/base.h"
#include "src/mca/gds/base/base.h" #include "src/mca/gds/base/base.h"
#include "src/mca/preg/preg.h" #include "src/mca/preg/preg.h"
#include "src/mca/ptl/base/base.h" #include "src/mca/ptl/base/base.h"
#include "src/include/pmix_globals.h" #include "src/include/pmix_globals.h"
#include "src/common/pmix_attributes.h"
#include "src/common/pmix_iof.h" #include "src/common/pmix_iof.h"
#include "pmix_client_ops.h" #include "pmix_client_ops.h"
@ -421,7 +420,7 @@ PMIX_EXPORT pmix_status_t PMIx_Init(pmix_proc_t *proc,
pmix_info_t info[], size_t ninfo) pmix_info_t info[], size_t ninfo)
{ {
char *evar; char *evar;
pmix_status_t rc; pmix_status_t rc = PMIX_SUCCESS;
pmix_cb_t cb; pmix_cb_t cb;
pmix_buffer_t *req; pmix_buffer_t *req;
pmix_cmd_t cmd = PMIX_REQ_CMD; pmix_cmd_t cmd = PMIX_REQ_CMD;
@ -695,7 +694,10 @@ PMIX_EXPORT pmix_status_t PMIx_Init(pmix_proc_t *proc,
if (NULL != info) { if (NULL != info) {
_check_for_notify(info, ninfo); _check_for_notify(info, ninfo);
} }
return PMIX_SUCCESS;
/* register the client supported attrs */
rc = pmix_register_client_attrs();
return rc;
} }
PMIX_EXPORT int PMIx_Initialized(void) PMIX_EXPORT int PMIx_Initialized(void)
@ -979,7 +981,7 @@ static void _putfn(int sd, short args, void *cbdata)
kv->value = (pmix_value_t*)malloc(sizeof(pmix_value_t)); kv->value = (pmix_value_t*)malloc(sizeof(pmix_value_t));
if (PMIX_STRING_SIZE_CHECK(cb->value)) { if (PMIX_STRING_SIZE_CHECK(cb->value)) {
/* compress large strings */ /* compress large strings */
if (pmix_util_compress_string(cb->value->data.string, &tmp, &len)) { if (pmix_compress.compress_string(cb->value->data.string, &tmp, &len)) {
if (NULL == tmp) { if (NULL == tmp) {
PMIX_ERROR_LOG(PMIX_ERR_NOMEM); PMIX_ERROR_LOG(PMIX_ERR_NOMEM);
rc = PMIX_ERR_NOMEM; rc = PMIX_ERR_NOMEM;

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

@ -1,8 +1,8 @@
/* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil -*- */ /* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil -*- */
/* /*
* Copyright (c) 2014-2018 Intel, Inc. All rights reserved. * Copyright (c) 2014-2018 Intel, Inc. All rights reserved.
* Copyright (c) 2014-2017 Research Organization for Information Science * Copyright (c) 2014-2019 Research Organization for Information Science
* and Technology (RIST). All rights reserved. * and Technology (RIST). All rights reserved.
* Copyright (c) 2014 Artem Y. Polyakov <artpol84@gmail.com>. * Copyright (c) 2014 Artem Y. Polyakov <artpol84@gmail.com>.
* All rights reserved. * All rights reserved.
* Copyright (c) 2016 Mellanox Technologies, Inc. * Copyright (c) 2016 Mellanox Technologies, Inc.
@ -17,7 +17,6 @@
#include <src/include/pmix_config.h> #include <src/include/pmix_config.h>
#include <src/include/types.h>
#include <src/include/pmix_stdint.h> #include <src/include/pmix_stdint.h>
#include <pmix.h> #include <pmix.h>

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

@ -1,8 +1,8 @@
/* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil -*- */ /* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil -*- */
/* /*
* Copyright (c) 2014-2018 Intel, Inc. All rights reserved. * Copyright (c) 2014-2018 Intel, Inc. All rights reserved.
* Copyright (c) 2014-2015 Research Organization for Information Science * Copyright (c) 2014-2019 Research Organization for Information Science
* and Technology (RIST). All rights reserved. * and Technology (RIST). All rights reserved.
* Copyright (c) 2014 Artem Y. Polyakov <artpol84@gmail.com>. * Copyright (c) 2014 Artem Y. Polyakov <artpol84@gmail.com>.
* All rights reserved. * All rights reserved.
* Copyright (c) 2016 Mellanox Technologies, Inc. * Copyright (c) 2016 Mellanox Technologies, Inc.
@ -17,7 +17,6 @@
#include <src/include/pmix_config.h> #include <src/include/pmix_config.h>
#include <src/include/types.h>
#include <src/include/pmix_stdint.h> #include <src/include/pmix_stdint.h>
#include <pmix.h> #include <pmix.h>

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

@ -1,8 +1,8 @@
/* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil -*- */ /* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil -*- */
/* /*
* Copyright (c) 2014-2018 Intel, Inc. All rights reserved. * Copyright (c) 2014-2019 Intel, Inc. All rights reserved.
* Copyright (c) 2014-2016 Research Organization for Information Science * Copyright (c) 2014-2019 Research Organization for Information Science
* and Technology (RIST). All rights reserved. * and Technology (RIST). All rights reserved.
* Copyright (c) 2014 Artem Y. Polyakov <artpol84@gmail.com>. * Copyright (c) 2014 Artem Y. Polyakov <artpol84@gmail.com>.
* All rights reserved. * All rights reserved.
* Copyright (c) 2016-2018 Mellanox Technologies, Inc. * Copyright (c) 2016-2018 Mellanox Technologies, Inc.
@ -17,7 +17,6 @@
#include <src/include/pmix_config.h> #include <src/include/pmix_config.h>
#include <src/include/types.h>
#include <src/include/pmix_stdint.h> #include <src/include/pmix_stdint.h>
#include <pmix.h> #include <pmix.h>
@ -45,16 +44,13 @@
#include <sys/types.h> #include <sys/types.h>
#endif #endif
#if PMIX_HAVE_ZLIB
#include <zlib.h>
#endif
#include PMIX_EVENT_HEADER #include PMIX_EVENT_HEADER
#include "src/class/pmix_list.h" #include "src/class/pmix_list.h"
#include "src/mca/bfrops/bfrops.h" #include "src/mca/bfrops/bfrops.h"
#include "src/mca/pcompress/base/base.h"
#include "src/threads/threads.h" #include "src/threads/threads.h"
#include "src/util/argv.h" #include "src/util/argv.h"
#include "src/util/compress.h"
#include "src/util/error.h" #include "src/util/error.h"
#include "src/util/hash.h" #include "src/util/hash.h"
#include "src/util/output.h" #include "src/util/output.h"
@ -453,7 +449,9 @@ static void infocb(pmix_status_t status,
/* if this is a compressed string, then uncompress it */ /* if this is a compressed string, then uncompress it */
if (PMIX_COMPRESSED_STRING == info[0].value.type) { if (PMIX_COMPRESSED_STRING == info[0].value.type) {
kv->type = PMIX_STRING; kv->type = PMIX_STRING;
pmix_util_uncompress_string(&kv->data.string, (uint8_t*)info[0].value.data.bo.bytes, info[0].value.data.bo.size); pmix_compress.decompress_string(&kv->data.string,
(uint8_t*)info[0].value.data.bo.bytes,
info[0].value.data.bo.size);
if (NULL == kv->data.string) { if (NULL == kv->data.string) {
PMIX_ERROR_LOG(PMIX_ERR_NOMEM); PMIX_ERROR_LOG(PMIX_ERR_NOMEM);
rc = PMIX_ERR_NOMEM; rc = PMIX_ERR_NOMEM;

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

@ -1,8 +1,8 @@
/* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil -*- */ /* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil -*- */
/* /*
* Copyright (c) 2014-2019 Intel, Inc. All rights reserved. * Copyright (c) 2014-2019 Intel, Inc. All rights reserved.
* Copyright (c) 2014-2017 Research Organization for Information Science * Copyright (c) 2014-2019 Research Organization for Information Science
* and Technology (RIST). All rights reserved. * and Technology (RIST). All rights reserved.
* Copyright (c) 2014 Artem Y. Polyakov <artpol84@gmail.com>. * Copyright (c) 2014 Artem Y. Polyakov <artpol84@gmail.com>.
* All rights reserved. * All rights reserved.
* Copyright (c) 2016 Mellanox Technologies, Inc. * Copyright (c) 2016 Mellanox Technologies, Inc.
@ -17,7 +17,6 @@
#include <src/include/pmix_config.h> #include <src/include/pmix_config.h>
#include <src/include/types.h>
#include <src/include/pmix_stdint.h> #include <src/include/pmix_stdint.h>
#include <pmix.h> #include <pmix.h>

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

@ -1,8 +1,8 @@
/* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil -*- */ /* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil -*- */
/* /*
* Copyright (c) 2014-2018 Intel, Inc. All rights reserved. * Copyright (c) 2014-2018 Intel, Inc. All rights reserved.
* Copyright (c) 2014-2015 Research Organization for Information Science * Copyright (c) 2014-2019 Research Organization for Information Science
* and Technology (RIST). All rights reserved. * and Technology (RIST). All rights reserved.
* Copyright (c) 2014 Artem Y. Polyakov <artpol84@gmail.com>. * Copyright (c) 2014 Artem Y. Polyakov <artpol84@gmail.com>.
* All rights reserved. * All rights reserved.
* Copyright (c) 2016 Mellanox Technologies, Inc. * Copyright (c) 2016 Mellanox Technologies, Inc.
@ -17,7 +17,6 @@
#include <src/include/pmix_config.h> #include <src/include/pmix_config.h>
#include <src/include/types.h>
#include <src/include/pmix_stdint.h> #include <src/include/pmix_stdint.h>
#include <pmix.h> #include <pmix.h>

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

@ -1,8 +1,8 @@
/* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil -*- */ /* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil -*- */
/* /*
* Copyright (c) 2014-2019 Intel, Inc. All rights reserved. * Copyright (c) 2014-2019 Intel, Inc. All rights reserved.
* Copyright (c) 2014-2017 Research Organization for Information Science * Copyright (c) 2014-2019 Research Organization for Information Science
* and Technology (RIST). All rights reserved. * and Technology (RIST). All rights reserved.
* Copyright (c) 2014 Artem Y. Polyakov <artpol84@gmail.com>. * Copyright (c) 2014 Artem Y. Polyakov <artpol84@gmail.com>.
* All rights reserved. * All rights reserved.
* Copyright (c) 2016 Mellanox Technologies, Inc. * Copyright (c) 2016 Mellanox Technologies, Inc.
@ -17,7 +17,6 @@
#include <src/include/pmix_config.h> #include <src/include/pmix_config.h>
#include <src/include/types.h>
#include <src/include/pmix_stdint.h> #include <src/include/pmix_stdint.h>
#include <pmix.h> #include <pmix.h>

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

@ -1,6 +1,6 @@
# -*- makefile -*- # -*- makefile -*-
# #
# Copyright (c) 2015-2018 Intel, Inc. All rights reserved. # Copyright (c) 2015-2019 Intel, Inc. All rights reserved.
# Copyright (c) 2016 Cisco Systems, Inc. All rights reserved. # Copyright (c) 2016 Cisco Systems, Inc. All rights reserved.
# $COPYRIGHT$ # $COPYRIGHT$
# #
@ -16,7 +16,9 @@ sources += \
common/pmix_control.c \ common/pmix_control.c \
common/pmix_data.c \ common/pmix_data.c \
common/pmix_security.c \ common/pmix_security.c \
common/pmix_iof.c common/pmix_iof.c \
common/pmix_attributes.c
headers += \ headers += \
common/pmix_iof.h common/pmix_iof.h \
common/pmix_attributes.h

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

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

@ -0,0 +1,72 @@
/*
* Copyright (c) 2004-2005 The Trustees of Indiana University and Indiana
* University Research and Technology
* Corporation. All rights reserved.
* Copyright (c) 2004-2011 The University of Tennessee and The University
* of Tennessee Research Foundation. All rights
* reserved.
* Copyright (c) 2004-2005 High Performance Computing Center Stuttgart,
* University of Stuttgart. All rights reserved.
* Copyright (c) 2004-2005 The Regents of the University of California.
* All rights reserved.
* Copyright (c) 2008 Cisco Systems, Inc. All rights reserved.
* Copyright (c) 2012-2013 Los Alamos National Security, LLC.
* All rights reserved.
* Copyright (c) 2015-2019 Intel, Inc. All rights reserved.
* Copyright (c) 2017 IBM Corporation. All rights reserved.
* Copyright (c) 2017 Mellanox Technologies. All rights reserved.
* Copyright (c) 2018 Research Organization for Information Science
* and Technology (RIST). All rights reserved.
* $COPYRIGHT$
*
* Additional copyrights may follow
*
* $HEADER$
*/
/**
* @file
*
* I/O Forwarding Service
*/
#ifndef PMIX_ATTRIBUTES_H
#define PMIX_ATTRIBUTES_H
#include <src/include/pmix_config.h>
#ifdef HAVE_SYS_TYPES_H
#include <sys/types.h>
#endif
#ifdef HAVE_SYS_UIO_H
#include <sys/uio.h>
#endif
#ifdef HAVE_NET_UIO_H
#include <net/uio.h>
#endif
#ifdef HAVE_UNISTD_H
#include <unistd.h>
#endif
#include "src/class/pmix_list.h"
BEGIN_C_DECLS
PMIX_EXPORT void pmix_init_registered_attrs(void);
PMIX_EXPORT void pmix_release_registered_attrs(void);
PMIX_EXPORT pmix_status_t pmix_register_tool_attrs(void);
PMIX_EXPORT pmix_status_t pmix_register_client_attrs(void);
PMIX_EXPORT pmix_status_t pmix_register_server_attrs(void);
PMIX_EXPORT char** pmix_attributes_print_functions(char *level);
PMIX_EXPORT char** pmix_attributes_print_attr(char *level, char *function);
PMIX_EXPORT void pmix_attributes_print_attrs(char ***ans, char *function,
pmix_regattr_t *attrs,
size_t nattrs);
PMIX_EXPORT void pmix_attributes_print_headers(char ***ans, char *level);
PMIX_EXPORT void pmix_attrs_query_support(int sd, short args, void *cbdata);
END_C_DECLS
#endif /* PMIX_IOF_H */

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

@ -1,6 +1,6 @@
/* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil -*- */ /* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil -*- */
/* /*
* Copyright (c) 2014-2019 Intel, Inc. All rights reserved. * Copyright (c) 2014-2018 Intel, Inc. All rights reserved.
* Copyright (c) 2016 Mellanox Technologies, Inc. * Copyright (c) 2016 Mellanox Technologies, Inc.
* All rights reserved. * All rights reserved.
* Copyright (c) 2016 IBM Corporation. All rights reserved. * Copyright (c) 2016 IBM Corporation. All rights reserved.
@ -14,7 +14,6 @@
*/ */
#include <src/include/pmix_config.h> #include <src/include/pmix_config.h>
#include <src/include/types.h>
#include <src/include/pmix_stdint.h> #include <src/include/pmix_stdint.h>
#include <src/include/pmix_socket_errno.h> #include <src/include/pmix_socket_errno.h>

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

@ -1,9 +1,11 @@
/* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil -*- */ /* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil -*- */
/* /*
* Copyright (c) 2014-2018 Intel, Inc. All rights reserved. * Copyright (c) 2014-2019 Intel, Inc. All rights reserved.
* Copyright (c) 2016 Mellanox Technologies, Inc. * Copyright (c) 2016 Mellanox Technologies, Inc.
* All rights reserved. * All rights reserved.
* Copyright (c) 2016 IBM Corporation. All rights reserved. * Copyright (c) 2016 IBM Corporation. All rights reserved.
* Copyright (c) 2019 Research Organization for Information Science
* and Technology (RIST). All rights reserved.
* $COPYRIGHT$ * $COPYRIGHT$
* *
* Additional copyrights may follow * Additional copyrights may follow
@ -12,7 +14,14 @@
*/ */
#include <src/include/pmix_config.h> #include <src/include/pmix_config.h>
#include <src/include/types.h> #ifdef HAVE_FCNTL_H
#include <fcntl.h>
#else
#ifdef HAVE_SYS_FCNTL_H
#include <sys/fcntl.h>
#endif
#endif
#include <src/include/pmix_stdint.h> #include <src/include/pmix_stdint.h>
#include <src/include/pmix_socket_errno.h> #include <src/include/pmix_socket_errno.h>
@ -187,6 +196,9 @@ typedef struct {
void *cbdata; void *cbdata;
} pmix_ltcaddy_t; } pmix_ltcaddy_t;
static pmix_event_t stdinsig_ev;
static pmix_iof_read_event_t *stdinev = NULL;
static void stdincbfunc(struct pmix_peer_t *peer, static void stdincbfunc(struct pmix_peer_t *peer,
pmix_ptl_hdr_t *hdr, pmix_ptl_hdr_t *hdr,
pmix_buffer_t *buf, void *cbdata) pmix_buffer_t *buf, void *cbdata)
@ -225,8 +237,11 @@ pmix_status_t PMIx_IOF_push(const pmix_proc_t targets[], size_t ntargets,
{ {
pmix_buffer_t *msg; pmix_buffer_t *msg;
pmix_cmd_t cmd = PMIX_IOF_PUSH_CMD; pmix_cmd_t cmd = PMIX_IOF_PUSH_CMD;
pmix_status_t rc; pmix_status_t rc = PMIX_SUCCESS;
pmix_ltcaddy_t *cd; pmix_ltcaddy_t *cd;
size_t n;
bool begincollecting, stopcollecting;
int flags, fd = fileno(stdin);
PMIX_ACQUIRE_THREAD(&pmix_global_lock); PMIX_ACQUIRE_THREAD(&pmix_global_lock);
if (pmix_globals.init_cntr <= 0) { if (pmix_globals.init_cntr <= 0) {
@ -235,6 +250,104 @@ pmix_status_t PMIx_IOF_push(const pmix_proc_t targets[], size_t ntargets,
} }
PMIX_RELEASE_THREAD(&pmix_global_lock); PMIX_RELEASE_THREAD(&pmix_global_lock);
if (NULL == bo) {
/* check the directives */
for (n=0; n < ndirs; n++) {
if (PMIX_CHECK_KEY(&directives[n], PMIX_IOF_PUSH_STDIN)) {
/* we are to start collecting our stdin and pushing
* it to the specified targets */
begincollecting = PMIX_INFO_TRUE(&directives[n]);
if (begincollecting) {
/* add these targets to our list */
if (!pmix_globals.pushstdin) {
/* not already collecting, so start */
pmix_globals.pushstdin = true;
/* We don't want to set nonblocking on our
* stdio stream. If we do so, we set the file descriptor to
* non-blocking for everyone that has that file descriptor, which
* includes everyone else in our shell pipeline chain. (See
* http://lists.freebsd.org/pipermail/freebsd-hackers/2005-January/009742.html).
* This causes things like "prun -np 1 big_app | cat" to lose
* output, because cat's stdout is then ALSO non-blocking and cat
* isn't built to deal with that case (same with almost all other
* unix text utils).
*/
if (0 != fd) {
if((flags = fcntl(fd, F_GETFL, 0)) < 0) {
pmix_output(pmix_client_globals.iof_output,
"[%s:%d]: fcntl(F_GETFL) failed with errno=%d\n",
__FILE__, __LINE__, errno);
} else {
flags |= O_NONBLOCK;
fcntl(fd, F_SETFL, flags);
}
}
if (isatty(fd)) {
/* We should avoid trying to read from stdin if we
* have a terminal, but are backgrounded. Catch the
* signals that are commonly used when we switch
* between being backgrounded and not. If the
* filedescriptor is not a tty, don't worry about it
* and always stay connected.
*/
pmix_event_signal_set(pmix_globals.evbase, &stdinsig_ev,
SIGCONT, pmix_iof_stdin_cb,
NULL);
/* setup a read event to read stdin, but don't activate it yet. The
* dst_name indicates who should receive the stdin. If that recipient
* doesn't do a corresponding pull, however, then the stdin will
* be dropped upon receipt at the local daemon
*/
PMIX_IOF_READ_EVENT(&stdinev,
targets, ntargets,
directives, ndirs, fd,
pmix_iof_read_local_handler, false);
/* check to see if we want the stdin read event to be
* active - we will always at least define the event,
* but may delay its activation
*/
if (pmix_iof_stdin_check(fd)) {
PMIX_IOF_READ_ACTIVATE(stdinev);
}
} else {
/* if we are not looking at a tty, just setup a read event
* and activate it
*/
PMIX_IOF_READ_EVENT(&stdinev, targets, ntargets,
directives, ndirs, fd,
pmix_iof_read_local_handler, true);
}
}
} else {
if (pmix_globals.pushstdin) {
/* remove these targets from the list of
* recipients - if the list is then empty,
* stop collecting. If the targets param
* is NULL, then remove all targets and stop.
* Flush any cached input before calling
* the cbfunc */
}
}
} else if (PMIX_CHECK_KEY(&directives[n], PMIX_IOF_COMPLETE)) {
/* if we are collecting our stdin for the specified
* targets, then stop - a NULL for targets indicates
* stop for everyone. Flush any remaining cached input
* before calling the cbfunc */
stopcollecting = PMIX_INFO_TRUE(&directives[n]);
if (stopcollecting) {
if (pmix_globals.pushstdin) {
/* remove these targets from the list of
* recipients - if the list is then empty,
* stop collecting */
}
}
}
}
return PMIX_OPERATION_SUCCEEDED;
}
/* if we are not a server, then we send the provided /* if we are not a server, then we send the provided
* data to our server for processing */ * data to our server for processing */
if (!PMIX_PROC_IS_SERVER(pmix_globals.mypeer) || if (!PMIX_PROC_IS_SERVER(pmix_globals.mypeer) ||
@ -282,12 +395,14 @@ pmix_status_t PMIx_IOF_push(const pmix_proc_t targets[], size_t ntargets,
return rc; return rc;
} }
} }
PMIX_BFROPS_PACK(rc, pmix_client_globals.myserver, if (NULL != bo) {
msg, bo, 1, PMIX_BYTE_OBJECT); PMIX_BFROPS_PACK(rc, pmix_client_globals.myserver,
if (PMIX_SUCCESS != rc) { msg, bo, 1, PMIX_BYTE_OBJECT);
PMIX_ERROR_LOG(rc); if (PMIX_SUCCESS != rc) {
PMIX_RELEASE(msg); PMIX_ERROR_LOG(rc);
return rc; PMIX_RELEASE(msg);
return rc;
}
} }
cd = (pmix_ltcaddy_t*)malloc(sizeof(pmix_ltcaddy_t)); cd = (pmix_ltcaddy_t*)malloc(sizeof(pmix_ltcaddy_t));
@ -296,6 +411,8 @@ pmix_status_t PMIx_IOF_push(const pmix_proc_t targets[], size_t ntargets,
rc = PMIX_ERR_NOMEM; rc = PMIX_ERR_NOMEM;
return rc; return rc;
} }
cd->cbfunc = cbfunc;
cd->cbdata = cbdata;
PMIX_PTL_SEND_RECV(rc, pmix_client_globals.myserver, PMIX_PTL_SEND_RECV(rc, pmix_client_globals.myserver,
msg, stdincbfunc, cd); msg, stdincbfunc, cd);
if (PMIX_SUCCESS != rc) { if (PMIX_SUCCESS != rc) {
@ -314,7 +431,7 @@ pmix_status_t PMIx_IOF_push(const pmix_proc_t targets[], size_t ntargets,
targets, ntargets, targets, ntargets,
directives, ndirs, directives, ndirs,
bo, cbfunc, cbdata); bo, cbfunc, cbdata);
return PMIX_SUCCESS; return rc;
} }
pmix_status_t pmix_iof_write_output(const pmix_proc_t *name, pmix_status_t pmix_iof_write_output(const pmix_proc_t *name,
@ -691,15 +808,41 @@ void pmix_iof_stdin_cb(int fd, short event, void *cbdata)
} }
} }
static void restart_stdin(int fd, short event, void *cbdata) static void iof_stdin_cbfunc(struct pmix_peer_t *peer,
pmix_ptl_hdr_t *hdr,
pmix_buffer_t *buf, void *cbdata)
{ {
pmix_iof_read_event_t *tm = (pmix_iof_read_event_t*)cbdata; pmix_iof_read_event_t *stdinev = (pmix_iof_read_event_t*)cbdata;
int cnt;
pmix_status_t rc, ret;
PMIX_ACQUIRE_OBJECT(tm); PMIX_ACQUIRE_OBJECT(stdinev);
if (!tm->active) { /* check the return status */
PMIX_IOF_READ_ACTIVATE(tm); cnt = 1;
PMIX_BFROPS_UNPACK(rc, peer, buf, &ret, &cnt, PMIX_STATUS);
if (PMIX_SUCCESS != rc) {
PMIX_ERROR_LOG(rc);
pmix_event_del(&stdinev->ev);
stdinev->active = false;
PMIX_POST_OBJECT(stdinev);
return;
} }
/* if the status wasn't success, then terminate the forward */
if (PMIX_SUCCESS != ret) {
pmix_event_del(&stdinev->ev);
stdinev->active = false;
PMIX_POST_OBJECT(stdinev);
if (PMIX_ERR_IOF_COMPLETE != ret) {
/* generate an IOF-failed event so the tool knows */
PMIx_Notify_event(PMIX_ERR_IOF_FAILURE,
&pmix_globals.myid, PMIX_RANGE_PROC_LOCAL,
NULL, 0, NULL, NULL);
}
return;
}
pmix_iof_stdin_cb(0, 0, stdinev);
} }
/* this is the read handler for stdin */ /* this is the read handler for stdin */
@ -712,6 +855,7 @@ void pmix_iof_read_local_handler(int unusedfd, short event, void *cbdata)
pmix_status_t rc; pmix_status_t rc;
pmix_buffer_t *msg; pmix_buffer_t *msg;
pmix_cmd_t cmd = PMIX_IOF_PUSH_CMD; pmix_cmd_t cmd = PMIX_IOF_PUSH_CMD;
pmix_byte_object_t bo;
PMIX_ACQUIRE_OBJECT(rev); PMIX_ACQUIRE_OBJECT(rev);
@ -759,49 +903,62 @@ void pmix_iof_read_local_handler(int unusedfd, short event, void *cbdata)
if (PMIX_SUCCESS != rc) { if (PMIX_SUCCESS != rc) {
PMIX_ERROR_LOG(rc); PMIX_ERROR_LOG(rc);
PMIX_RELEASE(msg); PMIX_RELEASE(msg);
goto restart; return;
} }
/* pack the number of targets */
PMIX_BFROPS_PACK(rc, pmix_client_globals.myserver, PMIX_BFROPS_PACK(rc, pmix_client_globals.myserver,
msg, &numbytes, 1, PMIX_INT32); msg, &rev->ntargets, 1, PMIX_SIZE);
if (PMIX_SUCCESS != rc) { if (PMIX_SUCCESS != rc) {
PMIX_ERROR_LOG(rc); PMIX_ERROR_LOG(rc);
PMIX_RELEASE(msg); PMIX_RELEASE(msg);
goto restart; return;
} }
/* and the targets */
if (0 < rev->ntargets) {
PMIX_BFROPS_PACK(rc, pmix_client_globals.myserver,
msg, rev->targets, rev->ntargets, PMIX_PROC);
if (PMIX_SUCCESS != rc) {
PMIX_ERROR_LOG(rc);
PMIX_RELEASE(msg);
return;
}
}
/* pack the number of directives */
PMIX_BFROPS_PACK(rc, pmix_client_globals.myserver, PMIX_BFROPS_PACK(rc, pmix_client_globals.myserver,
msg, data, numbytes, PMIX_BYTE); msg, &rev->ndirs, 1, PMIX_SIZE);
if (PMIX_SUCCESS != rc) { if (PMIX_SUCCESS != rc) {
PMIX_ERROR_LOG(rc); PMIX_ERROR_LOG(rc);
PMIX_RELEASE(msg); PMIX_RELEASE(msg);
goto restart; return;
} }
PMIX_PTL_SEND_RECV(rc, pmix_client_globals.myserver, /* and the directives */
msg, stdincbfunc, NULL); if (0 < rev->ndirs) {
if (PMIX_SUCCESS != rc) { PMIX_BFROPS_PACK(rc, pmix_client_globals.myserver,
PMIX_ERROR_LOG(rc); msg, rev->directives, rev->ndirs, PMIX_INFO);
PMIX_RELEASE(msg); if (PMIX_SUCCESS != rc) {
PMIX_ERROR_LOG(rc);
PMIX_RELEASE(msg);
return;
}
} }
restart: /* pack the data */
/* if num_bytes was zero, or we read the last piece of the file, then we need to terminate the event */ bo.bytes = (char*)data;
if (0 == numbytes) { bo.size = numbytes;
/* this will also close our stdin file descriptor */ PMIX_BFROPS_PACK(rc, pmix_client_globals.myserver,
PMIX_RELEASE(rev); msg, &bo, 1, PMIX_BYTE_OBJECT);
} else { if (PMIX_SUCCESS != rc) {
/* if we are looking at a tty, then we just go ahead and restart the PMIX_ERROR_LOG(rc);
* read event assuming we are not backgrounded PMIX_RELEASE(msg);
*/ return;
if (pmix_iof_stdin_check(fd)) { }
restart_stdin(fd, 0, rev);
} else { /* send it to the server */
/* delay for awhile and then restart */ PMIX_PTL_SEND_RECV(rc, pmix_client_globals.myserver,
pmix_event_evtimer_set(pmix_globals.evbase, msg, iof_stdin_cbfunc, rev);
&rev->ev, restart_stdin, rev); if (PMIX_SUCCESS != rc) {
rev->tv.tv_sec = 0; PMIX_ERROR_LOG(rc);
rev->tv.tv_usec = 10000; PMIX_RELEASE(msg);
PMIX_POST_OBJECT(rev);
pmix_event_evtimer_add(&rev->ev, &rev->tv);
}
} }
/* nothing more to do */ /* nothing more to do */
return; return;
@ -837,6 +994,10 @@ static void iof_read_event_construct(pmix_iof_read_event_t* rev)
rev->active = false; rev->active = false;
rev->tv.tv_sec = 0; rev->tv.tv_sec = 0;
rev->tv.tv_usec = 0; rev->tv.tv_usec = 0;
rev->targets = NULL;
rev->ntargets = 0;
rev->directives = NULL;
rev->ndirs = 0;
} }
static void iof_read_event_destruct(pmix_iof_read_event_t* rev) static void iof_read_event_destruct(pmix_iof_read_event_t* rev)
{ {
@ -848,6 +1009,12 @@ static void iof_read_event_destruct(pmix_iof_read_event_t* rev)
close(rev->fd); close(rev->fd);
rev->fd = -1; rev->fd = -1;
} }
if (NULL != rev->targets) {
PMIX_PROC_FREE(rev->targets, rev->ntargets);
}
if (NULL != rev->directives) {
PMIX_INFO_FREE(rev->directives, rev->ndirs);
}
} }
PMIX_CLASS_INSTANCE(pmix_iof_read_event_t, PMIX_CLASS_INSTANCE(pmix_iof_read_event_t,
pmix_object_t, pmix_object_t,

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

@ -12,7 +12,7 @@
* Copyright (c) 2008 Cisco Systems, Inc. All rights reserved. * Copyright (c) 2008 Cisco Systems, Inc. All rights reserved.
* Copyright (c) 2012-2013 Los Alamos National Security, LLC. * Copyright (c) 2012-2013 Los Alamos National Security, LLC.
* All rights reserved. * All rights reserved.
* Copyright (c) 2015-2018 Intel, Inc. All rights reserved. * Copyright (c) 2015-2019 Intel, Inc. All rights reserved.
* Copyright (c) 2017 IBM Corporation. All rights reserved. * Copyright (c) 2017 IBM Corporation. All rights reserved.
* Copyright (c) 2017 Mellanox Technologies. All rights reserved. * Copyright (c) 2017 Mellanox Technologies. All rights reserved.
* Copyright (c) 2018 Research Organization for Information Science * Copyright (c) 2018 Research Organization for Information Science
@ -52,8 +52,6 @@
#include "src/include/pmix_globals.h" #include "src/include/pmix_globals.h"
#include "src/util/fd.h" #include "src/util/fd.h"
#include "src/common/pmix_iof.h"
BEGIN_C_DECLS BEGIN_C_DECLS
/* /*
@ -100,6 +98,10 @@ typedef struct {
int fd; int fd;
bool active; bool active;
bool always_readable; bool always_readable;
pmix_proc_t *targets;
size_t ntargets;
pmix_info_t *directives;
size_t ndirs;
} pmix_iof_read_event_t; } pmix_iof_read_event_t;
PMIX_EXPORT PMIX_CLASS_DECLARATION(pmix_iof_read_event_t); PMIX_EXPORT PMIX_CLASS_DECLARATION(pmix_iof_read_event_t);
@ -188,6 +190,42 @@ pmix_iof_fd_always_ready(int fd)
} while(0); } while(0);
#define PMIX_IOF_READ_EVENT(rv, p, np, d, nd, fid, cbfunc, actv) \
do { \
size_t _ii; \
pmix_iof_read_event_t *rev; \
PMIX_OUTPUT_VERBOSE((1, pmix_client_globals.iof_output, \
"defining read event at: %s %d", \
__FILE__, __LINE__)); \
rev = PMIX_NEW(pmix_iof_read_event_t); \
(rev)->ntargets = (np); \
PMIX_PROC_CREATE((rev)->targets, (rev)->ntargets); \
memcpy((rev)->targets, (p), (np) * sizeof(pmix_proc_t)); \
if (NULL != (d)) { \
PMIX_INFO_CREATE((rev)->directives, (nd)); \
(rev)->ndirs = (nd); \
for (_ii=0; _ii < (nd); _ii++) { \
PMIX_INFO_XFER(&((rev)->directives[_ii]), &((d)[_ii])); \
} \
} \
rev->fd = (fid); \
rev->always_readable = pmix_iof_fd_always_ready(fid); \
*(rv) = rev; \
if(rev->always_readable) { \
pmix_event_evtimer_set(pmix_globals.evbase, \
&rev->ev, (cbfunc), rev); \
} else { \
pmix_event_set(pmix_globals.evbase, \
&rev->ev, (fid), \
PMIX_EV_READ, \
(cbfunc), rev); \
} \
if ((actv)) { \
PMIX_IOF_READ_ACTIVATE(rev) \
} \
} while(0);
PMIX_EXPORT pmix_status_t pmix_iof_flush(void); PMIX_EXPORT pmix_status_t pmix_iof_flush(void);
PMIX_EXPORT pmix_status_t pmix_iof_write_output(const pmix_proc_t *name, PMIX_EXPORT pmix_status_t pmix_iof_write_output(const pmix_proc_t *name,
@ -196,10 +234,9 @@ PMIX_EXPORT pmix_status_t pmix_iof_write_output(const pmix_proc_t *name,
pmix_iof_flags_t *flags); pmix_iof_flags_t *flags);
PMIX_EXPORT void pmix_iof_static_dump_output(pmix_iof_sink_t *sink); PMIX_EXPORT void pmix_iof_static_dump_output(pmix_iof_sink_t *sink);
PMIX_EXPORT void pmix_iof_write_handler(int fd, short event, void *cbdata); PMIX_EXPORT void pmix_iof_write_handler(int fd, short event, void *cbdata);
PMIX_EXPORT void pmix_iof_stdin_write_handler(int fd, short event, void *cbdata);
PMIX_EXPORT bool pmix_iof_stdin_check(int fd); PMIX_EXPORT bool pmix_iof_stdin_check(int fd);
PMIX_EXPORT void pmix_iof_read_local_handler(int unusedfd, short event, void *cbdata);
PMIX_EXPORT void pmix_iof_stdin_cb(int fd, short event, void *cbdata); PMIX_EXPORT void pmix_iof_stdin_cb(int fd, short event, void *cbdata);
PMIX_EXPORT void pmix_iof_read_local_handler(int fd, short event, void *cbdata);
END_C_DECLS END_C_DECLS

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

@ -4,6 +4,8 @@
* Copyright (c) 2016 Mellanox Technologies, Inc. * Copyright (c) 2016 Mellanox Technologies, Inc.
* All rights reserved. * All rights reserved.
* Copyright (c) 2016 IBM Corporation. All rights reserved. * Copyright (c) 2016 IBM Corporation. All rights reserved.
* Copyright (c) 2019 Research Organization for Information Science
* and Technology (RIST). All rights reserved.
* $COPYRIGHT$ * $COPYRIGHT$
* *
* Additional copyrights may follow * Additional copyrights may follow
@ -12,7 +14,6 @@
*/ */
#include <src/include/pmix_config.h> #include <src/include/pmix_config.h>
#include <src/include/types.h>
#include <src/include/pmix_stdint.h> #include <src/include/pmix_stdint.h>
#include <src/include/pmix_socket_errno.h> #include <src/include/pmix_socket_errno.h>

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

@ -4,6 +4,8 @@
* Copyright (c) 2016 Mellanox Technologies, Inc. * Copyright (c) 2016 Mellanox Technologies, Inc.
* All rights reserved. * All rights reserved.
* Copyright (c) 2016 IBM Corporation. All rights reserved. * Copyright (c) 2016 IBM Corporation. All rights reserved.
* Copyright (c) 2019 Research Organization for Information Science
* and Technology (RIST). All rights reserved.
* $COPYRIGHT$ * $COPYRIGHT$
* *
* Additional copyrights may follow * Additional copyrights may follow
@ -12,7 +14,6 @@
*/ */
#include <src/include/pmix_config.h> #include <src/include/pmix_config.h>
#include <src/include/types.h>
#include <src/include/pmix_stdint.h> #include <src/include/pmix_stdint.h>
#include <src/include/pmix_socket_errno.h> #include <src/include/pmix_socket_errno.h>
@ -28,6 +29,7 @@
#include "src/util/output.h" #include "src/util/output.h"
#include "src/mca/bfrops/bfrops.h" #include "src/mca/bfrops/bfrops.h"
#include "src/mca/ptl/ptl.h" #include "src/mca/ptl/ptl.h"
#include "src/common/pmix_attributes.h"
#include "src/client/pmix_client_ops.h" #include "src/client/pmix_client_ops.h"
#include "src/server/pmix_server_ops.h" #include "src/server/pmix_server_ops.h"
@ -107,7 +109,7 @@ static void query_cbfunc(struct pmix_peer_t *peer,
complete: complete:
pmix_output_verbose(2, pmix_globals.debug_output, pmix_output_verbose(2, pmix_globals.debug_output,
"pmix:query cback from server releasing"); "pmix:query cback from server releasing with status %s", PMIx_Error_string(results->status));
/* release the caller */ /* release the caller */
if (NULL != cd->cbfunc) { if (NULL != cd->cbfunc) {
cd->cbfunc(results->status, results->info, results->ninfo, cd->cbdata, relcbfunc, results); cd->cbfunc(results->status, results->info, results->ninfo, cd->cbdata, relcbfunc, results);
@ -186,10 +188,25 @@ PMIX_EXPORT pmix_status_t PMIx_Query_info_nb(pmix_query_t queries[], size_t nque
* more, we would check each query and allow those that don't * more, we would check each query and allow those that don't
* want to be refreshed to be executed locally, and those that * want to be refreshed to be executed locally, and those that
* did would be sent to the host. However, for now we simply * did would be sent to the host. However, for now we simply
* */ * assume that any requirement to refresh will force all to
* do so */
memset(proc.nspace, 0, PMIX_MAX_NSLEN+1); memset(proc.nspace, 0, PMIX_MAX_NSLEN+1);
proc.rank = PMIX_RANK_INVALID; proc.rank = PMIX_RANK_INVALID;
for (n=0; n < nqueries; n++) { for (n=0; n < nqueries; n++) {
/* check for requests to report supported attributes */
if (0 == strcmp(queries[n].keys[0], PMIX_QUERY_ATTRIBUTE_SUPPORT)) {
cd = PMIX_NEW(pmix_query_caddy_t);
cd->queries = queries;
cd->nqueries = nqueries;
cd->cbfunc = cbfunc;
cd->cbdata = cbdata;
PMIX_THREADSHIFT(cd, pmix_attrs_query_support);
/* regardless of the result of the query, we return
* PMIX_SUCCESS here to indicate that the operation
* was accepted for processing */
PMIX_RELEASE_THREAD(&pmix_global_lock);
return PMIX_SUCCESS;
}
for (p=0; p < queries[n].nqual; p++) { for (p=0; p < queries[n].nqual; p++) {
if (PMIX_CHECK_KEY(&queries[n].qualifiers[p], PMIX_QUERY_REFRESH_CACHE)) { if (PMIX_CHECK_KEY(&queries[n].qualifiers[p], PMIX_QUERY_REFRESH_CACHE)) {
if (PMIX_INFO_TRUE(&queries[n].qualifiers[p])) { if (PMIX_INFO_TRUE(&queries[n].qualifiers[p])) {

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

@ -4,6 +4,8 @@
* Copyright (c) 2016 Mellanox Technologies, Inc. * Copyright (c) 2016 Mellanox Technologies, Inc.
* All rights reserved. * All rights reserved.
* Copyright (c) 2016 IBM Corporation. All rights reserved. * Copyright (c) 2016 IBM Corporation. All rights reserved.
* Copyright (c) 2019 Research Organization for Information Science
* and Technology (RIST). All rights reserved.
* $COPYRIGHT$ * $COPYRIGHT$
* *
* Additional copyrights may follow * Additional copyrights may follow
@ -12,7 +14,6 @@
*/ */
#include <src/include/pmix_config.h> #include <src/include/pmix_config.h>
#include <src/include/types.h>
#include <src/include/pmix_stdint.h> #include <src/include/pmix_stdint.h>
#include <src/include/pmix_socket_errno.h> #include <src/include/pmix_socket_errno.h>

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

@ -293,7 +293,7 @@ static pmix_status_t notify_server_of_event(pmix_status_t status,
PMIX_RELEASE(cb); PMIX_RELEASE(cb);
goto cleanup; goto cleanup;
} }
} else { } else if (NULL != cbfunc) {
cbfunc(PMIX_SUCCESS, cbdata); cbfunc(PMIX_SUCCESS, cbdata);
} }
@ -1020,16 +1020,6 @@ static void _notify_client_event(int sd, short args, void *cbdata)
if (!pmix_notify_check_range(&rngtrk, &proc)) { if (!pmix_notify_check_range(&rngtrk, &proc)) {
continue; continue;
} }
if (NULL != cd->targets) {
/* track the number of targets we have left to notify */
--cd->nleft;
/* if the event was cached and this is the last one,
* then evict this event from the cache */
if (0 == cd->nleft) {
pmix_hotel_checkout(&pmix_globals.notifications, cd->room);
PMIX_RELEASE(cd);
}
}
pmix_output_verbose(2, pmix_server_globals.event_output, pmix_output_verbose(2, pmix_server_globals.event_output,
"pmix_server: notifying client %s:%u on status %s", "pmix_server: notifying client %s:%u on status %s",
pr->peer->info->pname.nspace, pr->peer->info->pname.rank, pr->peer->info->pname.nspace, pr->peer->info->pname.rank,
@ -1087,6 +1077,17 @@ static void _notify_client_event(int sd, short args, void *cbdata)
if (PMIX_SUCCESS != rc) { if (PMIX_SUCCESS != rc) {
PMIX_RELEASE(bfr); PMIX_RELEASE(bfr);
} }
if (NULL != cd->targets && 0 < cd->nleft) {
/* track the number of targets we have left to notify */
--cd->nleft;
/* if the event was cached and this is the last one,
* then evict this event from the cache */
if (0 == cd->nleft) {
pmix_hotel_checkout(&pmix_globals.notifications, cd->room);
holdcd = false;
break;
}
}
} }
} }
} }

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

@ -1,12 +1,13 @@
/* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil -*- */ /* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil -*- */
/* /*
* Copyright (c) 2014-2019 Intel, Inc. All rights reserved. * Copyright (c) 2014-2019 Intel, Inc. All rights reserved.
* Copyright (c) 2014-2017 Research Organization for Information Science * Copyright (c) 2014-2019 Research Organization for Information Science
* Copyright (c) 2014-2019 Intel, Inc. All rights reserved.
* and Technology (RIST). All rights reserved. * and Technology (RIST). All rights reserved.
* Copyright (c) 2014-2015 Artem Y. Polyakov <artpol84@gmail.com>. * Copyright (c) 2014-2015 Artem Y. Polyakov <artpol84@gmail.com>.
* All rights reserved. * All rights reserved.
* Copyright (c) 2016 IBM Corporation. All rights reserved. * Copyright (c) 2016 IBM Corporation. All rights reserved.
* Copyright (c) 2019 Mellanox Technologies, Inc.
* All rights reserved.
* $COPYRIGHT$ * $COPYRIGHT$
* *
* Additional copyrights may follow * Additional copyrights may follow
@ -18,6 +19,7 @@
#include <src/include/pmix_config.h> #include <src/include/pmix_config.h>
#include <pmix_common.h>
#include <src/include/types.h> #include <src/include/types.h>
#include <src/include/pmix_stdint.h> #include <src/include/pmix_stdint.h>
#include <src/include/pmix_socket_errno.h> #include <src/include/pmix_socket_errno.h>
@ -326,6 +328,18 @@ PMIX_EXPORT PMIX_CLASS_INSTANCE(pmix_info_caddy_t,
pmix_list_item_t, pmix_list_item_t,
NULL, NULL); NULL, NULL);
static void ifcon(pmix_infolist_t *p)
{
PMIX_INFO_CONSTRUCT(&p->info);
}
static void ifdes(pmix_infolist_t *p)
{
PMIX_INFO_DESTRUCT(&p->info);
}
PMIX_EXPORT PMIX_CLASS_INSTANCE(pmix_infolist_t,
pmix_list_item_t,
ifcon, ifdes);
static void qcon(pmix_query_caddy_t *p) static void qcon(pmix_query_caddy_t *p)
{ {
PMIX_CONSTRUCT_LOCK(&p->lock); PMIX_CONSTRUCT_LOCK(&p->lock);
@ -336,6 +350,7 @@ static void qcon(pmix_query_caddy_t *p)
p->info = NULL; p->info = NULL;
p->ninfo = 0; p->ninfo = 0;
PMIX_BYTE_OBJECT_CONSTRUCT(&p->bo); PMIX_BYTE_OBJECT_CONSTRUCT(&p->bo);
PMIX_CONSTRUCT(&p->results, pmix_list_t);
p->cbfunc = NULL; p->cbfunc = NULL;
p->valcbfunc = NULL; p->valcbfunc = NULL;
p->cbdata = NULL; p->cbdata = NULL;
@ -349,6 +364,7 @@ static void qdes(pmix_query_caddy_t *p)
PMIX_BYTE_OBJECT_DESTRUCT(&p->bo); PMIX_BYTE_OBJECT_DESTRUCT(&p->bo);
PMIX_PROC_FREE(p->targets, p->ntargets); PMIX_PROC_FREE(p->targets, p->ntargets);
PMIX_INFO_FREE(p->info, p->ninfo); PMIX_INFO_FREE(p->info, p->ninfo);
PMIX_LIST_DESTRUCT(&p->results);
} }
PMIX_EXPORT PMIX_CLASS_INSTANCE(pmix_query_caddy_t, PMIX_EXPORT PMIX_CLASS_INSTANCE(pmix_query_caddy_t,
pmix_object_t, pmix_object_t,
@ -566,3 +582,30 @@ static bool dirpath_is_empty(const char *path )
return true; return true;
} }
int pmix_event_assign(struct event *ev, pmix_event_base_t *evbase,
int fd, short arg, event_callback_fn cbfn, void *cbd)
{
#if PMIX_HAVE_LIBEV
event_set(ev, fd, arg, cbfn, cbd);
event_base_set(evbase, ev);
#else
event_assign(ev, evbase, fd, arg, cbfn, cbd);
#endif
return 0;
}
pmix_event_t* pmix_event_new(pmix_event_base_t *b, int fd,
short fg, event_callback_fn cbfn, void *cbd)
{
pmix_event_t *ev = NULL;
#if PMIX_HAVE_LIBEV
ev = (pmix_event_t*)calloc(1, sizeof(pmix_event_t));
ev->ev_base = b;
#else
ev = event_new(b, fd, fg, (event_callback_fn) cbfn, cbd);
#endif
return ev;
}

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

@ -11,6 +11,10 @@
* 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) 2014-2019 Intel, Inc. All rights reserved. * Copyright (c) 2014-2019 Intel, Inc. All rights reserved.
* Copyright (c) 2019 Research Organization for Information Science
* and Technology (RIST). All rights reserved.
* Copyright (c) 2019 Mellanox Technologies, Inc.
* All rights reserved.
* $COPYRIGHT$ * $COPYRIGHT$
* *
* Additional copyrights may follow * Additional copyrights may follow
@ -23,6 +27,8 @@
#include <src/include/pmix_config.h> #include <src/include/pmix_config.h>
#include <pmix_common.h>
#include <src/include/types.h> #include <src/include/types.h>
#include <unistd.h> #include <unistd.h>
@ -216,6 +222,11 @@ typedef struct {
} pmix_info_caddy_t; } pmix_info_caddy_t;
PMIX_CLASS_DECLARATION(pmix_info_caddy_t); PMIX_CLASS_DECLARATION(pmix_info_caddy_t);
typedef struct {
pmix_list_item_t super;
pmix_info_t info;
} pmix_infolist_t;
PMIX_CLASS_DECLARATION(pmix_infolist_t);
/* object for tracking peers - each peer can have multiple /* object for tracking peers - each peer can have multiple
* connections. This can occur if the initial app executes * connections. This can occur if the initial app executes
@ -269,6 +280,7 @@ typedef struct {
size_t ntargets; size_t ntargets;
pmix_info_t *info; pmix_info_t *info;
size_t ninfo; size_t ninfo;
pmix_list_t results;
pmix_byte_object_t bo; pmix_byte_object_t bo;
pmix_info_cbfunc_t cbfunc; pmix_info_cbfunc_t cbfunc;
pmix_value_cbfunc_t valcbfunc; pmix_value_cbfunc_t valcbfunc;
@ -285,7 +297,7 @@ typedef struct {
pmix_list_item_t super; pmix_list_item_t super;
pmix_event_t ev; pmix_event_t ev;
bool event_active; bool event_active;
bool lost_connection; // tracker went thru lost connection procedure bool host_called; // tracker has been passed up to host
bool local; // operation is strictly local bool local; // operation is strictly local
char *id; // string identifier for the collective char *id; // string identifier for the collective
pmix_cmd_t type; pmix_cmd_t type;
@ -293,6 +305,7 @@ typedef struct {
bool hybrid; // true if participating procs are from more than one nspace bool hybrid; // true if participating procs are from more than one nspace
pmix_proc_t *pcs; // copy of the original array of participants pmix_proc_t *pcs; // copy of the original array of participants
size_t npcs; // number of procs in the array size_t npcs; // number of procs in the array
pmix_list_t nslist; // unique nspace list of participants
pmix_lock_t lock; // flag for waiting for completion pmix_lock_t lock; // flag for waiting for completion
bool def_complete; // all local procs have been registered and the trk definition is complete bool def_complete; // all local procs have been registered and the trk definition is complete
pmix_list_t local_cbs; // list of pmix_server_caddy_t for sending result to the local participants pmix_list_t local_cbs; // list of pmix_server_caddy_t for sending result to the local participants
@ -479,6 +492,8 @@ typedef struct {
* look them up */ * look them up */
pmix_gds_base_module_t *mygds; pmix_gds_base_module_t *mygds;
/* IOF controls */ /* IOF controls */
bool pushstdin;
pmix_list_t stdin_targets; // list of pmix_namelist_t
bool tag_output; bool tag_output;
bool xml_output; bool xml_output;
bool timestamp_output; bool timestamp_output;

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

@ -9,9 +9,11 @@
* 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) 2014-2018 Intel, Inc. All rights reserved. * Copyright (c) 2014-2019 Intel, Inc. All rights reserved.
* Copyright (c) 2015 Mellanox Technologies, Inc. * Copyright (c) 2015 Mellanox Technologies, Inc.
* All rights reserved. * All rights reserved.
* Copyright (c) 2019 Research Organization for Information Science
* and Technology (RIST). All rights reserved.
* $COPYRIGHT$ * $COPYRIGHT$
* *
* Additional copyrights may follow * Additional copyrights may follow
@ -43,11 +45,16 @@
#include <arpa/inet.h> #include <arpa/inet.h>
#endif #endif
#include PMIX_EVENT_HEADER #include PMIX_EVENT_HEADER
#if ! PMIX_HAVE_LIBEV
#include PMIX_EVENT2_THREAD_HEADER
#endif
#if PMIX_ENABLE_DEBUG #if PMIX_ENABLE_DEBUG
#include "src/util/output.h" #include "src/util/output.h"
#endif #endif
#include <pthread.h>
/* /*
* portable assignment of pointer to int * portable assignment of pointer to int
@ -232,42 +239,53 @@ typedef struct event pmix_event_t;
#define pmix_event_base_free(b) event_base_free(b) #define pmix_event_base_free(b) event_base_free(b)
#define pmix_event_free(x) event_free(x)
#define pmix_event_base_loopbreak(b) event_base_loopbreak(b)
#define pmix_event_base_loopexit(b) event_base_loopexit(b, NULL) #define pmix_event_base_loopexit(b) event_base_loopexit(b, NULL)
#if PMIX_HAVE_LIBEV
#define pmix_event_use_threads()
#define pmix_event_free(b) free(b)
#define pmix_event_get_signal(x) (x)->ev_fd
#else
/* thread support APIs */ /* thread support APIs */
#define pmix_event_use_threads() evthread_use_pthreads() #define pmix_event_use_threads() evthread_use_pthreads()
#define pmix_event_free(x) event_free(x)
#define pmix_event_get_signal(x) event_get_signal(x)
#endif
/* Basic event APIs */ /* Basic event APIs */
#define pmix_event_enable_debug_mode() event_enable_debug_mode() #define pmix_event_enable_debug_mode() event_enable_debug_mode()
#define pmix_event_assign(x, b, fd, fg, cb, arg) event_assign((x), (b), (fd), (fg), (event_callback_fn) (cb), (arg)) PMIX_EXPORT int pmix_event_assign(struct event *ev, pmix_event_base_t *evbase,
int fd, short arg, event_callback_fn cbfn, void *cbd);
#define pmix_event_set(b, x, fd, fg, cb, arg) event_assign((x), (b), (fd), (fg), (event_callback_fn) (cb), (arg)) #define pmix_event_set(b, x, fd, fg, cb, arg) pmix_event_assign((x), (b), (fd), (fg), (event_callback_fn) (cb), (arg))
#if PMIX_HAVE_LIBEV
PMIX_EXPORT int pmix_event_add(struct event *ev, struct timeval *tv);
PMIX_EXPORT int pmix_event_del(struct event *ev);
PMIX_EXPORT void pmix_event_active (struct event *ev, int res, short ncalls);
PMIX_EXPORT void pmix_event_base_loopbreak (pmix_event_base_t *b);
#else
#define pmix_event_add(ev, tv) event_add((ev), (tv)) #define pmix_event_add(ev, tv) event_add((ev), (tv))
#define pmix_event_del(ev) event_del((ev)) #define pmix_event_del(ev) event_del((ev))
#define pmix_event_active(x, y, z) event_active((x), (y), (z)) #define pmix_event_active(x, y, z) event_active((x), (y), (z))
#define pmix_event_base_loopbreak(b) event_base_loopbreak(b)
#endif
#define pmix_event_new(b, fd, fg, cb, arg) event_new((b), (fd), (fg), (event_callback_fn) (cb), (arg)) PMIX_EXPORT pmix_event_t* pmix_event_new(pmix_event_base_t *b, int fd,
short fg, event_callback_fn cbfn, void *cbd);
#define pmix_event_loop(b, fg) event_base_loop((b), (fg)) #define pmix_event_loop(b, fg) event_base_loop((b), (fg))
#define pmix_event_active(x, y, z) event_active((x), (y), (z))
#define pmix_event_evtimer_new(b, cb, arg) pmix_event_new((b), -1, 0, (cb), (arg)) #define pmix_event_evtimer_new(b, cb, arg) pmix_event_new((b), -1, 0, (cb), (arg))
#define pmix_event_evtimer_add(x, tv) pmix_event_add((x), (tv)) #define pmix_event_evtimer_add(x, tv) pmix_event_add((x), (tv))
#define pmix_event_evtimer_set(b, x, cb, arg) event_assign((x), (b), -1, 0, (event_callback_fn) (cb), (arg)) #define pmix_event_evtimer_set(b, x, cb, arg) pmix_event_assign((x), (b), -1, 0, (event_callback_fn) (cb), (arg))
#define pmix_event_evtimer_del(x) pmix_event_del((x)) #define pmix_event_evtimer_del(x) pmix_event_del((x))
#define pmix_event_signal_set(b, x, fd, cb, arg) event_assign((x), (b), (fd), EV_SIGNAL|EV_PERSIST, (event_callback_fn) (cb), (arg)) #define pmix_event_signal_set(b, x, fd, cb, arg) pmix_event_assign((x), (b), (fd), EV_SIGNAL|EV_PERSIST, (event_callback_fn) (cb), (arg))
#endif /* PMIX_TYPES_H */ #endif /* PMIX_TYPES_H */

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

@ -11,9 +11,11 @@
* 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) 2012 Los Alamos National Security, Inc. All rights reserved. * Copyright (c) 2012 Los Alamos National Security, Inc. All rights reserved.
* Copyright (c) 2014-2018 Intel, Inc. All rights reserved. * Copyright (c) 2014-2019 Intel, Inc. All rights reserved.
* Copyright (c) 2015 Research Organization for Information Science * Copyright (c) 2015 Research Organization for Information Science
* and Technology (RIST). All rights reserved. * and Technology (RIST). All rights reserved.
* Copyright (c) 2019 Mellanox Technologies, Inc.
* All rights reserved.
* $COPYRIGHT$ * $COPYRIGHT$
* *
* Additional copyrights may follow * Additional copyrights may follow
@ -159,46 +161,72 @@ PMIX_EXPORT extern pmix_bfrops_globals_t pmix_bfrops_globals;
#endif #endif
/* Unpack generic size macros */ /* Unpack generic size macros */
#define PMIX_BFROP_UNPACK_SIZE_MISMATCH(unpack_type, remote_type, ret) \ #define PMIX_BFROP_UNPACK_SIZE_MISMATCH(reg_types, unpack_type, remote_type, ret) \
do { \ do { \
switch(remote_type) { \ switch(remote_type) { \
case PMIX_UINT8: \ case PMIX_UINT8: \
PMIX_BFROP_UNPACK_SIZE_MISMATCH_FOUND(unpack_type, uint8_t, remote_type); \ PMIX_BFROP_UNPACK_SIZE_MISMATCH_FOUND(reg_types, unpack_type, uint8_t, remote_type); \
break; \ break; \
case PMIX_INT8: \ case PMIX_INT8: \
PMIX_BFROP_UNPACK_SIZE_MISMATCH_FOUND(unpack_type, int8_t, remote_type); \ PMIX_BFROP_UNPACK_SIZE_MISMATCH_FOUND(reg_types, unpack_type, int8_t, remote_type); \
break; \ break; \
case PMIX_UINT16: \ case PMIX_UINT16: \
PMIX_BFROP_UNPACK_SIZE_MISMATCH_FOUND(unpack_type, uint16_t, remote_type); \ PMIX_BFROP_UNPACK_SIZE_MISMATCH_FOUND(reg_types, unpack_type, uint16_t, remote_type); \
break; \ break; \
case PMIX_INT16: \ case PMIX_INT16: \
PMIX_BFROP_UNPACK_SIZE_MISMATCH_FOUND(unpack_type, int16_t, remote_type); \ PMIX_BFROP_UNPACK_SIZE_MISMATCH_FOUND(reg_types, unpack_type, int16_t, remote_type); \
break; \ break; \
case PMIX_UINT32: \ case PMIX_UINT32: \
PMIX_BFROP_UNPACK_SIZE_MISMATCH_FOUND(unpack_type, uint32_t, remote_type); \ PMIX_BFROP_UNPACK_SIZE_MISMATCH_FOUND(reg_types, unpack_type, uint32_t, remote_type); \
break; \ break; \
case PMIX_INT32: \ case PMIX_INT32: \
PMIX_BFROP_UNPACK_SIZE_MISMATCH_FOUND(unpack_type, int32_t, remote_type); \ PMIX_BFROP_UNPACK_SIZE_MISMATCH_FOUND(reg_types, unpack_type, int32_t, remote_type); \
break; \ break; \
case PMIX_UINT64: \ case PMIX_UINT64: \
PMIX_BFROP_UNPACK_SIZE_MISMATCH_FOUND(unpack_type, uint64_t, remote_type); \ PMIX_BFROP_UNPACK_SIZE_MISMATCH_FOUND(reg_types, unpack_type, uint64_t, remote_type); \
break; \ break; \
case PMIX_INT64: \ case PMIX_INT64: \
PMIX_BFROP_UNPACK_SIZE_MISMATCH_FOUND(unpack_type, int64_t, remote_type); \ PMIX_BFROP_UNPACK_SIZE_MISMATCH_FOUND(reg_types, unpack_type, int64_t, remote_type); \
break; \ break; \
default: \ default: \
ret = PMIX_ERR_NOT_FOUND; \ ret = PMIX_ERR_NOT_FOUND; \
} \ } \
} while (0) } while (0)
#define PMIX_BFROPS_PACK_TYPE(r, b, s, n, t, arr) \
do { \
pmix_bfrop_type_info_t *__info; \
/* Lookup the pack function for this type and call it */ \
__info = (pmix_bfrop_type_info_t*)pmix_pointer_array_get_item((arr),\
(t)); \
if (NULL == __info) { \
(r) = PMIX_ERR_UNKNOWN_DATA_TYPE; \
} else { \
(r) = __info->odti_pack_fn(arr, b, s, n, t); \
} \
} while(0)
#define PMIX_BFROPS_UNPACK_TYPE(r, b, d, n, t, arr) \
do { \
pmix_bfrop_type_info_t *__info; \
/* Lookup the unpack function for this type and call it */ \
__info = (pmix_bfrop_type_info_t*)pmix_pointer_array_get_item((arr),\
(t)); \
if (NULL == __info) { \
(r) = PMIX_ERR_UNKNOWN_DATA_TYPE; \
} else { \
(r) = __info->odti_unpack_fn(arr, b, d, n, t); \
} \
} while(0)
/* NOTE: do not need to deal with endianness here, as the unpacking of /* NOTE: do not need to deal with endianness here, as the unpacking of
the underling sender-side type will do that for us. Repeat: the the underling sender-side type will do that for us. Repeat: the
data in tmpbuf[] is already in host byte order. */ data in tmpbuf[] is already in host byte order. */
#define PMIX_BFROP_UNPACK_SIZE_MISMATCH_FOUND(unpack_type, tmptype, tmpbfroptype) \ #define PMIX_BFROP_UNPACK_SIZE_MISMATCH_FOUND(reg_types, unpack_type, tmptype, tmpbfroptype) \
do { \ do { \
int32_t i; \ int32_t i; \
tmptype *tmpbuf = (tmptype*)malloc(sizeof(tmptype) * (*num_vals)); \ tmptype *tmpbuf = (tmptype*)malloc(sizeof(tmptype) * (*num_vals)); \
ret = unpack_gentype(buffer, tmpbuf, num_vals, tmpbfroptype); \ PMIX_BFROPS_UNPACK_TYPE(ret, buffer, tmpbuf, num_vals, tmpbfroptype, reg_types); \
for (i = 0 ; i < *num_vals ; ++i) { \ for (i = 0 ; i < *num_vals ; ++i) { \
((unpack_type*) dest)[i] = (unpack_type)(tmpbuf[i]); \ ((unpack_type*) dest)[i] = (unpack_type)(tmpbuf[i]); \
} \ } \
@ -211,6 +239,16 @@ typedef struct pmix_info_array {
pmix_info_t *array; pmix_info_t *array;
} pmix_info_array_t; } pmix_info_array_t;
typedef pmix_status_t (*pmix_bfrop_internal_pack_fn_t)(pmix_pointer_array_t *regtypes,
pmix_buffer_t *buffer,
const void *src,
int32_t num_values,
pmix_data_type_t type);
typedef pmix_status_t (*pmix_bfrop_internal_unpack_fn_t)(pmix_pointer_array_t *regtypes,
pmix_buffer_t *buffer, void *dest,
int32_t *max_num_values,
pmix_data_type_t type);
/** /**
* Internal struct used for holding registered bfrop functions * Internal struct used for holding registered bfrop functions
@ -222,9 +260,9 @@ typedef struct pmix_info_array {
/** Debugging string name */ /** Debugging string name */
char *odti_name; char *odti_name;
/** Pack function */ /** Pack function */
pmix_bfrop_pack_fn_t odti_pack_fn; pmix_bfrop_internal_pack_fn_t odti_pack_fn;
/** Unpack function */ /** Unpack function */
pmix_bfrop_unpack_fn_t odti_unpack_fn; pmix_bfrop_internal_unpack_fn_t odti_unpack_fn;
/** copy function */ /** copy function */
pmix_bfrop_copy_fn_t odti_copy_fn; pmix_bfrop_copy_fn_t odti_copy_fn;
/** prpmix_status_t function */ /** prpmix_status_t function */
@ -240,8 +278,8 @@ PMIX_EXPORT PMIX_CLASS_DECLARATION(pmix_bfrop_type_info_t);
_info = PMIX_NEW(pmix_bfrop_type_info_t); \ _info = PMIX_NEW(pmix_bfrop_type_info_t); \
_info->odti_name = strdup((n)); \ _info->odti_name = strdup((n)); \
_info->odti_type = (t); \ _info->odti_type = (t); \
_info->odti_pack_fn = (pmix_bfrop_pack_fn_t)(p); \ _info->odti_pack_fn = (pmix_bfrop_internal_pack_fn_t)(p); \
_info->odti_unpack_fn = (pmix_bfrop_unpack_fn_t)(u); \ _info->odti_unpack_fn = (pmix_bfrop_internal_unpack_fn_t)(u); \
_info->odti_copy_fn = (pmix_bfrop_copy_fn_t)(c) ; \ _info->odti_copy_fn = (pmix_bfrop_copy_fn_t)(c) ; \
_info->odti_print_fn = (pmix_bfrop_print_fn_t)(pr) ; \ _info->odti_print_fn = (pmix_bfrop_print_fn_t)(pr) ; \
pmix_pointer_array_set_item((arr), (t), _info); \ pmix_pointer_array_set_item((arr), (t), _info); \
@ -306,89 +344,135 @@ PMIX_EXPORT pmix_status_t pmix_bfrops_base_pack_buffer(pmix_pointer_array_t *reg
const void *src, int32_t num_vals, const void *src, int32_t num_vals,
pmix_data_type_t type); pmix_data_type_t type);
PMIX_EXPORT pmix_status_t pmix_bfrops_base_pack_bool(pmix_buffer_t *buffer, const void *src, PMIX_EXPORT pmix_status_t pmix_bfrops_base_pack_bool(pmix_pointer_array_t *regtypes,
pmix_buffer_t *buffer, const void *src,
int32_t num_vals, pmix_data_type_t type); int32_t num_vals, pmix_data_type_t type);
PMIX_EXPORT pmix_status_t pmix_bfrops_base_pack_int(pmix_buffer_t *buffer, const void *src, PMIX_EXPORT pmix_status_t pmix_bfrops_base_pack_int(pmix_pointer_array_t *regtypes,
pmix_buffer_t *buffer, const void *src,
int32_t num_vals, pmix_data_type_t type); int32_t num_vals, pmix_data_type_t type);
PMIX_EXPORT pmix_status_t pmix_bfrops_base_pack_sizet(pmix_buffer_t *buffer, const void *src, PMIX_EXPORT pmix_status_t pmix_bfrops_base_pack_sizet(pmix_pointer_array_t *regtypes,
pmix_buffer_t *buffer, const void *src,
int32_t num_vals, pmix_data_type_t type); int32_t num_vals, pmix_data_type_t type);
PMIX_EXPORT pmix_status_t pmix_bfrops_base_pack_byte(pmix_buffer_t *buffer, const void *src, PMIX_EXPORT pmix_status_t pmix_bfrops_base_pack_byte(pmix_pointer_array_t *regtypes,
pmix_buffer_t *buffer, const void *src,
int32_t num_vals, pmix_data_type_t type); int32_t num_vals, pmix_data_type_t type);
PMIX_EXPORT pmix_status_t pmix_bfrops_base_pack_string(pmix_buffer_t *buffer, const void *src, PMIX_EXPORT pmix_status_t pmix_bfrops_base_pack_string(pmix_pointer_array_t *regtypes,
pmix_buffer_t *buffer, const void *src,
int32_t num_vals, pmix_data_type_t type); int32_t num_vals, pmix_data_type_t type);
PMIX_EXPORT pmix_status_t pmix_bfrops_base_pack_pid(pmix_buffer_t *buffer, const void *src, PMIX_EXPORT pmix_status_t pmix_bfrops_base_pack_pid(pmix_pointer_array_t *regtypes,
pmix_buffer_t *buffer, const void *src,
int32_t num_vals, pmix_data_type_t type); int32_t num_vals, pmix_data_type_t type);
PMIX_EXPORT pmix_status_t pmix_bfrops_base_pack_int16(pmix_buffer_t *buffer, const void *src, PMIX_EXPORT pmix_status_t pmix_bfrops_base_pack_int16(pmix_pointer_array_t *regtypes,
pmix_buffer_t *buffer, const void *src,
int32_t num_vals, pmix_data_type_t type); int32_t num_vals, pmix_data_type_t type);
PMIX_EXPORT pmix_status_t pmix_bfrops_base_pack_int32(pmix_buffer_t *buffer, const void *src, PMIX_EXPORT pmix_status_t pmix_bfrops_base_pack_int32(pmix_pointer_array_t *regtypes,
pmix_buffer_t *buffer, const void *src,
int32_t num_vals, pmix_data_type_t type); int32_t num_vals, pmix_data_type_t type);
PMIX_EXPORT pmix_status_t pmix_bfrops_base_pack_int64(pmix_buffer_t *buffer, const void *src, PMIX_EXPORT pmix_status_t pmix_bfrops_base_pack_int64(pmix_pointer_array_t *regtypes,
pmix_buffer_t *buffer, const void *src,
int32_t num_vals, pmix_data_type_t type); int32_t num_vals, pmix_data_type_t type);
PMIX_EXPORT pmix_status_t pmix_bfrops_base_pack_string(pmix_buffer_t *buffer, const void *src, PMIX_EXPORT pmix_status_t pmix_bfrops_base_pack_string(pmix_pointer_array_t *regtypes,
pmix_buffer_t *buffer, const void *src,
int32_t num_vals, pmix_data_type_t type); int32_t num_vals, pmix_data_type_t type);
PMIX_EXPORT pmix_status_t pmix_bfrops_base_pack_float(pmix_buffer_t *buffer, const void *src, PMIX_EXPORT pmix_status_t pmix_bfrops_base_pack_float(pmix_pointer_array_t *regtypes,
pmix_buffer_t *buffer, const void *src,
int32_t num_vals, pmix_data_type_t type); int32_t num_vals, pmix_data_type_t type);
PMIX_EXPORT pmix_status_t pmix_bfrops_base_pack_double(pmix_buffer_t *buffer, const void *src, PMIX_EXPORT pmix_status_t pmix_bfrops_base_pack_double(pmix_pointer_array_t *regtypes,
pmix_buffer_t *buffer, const void *src,
int32_t num_vals, pmix_data_type_t type); int32_t num_vals, pmix_data_type_t type);
PMIX_EXPORT pmix_status_t pmix_bfrops_base_pack_timeval(pmix_buffer_t *buffer, const void *src, PMIX_EXPORT pmix_status_t pmix_bfrops_base_pack_timeval(pmix_pointer_array_t *regtypes,
pmix_buffer_t *buffer, const void *src,
int32_t num_vals, pmix_data_type_t type); int32_t num_vals, pmix_data_type_t type);
PMIX_EXPORT pmix_status_t pmix_bfrops_base_pack_time(pmix_buffer_t *buffer, const void *src, PMIX_EXPORT pmix_status_t pmix_bfrops_base_pack_time(pmix_pointer_array_t *regtypes,
pmix_buffer_t *buffer, const void *src,
int32_t num_vals, pmix_data_type_t type); int32_t num_vals, pmix_data_type_t type);
PMIX_EXPORT pmix_status_t pmix_bfrops_base_pack_status(pmix_buffer_t *buffer, const void *src, PMIX_EXPORT pmix_status_t pmix_bfrops_base_pack_status(pmix_pointer_array_t *regtypes,
pmix_buffer_t *buffer, const void *src,
int32_t num_vals, pmix_data_type_t type); int32_t num_vals, pmix_data_type_t type);
PMIX_EXPORT pmix_status_t pmix_bfrops_base_pack_buf(pmix_buffer_t *buffer, const void *src, PMIX_EXPORT pmix_status_t pmix_bfrops_base_pack_buf(pmix_pointer_array_t *regtypes,
pmix_buffer_t *buffer, const void *src,
int32_t num_vals, pmix_data_type_t type); int32_t num_vals, pmix_data_type_t type);
PMIX_EXPORT pmix_status_t pmix_bfrops_base_pack_bo(pmix_buffer_t *buffer, const void *src, PMIX_EXPORT pmix_status_t pmix_bfrops_base_pack_bo(pmix_pointer_array_t *regtypes,
pmix_buffer_t *buffer, const void *src,
int32_t num_vals, pmix_data_type_t type); int32_t num_vals, pmix_data_type_t type);
PMIX_EXPORT pmix_status_t pmix_bfrops_base_pack_proc(pmix_buffer_t *buffer, const void *src, PMIX_EXPORT pmix_status_t pmix_bfrops_base_pack_proc(pmix_pointer_array_t *regtypes,
pmix_buffer_t *buffer, const void *src,
int32_t num_vals, pmix_data_type_t type); int32_t num_vals, pmix_data_type_t type);
PMIX_EXPORT pmix_status_t pmix_bfrops_base_pack_value(pmix_buffer_t *buffer, const void *src, PMIX_EXPORT pmix_status_t pmix_bfrops_base_pack_value(pmix_pointer_array_t *regtypes,
pmix_buffer_t *buffer, const void *src,
int32_t num_vals, pmix_data_type_t type); int32_t num_vals, pmix_data_type_t type);
PMIX_EXPORT pmix_status_t pmix_bfrops_base_pack_info(pmix_buffer_t *buffer, const void *src, PMIX_EXPORT pmix_status_t pmix_bfrops_base_pack_info(pmix_pointer_array_t *regtypes,
pmix_buffer_t *buffer, const void *src,
int32_t num_vals, pmix_data_type_t type); int32_t num_vals, pmix_data_type_t type);
PMIX_EXPORT pmix_status_t pmix_bfrops_base_pack_pdata(pmix_buffer_t *buffer, const void *src, PMIX_EXPORT pmix_status_t pmix_bfrops_base_pack_pdata(pmix_pointer_array_t *regtypes,
pmix_buffer_t *buffer, const void *src,
int32_t num_vals, pmix_data_type_t type); int32_t num_vals, pmix_data_type_t type);
PMIX_EXPORT pmix_status_t pmix_bfrops_base_pack_app(pmix_buffer_t *buffer, const void *src, PMIX_EXPORT pmix_status_t pmix_bfrops_base_pack_app(pmix_pointer_array_t *regtypes,
pmix_buffer_t *buffer, const void *src,
int32_t num_vals, pmix_data_type_t type); int32_t num_vals, pmix_data_type_t type);
PMIX_EXPORT pmix_status_t pmix_bfrops_base_pack_kval(pmix_buffer_t *buffer, const void *src, PMIX_EXPORT pmix_status_t pmix_bfrops_base_pack_kval(pmix_pointer_array_t *regtypes,
pmix_buffer_t *buffer, const void *src,
int32_t num_vals, pmix_data_type_t type); int32_t num_vals, pmix_data_type_t type);
PMIX_EXPORT pmix_status_t pmix_bfrops_base_pack_array(pmix_buffer_t *buffer, const void *src, PMIX_EXPORT pmix_status_t pmix_bfrops_base_pack_array(pmix_pointer_array_t *regtypes,
pmix_buffer_t *buffer, const void *src,
int32_t num_vals, pmix_data_type_t type); int32_t num_vals, pmix_data_type_t type);
PMIX_EXPORT pmix_status_t pmix_bfrops_base_pack_modex(pmix_buffer_t *buffer, const void *src, PMIX_EXPORT pmix_status_t pmix_bfrops_base_pack_modex(pmix_buffer_t *buffer, const void *src,
int32_t num_vals, pmix_data_type_t type); int32_t num_vals, pmix_data_type_t type);
PMIX_EXPORT pmix_status_t pmix_bfrops_base_pack_persist(pmix_buffer_t *buffer, const void *src, PMIX_EXPORT pmix_status_t pmix_bfrops_base_pack_persist(pmix_pointer_array_t *regtypes,
pmix_buffer_t *buffer, const void *src,
int32_t num_vals, pmix_data_type_t type); int32_t num_vals, pmix_data_type_t type);
PMIX_EXPORT pmix_status_t pmix_bfrops_base_pack_datatype(pmix_buffer_t *buffer, const void *src, PMIX_EXPORT pmix_status_t pmix_bfrops_base_pack_datatype(pmix_pointer_array_t *regtypes,
pmix_buffer_t *buffer, const void *src,
int32_t num_vals, pmix_data_type_t type); int32_t num_vals, pmix_data_type_t type);
PMIX_EXPORT pmix_status_t pmix_bfrops_base_pack_ptr(pmix_buffer_t *buffer, const void *src, PMIX_EXPORT pmix_status_t pmix_bfrops_base_pack_ptr(pmix_pointer_array_t *regtypes,
pmix_buffer_t *buffer, const void *src,
int32_t num_vals, pmix_data_type_t type); int32_t num_vals, pmix_data_type_t type);
PMIX_EXPORT pmix_status_t pmix_bfrops_base_pack_scope(pmix_buffer_t *buffer, const void *src, PMIX_EXPORT pmix_status_t pmix_bfrops_base_pack_scope(pmix_pointer_array_t *regtypes,
pmix_buffer_t *buffer, const void *src,
int32_t num_vals, pmix_data_type_t type); int32_t num_vals, pmix_data_type_t type);
PMIX_EXPORT pmix_status_t pmix_bfrops_base_pack_range(pmix_buffer_t *buffer, const void *src, PMIX_EXPORT pmix_status_t pmix_bfrops_base_pack_range(pmix_pointer_array_t *regtypes,
pmix_buffer_t *buffer, const void *src,
int32_t num_vals, pmix_data_type_t type); int32_t num_vals, pmix_data_type_t type);
PMIX_EXPORT pmix_status_t pmix_bfrops_base_pack_cmd(pmix_buffer_t *buffer, const void *src, PMIX_EXPORT pmix_status_t pmix_bfrops_base_pack_cmd(pmix_pointer_array_t *regtypes,
pmix_buffer_t *buffer, const void *src,
int32_t num_vals, pmix_data_type_t type); int32_t num_vals, pmix_data_type_t type);
PMIX_EXPORT pmix_status_t pmix_bfrops_base_pack_info_directives(pmix_buffer_t *buffer, const void *src, PMIX_EXPORT pmix_status_t pmix_bfrops_base_pack_info_directives(pmix_pointer_array_t *regtypes,
pmix_buffer_t *buffer, const void *src,
int32_t num_vals, pmix_data_type_t type); int32_t num_vals, pmix_data_type_t type);
PMIX_EXPORT pmix_status_t pmix_bfrops_base_pack_pstate(pmix_buffer_t *buffer, const void *src, PMIX_EXPORT pmix_status_t pmix_bfrops_base_pack_pstate(pmix_pointer_array_t *regtypes,
pmix_buffer_t *buffer, const void *src,
int32_t num_vals, pmix_data_type_t type); int32_t num_vals, pmix_data_type_t type);
PMIX_EXPORT pmix_status_t pmix_bfrops_base_pack_pinfo(pmix_buffer_t *buffer, const void *src, PMIX_EXPORT pmix_status_t pmix_bfrops_base_pack_pinfo(pmix_pointer_array_t *regtypes,
pmix_buffer_t *buffer, const void *src,
int32_t num_vals, pmix_data_type_t type); int32_t num_vals, pmix_data_type_t type);
PMIX_EXPORT pmix_status_t pmix_bfrops_base_pack_darray(pmix_buffer_t *buffer, const void *src, PMIX_EXPORT pmix_status_t pmix_bfrops_base_pack_darray(pmix_pointer_array_t *regtypes,
pmix_buffer_t *buffer, const void *src,
int32_t num_vals, pmix_data_type_t type); int32_t num_vals, pmix_data_type_t type);
PMIX_EXPORT pmix_status_t pmix_bfrops_base_pack_rank(pmix_buffer_t *buffer, const void *src, PMIX_EXPORT pmix_status_t pmix_bfrops_base_pack_rank(pmix_pointer_array_t *regtypes,
pmix_buffer_t *buffer, const void *src,
int32_t num_vals, pmix_data_type_t type); int32_t num_vals, pmix_data_type_t type);
PMIX_EXPORT pmix_status_t pmix_bfrops_base_pack_query(pmix_buffer_t *buffer, const void *src, PMIX_EXPORT pmix_status_t pmix_bfrops_base_pack_query(pmix_pointer_array_t *regtypes,
pmix_buffer_t *buffer, const void *src,
int32_t num_vals, pmix_data_type_t type); int32_t num_vals, pmix_data_type_t type);
PMIX_EXPORT pmix_status_t pmix_bfrops_base_pack_val(pmix_buffer_t *buffer, PMIX_EXPORT pmix_status_t pmix_bfrops_base_pack_val(pmix_pointer_array_t *regtypes,
pmix_buffer_t *buffer,
pmix_value_t *p); pmix_value_t *p);
PMIX_EXPORT pmix_status_t pmix_bfrops_base_pack_alloc_directive(pmix_buffer_t *buffer, const void *src, PMIX_EXPORT pmix_status_t pmix_bfrops_base_pack_alloc_directive(pmix_pointer_array_t *regtypes,
pmix_buffer_t *buffer, const void *src,
int32_t num_vals, pmix_data_type_t type); int32_t num_vals, pmix_data_type_t type);
PMIX_EXPORT pmix_status_t pmix_bfrops_base_pack_iof_channel(pmix_buffer_t *buffer, const void *src, PMIX_EXPORT pmix_status_t pmix_bfrops_base_pack_iof_channel(pmix_pointer_array_t *regtypes,
pmix_buffer_t *buffer, const void *src,
int32_t num_vals, pmix_data_type_t type); int32_t num_vals, pmix_data_type_t type);
PMIX_EXPORT pmix_status_t pmix_bfrops_base_pack_envar(pmix_buffer_t *buffer, const void *src, PMIX_EXPORT pmix_status_t pmix_bfrops_base_pack_envar(pmix_pointer_array_t *regtypes,
pmix_buffer_t *buffer, const void *src,
int32_t num_vals, pmix_data_type_t type); int32_t num_vals, pmix_data_type_t type);
PMIX_EXPORT pmix_status_t pmix_bfrops_base_pack_coord(pmix_pointer_array_t *regtypes,
pmix_buffer_t *buffer, const void *src,
int32_t num_vals, pmix_data_type_t type);
PMIX_EXPORT pmix_status_t pmix_bfrops_base_pack_regattr(pmix_pointer_array_t *regtypes,
pmix_buffer_t *buffer, const void *src,
int32_t num_vals, pmix_data_type_t type);
/* /*
* "Standard" unpack functions * "Standard" unpack functions
@ -398,90 +482,137 @@ PMIX_EXPORT pmix_status_t pmix_bfrops_base_unpack(pmix_pointer_array_t *regtypes
void *dst, int32_t *num_vals, void *dst, int32_t *num_vals,
pmix_data_type_t type); pmix_data_type_t type);
PMIX_EXPORT pmix_status_t pmix_bfrops_base_unpack_bool(pmix_buffer_t *buffer, void *dest, PMIX_EXPORT pmix_status_t pmix_bfrops_base_unpack_bool(pmix_pointer_array_t *regtypes,
pmix_buffer_t *buffer, void *dest,
int32_t *num_vals, pmix_data_type_t type); int32_t *num_vals, pmix_data_type_t type);
PMIX_EXPORT pmix_status_t pmix_bfrops_base_unpack_byte(pmix_buffer_t *buffer, void *dest, PMIX_EXPORT pmix_status_t pmix_bfrops_base_unpack_byte(pmix_pointer_array_t *regtypes,
pmix_buffer_t *buffer, void *dest,
int32_t *num_vals, pmix_data_type_t type); int32_t *num_vals, pmix_data_type_t type);
PMIX_EXPORT pmix_status_t pmix_bfrops_base_unpack_string(pmix_buffer_t *buffer, void *dest, PMIX_EXPORT pmix_status_t pmix_bfrops_base_unpack_string(pmix_pointer_array_t *regtypes,
pmix_buffer_t *buffer, void *dest,
int32_t *num_vals, pmix_data_type_t type); int32_t *num_vals, pmix_data_type_t type);
PMIX_EXPORT pmix_status_t pmix_bfrops_base_unpack_int(pmix_buffer_t *buffer, void *dest, PMIX_EXPORT pmix_status_t pmix_bfrops_base_unpack_int(pmix_pointer_array_t *regtypes,
pmix_buffer_t *buffer, void *dest,
int32_t *num_vals, pmix_data_type_t type); int32_t *num_vals, pmix_data_type_t type);
PMIX_EXPORT pmix_status_t pmix_bfrops_base_unpack_sizet(pmix_buffer_t *buffer, void *dest, PMIX_EXPORT pmix_status_t pmix_bfrops_base_unpack_sizet(pmix_pointer_array_t *regtypes,
pmix_buffer_t *buffer, void *dest,
int32_t *num_vals, pmix_data_type_t type); int32_t *num_vals, pmix_data_type_t type);
PMIX_EXPORT pmix_status_t pmix_bfrops_base_unpack_pid(pmix_buffer_t *buffer, void *dest, PMIX_EXPORT pmix_status_t pmix_bfrops_base_unpack_pid(pmix_pointer_array_t *regtypes,
pmix_buffer_t *buffer, void *dest,
int32_t *num_vals, pmix_data_type_t type); int32_t *num_vals, pmix_data_type_t type);
PMIX_EXPORT pmix_status_t pmix_bfrops_base_unpack_int16(pmix_buffer_t *buffer, void *dest, PMIX_EXPORT pmix_status_t pmix_bfrops_base_unpack_int16(pmix_pointer_array_t *regtypes,
pmix_buffer_t *buffer, void *dest,
int32_t *num_vals, pmix_data_type_t type); int32_t *num_vals, pmix_data_type_t type);
PMIX_EXPORT pmix_status_t pmix_bfrops_base_unpack_int32(pmix_buffer_t *buffer, void *dest, PMIX_EXPORT pmix_status_t pmix_bfrops_base_unpack_int32(pmix_pointer_array_t *regtypes,
pmix_buffer_t *buffer, void *dest,
int32_t *num_vals, pmix_data_type_t type); int32_t *num_vals, pmix_data_type_t type);
PMIX_EXPORT pmix_status_t pmix_bfrops_base_unpack_datatype(pmix_buffer_t *buffer, void *dest, PMIX_EXPORT pmix_status_t pmix_bfrops_base_unpack_datatype(pmix_pointer_array_t *regtypes,
pmix_buffer_t *buffer, void *dest,
int32_t *num_vals, pmix_data_type_t type); int32_t *num_vals, pmix_data_type_t type);
PMIX_EXPORT pmix_status_t pmix_bfrops_base_unpack_int64(pmix_buffer_t *buffer, void *dest, PMIX_EXPORT pmix_status_t pmix_bfrops_base_unpack_int64(pmix_pointer_array_t *regtypes,
pmix_buffer_t *buffer, void *dest,
int32_t *num_vals, pmix_data_type_t type); int32_t *num_vals, pmix_data_type_t type);
PMIX_EXPORT pmix_status_t pmix_bfrops_base_unpack_float(pmix_buffer_t *buffer, void *dest, PMIX_EXPORT pmix_status_t pmix_bfrops_base_unpack_float(pmix_pointer_array_t *regtypes,
pmix_buffer_t *buffer, void *dest,
int32_t *num_vals, pmix_data_type_t type); int32_t *num_vals, pmix_data_type_t type);
PMIX_EXPORT pmix_status_t pmix_bfrops_base_unpack_double(pmix_buffer_t *buffer, void *dest, PMIX_EXPORT pmix_status_t pmix_bfrops_base_unpack_double(pmix_pointer_array_t *regtypes,
pmix_buffer_t *buffer, void *dest,
int32_t *num_vals, pmix_data_type_t type); int32_t *num_vals, pmix_data_type_t type);
PMIX_EXPORT pmix_status_t pmix_bfrops_base_unpack_timeval(pmix_buffer_t *buffer, void *dest, PMIX_EXPORT pmix_status_t pmix_bfrops_base_unpack_timeval(pmix_pointer_array_t *regtypes,
pmix_buffer_t *buffer, void *dest,
int32_t *num_vals, pmix_data_type_t type); int32_t *num_vals, pmix_data_type_t type);
PMIX_EXPORT pmix_status_t pmix_bfrops_base_unpack_time(pmix_buffer_t *buffer, void *dest, PMIX_EXPORT pmix_status_t pmix_bfrops_base_unpack_time(pmix_pointer_array_t *regtypes,
pmix_buffer_t *buffer, void *dest,
int32_t *num_vals, pmix_data_type_t type); int32_t *num_vals, pmix_data_type_t type);
PMIX_EXPORT pmix_status_t pmix_bfrops_base_unpack_status(pmix_buffer_t *buffer, void *dest, PMIX_EXPORT pmix_status_t pmix_bfrops_base_unpack_status(pmix_pointer_array_t *regtypes,
pmix_buffer_t *buffer, void *dest,
int32_t *num_vals, pmix_data_type_t type); int32_t *num_vals, pmix_data_type_t type);
PMIX_EXPORT pmix_status_t pmix_bfrops_base_unpack_val(pmix_buffer_t *buffer, PMIX_EXPORT pmix_status_t pmix_bfrops_base_unpack_val(pmix_pointer_array_t *regtypes,
pmix_buffer_t *buffer,
pmix_value_t *val); pmix_value_t *val);
PMIX_EXPORT pmix_status_t pmix_bfrops_base_unpack_value(pmix_buffer_t *buffer, void *dest, PMIX_EXPORT pmix_status_t pmix_bfrops_base_unpack_value(pmix_pointer_array_t *regtypes,
pmix_buffer_t *buffer, void *dest,
int32_t *num_vals, pmix_data_type_t type); int32_t *num_vals, pmix_data_type_t type);
PMIX_EXPORT pmix_status_t pmix_bfrops_base_unpack_info(pmix_buffer_t *buffer, void *dest, PMIX_EXPORT pmix_status_t pmix_bfrops_base_unpack_info(pmix_pointer_array_t *regtypes,
pmix_buffer_t *buffer, void *dest,
int32_t *num_vals, pmix_data_type_t type); int32_t *num_vals, pmix_data_type_t type);
PMIX_EXPORT pmix_status_t pmix_bfrops_base_unpack_pdata(pmix_buffer_t *buffer, void *dest, PMIX_EXPORT pmix_status_t pmix_bfrops_base_unpack_pdata(pmix_pointer_array_t *regtypes,
pmix_buffer_t *buffer, void *dest,
int32_t *num_vals, pmix_data_type_t type); int32_t *num_vals, pmix_data_type_t type);
PMIX_EXPORT pmix_status_t pmix_bfrops_base_unpack_buf(pmix_buffer_t *buffer, void *dest, PMIX_EXPORT pmix_status_t pmix_bfrops_base_unpack_buf(pmix_pointer_array_t *regtypes,
pmix_buffer_t *buffer, void *dest,
int32_t *num_vals, pmix_data_type_t type); int32_t *num_vals, pmix_data_type_t type);
PMIX_EXPORT pmix_status_t pmix_bfrops_base_unpack_proc(pmix_buffer_t *buffer, void *dest, PMIX_EXPORT pmix_status_t pmix_bfrops_base_unpack_proc(pmix_pointer_array_t *regtypes,
pmix_buffer_t *buffer, void *dest,
int32_t *num_vals, pmix_data_type_t type); int32_t *num_vals, pmix_data_type_t type);
PMIX_EXPORT pmix_status_t pmix_bfrops_base_unpack_app(pmix_buffer_t *buffer, void *dest, PMIX_EXPORT pmix_status_t pmix_bfrops_base_unpack_app(pmix_pointer_array_t *regtypes,
pmix_buffer_t *buffer, void *dest,
int32_t *num_vals, pmix_data_type_t type); int32_t *num_vals, pmix_data_type_t type);
PMIX_EXPORT pmix_status_t pmix_bfrops_base_unpack_kval(pmix_buffer_t *buffer, void *dest, PMIX_EXPORT pmix_status_t pmix_bfrops_base_unpack_kval(pmix_pointer_array_t *regtypes,
pmix_buffer_t *buffer, void *dest,
int32_t *num_vals, pmix_data_type_t type); int32_t *num_vals, pmix_data_type_t type);
PMIX_EXPORT pmix_status_t pmix_bfrops_base_unpack_modex(pmix_buffer_t *buffer, void *dest, PMIX_EXPORT pmix_status_t pmix_bfrops_base_unpack_modex(pmix_pointer_array_t *regtypes,
pmix_buffer_t *buffer, void *dest,
int32_t *num_vals, pmix_data_type_t type); int32_t *num_vals, pmix_data_type_t type);
PMIX_EXPORT pmix_status_t pmix_bfrops_base_unpack_persist(pmix_buffer_t *buffer, void *dest, PMIX_EXPORT pmix_status_t pmix_bfrops_base_unpack_persist(pmix_pointer_array_t *regtypes,
pmix_buffer_t *buffer, void *dest,
int32_t *num_vals, pmix_data_type_t type); int32_t *num_vals, pmix_data_type_t type);
PMIX_EXPORT pmix_status_t pmix_bfrops_base_unpack_bo(pmix_buffer_t *buffer, void *dest, PMIX_EXPORT pmix_status_t pmix_bfrops_base_unpack_bo(pmix_pointer_array_t *regtypes,
pmix_buffer_t *buffer, void *dest,
int32_t *num_vals, pmix_data_type_t type); int32_t *num_vals, pmix_data_type_t type);
PMIX_EXPORT pmix_status_t pmix_bfrops_base_unpack_ptr(pmix_buffer_t *buffer, void *dest, PMIX_EXPORT pmix_status_t pmix_bfrops_base_unpack_ptr(pmix_pointer_array_t *regtypes,
pmix_buffer_t *buffer, void *dest,
int32_t *num_vals, pmix_data_type_t type); int32_t *num_vals, pmix_data_type_t type);
PMIX_EXPORT pmix_status_t pmix_bfrops_base_unpack_scope(pmix_buffer_t *buffer, void *dest, PMIX_EXPORT pmix_status_t pmix_bfrops_base_unpack_scope(pmix_pointer_array_t *regtypes,
pmix_buffer_t *buffer, void *dest,
int32_t *num_vals, pmix_data_type_t type); int32_t *num_vals, pmix_data_type_t type);
PMIX_EXPORT pmix_status_t pmix_bfrops_base_unpack_range(pmix_buffer_t *buffer, void *dest, PMIX_EXPORT pmix_status_t pmix_bfrops_base_unpack_range(pmix_pointer_array_t *regtypes,
pmix_buffer_t *buffer, void *dest,
int32_t *num_vals, pmix_data_type_t type); int32_t *num_vals, pmix_data_type_t type);
PMIX_EXPORT pmix_status_t pmix_bfrops_base_unpack_cmd(pmix_buffer_t *buffer, void *dest, PMIX_EXPORT pmix_status_t pmix_bfrops_base_unpack_cmd(pmix_pointer_array_t *regtypes,
pmix_buffer_t *buffer, void *dest,
int32_t *num_vals, pmix_data_type_t type); int32_t *num_vals, pmix_data_type_t type);
PMIX_EXPORT pmix_status_t pmix_bfrops_base_unpack_info_directives(pmix_buffer_t *buffer, void *dest, PMIX_EXPORT pmix_status_t pmix_bfrops_base_unpack_info_directives(pmix_pointer_array_t *regtypes,
pmix_buffer_t *buffer, void *dest,
int32_t *num_vals, pmix_data_type_t type); int32_t *num_vals, pmix_data_type_t type);
PMIX_EXPORT pmix_status_t pmix_bfrops_base_unpack_datatype(pmix_buffer_t *buffer, void *dest, PMIX_EXPORT pmix_status_t pmix_bfrops_base_unpack_datatype(pmix_pointer_array_t *regtypes,
pmix_buffer_t *buffer, void *dest,
int32_t *num_vals, pmix_data_type_t type); int32_t *num_vals, pmix_data_type_t type);
PMIX_EXPORT pmix_status_t pmix_bfrops_base_unpack_pstate(pmix_buffer_t *buffer, void *dest, PMIX_EXPORT pmix_status_t pmix_bfrops_base_unpack_pstate(pmix_pointer_array_t *regtypes,
pmix_buffer_t *buffer, void *dest,
int32_t *num_vals, pmix_data_type_t type); int32_t *num_vals, pmix_data_type_t type);
PMIX_EXPORT pmix_status_t pmix_bfrops_base_unpack_pinfo(pmix_buffer_t *buffer, void *dest, PMIX_EXPORT pmix_status_t pmix_bfrops_base_unpack_pinfo(pmix_pointer_array_t *regtypes,
pmix_buffer_t *buffer, void *dest,
int32_t *num_vals, pmix_data_type_t type); int32_t *num_vals, pmix_data_type_t type);
PMIX_EXPORT pmix_status_t pmix_bfrops_base_unpack_darray(pmix_buffer_t *buffer, void *dest, PMIX_EXPORT pmix_status_t pmix_bfrops_base_unpack_darray(pmix_pointer_array_t *regtypes,
pmix_buffer_t *buffer, void *dest,
int32_t *num_vals, pmix_data_type_t type); int32_t *num_vals, pmix_data_type_t type);
PMIX_EXPORT pmix_status_t pmix_bfrops_base_unpack_rank(pmix_buffer_t *buffer, void *dest, PMIX_EXPORT pmix_status_t pmix_bfrops_base_unpack_rank(pmix_pointer_array_t *regtypes,
pmix_buffer_t *buffer, void *dest,
int32_t *num_vals, pmix_data_type_t type); int32_t *num_vals, pmix_data_type_t type);
PMIX_EXPORT pmix_status_t pmix_bfrops_base_unpack_query(pmix_buffer_t *buffer, void *dest, PMIX_EXPORT pmix_status_t pmix_bfrops_base_unpack_query(pmix_pointer_array_t *regtypes,
pmix_buffer_t *buffer, void *dest,
int32_t *num_vals, pmix_data_type_t type); int32_t *num_vals, pmix_data_type_t type);
PMIX_EXPORT pmix_status_t pmix_bfrops_base_unpack_alloc_directive(pmix_buffer_t *buffer, void *dest, PMIX_EXPORT pmix_status_t pmix_bfrops_base_unpack_alloc_directive(pmix_pointer_array_t *regtypes,
pmix_buffer_t *buffer, void *dest,
int32_t *num_vals, pmix_data_type_t type); int32_t *num_vals, pmix_data_type_t type);
PMIX_EXPORT pmix_status_t pmix_bfrops_base_unpack_iof_channel(pmix_buffer_t *buffer, void *dest, PMIX_EXPORT pmix_status_t pmix_bfrops_base_unpack_iof_channel(pmix_pointer_array_t *regtypes,
pmix_buffer_t *buffer, void *dest,
int32_t *num_vals, pmix_data_type_t type); int32_t *num_vals, pmix_data_type_t type);
PMIX_EXPORT pmix_status_t pmix_bfrops_base_unpack_envar(pmix_buffer_t *buffer, void *dest, PMIX_EXPORT pmix_status_t pmix_bfrops_base_unpack_envar(pmix_pointer_array_t *regtypes,
pmix_buffer_t *buffer, void *dest,
int32_t *num_vals, pmix_data_type_t type); int32_t *num_vals, pmix_data_type_t type);
PMIX_EXPORT pmix_status_t pmix_bfrops_base_unpack_coord(pmix_pointer_array_t *regtypes,
pmix_buffer_t *buffer, void *dest,
int32_t *num_vals, pmix_data_type_t type);
PMIX_EXPORT pmix_status_t pmix_bfrops_base_unpack_regattr(pmix_pointer_array_t *regtypes,
pmix_buffer_t *buffer, void *dest,
int32_t *num_vals, pmix_data_type_t type);
/**** DEPRECATED ****/ /**** DEPRECATED ****/
PMIX_EXPORT pmix_status_t pmix_bfrops_base_unpack_array(pmix_buffer_t *buffer, void *dest, PMIX_EXPORT pmix_status_t pmix_bfrops_base_unpack_array(pmix_pointer_array_t *regtypes,
pmix_buffer_t *buffer, void *dest,
int32_t *num_vals, pmix_data_type_t type); int32_t *num_vals, pmix_data_type_t type);
/* /*
@ -538,6 +669,12 @@ PMIX_EXPORT pmix_status_t pmix_bfrops_base_copy_query(pmix_query_t **dest,
PMIX_EXPORT pmix_status_t pmix_bfrops_base_copy_envar(pmix_envar_t **dest, PMIX_EXPORT pmix_status_t pmix_bfrops_base_copy_envar(pmix_envar_t **dest,
pmix_envar_t *src, pmix_envar_t *src,
pmix_data_type_t type); pmix_data_type_t type);
PMIX_EXPORT pmix_status_t pmix_bfrops_base_copy_coord(pmix_coord_t **dest,
pmix_coord_t *src,
pmix_data_type_t type);
PMIX_EXPORT pmix_status_t pmix_bfrops_base_copy_regattr(pmix_regattr_t **dest,
pmix_regattr_t *src,
pmix_data_type_t type);
/* /*
* "Standard" print functions * "Standard" print functions
@ -646,6 +783,12 @@ PMIX_EXPORT pmix_status_t pmix_bfrops_base_print_iof_channel(char **output, char
PMIX_EXPORT pmix_status_t pmix_bfrops_base_print_envar(char **output, char *prefix, PMIX_EXPORT pmix_status_t pmix_bfrops_base_print_envar(char **output, char *prefix,
pmix_envar_t *src, pmix_envar_t *src,
pmix_data_type_t type); pmix_data_type_t type);
PMIX_EXPORT pmix_status_t pmix_bfrops_base_print_coord(char **output, char *prefix,
pmix_coord_t *src,
pmix_data_type_t type);
PMIX_EXPORT pmix_status_t pmix_bfrops_base_print_regattr(char **output, char *prefix,
pmix_regattr_t *src,
pmix_data_type_t type);
/* /*
* Common helper functions * Common helper functions
@ -655,9 +798,11 @@ PMIX_EXPORT char* pmix_bfrop_buffer_extend(pmix_buffer_t *bptr, size_t bytes_to_
PMIX_EXPORT bool pmix_bfrop_too_small(pmix_buffer_t *buffer, size_t bytes_reqd); PMIX_EXPORT bool pmix_bfrop_too_small(pmix_buffer_t *buffer, size_t bytes_reqd);
PMIX_EXPORT pmix_status_t pmix_bfrop_store_data_type(pmix_buffer_t *buffer, pmix_data_type_t type); PMIX_EXPORT pmix_status_t pmix_bfrop_store_data_type(pmix_pointer_array_t *regtypes,
pmix_buffer_t *buffer, pmix_data_type_t type);
PMIX_EXPORT pmix_status_t pmix_bfrop_get_data_type(pmix_buffer_t *buffer, pmix_data_type_t *type); PMIX_EXPORT pmix_status_t pmix_bfrop_get_data_type(pmix_pointer_array_t *regtypes,
pmix_buffer_t *buffer, pmix_data_type_t *type);
PMIX_EXPORT pmix_status_t pmix_bfrops_base_copy_payload(pmix_buffer_t *dest, PMIX_EXPORT pmix_status_t pmix_bfrops_base_copy_payload(pmix_buffer_t *dest,
pmix_buffer_t *src); pmix_buffer_t *src);

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

@ -9,7 +9,7 @@
* 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) 2014-2018 Intel, Inc. All rights reserved. * Copyright (c) 2014-2019 Intel, Inc. All rights reserved.
* Copyright (c) 2015 Research Organization for Information Science * Copyright (c) 2015 Research Organization for Information Science
* and Technology (RIST). All rights reserved. * and Technology (RIST). All rights reserved.
* $COPYRIGHT$ * $COPYRIGHT$
@ -387,6 +387,7 @@ pmix_status_t pmix_bfrops_base_copy_darray(pmix_data_array_t **dest,
pmix_proc_info_t *pi, *si; pmix_proc_info_t *pi, *si;
pmix_query_t *pq, *sq; pmix_query_t *pq, *sq;
pmix_envar_t *pe, *se; pmix_envar_t *pe, *se;
pmix_regattr_t *pr, *sr;
p = (pmix_data_array_t*)calloc(1, sizeof(pmix_data_array_t)); p = (pmix_data_array_t*)calloc(1, sizeof(pmix_data_array_t));
if (NULL == p) { if (NULL == p) {
@ -800,6 +801,35 @@ pmix_status_t pmix_bfrops_base_copy_darray(pmix_data_array_t **dest,
pe[n].separator = se[n].separator; pe[n].separator = se[n].separator;
} }
break; break;
case PMIX_COORD:
p->array = malloc(src->size * sizeof(pmix_coord_t));
if (NULL == p->array) {
free(p);
return PMIX_ERR_NOMEM;
}
memcpy(p->array, src->array, src->size * sizeof(pmix_coord_t));
break;
case PMIX_REGATTR:
PMIX_REGATTR_CREATE(p->array, src->size);
if (NULL == p->array) {
free(p);
return PMIX_ERR_NOMEM;
}
pr = (pmix_regattr_t*)p->array;
sr = (pmix_regattr_t*)src->array;
for (n=0; n < src->size; n++) {
if (NULL != sr[n].name) {
pr[n].name = strdup(sr[n].name);
}
PMIX_LOAD_KEY(pr[n].string, sr[n].string);
pr[n].type = sr[n].type;
if (NULL != sr[n].info) {
PMIX_INFO_XFER(pr[n].info, sr[n].info);
}
pr[n].ninfo = sr[n].ninfo;
pr[n].description = pmix_argv_copy(sr[n].description);
}
break;
default: default:
free(p); free(p);
return PMIX_ERR_UNKNOWN_DATA_TYPE; return PMIX_ERR_UNKNOWN_DATA_TYPE;
@ -846,3 +876,33 @@ pmix_status_t pmix_bfrops_base_copy_envar(pmix_envar_t **dest,
(*dest)->separator = src->separator; (*dest)->separator = src->separator;
return PMIX_SUCCESS; return PMIX_SUCCESS;
} }
pmix_status_t pmix_bfrops_base_copy_coord(pmix_coord_t **dest,
pmix_coord_t *src,
pmix_data_type_t type)
{
*dest = (pmix_coord_t*)malloc(sizeof(pmix_coord_t));
memcpy(*dest, src, sizeof(pmix_coord_t));
return PMIX_SUCCESS;
}
pmix_status_t pmix_bfrops_base_copy_regattr(pmix_regattr_t **dest,
pmix_regattr_t *src,
pmix_data_type_t type)
{
PMIX_REGATTR_CREATE(*dest, 1);
if (NULL == (*dest)) {
return PMIX_ERR_NOMEM;
}
if (NULL != src->name) {
(*dest)->name = strdup(src->name);
}
PMIX_LOAD_KEY((*dest)->string, src->string);
(*dest)->type = src->type;
if (NULL != src->info) {
PMIX_INFO_XFER((*dest)->info, src->info);
}
(*dest)->ninfo = src->ninfo;
(*dest)->description = pmix_argv_copy(src->description);
return PMIX_SUCCESS;
}

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

@ -9,7 +9,9 @@
* 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) 2015-2018 Intel, Inc. All rights reserved. * Copyright (c) 2015-2019 Intel, Inc. All rights reserved.
* Copyright (c) 2019 Mellanox Technologies, Inc.
* All rights reserved.
* $COPYRIGHT$ * $COPYRIGHT$
* *
* Additional copyrights may follow * Additional copyrights may follow
@ -59,6 +61,8 @@ void pmix_bfrops_base_value_load(pmix_value_t *v, const void *data,
pmix_envar_t *envar; pmix_envar_t *envar;
pmix_data_array_t *darray; pmix_data_array_t *darray;
pmix_status_t rc; pmix_status_t rc;
pmix_coord_t *coord;
pmix_regattr_t *regattr;
v->type = type; v->type = type;
if (NULL == data) { if (NULL == data) {
@ -201,6 +205,20 @@ void pmix_bfrops_base_value_load(pmix_value_t *v, const void *data,
PMIX_ERROR_LOG(rc); PMIX_ERROR_LOG(rc);
} }
break; break;
case PMIX_COORD:
coord = (pmix_coord_t*)data;
rc = pmix_bfrops_base_copy_coord(&v->data.coord, coord, PMIX_COORD);
if (PMIX_SUCCESS != rc) {
PMIX_ERROR_LOG(rc);
}
break;
case PMIX_REGATTR:
regattr = (pmix_regattr_t*)data;
rc = pmix_bfrops_base_copy_regattr((pmix_regattr_t**)&v->data.ptr, regattr, PMIX_REGATTR);
if (PMIX_SUCCESS != rc) {
PMIX_ERROR_LOG(rc);
}
break;
default: default:
/* silence warnings */ /* silence warnings */
@ -217,6 +235,8 @@ pmix_status_t pmix_bfrops_base_value_unload(pmix_value_t *kv,
pmix_status_t rc; pmix_status_t rc;
pmix_envar_t *envar; pmix_envar_t *envar;
pmix_data_array_t **darray; pmix_data_array_t **darray;
pmix_coord_t *coord;
pmix_regattr_t *regattr, *r;
rc = PMIX_SUCCESS; rc = PMIX_SUCCESS;
if (NULL == data || if (NULL == data ||
@ -354,6 +374,32 @@ pmix_status_t pmix_bfrops_base_value_unload(pmix_value_t *kv,
*data = envar; *data = envar;
*sz = sizeof(pmix_envar_t); *sz = sizeof(pmix_envar_t);
break; break;
case PMIX_COORD:
coord = (pmix_coord_t*)malloc(sizeof(pmix_coord_t));
if (NULL == coord) {
return PMIX_ERR_NOMEM;
}
memcpy(coord, kv->data.coord, sizeof(pmix_coord_t));
*data = coord;
break;
case PMIX_REGATTR:
PMIX_REGATTR_CREATE(regattr, 1);
if (NULL == regattr) {
return PMIX_ERR_NOMEM;
}
r = (pmix_regattr_t*)kv->data.ptr;
if (NULL != r->name) {
regattr->name = strdup(r->name);
}
PMIX_LOAD_KEY(regattr->string, r->string);
regattr->type = r->type;
if (NULL != r->info) {
PMIX_INFO_XFER(regattr->info, r->info);
}
regattr->ninfo = r->ninfo;
regattr->description = pmix_argv_copy(r->description);
*data = regattr;
break;
default: default:
/* silence warnings */ /* silence warnings */
rc = PMIX_ERROR; rc = PMIX_ERROR;
@ -501,6 +547,27 @@ pmix_value_cmp_t pmix_bfrops_base_value_cmp(pmix_value_t *p,
} }
rc = PMIX_EQUAL; rc = PMIX_EQUAL;
break; break;
case PMIX_COORD:
rc = memcmp(p->data.coord, p1->data.coord, sizeof(pmix_coord_t));
if (0 > rc) {
rc = PMIX_VALUE2_GREATER;
} else if (0 < rc) {
rc = PMIX_VALUE1_GREATER;
} else {
rc = PMIX_EQUAL;
}
break;
case PMIX_REGATTR:
rc = memcmp(p->data.ptr, p1->data.ptr, sizeof(pmix_regattr_t));
if (0 > rc) {
rc = PMIX_VALUE2_GREATER;
} else if (0 < rc) {
rc = PMIX_VALUE1_GREATER;
} else {
rc = PMIX_EQUAL;
}
break;
default: default:
pmix_output(0, "COMPARE-PMIX-VALUE: UNSUPPORTED TYPE %d", (int)p->type); pmix_output(0, "COMPARE-PMIX-VALUE: UNSUPPORTED TYPE %d", (int)p->type);
} }
@ -639,7 +706,12 @@ pmix_status_t pmix_bfrops_base_value_xfer(pmix_value_t *p,
} }
p->data.envar.separator = src->data.envar.separator; p->data.envar.separator = src->data.envar.separator;
break; break;
case PMIX_COORD:
pmix_bfrops_base_copy_coord(&p->data.coord, src->data.coord, PMIX_COORD);
break;
case PMIX_REGATTR:
pmix_bfrops_base_copy_regattr((pmix_regattr_t**)&p->data.ptr, src->data.ptr, PMIX_REGATTR);
break;
default: default:
pmix_output(0, "PMIX-XFER-VALUE: UNSUPPORTED TYPE %d", (int)src->type); pmix_output(0, "PMIX-XFER-VALUE: UNSUPPORTED TYPE %d", (int)src->type);
return PMIX_ERROR; return PMIX_ERROR;
@ -727,39 +799,23 @@ bool pmix_bfrop_too_small(pmix_buffer_t *buffer, size_t bytes_reqd)
return false; return false;
} }
pmix_status_t pmix_bfrop_store_data_type(pmix_buffer_t *buffer, pmix_data_type_t type) pmix_status_t pmix_bfrop_store_data_type(pmix_pointer_array_t *regtypes,
pmix_buffer_t *buffer, pmix_data_type_t type)
{ {
uint16_t tmp; pmix_status_t ret;
char *dst;
/* check to see if buffer needs extending */ PMIX_BFROPS_PACK_TYPE(ret, buffer, &type, 1, PMIX_UINT16, regtypes);
if (NULL == (dst = pmix_bfrop_buffer_extend(buffer, sizeof(tmp)))) { return ret;
return PMIX_ERR_OUT_OF_RESOURCE;
}
tmp = pmix_htons(type);
memcpy(dst, &tmp, sizeof(tmp));
buffer->pack_ptr += sizeof(tmp);
buffer->bytes_used += sizeof(tmp);
return PMIX_SUCCESS;
} }
pmix_status_t pmix_bfrop_get_data_type(pmix_buffer_t *buffer, pmix_data_type_t *type) pmix_status_t pmix_bfrop_get_data_type(pmix_pointer_array_t *regtypes,
pmix_buffer_t *buffer, pmix_data_type_t *type)
{ {
uint16_t tmp; pmix_status_t ret;
int32_t m = 1;
/* check to see if there's enough data in buffer */ PMIX_BFROPS_UNPACK_TYPE(ret, buffer, type, &m, PMIX_UINT16, regtypes);
if (pmix_bfrop_too_small(buffer, sizeof(tmp))) { return ret;
return PMIX_ERR_UNPACK_READ_PAST_END_OF_BUFFER;
}
/* unpack the data */
memcpy(&tmp, buffer->unpack_ptr, sizeof(tmp));
tmp = pmix_ntohs(tmp);
memcpy(type, &tmp, sizeof(tmp));
buffer->unpack_ptr += sizeof(tmp);
return PMIX_SUCCESS;
} }
const char* pmix_bfrops_base_data_type_string(pmix_pointer_array_t *regtypes, const char* pmix_bfrops_base_data_type_string(pmix_pointer_array_t *regtypes,

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

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

@ -10,7 +10,7 @@
* 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) 2012 Los Alamos National Security, Inc. All rights reserved. * Copyright (c) 2012 Los Alamos National Security, Inc. All rights reserved.
* Copyright (c) 2014-2018 Intel, Inc. All rights reserved. * Copyright (c) 2014-2019 Intel, Inc. All rights reserved.
* Copyright (c) 2016 Mellanox Technologies, Inc. * Copyright (c) 2016 Mellanox Technologies, Inc.
* All rights reserved. * All rights reserved.
* *
@ -875,6 +875,7 @@ int pmix_bfrops_base_print_status(char **output, char *prefix,
{ {
char *prefx; char *prefx;
int rc; int rc;
pmix_regattr_t *r;
/* deal with NULL prefix */ /* deal with NULL prefix */
if (NULL == prefix) { if (NULL == prefix) {
@ -1021,6 +1022,18 @@ int pmix_bfrops_base_print_status(char **output, char *prefix,
src->data.envar.separator); src->data.envar.separator);
break; break;
case PMIX_COORD:
rc = asprintf(output, "%sPMIX_VALUE: Data type: PMIX_COORD\tx-axis: %d\ty-axis: %d\tz-axis: %d",
prefx, src->data.coord->x, src->data.coord->y, src->data.coord->z);
break;
case PMIX_REGATTR:
r = (pmix_regattr_t*)src->data.ptr;
rc = asprintf(output, "%sPMIX_VALUE: Data type: PMIX_REGATTR\tName: %s\tString: %s",
prefx, (NULL == r->name) ? "NULL" : r->name,
(NULL == r->string) ? "NULL" : r->string);
break;
default: default:
rc = asprintf(output, "%sPMIX_VALUE: Data type: UNKNOWN\tValue: UNPRINTABLE", prefx); rc = asprintf(output, "%sPMIX_VALUE: Data type: UNKNOWN\tValue: UNPRINTABLE", prefx);
break; break;
@ -1690,3 +1703,63 @@ pmix_status_t pmix_bfrops_base_print_envar(char **output, char *prefix,
return PMIX_SUCCESS; return PMIX_SUCCESS;
} }
} }
pmix_status_t pmix_bfrops_base_print_coord(char **output, char *prefix,
pmix_coord_t *src,
pmix_data_type_t type)
{
char *prefx;
int ret;
/* deal with NULL prefix */
if (NULL == prefix) {
if (0 > asprintf(&prefx, " ")) {
return PMIX_ERR_NOMEM;
}
} else {
prefx = prefix;
}
ret = asprintf(output, "%sData type: PMIX_COORD\tx-axis: %d\ty-axis: %d\tz-axis: %d",
prefx, src->x, src->y, src->z);
if (prefx != prefix) {
free(prefx);
}
if (0 > ret) {
return PMIX_ERR_OUT_OF_RESOURCE;
} else {
return PMIX_SUCCESS;
}
}
pmix_status_t pmix_bfrops_base_print_regattr(char **output, char *prefix,
pmix_regattr_t *src,
pmix_data_type_t type)
{
char *prefx;
int ret;
/* deal with NULL prefix */
if (NULL == prefix) {
if (0 > asprintf(&prefx, " ")) {
return PMIX_ERR_NOMEM;
}
} else {
prefx = prefix;
}
ret = asprintf(output, "%sData type: PMIX_REGATTR\tName: %s\tString: %s",
prefx, (NULL == src->name) ? "NULL" : src->name,
(NULL == src->string) ? "NULL" : src->string);
if (prefx != prefix) {
free(prefx);
}
if (0 > ret) {
return PMIX_ERR_OUT_OF_RESOURCE;
} else {
return PMIX_SUCCESS;
}
}

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

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

@ -14,6 +14,8 @@
* Copyright (c) 201-2013 Los Alamos National Security, LLC. All rights * Copyright (c) 201-2013 Los Alamos National Security, LLC. All rights
* reserved. * reserved.
* Copyright (c) 2013-2017 Intel, Inc. All rights reserved. * Copyright (c) 2013-2017 Intel, Inc. All rights reserved.
* Copyright (c) 2019 Mellanox Technologies, Inc.
* All rights reserved.
* $COPYRIGHT$ * $COPYRIGHT$
* *
* Additional copyrights may follow * Additional copyrights may follow
@ -444,13 +446,15 @@ int pmix12_v2_to_v1_datatype(pmix_data_type_t v2type)
return v1type; return v1type;
} }
pmix_status_t pmix12_bfrop_store_data_type(pmix_buffer_t *buffer, pmix_data_type_t type) pmix_status_t pmix12_bfrop_store_data_type(pmix_pointer_array_t *regtypes,
pmix_buffer_t *buffer,
pmix_data_type_t type)
{ {
int v1type; int v1type;
v1type = pmix12_v2_to_v1_datatype(type); v1type = pmix12_v2_to_v1_datatype(type);
return pmix12_bfrop_pack_datatype(buffer, &v1type, 1, PMIX_INT); return pmix12_bfrop_pack_datatype(regtypes, buffer, &v1type, 1, PMIX_INT);
} }
pmix_data_type_t pmix12_v1_to_v2_datatype(int v1type) pmix_data_type_t pmix12_v1_to_v2_datatype(int v1type)
@ -491,13 +495,14 @@ pmix_data_type_t pmix12_v1_to_v2_datatype(int v1type)
return v2type; return v2type;
} }
pmix_status_t pmix12_bfrop_get_data_type(pmix_buffer_t *buffer, pmix_data_type_t *type) pmix_status_t pmix12_bfrop_get_data_type(pmix_pointer_array_t *regtypes,
pmix_buffer_t *buffer, pmix_data_type_t *type)
{ {
int32_t n=1; int32_t n=1;
int v1type; int v1type;
pmix_status_t rc; pmix_status_t rc;
rc = pmix12_bfrop_unpack_datatype(buffer, &v1type, &n, PMIX_INT); rc = pmix12_bfrop_unpack_datatype(regtypes, buffer, &v1type, &n, PMIX_INT);
if (UINT16_MAX < v1type) { if (UINT16_MAX < v1type) {
*type = 0; *type = 0;
return PMIX_ERR_UNKNOWN_DATA_TYPE; return PMIX_ERR_UNKNOWN_DATA_TYPE;

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

@ -15,6 +15,8 @@
* Copyright (c) 2015 Research Organization for Information Science * Copyright (c) 2015 Research Organization for Information Science
* and Technology (RIST). All rights reserved. * and Technology (RIST). All rights reserved.
* Copyright (c) 2016 IBM Corporation. All rights reserved. * Copyright (c) 2016 IBM Corporation. All rights reserved.
* Copyright (c) 2019 Mellanox Technologies, Inc.
* All rights reserved.
* $COPYRIGHT$ * $COPYRIGHT$
* *
* Additional copyrights may follow * Additional copyrights may follow
@ -122,175 +124,249 @@ pmix_value_cmp_t pmix12_bfrop_value_cmp(pmix_value_t *p,
/* /*
* Specialized functions * Specialized functions
*/ */
pmix_status_t pmix12_bfrop_pack_buffer(pmix_buffer_t *buffer, const void *src, pmix_status_t pmix12_bfrop_pack_buffer(pmix_pointer_array_t *regtypes,
int32_t num_vals, pmix_data_type_t type); pmix_buffer_t *buffer, const void *src,
int32_t num_vals, pmix_data_type_t type);
pmix_status_t pmix12_bfrop_unpack_buffer(pmix_buffer_t *buffer, void *dst, pmix_status_t pmix12_bfrop_unpack_buffer(pmix_pointer_array_t *regtypes,
int32_t *num_vals, pmix_data_type_t type); pmix_buffer_t *buffer, void *dst,
int32_t *num_vals, pmix_data_type_t type);
/* /*
* Internal pack functions * Internal pack functions
*/ */
pmix_status_t pmix12_bfrop_pack_bool(pmix_buffer_t *buffer, const void *src, pmix_status_t pmix12_bfrop_pack_bool(pmix_pointer_array_t *regtypes,
int32_t num_vals, pmix_data_type_t type); pmix_buffer_t *buffer, const void *src,
pmix_status_t pmix12_bfrop_pack_byte(pmix_buffer_t *buffer, const void *src,
int32_t num_vals, pmix_data_type_t type);
pmix_status_t pmix12_bfrop_pack_string(pmix_buffer_t *buffer, const void *src,
int32_t num_vals, pmix_data_type_t type);
pmix_status_t pmix12_bfrop_pack_sizet(pmix_buffer_t *buffer, const void *src,
int32_t num_vals, pmix_data_type_t type); int32_t num_vals, pmix_data_type_t type);
pmix_status_t pmix12_bfrop_pack_pid(pmix_buffer_t *buffer, const void *src, pmix_status_t pmix12_bfrop_pack_byte(pmix_pointer_array_t *regtypes,
int32_t num_vals, pmix_data_type_t type); pmix_buffer_t *buffer, const void *src,
pmix_status_t pmix12_bfrop_pack_int(pmix_buffer_t *buffer, const void *src,
int32_t num_vals, pmix_data_type_t type);
pmix_status_t pmix12_bfrop_pack_int16(pmix_buffer_t *buffer, const void *src,
int32_t num_vals, pmix_data_type_t type); int32_t num_vals, pmix_data_type_t type);
pmix_status_t pmix12_bfrop_pack_int32(pmix_buffer_t *buffer, const void *src, pmix_status_t pmix12_bfrop_pack_string(pmix_pointer_array_t *regtypes,
int32_t num_vals, pmix_data_type_t type); pmix_buffer_t *buffer, const void *src,
pmix_status_t pmix12_bfrop_pack_datatype(pmix_buffer_t *buffer, const void *src,
int32_t num_vals, pmix_data_type_t type);
pmix_status_t pmix12_bfrop_pack_int64(pmix_buffer_t *buffer, const void *src,
int32_t num_vals, pmix_data_type_t type);
pmix_status_t pmix12_bfrop_pack_float(pmix_buffer_t *buffer, const void *src,
int32_t num_vals, pmix_data_type_t type);
pmix_status_t pmix12_bfrop_pack_double(pmix_buffer_t *buffer, const void *src,
int32_t num_vals, pmix_data_type_t type);
pmix_status_t pmix12_bfrop_pack_timeval(pmix_buffer_t *buffer, const void *src,
int32_t num_vals, pmix_data_type_t type); int32_t num_vals, pmix_data_type_t type);
pmix_status_t pmix12_bfrop_pack_time(pmix_buffer_t *buffer, const void *src, pmix_status_t pmix12_bfrop_pack_sizet(pmix_pointer_array_t *regtypes,
pmix_buffer_t *buffer, const void *src,
int32_t num_vals, pmix_data_type_t type);
pmix_status_t pmix12_bfrop_pack_pid(pmix_pointer_array_t *regtypes,
pmix_buffer_t *buffer, const void *src,
int32_t num_vals, pmix_data_type_t type); int32_t num_vals, pmix_data_type_t type);
pmix_status_t pmix12_bfrop_pack_value(pmix_buffer_t *buffer, const void *src, pmix_status_t pmix12_bfrop_pack_int(pmix_pointer_array_t *regtypes,
int32_t num_vals, pmix_data_type_t type); pmix_buffer_t *buffer, const void *src,
pmix_status_t pmix12_bfrop_pack_array(pmix_buffer_t *buffer, const void *src,
int32_t num_vals, pmix_data_type_t type);
pmix_status_t pmix12_bfrop_pack_proc(pmix_buffer_t *buffer, const void *src,
int32_t num_vals, pmix_data_type_t type); int32_t num_vals, pmix_data_type_t type);
pmix_status_t pmix12_bfrop_pack_app(pmix_buffer_t *buffer, const void *src, pmix_status_t pmix12_bfrop_pack_int16(pmix_pointer_array_t *regtypes,
int32_t num_vals, pmix_data_type_t type); pmix_buffer_t *buffer, const void *src,
pmix_status_t pmix12_bfrop_pack_info(pmix_buffer_t *buffer, const void *src,
int32_t num_vals, pmix_data_type_t type);
pmix_status_t pmix12_bfrop_pack_buf(pmix_buffer_t *buffer, const void *src,
int32_t num_vals, pmix_data_type_t type);
pmix_status_t pmix12_bfrop_pack_kval(pmix_buffer_t *buffer, const void *src,
int32_t num_vals, pmix_data_type_t type);
pmix_status_t pmix12_bfrop_pack_modex(pmix_buffer_t *buffer, const void *src,
int32_t num_vals, pmix_data_type_t type);
pmix_status_t pmix12_bfrop_pack_persist(pmix_buffer_t *buffer, const void *src,
int32_t num_vals, pmix_data_type_t type);
pmix_status_t pmix12_bfrop_pack_bo(pmix_buffer_t *buffer, const void *src,
int32_t num_vals, pmix_data_type_t type);
pmix_status_t pmix12_bfrop_pack_pdata(pmix_buffer_t *buffer, const void *src,
int32_t num_vals, pmix_data_type_t type);
/* compatibility functions - no corresponding PMIx v1.x definitions */
pmix_status_t pmix12_bfrop_pack_ptr(pmix_buffer_t *buffer, const void *src,
int32_t num_vals, pmix_data_type_t type);
pmix_status_t pmix12_bfrop_pack_scope(pmix_buffer_t *buffer, const void *src,
int32_t num_vals, pmix_data_type_t type);
pmix_status_t pmix12_bfrop_pack_status(pmix_buffer_t *buffer, const void *src,
int32_t num_vals, pmix_data_type_t type); int32_t num_vals, pmix_data_type_t type);
pmix_status_t pmix12_bfrop_pack_range(pmix_buffer_t *buffer, const void *src, pmix_status_t pmix12_bfrop_pack_int32(pmix_pointer_array_t *regtypes,
int32_t num_vals, pmix_data_type_t type); pmix_buffer_t *buffer, const void *src,
pmix_status_t pmix12_bfrop_pack_cmd(pmix_buffer_t *buffer, const void *src,
int32_t num_vals, pmix_data_type_t type);
pmix_status_t pmix12_bfrop_pack_info_directives(pmix_buffer_t *buffer, const void *src,
int32_t num_vals, pmix_data_type_t type);
pmix_status_t pmix12_bfrop_pack_proc_state(pmix_buffer_t *buffer, const void *src,
int32_t num_vals, pmix_data_type_t type);
pmix_status_t pmix12_bfrop_pack_darray(pmix_buffer_t *buffer, const void *src,
int32_t num_vals, pmix_data_type_t type); int32_t num_vals, pmix_data_type_t type);
pmix_status_t pmix12_bfrop_pack_proc_info(pmix_buffer_t *buffer, const void *src, pmix_status_t pmix12_bfrop_pack_datatype(pmix_pointer_array_t *regtypes,
pmix_buffer_t *buffer, const void *src,
int32_t num_vals, pmix_data_type_t type); int32_t num_vals, pmix_data_type_t type);
pmix_status_t pmix12_bfrop_pack_query(pmix_buffer_t *buffer, const void *src, pmix_status_t pmix12_bfrop_pack_int64(pmix_pointer_array_t *regtypes,
pmix_buffer_t *buffer, const void *src,
int32_t num_vals, pmix_data_type_t type);
pmix_status_t pmix12_bfrop_pack_float(pmix_pointer_array_t *regtypes,
pmix_buffer_t *buffer, const void *src,
int32_t num_vals, pmix_data_type_t type);
pmix_status_t pmix12_bfrop_pack_double(pmix_pointer_array_t *regtypes,
pmix_buffer_t *buffer, const void *src,
int32_t num_vals, pmix_data_type_t type);
pmix_status_t pmix12_bfrop_pack_timeval(pmix_pointer_array_t *regtypes,
pmix_buffer_t *buffer, const void *src,
int32_t num_vals, pmix_data_type_t type);
pmix_status_t pmix12_bfrop_pack_time(pmix_pointer_array_t *regtypes,
pmix_buffer_t *buffer, const void *src,
int32_t num_vals, pmix_data_type_t type); int32_t num_vals, pmix_data_type_t type);
pmix_status_t pmix12_bfrop_pack_rank(pmix_buffer_t *buffer, const void *src,
pmix_status_t pmix12_bfrop_pack_value(pmix_pointer_array_t *regtypes,
pmix_buffer_t *buffer, const void *src,
int32_t num_vals, pmix_data_type_t type);
pmix_status_t pmix12_bfrop_pack_array(pmix_pointer_array_t *regtypes,
pmix_buffer_t *buffer, const void *src,
int32_t num_vals, pmix_data_type_t type);
pmix_status_t pmix12_bfrop_pack_proc(pmix_pointer_array_t *regtypes,
pmix_buffer_t *buffer, const void *src,
int32_t num_vals, pmix_data_type_t type);
pmix_status_t pmix12_bfrop_pack_app(pmix_pointer_array_t *regtypes,
pmix_buffer_t *buffer, const void *src,
int32_t num_vals, pmix_data_type_t type); int32_t num_vals, pmix_data_type_t type);
pmix_status_t pmix12_bfrop_pack_info(pmix_pointer_array_t *regtypes,
pmix_buffer_t *buffer, const void *src,
int32_t num_vals, pmix_data_type_t type);
pmix_status_t pmix12_bfrop_pack_buf(pmix_pointer_array_t *regtypes,
pmix_buffer_t *buffer, const void *src,
int32_t num_vals, pmix_data_type_t type);
pmix_status_t pmix12_bfrop_pack_kval(pmix_pointer_array_t *regtypes,
pmix_buffer_t *buffer, const void *src,
int32_t num_vals, pmix_data_type_t type);
pmix_status_t pmix12_bfrop_pack_modex(pmix_pointer_array_t *regtypes,
pmix_buffer_t *buffer, const void *src,
int32_t num_vals, pmix_data_type_t type);
pmix_status_t pmix12_bfrop_pack_persist(pmix_pointer_array_t *regtypes,
pmix_buffer_t *buffer, const void *src,
int32_t num_vals, pmix_data_type_t type);
pmix_status_t pmix12_bfrop_pack_bo(pmix_pointer_array_t *regtypes,
pmix_buffer_t *buffer, const void *src,
int32_t num_vals, pmix_data_type_t type);
pmix_status_t pmix12_bfrop_pack_pdata(pmix_pointer_array_t *regtypes,
pmix_buffer_t *buffer, const void *src,
int32_t num_vals, pmix_data_type_t type);
/* compatibility functions - no corresponding PMIx v1.x definitions */
pmix_status_t pmix12_bfrop_pack_ptr(pmix_pointer_array_t *regtypes,
pmix_buffer_t *buffer, const void *src,
int32_t num_vals, pmix_data_type_t type);
pmix_status_t pmix12_bfrop_pack_scope(pmix_pointer_array_t *regtypes,
pmix_buffer_t *buffer, const void *src,
int32_t num_vals, pmix_data_type_t type);
pmix_status_t pmix12_bfrop_pack_status(pmix_pointer_array_t *regtypes,
pmix_buffer_t *buffer, const void *src,
int32_t num_vals, pmix_data_type_t type);
pmix_status_t pmix12_bfrop_pack_range(pmix_pointer_array_t *regtypes,
pmix_buffer_t *buffer, const void *src,
int32_t num_vals, pmix_data_type_t type);
pmix_status_t pmix12_bfrop_pack_cmd(pmix_pointer_array_t *regtypes,
pmix_buffer_t *buffer, const void *src,
int32_t num_vals, pmix_data_type_t type);
pmix_status_t pmix12_bfrop_pack_info_directives(pmix_pointer_array_t *regtypes,
pmix_buffer_t *buffer, const void *src,
int32_t num_vals, pmix_data_type_t type);
pmix_status_t pmix12_bfrop_pack_proc_state(pmix_pointer_array_t *regtypes,
pmix_buffer_t *buffer, const void *src,
int32_t num_vals, pmix_data_type_t type);
pmix_status_t pmix12_bfrop_pack_darray(pmix_pointer_array_t *regtypes,
pmix_buffer_t *buffer, const void *src,
int32_t num_vals, pmix_data_type_t type);
pmix_status_t pmix12_bfrop_pack_proc_info(pmix_pointer_array_t *regtypes,
pmix_buffer_t *buffer, const void *src,
int32_t num_vals, pmix_data_type_t type);
pmix_status_t pmix12_bfrop_pack_query(pmix_pointer_array_t *regtypes,
pmix_buffer_t *buffer, const void *src,
int32_t num_vals, pmix_data_type_t type);
pmix_status_t pmix12_bfrop_pack_rank(pmix_pointer_array_t *regtypes,
pmix_buffer_t *buffer, const void *src,
int32_t num_vals, pmix_data_type_t type);
/* /*
* Internal unpack functions * Internal unpack functions
*/ */
pmix_status_t pmix12_bfrop_unpack_bool(pmix_buffer_t *buffer, void *dest, pmix_status_t pmix12_bfrop_unpack_bool(pmix_pointer_array_t *regtypes,
int32_t *num_vals, pmix_data_type_t type); pmix_buffer_t *buffer, void *dest,
pmix_status_t pmix12_bfrop_unpack_byte(pmix_buffer_t *buffer, void *dest,
int32_t *num_vals, pmix_data_type_t type);
pmix_status_t pmix12_bfrop_unpack_string(pmix_buffer_t *buffer, void *dest,
int32_t *num_vals, pmix_data_type_t type);
pmix_status_t pmix12_bfrop_unpack_sizet(pmix_buffer_t *buffer, void *dest,
int32_t *num_vals, pmix_data_type_t type); int32_t *num_vals, pmix_data_type_t type);
pmix_status_t pmix12_bfrop_unpack_pid(pmix_buffer_t *buffer, void *dest, pmix_status_t pmix12_bfrop_unpack_byte(pmix_pointer_array_t *regtypes,
int32_t *num_vals, pmix_data_type_t type); pmix_buffer_t *buffer, void *dest,
pmix_status_t pmix12_bfrop_unpack_int(pmix_buffer_t *buffer, void *dest,
int32_t *num_vals, pmix_data_type_t type);
pmix_status_t pmix12_bfrop_unpack_int16(pmix_buffer_t *buffer, void *dest,
int32_t *num_vals, pmix_data_type_t type); int32_t *num_vals, pmix_data_type_t type);
pmix_status_t pmix12_bfrop_unpack_int32(pmix_buffer_t *buffer, void *dest, pmix_status_t pmix12_bfrop_unpack_string(pmix_pointer_array_t *regtypes,
int32_t *num_vals, pmix_data_type_t type); pmix_buffer_t *buffer, void *dest,
pmix_status_t pmix12_bfrop_unpack_datatype(pmix_buffer_t *buffer, void *dest,
int32_t *num_vals, pmix_data_type_t type);
pmix_status_t pmix12_bfrop_unpack_int64(pmix_buffer_t *buffer, void *dest,
int32_t *num_vals, pmix_data_type_t type);
pmix_status_t pmix12_bfrop_unpack_float(pmix_buffer_t *buffer, void *dest,
int32_t *num_vals, pmix_data_type_t type);
pmix_status_t pmix12_bfrop_unpack_double(pmix_buffer_t *buffer, void *dest,
int32_t *num_vals, pmix_data_type_t type);
pmix_status_t pmix12_bfrop_unpack_timeval(pmix_buffer_t *buffer, void *dest,
int32_t *num_vals, pmix_data_type_t type); int32_t *num_vals, pmix_data_type_t type);
pmix_status_t pmix12_bfrop_unpack_time(pmix_buffer_t *buffer, void *dest, pmix_status_t pmix12_bfrop_unpack_sizet(pmix_pointer_array_t *regtypes,
pmix_buffer_t *buffer, void *dest,
int32_t *num_vals, pmix_data_type_t type);
pmix_status_t pmix12_bfrop_unpack_pid(pmix_pointer_array_t *regtypes,
pmix_buffer_t *buffer, void *dest,
int32_t *num_vals, pmix_data_type_t type); int32_t *num_vals, pmix_data_type_t type);
pmix_status_t pmix12_bfrop_unpack_value(pmix_buffer_t *buffer, void *dest, pmix_status_t pmix12_bfrop_unpack_int(pmix_pointer_array_t *regtypes,
int32_t *num_vals, pmix_data_type_t type); pmix_buffer_t *buffer, void *dest,
pmix_status_t pmix12_bfrop_unpack_array(pmix_buffer_t *buffer, void *dest,
int32_t *num_vals, pmix_data_type_t type);
pmix_status_t pmix12_bfrop_unpack_proc(pmix_buffer_t *buffer, void *dest,
int32_t *num_vals, pmix_data_type_t type); int32_t *num_vals, pmix_data_type_t type);
pmix_status_t pmix12_bfrop_unpack_app(pmix_buffer_t *buffer, void *dest, pmix_status_t pmix12_bfrop_unpack_int16(pmix_pointer_array_t *regtypes,
int32_t *num_vals, pmix_data_type_t type); pmix_buffer_t *buffer, void *dest,
pmix_status_t pmix12_bfrop_unpack_info(pmix_buffer_t *buffer, void *dest,
int32_t *num_vals, pmix_data_type_t type);
pmix_status_t pmix12_bfrop_unpack_buf(pmix_buffer_t *buffer, void *dest,
int32_t *num_vals, pmix_data_type_t type);
pmix_status_t pmix12_bfrop_unpack_kval(pmix_buffer_t *buffer, void *dest,
int32_t *num_vals, pmix_data_type_t type);
pmix_status_t pmix12_bfrop_unpack_modex(pmix_buffer_t *buffer, void *dest,
int32_t *num_vals, pmix_data_type_t type);
pmix_status_t pmix12_bfrop_unpack_persist(pmix_buffer_t *buffer, void *dest,
int32_t *num_vals, pmix_data_type_t type);
pmix_status_t pmix12_bfrop_unpack_bo(pmix_buffer_t *buffer, void *dest,
int32_t *num_vals, pmix_data_type_t type);
pmix_status_t pmix12_bfrop_unpack_pdata(pmix_buffer_t *buffer, void *dest,
int32_t *num_vals, pmix_data_type_t type);
/* compatibility functions - no corresponding PMIx v1.x definitions */
pmix_status_t pmix12_bfrop_unpack_ptr(pmix_buffer_t *buffer, void *dest,
int32_t *num_vals, pmix_data_type_t type);
pmix_status_t pmix12_bfrop_unpack_scope(pmix_buffer_t *buffer, void *dest,
int32_t *num_vals, pmix_data_type_t type);
pmix_status_t pmix12_bfrop_unpack_status(pmix_buffer_t *buffer, void *dest,
int32_t *num_vals, pmix_data_type_t type); int32_t *num_vals, pmix_data_type_t type);
pmix_status_t pmix12_bfrop_unpack_range(pmix_buffer_t *buffer, void *dest, pmix_status_t pmix12_bfrop_unpack_int32(pmix_pointer_array_t *regtypes,
int32_t *num_vals, pmix_data_type_t type); pmix_buffer_t *buffer, void *dest,
pmix_status_t pmix12_bfrop_unpack_cmd(pmix_buffer_t *buffer, void *dest,
int32_t *num_vals, pmix_data_type_t type);
pmix_status_t pmix12_bfrop_unpack_info_directives(pmix_buffer_t *buffer, void *dest,
int32_t *num_vals, pmix_data_type_t type);
pmix_status_t pmix12_bfrop_unpack_proc_state(pmix_buffer_t *buffer, void *dest,
int32_t *num_vals, pmix_data_type_t type);
pmix_status_t pmix12_bfrop_unpack_darray(pmix_buffer_t *buffer, void *dest,
int32_t *num_vals, pmix_data_type_t type); int32_t *num_vals, pmix_data_type_t type);
pmix_status_t pmix12_bfrop_unpack_proc_info(pmix_buffer_t *buffer, void *dest, pmix_status_t pmix12_bfrop_unpack_datatype(pmix_pointer_array_t *regtypes,
pmix_buffer_t *buffer, void *dest,
int32_t *num_vals, pmix_data_type_t type); int32_t *num_vals, pmix_data_type_t type);
pmix_status_t pmix12_bfrop_unpack_query(pmix_buffer_t *buffer, void *dest, pmix_status_t pmix12_bfrop_unpack_int64(pmix_pointer_array_t *regtypes,
pmix_buffer_t *buffer, void *dest,
int32_t *num_vals, pmix_data_type_t type);
pmix_status_t pmix12_bfrop_unpack_float(pmix_pointer_array_t *regtypes,
pmix_buffer_t *buffer, void *dest,
int32_t *num_vals, pmix_data_type_t type);
pmix_status_t pmix12_bfrop_unpack_double(pmix_pointer_array_t *regtypes,
pmix_buffer_t *buffer, void *dest,
int32_t *num_vals, pmix_data_type_t type);
pmix_status_t pmix12_bfrop_unpack_timeval(pmix_pointer_array_t *regtypes,
pmix_buffer_t *buffer, void *dest,
int32_t *num_vals, pmix_data_type_t type);
pmix_status_t pmix12_bfrop_unpack_time(pmix_pointer_array_t *regtypes,
pmix_buffer_t *buffer, void *dest,
int32_t *num_vals, pmix_data_type_t type); int32_t *num_vals, pmix_data_type_t type);
pmix_status_t pmix12_bfrop_unpack_rank(pmix_buffer_t *buffer, void *dest,
pmix_status_t pmix12_bfrop_unpack_value(pmix_pointer_array_t *regtypes,
pmix_buffer_t *buffer, void *dest,
int32_t *num_vals, pmix_data_type_t type);
pmix_status_t pmix12_bfrop_unpack_array(pmix_pointer_array_t *regtypes,
pmix_buffer_t *buffer, void *dest,
int32_t *num_vals, pmix_data_type_t type);
pmix_status_t pmix12_bfrop_unpack_proc(pmix_pointer_array_t *regtypes,
pmix_buffer_t *buffer, void *dest,
int32_t *num_vals, pmix_data_type_t type);
pmix_status_t pmix12_bfrop_unpack_app(pmix_pointer_array_t *regtypes,
pmix_buffer_t *buffer, void *dest,
int32_t *num_vals, pmix_data_type_t type); int32_t *num_vals, pmix_data_type_t type);
pmix_status_t pmix12_bfrop_unpack_info(pmix_pointer_array_t *regtypes,
pmix_buffer_t *buffer, void *dest,
int32_t *num_vals, pmix_data_type_t type);
pmix_status_t pmix12_bfrop_unpack_buf(pmix_pointer_array_t *regtypes,
pmix_buffer_t *buffer, void *dest,
int32_t *num_vals, pmix_data_type_t type);
pmix_status_t pmix12_bfrop_unpack_kval(pmix_pointer_array_t *regtypes,
pmix_buffer_t *buffer, void *dest,
int32_t *num_vals, pmix_data_type_t type);
pmix_status_t pmix12_bfrop_unpack_modex(pmix_pointer_array_t *regtypes,
pmix_buffer_t *buffer, void *dest,
int32_t *num_vals, pmix_data_type_t type);
pmix_status_t pmix12_bfrop_unpack_persist(pmix_pointer_array_t *regtypes,
pmix_buffer_t *buffer, void *dest,
int32_t *num_vals, pmix_data_type_t type);
pmix_status_t pmix12_bfrop_unpack_bo(pmix_pointer_array_t *regtypes,
pmix_buffer_t *buffer, void *dest,
int32_t *num_vals, pmix_data_type_t type);
pmix_status_t pmix12_bfrop_unpack_pdata(pmix_pointer_array_t *regtypes,
pmix_buffer_t *buffer, void *dest,
int32_t *num_vals, pmix_data_type_t type);
/* compatibility functions - no corresponding PMIx v1.x definitions */
pmix_status_t pmix12_bfrop_unpack_ptr(pmix_pointer_array_t *regtypes,
pmix_buffer_t *buffer, void *dest,
int32_t *num_vals, pmix_data_type_t type);
pmix_status_t pmix12_bfrop_unpack_scope(pmix_pointer_array_t *regtypes,
pmix_buffer_t *buffer, void *dest,
int32_t *num_vals, pmix_data_type_t type);
pmix_status_t pmix12_bfrop_unpack_status(pmix_pointer_array_t *regtypes,
pmix_buffer_t *buffer, void *dest,
int32_t *num_vals, pmix_data_type_t type);
pmix_status_t pmix12_bfrop_unpack_range(pmix_pointer_array_t *regtypes,
pmix_buffer_t *buffer, void *dest,
int32_t *num_vals, pmix_data_type_t type);
pmix_status_t pmix12_bfrop_unpack_cmd(pmix_pointer_array_t *regtypes,
pmix_buffer_t *buffer, void *dest,
int32_t *num_vals, pmix_data_type_t type);
pmix_status_t pmix12_bfrop_unpack_info_directives(pmix_pointer_array_t *regtypes,
pmix_buffer_t *buffer, void *dest,
int32_t *num_vals, pmix_data_type_t type);
pmix_status_t pmix12_bfrop_unpack_proc_state(pmix_pointer_array_t *regtypes,
pmix_buffer_t *buffer, void *dest,
int32_t *num_vals, pmix_data_type_t type);
pmix_status_t pmix12_bfrop_unpack_darray(pmix_pointer_array_t *regtypes,
pmix_buffer_t *buffer, void *dest,
int32_t *num_vals, pmix_data_type_t type);
pmix_status_t pmix12_bfrop_unpack_proc_info(pmix_pointer_array_t *regtypes,
pmix_buffer_t *buffer, void *dest,
int32_t *num_vals, pmix_data_type_t type);
pmix_status_t pmix12_bfrop_unpack_query(pmix_pointer_array_t *regtypes,
pmix_buffer_t *buffer, void *dest,
int32_t *num_vals, pmix_data_type_t type);
pmix_status_t pmix12_bfrop_unpack_rank(pmix_pointer_array_t *regtypes,
pmix_buffer_t *buffer, void *dest,
int32_t *num_vals, pmix_data_type_t type);
/* /*
@ -408,9 +484,12 @@ pmix_status_t pmix12_bfrop_print_rank(char **output, char *prefix,
/* /*
* Internal helper functions * Internal helper functions
*/ */
pmix_status_t pmix12_bfrop_store_data_type(pmix_buffer_t *buffer, pmix_data_type_t type); pmix_status_t pmix12_bfrop_store_data_type(pmix_pointer_array_t *regtypes,
pmix_buffer_t *buffer,
pmix_data_type_t type);
pmix_status_t pmix12_bfrop_get_data_type(pmix_buffer_t *buffer, pmix_data_type_t *type); pmix_status_t pmix12_bfrop_get_data_type(pmix_pointer_array_t *regtypes,
pmix_buffer_t *buffer, pmix_data_type_t *type);
int pmix12_v2_to_v1_datatype(pmix_data_type_t v2type); int pmix12_v2_to_v1_datatype(pmix_data_type_t v2type);

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

@ -11,9 +11,9 @@
* All rights reserved. * All rights reserved.
* Copyright (c) 2011-2013 Cisco Systems, Inc. All rights reserved. * Copyright (c) 2011-2013 Cisco Systems, Inc. All rights reserved.
* Copyright (c) 2014-2018 Intel, Inc. All rights reserved. * Copyright (c) 2014-2018 Intel, Inc. All rights reserved.
* Copyright (c) 2015 Research Organization for Information Science * Copyright (c) 2015-2019 Research Organization for Information Science
* and Technology (RIST). All rights reserved. * and Technology (RIST). All rights reserved.
* Copyright (c) 2016 Mellanox Technologies, Inc. * Copyright (c) 2016-2019 Mellanox Technologies, Inc.
* All rights reserved. * All rights reserved.
* Copyright (c) 2016 IBM Corporation. All rights reserved. * Copyright (c) 2016 IBM Corporation. All rights reserved.
* $COPYRIGHT$ * $COPYRIGHT$
@ -25,8 +25,6 @@
#include <src/include/pmix_config.h> #include <src/include/pmix_config.h>
#include <src/include/types.h>
#ifdef HAVE_ARPA_INET_H #ifdef HAVE_ARPA_INET_H
#include <arpa/inet.h> #include <arpa/inet.h>
#endif #endif
@ -37,11 +35,12 @@
#include "bfrop_v12.h" #include "bfrop_v12.h"
#include "internal.h" #include "internal.h"
pmix_status_t pmix12_bfrop_pack(pmix_buffer_t *buffer, pmix_status_t pmix12_bfrop_pack(pmix_buffer_t *buffer,
const void *src, int32_t num_vals, const void *src, int32_t num_vals,
pmix_data_type_t type) pmix_data_type_t type)
{ {
pmix_status_t rc; pmix_status_t rc;
pmix_pointer_array_t *regtypes = &mca_bfrops_v12_component.types;
/* check for error */ /* check for error */
if (NULL == buffer) { if (NULL == buffer) {
@ -50,21 +49,22 @@
/* Pack the number of values */ /* Pack the number of values */
if (PMIX_BFROP_BUFFER_FULLY_DESC == buffer->type) { if (PMIX_BFROP_BUFFER_FULLY_DESC == buffer->type) {
if (PMIX_SUCCESS != (rc = pmix12_bfrop_store_data_type(buffer, PMIX_INT32))) { if (PMIX_SUCCESS != (rc = pmix12_bfrop_store_data_type(regtypes, buffer, PMIX_INT32))) {
return rc; return rc;
} }
} }
if (PMIX_SUCCESS != (rc = pmix12_bfrop_pack_int32(buffer, &num_vals, 1, PMIX_INT32))) { if (PMIX_SUCCESS != (rc = pmix12_bfrop_pack_int32(regtypes, buffer, &num_vals, 1, PMIX_INT32))) {
return rc; return rc;
} }
/* Pack the value(s) */ /* Pack the value(s) */
return pmix12_bfrop_pack_buffer(buffer, src, num_vals, type); return pmix12_bfrop_pack_buffer(regtypes, buffer, src, num_vals, type);
} }
pmix_status_t pmix12_bfrop_pack_buffer(pmix_buffer_t *buffer, pmix_status_t pmix12_bfrop_pack_buffer(pmix_pointer_array_t *regtypes,
const void *src, int32_t num_vals, pmix_buffer_t *buffer,
pmix_data_type_t type) const void *src, int32_t num_vals,
pmix_data_type_t type)
{ {
pmix_status_t rc; pmix_status_t rc;
pmix_bfrop_type_info_t *info; pmix_bfrop_type_info_t *info;
@ -95,7 +95,7 @@ pmix_status_t pmix12_bfrop_pack_buffer(pmix_buffer_t *buffer,
/* Pack the declared data type */ /* Pack the declared data type */
if (PMIX_BFROP_BUFFER_FULLY_DESC == buffer->type) { if (PMIX_BFROP_BUFFER_FULLY_DESC == buffer->type) {
if (PMIX_SUCCESS != (rc = pmix12_bfrop_store_data_type(buffer, v1type))) { if (PMIX_SUCCESS != (rc = pmix12_bfrop_store_data_type(regtypes, buffer, v1type))) {
return rc; return rc;
} }
} }
@ -111,7 +111,7 @@ pmix_status_t pmix12_bfrop_pack_buffer(pmix_buffer_t *buffer,
return PMIX_ERR_PACK_FAILURE; return PMIX_ERR_PACK_FAILURE;
} }
return info->odti_pack_fn(buffer, src, num_vals, v1type); return info->odti_pack_fn(regtypes, buffer, src, num_vals, v1type);
} }
@ -120,8 +120,9 @@ pmix_status_t pmix12_bfrop_pack_buffer(pmix_buffer_t *buffer,
/* /*
* BOOL * BOOL
*/ */
pmix_status_t pmix12_bfrop_pack_bool(pmix_buffer_t *buffer, const void *src, pmix_status_t pmix12_bfrop_pack_bool(pmix_pointer_array_t *regtypes,
int32_t num_vals, pmix_data_type_t type) pmix_buffer_t *buffer, const void *src,
int32_t num_vals, pmix_data_type_t type)
{ {
uint8_t *dst; uint8_t *dst;
int32_t i; int32_t i;
@ -152,54 +153,57 @@ pmix_status_t pmix12_bfrop_pack_bool(pmix_buffer_t *buffer, const void *src,
/* /*
* INT * INT
*/ */
pmix_status_t pmix12_bfrop_pack_int(pmix_buffer_t *buffer, const void *src, pmix_status_t pmix12_bfrop_pack_int(pmix_pointer_array_t *regtypes,
int32_t num_vals, pmix_data_type_t type) pmix_buffer_t *buffer, const void *src,
int32_t num_vals, pmix_data_type_t type)
{ {
pmix_status_t ret; pmix_status_t ret;
/* System types need to always be described so we can properly /* System types need to always be described so we can properly
unpack them */ unpack them */
if (PMIX_SUCCESS != (ret = pmix12_bfrop_store_data_type(buffer, BFROP_TYPE_INT))) { if (PMIX_SUCCESS != (ret = pmix12_bfrop_store_data_type(regtypes, buffer, BFROP_TYPE_INT))) {
return ret; return ret;
} }
/* Turn around and pack the real type */ /* Turn around and pack the real type */
return pmix12_bfrop_pack_buffer(buffer, src, num_vals, BFROP_TYPE_INT); return pmix12_bfrop_pack_buffer(regtypes, buffer, src, num_vals, BFROP_TYPE_INT);
} }
/* /*
* SIZE_T * SIZE_T
*/ */
pmix_status_t pmix12_bfrop_pack_sizet(pmix_buffer_t *buffer, const void *src, pmix_status_t pmix12_bfrop_pack_sizet(pmix_pointer_array_t *regtypes,
int32_t num_vals, pmix_data_type_t type) pmix_buffer_t *buffer, const void *src,
int32_t num_vals, pmix_data_type_t type)
{ {
pmix_status_t ret; pmix_status_t ret;
/* System types need to always be described so we can properly /* System types need to always be described so we can properly
unpack them. */ unpack them. */
if (PMIX_SUCCESS != (ret = pmix12_bfrop_store_data_type(buffer, BFROP_TYPE_SIZE_T))) { if (PMIX_SUCCESS != (ret = pmix12_bfrop_store_data_type(regtypes, buffer, BFROP_TYPE_SIZE_T))) {
return ret; return ret;
} }
return pmix12_bfrop_pack_buffer(buffer, src, num_vals, BFROP_TYPE_SIZE_T); return pmix12_bfrop_pack_buffer(regtypes, buffer, src, num_vals, BFROP_TYPE_SIZE_T);
} }
/* /*
* PID_T * PID_T
*/ */
pmix_status_t pmix12_bfrop_pack_pid(pmix_buffer_t *buffer, const void *src, pmix_status_t pmix12_bfrop_pack_pid(pmix_pointer_array_t *regtypes,
int32_t num_vals, pmix_data_type_t type) pmix_buffer_t *buffer, const void *src,
int32_t num_vals, pmix_data_type_t type)
{ {
pmix_status_t ret; pmix_status_t ret;
/* System types need to always be described so we can properly /* System types need to always be described so we can properly
unpack them. */ unpack them. */
if (PMIX_SUCCESS != (ret = pmix12_bfrop_store_data_type(buffer, BFROP_TYPE_PID_T))) { if (PMIX_SUCCESS != (ret = pmix12_bfrop_store_data_type(regtypes, buffer, BFROP_TYPE_PID_T))) {
return ret; return ret;
} }
/* Turn around and pack the real type */ /* Turn around and pack the real type */
return pmix12_bfrop_pack_buffer(buffer, src, num_vals, BFROP_TYPE_PID_T); return pmix12_bfrop_pack_buffer(regtypes, buffer, src, num_vals, BFROP_TYPE_PID_T);
} }
@ -208,8 +212,9 @@ pmix_status_t pmix12_bfrop_pack_pid(pmix_buffer_t *buffer, const void *src,
/* /*
* BYTE, CHAR, INT8 * BYTE, CHAR, INT8
*/ */
pmix_status_t pmix12_bfrop_pack_byte(pmix_buffer_t *buffer, const void *src, pmix_status_t pmix12_bfrop_pack_byte(pmix_pointer_array_t *regtypes,
int32_t num_vals, pmix_data_type_t type) pmix_buffer_t *buffer, const void *src,
int32_t num_vals, pmix_data_type_t type)
{ {
char *dst; char *dst;
@ -232,8 +237,9 @@ pmix_status_t pmix12_bfrop_pack_byte(pmix_buffer_t *buffer, const void *src,
/* /*
* INT16 * INT16
*/ */
pmix_status_t pmix12_bfrop_pack_int16(pmix_buffer_t *buffer, const void *src, pmix_status_t pmix12_bfrop_pack_int16(pmix_pointer_array_t *regtypes,
int32_t num_vals, pmix_data_type_t type) pmix_buffer_t *buffer, const void *src,
int32_t num_vals, pmix_data_type_t type)
{ {
int32_t i; int32_t i;
uint16_t tmp, *srctmp = (uint16_t*) src; uint16_t tmp, *srctmp = (uint16_t*) src;
@ -259,8 +265,9 @@ pmix_status_t pmix12_bfrop_pack_int16(pmix_buffer_t *buffer, const void *src,
/* /*
* INT32 * INT32
*/ */
pmix_status_t pmix12_bfrop_pack_int32(pmix_buffer_t *buffer, const void *src, pmix_status_t pmix12_bfrop_pack_int32(pmix_pointer_array_t *regtypes,
int32_t num_vals, pmix_data_type_t type) pmix_buffer_t *buffer, const void *src,
int32_t num_vals, pmix_data_type_t type)
{ {
int32_t i; int32_t i;
uint32_t tmp, *srctmp = (uint32_t*) src; uint32_t tmp, *srctmp = (uint32_t*) src;
@ -283,17 +290,19 @@ pmix_status_t pmix12_bfrop_pack_int32(pmix_buffer_t *buffer, const void *src,
return PMIX_SUCCESS; return PMIX_SUCCESS;
} }
pmix_status_t pmix12_bfrop_pack_datatype(pmix_buffer_t *buffer, const void *src, pmix_status_t pmix12_bfrop_pack_datatype(pmix_pointer_array_t *regtypes,
int32_t num_vals, pmix_data_type_t type) pmix_buffer_t *buffer, const void *src,
int32_t num_vals, pmix_data_type_t type)
{ {
return pmix12_bfrop_pack_int32(buffer, src, num_vals, type); return pmix12_bfrop_pack_int32(regtypes, buffer, src, num_vals, type);
} }
/* /*
* INT64 * INT64
*/ */
pmix_status_t pmix12_bfrop_pack_int64(pmix_buffer_t *buffer, const void *src, pmix_status_t pmix12_bfrop_pack_int64(pmix_pointer_array_t *regtypes,
int32_t num_vals, pmix_data_type_t type) pmix_buffer_t *buffer, const void *src,
int32_t num_vals, pmix_data_type_t type)
{ {
int32_t i; int32_t i;
uint64_t tmp, tmp2; uint64_t tmp, tmp2;
@ -321,8 +330,9 @@ pmix_status_t pmix12_bfrop_pack_int64(pmix_buffer_t *buffer, const void *src,
/* /*
* STRING * STRING
*/ */
pmix_status_t pmix12_bfrop_pack_string(pmix_buffer_t *buffer, const void *src, pmix_status_t pmix12_bfrop_pack_string(pmix_pointer_array_t *regtypes,
int32_t num_vals, pmix_data_type_t type) pmix_buffer_t *buffer, const void *src,
int32_t num_vals, pmix_data_type_t type)
{ {
int ret = PMIX_SUCCESS; int ret = PMIX_SUCCESS;
int32_t i, len; int32_t i, len;
@ -331,16 +341,16 @@ pmix_status_t pmix12_bfrop_pack_string(pmix_buffer_t *buffer, const void *src,
for (i = 0; i < num_vals; ++i) { for (i = 0; i < num_vals; ++i) {
if (NULL == ssrc[i]) { /* got zero-length string/NULL pointer - store NULL */ if (NULL == ssrc[i]) { /* got zero-length string/NULL pointer - store NULL */
len = 0; len = 0;
if (PMIX_SUCCESS != (ret = pmix12_bfrop_pack_int32(buffer, &len, 1, PMIX_INT32))) { if (PMIX_SUCCESS != (ret = pmix12_bfrop_pack_int32(regtypes, buffer, &len, 1, PMIX_INT32))) {
return ret; return ret;
} }
} else { } else {
len = (int32_t)strlen(ssrc[i]) + 1; len = (int32_t)strlen(ssrc[i]) + 1;
if (PMIX_SUCCESS != (ret = pmix12_bfrop_pack_int32(buffer, &len, 1, PMIX_INT32))) { if (PMIX_SUCCESS != (ret = pmix12_bfrop_pack_int32(regtypes, buffer, &len, 1, PMIX_INT32))) {
return ret; return ret;
} }
if (PMIX_SUCCESS != (ret = if (PMIX_SUCCESS != (ret =
pmix12_bfrop_pack_byte(buffer, ssrc[i], len, PMIX_BYTE))) { pmix12_bfrop_pack_byte(regtypes, buffer, ssrc[i], len, PMIX_BYTE))) {
return ret; return ret;
} }
} }
@ -350,8 +360,9 @@ pmix_status_t pmix12_bfrop_pack_string(pmix_buffer_t *buffer, const void *src,
} }
/* FLOAT */ /* FLOAT */
pmix_status_t pmix12_bfrop_pack_float(pmix_buffer_t *buffer, const void *src, pmix_status_t pmix12_bfrop_pack_float(pmix_pointer_array_t *regtypes,
int32_t num_vals, pmix_data_type_t type) pmix_buffer_t *buffer, const void *src,
int32_t num_vals, pmix_data_type_t type)
{ {
pmix_status_t ret = PMIX_SUCCESS; pmix_status_t ret = PMIX_SUCCESS;
int32_t i; int32_t i;
@ -362,7 +373,7 @@ pmix_status_t pmix12_bfrop_pack_float(pmix_buffer_t *buffer, const void *src,
if (0 > asprintf(&convert, "%f", ssrc[i])) { if (0 > asprintf(&convert, "%f", ssrc[i])) {
return PMIX_ERR_NOMEM; return PMIX_ERR_NOMEM;
} }
if (PMIX_SUCCESS != (ret = pmix12_bfrop_pack_string(buffer, &convert, 1, PMIX_STRING))) { if (PMIX_SUCCESS != (ret = pmix12_bfrop_pack_string(regtypes, buffer, &convert, 1, PMIX_STRING))) {
free(convert); free(convert);
return ret; return ret;
} }
@ -373,8 +384,9 @@ pmix_status_t pmix12_bfrop_pack_float(pmix_buffer_t *buffer, const void *src,
} }
/* DOUBLE */ /* DOUBLE */
pmix_status_t pmix12_bfrop_pack_double(pmix_buffer_t *buffer, const void *src, pmix_status_t pmix12_bfrop_pack_double(pmix_pointer_array_t *regtypes,
int32_t num_vals, pmix_data_type_t type) pmix_buffer_t *buffer, const void *src,
int32_t num_vals, pmix_data_type_t type)
{ {
pmix_status_t ret = PMIX_SUCCESS; pmix_status_t ret = PMIX_SUCCESS;
int32_t i; int32_t i;
@ -385,7 +397,7 @@ pmix_status_t pmix12_bfrop_pack_double(pmix_buffer_t *buffer, const void *src,
if (0 > asprintf(&convert, "%f", ssrc[i])) { if (0 > asprintf(&convert, "%f", ssrc[i])) {
return PMIX_ERR_NOMEM; return PMIX_ERR_NOMEM;
} }
if (PMIX_SUCCESS != (ret = pmix12_bfrop_pack_string(buffer, &convert, 1, PMIX_STRING))) { if (PMIX_SUCCESS != (ret = pmix12_bfrop_pack_string(regtypes, buffer, &convert, 1, PMIX_STRING))) {
free(convert); free(convert);
return ret; return ret;
} }
@ -396,8 +408,9 @@ pmix_status_t pmix12_bfrop_pack_double(pmix_buffer_t *buffer, const void *src,
} }
/* TIMEVAL */ /* TIMEVAL */
pmix_status_t pmix12_bfrop_pack_timeval(pmix_buffer_t *buffer, const void *src, pmix_status_t pmix12_bfrop_pack_timeval(pmix_pointer_array_t *regtypes,
int32_t num_vals, pmix_data_type_t type) pmix_buffer_t *buffer, const void *src,
int32_t num_vals, pmix_data_type_t type)
{ {
int64_t tmp[2]; int64_t tmp[2];
pmix_status_t ret = PMIX_SUCCESS; pmix_status_t ret = PMIX_SUCCESS;
@ -407,7 +420,7 @@ pmix_status_t pmix12_bfrop_pack_timeval(pmix_buffer_t *buffer, const void *src,
for (i = 0; i < num_vals; ++i) { for (i = 0; i < num_vals; ++i) {
tmp[0] = (int64_t)ssrc[i].tv_sec; tmp[0] = (int64_t)ssrc[i].tv_sec;
tmp[1] = (int64_t)ssrc[i].tv_usec; tmp[1] = (int64_t)ssrc[i].tv_usec;
if (PMIX_SUCCESS != (ret = pmix12_bfrop_pack_int64(buffer, tmp, 2, PMIX_INT64))) { if (PMIX_SUCCESS != (ret = pmix12_bfrop_pack_int64(regtypes, buffer, tmp, 2, PMIX_INT64))) {
return ret; return ret;
} }
} }
@ -416,8 +429,9 @@ pmix_status_t pmix12_bfrop_pack_timeval(pmix_buffer_t *buffer, const void *src,
} }
/* TIME */ /* TIME */
pmix_status_t pmix12_bfrop_pack_time(pmix_buffer_t *buffer, const void *src, pmix_status_t pmix12_bfrop_pack_time(pmix_pointer_array_t *regtypes,
int32_t num_vals, pmix_data_type_t type) pmix_buffer_t *buffer, const void *src,
int32_t num_vals, pmix_data_type_t type)
{ {
pmix_status_t ret = PMIX_SUCCESS; pmix_status_t ret = PMIX_SUCCESS;
int32_t i; int32_t i;
@ -429,7 +443,7 @@ pmix_status_t pmix12_bfrop_pack_time(pmix_buffer_t *buffer, const void *src,
*/ */
for (i = 0; i < num_vals; ++i) { for (i = 0; i < num_vals; ++i) {
ui64 = (uint64_t)ssrc[i]; ui64 = (uint64_t)ssrc[i];
if (PMIX_SUCCESS != (ret = pmix12_bfrop_pack_int64(buffer, &ui64, 1, PMIX_UINT64))) { if (PMIX_SUCCESS != (ret = pmix12_bfrop_pack_int64(regtypes, buffer, &ui64, 1, PMIX_UINT64))) {
return ret; return ret;
} }
} }
@ -439,7 +453,8 @@ pmix_status_t pmix12_bfrop_pack_time(pmix_buffer_t *buffer, const void *src,
/* PACK FUNCTIONS FOR GENERIC PMIX TYPES */ /* PACK FUNCTIONS FOR GENERIC PMIX TYPES */
static pmix_status_t pack_val(pmix_buffer_t *buffer, static pmix_status_t pack_val(pmix_pointer_array_t *regtypes,
pmix_buffer_t *buffer,
pmix_value_t *p) pmix_value_t *p)
{ {
pmix_status_t ret; pmix_status_t ret;
@ -448,97 +463,97 @@ static pmix_status_t pack_val(pmix_buffer_t *buffer,
switch (p->type) { switch (p->type) {
case PMIX_BOOL: case PMIX_BOOL:
if (PMIX_SUCCESS != (ret = pmix12_bfrop_pack_buffer(buffer, &p->data.flag, 1, PMIX_BOOL))) { if (PMIX_SUCCESS != (ret = pmix12_bfrop_pack_buffer(regtypes, buffer, &p->data.flag, 1, PMIX_BOOL))) {
return ret; return ret;
} }
break; break;
case PMIX_BYTE: case PMIX_BYTE:
if (PMIX_SUCCESS != (ret = pmix12_bfrop_pack_buffer(buffer, &p->data.byte, 1, PMIX_BYTE))) { if (PMIX_SUCCESS != (ret = pmix12_bfrop_pack_buffer(regtypes, buffer, &p->data.byte, 1, PMIX_BYTE))) {
return ret; return ret;
} }
break; break;
case PMIX_STRING: case PMIX_STRING:
if (PMIX_SUCCESS != (ret = pmix12_bfrop_pack_buffer(buffer, &p->data.string, 1, PMIX_STRING))) { if (PMIX_SUCCESS != (ret = pmix12_bfrop_pack_buffer(regtypes, buffer, &p->data.string, 1, PMIX_STRING))) {
return ret; return ret;
} }
break; break;
case PMIX_SIZE: case PMIX_SIZE:
if (PMIX_SUCCESS != (ret = pmix12_bfrop_pack_buffer(buffer, &p->data.size, 1, PMIX_SIZE))) { if (PMIX_SUCCESS != (ret = pmix12_bfrop_pack_buffer(regtypes, buffer, &p->data.size, 1, PMIX_SIZE))) {
return ret; return ret;
} }
break; break;
case PMIX_PID: case PMIX_PID:
if (PMIX_SUCCESS != (ret = pmix12_bfrop_pack_buffer(buffer, &p->data.pid, 1, PMIX_PID))) { if (PMIX_SUCCESS != (ret = pmix12_bfrop_pack_buffer(regtypes, buffer, &p->data.pid, 1, PMIX_PID))) {
return ret; return ret;
} }
break; break;
case PMIX_INT: case PMIX_INT:
if (PMIX_SUCCESS != (ret = pmix12_bfrop_pack_buffer(buffer, &p->data.integer, 1, PMIX_INT))) { if (PMIX_SUCCESS != (ret = pmix12_bfrop_pack_buffer(regtypes, buffer, &p->data.integer, 1, PMIX_INT))) {
return ret; return ret;
} }
break; break;
case PMIX_INT8: case PMIX_INT8:
if (PMIX_SUCCESS != (ret = pmix12_bfrop_pack_buffer(buffer, &p->data.int8, 1, PMIX_INT8))) { if (PMIX_SUCCESS != (ret = pmix12_bfrop_pack_buffer(regtypes, buffer, &p->data.int8, 1, PMIX_INT8))) {
return ret; return ret;
} }
break; break;
case PMIX_INT16: case PMIX_INT16:
if (PMIX_SUCCESS != (ret = pmix12_bfrop_pack_buffer(buffer, &p->data.int16, 1, PMIX_INT16))) { if (PMIX_SUCCESS != (ret = pmix12_bfrop_pack_buffer(regtypes, buffer, &p->data.int16, 1, PMIX_INT16))) {
return ret; return ret;
} }
break; break;
case PMIX_INT32: case PMIX_INT32:
if (PMIX_SUCCESS != (ret = pmix12_bfrop_pack_buffer(buffer, &p->data.int32, 1, PMIX_INT32))) { if (PMIX_SUCCESS != (ret = pmix12_bfrop_pack_buffer(regtypes, buffer, &p->data.int32, 1, PMIX_INT32))) {
return ret; return ret;
} }
break; break;
case PMIX_INT64: case PMIX_INT64:
if (PMIX_SUCCESS != (ret = pmix12_bfrop_pack_buffer(buffer, &p->data.int64, 1, PMIX_INT64))) { if (PMIX_SUCCESS != (ret = pmix12_bfrop_pack_buffer(regtypes, buffer, &p->data.int64, 1, PMIX_INT64))) {
return ret; return ret;
} }
break; break;
case PMIX_UINT: case PMIX_UINT:
if (PMIX_SUCCESS != (ret = pmix12_bfrop_pack_buffer(buffer, &p->data.uint, 1, PMIX_UINT))) { if (PMIX_SUCCESS != (ret = pmix12_bfrop_pack_buffer(regtypes, buffer, &p->data.uint, 1, PMIX_UINT))) {
return ret; return ret;
} }
break; break;
case PMIX_UINT8: case PMIX_UINT8:
if (PMIX_SUCCESS != (ret = pmix12_bfrop_pack_buffer(buffer, &p->data.uint8, 1, PMIX_UINT8))) { if (PMIX_SUCCESS != (ret = pmix12_bfrop_pack_buffer(regtypes, buffer, &p->data.uint8, 1, PMIX_UINT8))) {
return ret; return ret;
} }
break; break;
case PMIX_UINT16: case PMIX_UINT16:
if (PMIX_SUCCESS != (ret = pmix12_bfrop_pack_buffer(buffer, &p->data.uint16, 1, PMIX_UINT16))) { if (PMIX_SUCCESS != (ret = pmix12_bfrop_pack_buffer(regtypes, buffer, &p->data.uint16, 1, PMIX_UINT16))) {
return ret; return ret;
} }
break; break;
case PMIX_UINT32: case PMIX_UINT32:
if (PMIX_SUCCESS != (ret = pmix12_bfrop_pack_buffer(buffer, &p->data.uint32, 1, PMIX_UINT32))) { if (PMIX_SUCCESS != (ret = pmix12_bfrop_pack_buffer(regtypes, buffer, &p->data.uint32, 1, PMIX_UINT32))) {
return ret; return ret;
} }
break; break;
case PMIX_UINT64: case PMIX_UINT64:
if (PMIX_SUCCESS != (ret = pmix12_bfrop_pack_buffer(buffer, &p->data.uint64, 1, PMIX_UINT64))) { if (PMIX_SUCCESS != (ret = pmix12_bfrop_pack_buffer(regtypes, buffer, &p->data.uint64, 1, PMIX_UINT64))) {
return ret; return ret;
} }
break; break;
case PMIX_FLOAT: case PMIX_FLOAT:
if (PMIX_SUCCESS != (ret = pmix12_bfrop_pack_buffer(buffer, &p->data.fval, 1, PMIX_FLOAT))) { if (PMIX_SUCCESS != (ret = pmix12_bfrop_pack_buffer(regtypes, buffer, &p->data.fval, 1, PMIX_FLOAT))) {
return ret; return ret;
} }
break; break;
case PMIX_DOUBLE: case PMIX_DOUBLE:
if (PMIX_SUCCESS != (ret = pmix12_bfrop_pack_buffer(buffer, &p->data.dval, 1, PMIX_DOUBLE))) { if (PMIX_SUCCESS != (ret = pmix12_bfrop_pack_buffer(regtypes, buffer, &p->data.dval, 1, PMIX_DOUBLE))) {
return ret; return ret;
} }
break; break;
case PMIX_TIMEVAL: case PMIX_TIMEVAL:
if (PMIX_SUCCESS != (ret = pmix12_bfrop_pack_buffer(buffer, &p->data.tv, 1, PMIX_TIMEVAL))) { if (PMIX_SUCCESS != (ret = pmix12_bfrop_pack_buffer(regtypes, buffer, &p->data.tv, 1, PMIX_TIMEVAL))) {
return ret; return ret;
} }
break; break;
case PMIX_BYTE_OBJECT: case PMIX_BYTE_OBJECT:
if (PMIX_SUCCESS != (ret = pmix12_bfrop_pack_buffer(buffer, &p->data.bo, 1, PMIX_BYTE_OBJECT))) { if (PMIX_SUCCESS != (ret = pmix12_bfrop_pack_buffer(regtypes, buffer, &p->data.bo, 1, PMIX_BYTE_OBJECT))) {
return ret; return ret;
} }
break; break;
@ -549,7 +564,7 @@ static pmix_status_t pack_val(pmix_buffer_t *buffer,
} }
array.size = p->data.darray->size; array.size = p->data.darray->size;
array.array = (pmix_info_t*)p->data.darray->array; array.array = (pmix_info_t*)p->data.darray->array;
if (PMIX_SUCCESS != (ret = pmix12_bfrop_pack_buffer(buffer, &array, 1, PMIX_INFO_ARRAY))) { if (PMIX_SUCCESS != (ret = pmix12_bfrop_pack_buffer(regtypes, buffer, &array, 1, PMIX_INFO_ARRAY))) {
return ret; return ret;
} }
break; break;
@ -557,7 +572,7 @@ static pmix_status_t pack_val(pmix_buffer_t *buffer,
case PMIX_PROC_RANK: case PMIX_PROC_RANK:
/* must convert this to an int */ /* must convert this to an int */
rank = p->data.rank; rank = p->data.rank;
if (PMIX_SUCCESS != (ret = pmix12_bfrop_pack_buffer(buffer, &rank, 1, PMIX_INT))) { if (PMIX_SUCCESS != (ret = pmix12_bfrop_pack_buffer(regtypes, buffer, &rank, 1, PMIX_INT))) {
return ret; return ret;
} }
break; break;
@ -572,8 +587,9 @@ static pmix_status_t pack_val(pmix_buffer_t *buffer,
/* /*
* PMIX_VALUE * PMIX_VALUE
*/ */
pmix_status_t pmix12_bfrop_pack_value(pmix_buffer_t *buffer, const void *src, pmix_status_t pmix12_bfrop_pack_value(pmix_pointer_array_t *regtypes,
int32_t num_vals, pmix_data_type_t type) pmix_buffer_t *buffer, const void *src,
int32_t num_vals, pmix_data_type_t type)
{ {
pmix_value_t *ptr; pmix_value_t *ptr;
int32_t i; int32_t i;
@ -587,11 +603,11 @@ pmix_status_t pmix12_bfrop_pack_value(pmix_buffer_t *buffer, const void *src,
* using the store_data_type function. This means we lose the translation! * using the store_data_type function. This means we lose the translation!
* So get it here */ * So get it here */
v1type = pmix12_v2_to_v1_datatype(ptr[i].type); v1type = pmix12_v2_to_v1_datatype(ptr[i].type);
if (PMIX_SUCCESS != (ret = pmix12_bfrop_pack_int(buffer, &v1type, 1, PMIX_INT))) { if (PMIX_SUCCESS != (ret = pmix12_bfrop_pack_int(regtypes, buffer, &v1type, 1, PMIX_INT))) {
return ret; return ret;
} }
/* now pack the right field */ /* now pack the right field */
if (PMIX_SUCCESS != (ret = pack_val(buffer, &ptr[i]))) { if (PMIX_SUCCESS != (ret = pack_val(regtypes, buffer, &ptr[i]))) {
return ret; return ret;
} }
} }
@ -600,8 +616,9 @@ pmix_status_t pmix12_bfrop_pack_value(pmix_buffer_t *buffer, const void *src,
} }
pmix_status_t pmix12_bfrop_pack_info(pmix_buffer_t *buffer, const void *src, pmix_status_t pmix12_bfrop_pack_info(pmix_pointer_array_t *regtypes,
int32_t num_vals, pmix_data_type_t type) pmix_buffer_t *buffer, const void *src,
int32_t num_vals, pmix_data_type_t type)
{ {
pmix_info_t *info; pmix_info_t *info;
int32_t i; int32_t i;
@ -614,26 +631,27 @@ pmix_status_t pmix12_bfrop_pack_info(pmix_buffer_t *buffer, const void *src,
for (i = 0; i < num_vals; ++i) { for (i = 0; i < num_vals; ++i) {
/* pack key */ /* pack key */
foo = info[i].key; foo = info[i].key;
if (PMIX_SUCCESS != (ret = pmix12_bfrop_pack_string(buffer, &foo, 1, PMIX_STRING))) { if (PMIX_SUCCESS != (ret = pmix12_bfrop_pack_string(regtypes, buffer, &foo, 1, PMIX_STRING))) {
return ret; return ret;
} }
/* pack the type - unfortunately, v1.2 directly packed the int instead of /* pack the type - unfortunately, v1.2 directly packed the int instead of
* using the store_data_type function. This means we lose the translation! * using the store_data_type function. This means we lose the translation!
* So get it here */ * So get it here */
v1type = pmix12_v2_to_v1_datatype(info[i].value.type); v1type = pmix12_v2_to_v1_datatype(info[i].value.type);
if (PMIX_SUCCESS != (ret = pmix12_bfrop_pack_int(buffer, &v1type, 1, PMIX_INT))) { if (PMIX_SUCCESS != (ret = pmix12_bfrop_pack_int(regtypes, buffer, &v1type, 1, PMIX_INT))) {
return ret; return ret;
} }
/* pack value */ /* pack value */
if (PMIX_SUCCESS != (ret = pack_val(buffer, &info[i].value))) { if (PMIX_SUCCESS != (ret = pack_val(regtypes, buffer, &info[i].value))) {
return ret; return ret;
} }
} }
return PMIX_SUCCESS; return PMIX_SUCCESS;
} }
pmix_status_t pmix12_bfrop_pack_pdata(pmix_buffer_t *buffer, const void *src, pmix_status_t pmix12_bfrop_pack_pdata(pmix_pointer_array_t *regtypes,
int32_t num_vals, pmix_data_type_t type) pmix_buffer_t *buffer, const void *src,
int32_t num_vals, pmix_data_type_t type)
{ {
pmix_pdata_t *pdata; pmix_pdata_t *pdata;
int32_t i; int32_t i;
@ -645,31 +663,32 @@ pmix_status_t pmix12_bfrop_pack_pdata(pmix_buffer_t *buffer, const void *src,
for (i = 0; i < num_vals; ++i) { for (i = 0; i < num_vals; ++i) {
/* pack the proc */ /* pack the proc */
if (PMIX_SUCCESS != (ret = pmix12_bfrop_pack_proc(buffer, &pdata[i].proc, 1, PMIX_PROC))) { if (PMIX_SUCCESS != (ret = pmix12_bfrop_pack_proc(regtypes, buffer, &pdata[i].proc, 1, PMIX_PROC))) {
return ret; return ret;
} }
/* pack key */ /* pack key */
foo = pdata[i].key; foo = pdata[i].key;
if (PMIX_SUCCESS != (ret = pmix12_bfrop_pack_string(buffer, &foo, 1, PMIX_STRING))) { if (PMIX_SUCCESS != (ret = pmix12_bfrop_pack_string(regtypes, buffer, &foo, 1, PMIX_STRING))) {
return ret; return ret;
} }
/* pack the type - unfortunately, v1.2 directly packed the int instead of /* pack the type - unfortunately, v1.2 directly packed the int instead of
* using the store_data_type function. This means we lose the translation! * using the store_data_type function. This means we lose the translation!
* So get it here */ * So get it here */
v1type = pmix12_v2_to_v1_datatype(pdata[i].value.type); v1type = pmix12_v2_to_v1_datatype(pdata[i].value.type);
if (PMIX_SUCCESS != (ret = pmix12_bfrop_pack_int(buffer, &v1type, 1, PMIX_INT))) { if (PMIX_SUCCESS != (ret = pmix12_bfrop_pack_int(regtypes, buffer, &v1type, 1, PMIX_INT))) {
return ret; return ret;
} }
/* pack value */ /* pack value */
if (PMIX_SUCCESS != (ret = pack_val(buffer, &pdata[i].value))) { if (PMIX_SUCCESS != (ret = pack_val(regtypes, buffer, &pdata[i].value))) {
return ret; return ret;
} }
} }
return PMIX_SUCCESS; return PMIX_SUCCESS;
} }
pmix_status_t pmix12_bfrop_pack_buf(pmix_buffer_t *buffer, const void *src, pmix_status_t pmix12_bfrop_pack_buf(pmix_pointer_array_t *regtypes,
int32_t num_vals, pmix_data_type_t type) pmix_buffer_t *buffer, const void *src,
int32_t num_vals, pmix_data_type_t type)
{ {
pmix_buffer_t *ptr; pmix_buffer_t *ptr;
int32_t i; int32_t i;
@ -679,12 +698,12 @@ pmix_status_t pmix12_bfrop_pack_buf(pmix_buffer_t *buffer, const void *src,
for (i = 0; i < num_vals; ++i) { for (i = 0; i < num_vals; ++i) {
/* pack the number of bytes */ /* pack the number of bytes */
if (PMIX_SUCCESS != (ret = pmix12_bfrop_pack_sizet(buffer, &ptr[i].bytes_used, 1, PMIX_SIZE))) { if (PMIX_SUCCESS != (ret = pmix12_bfrop_pack_sizet(regtypes, buffer, &ptr[i].bytes_used, 1, PMIX_SIZE))) {
return ret; return ret;
} }
/* pack the bytes */ /* pack the bytes */
if (0 < ptr[i].bytes_used) { if (0 < ptr[i].bytes_used) {
if (PMIX_SUCCESS != (ret = pmix12_bfrop_pack_byte(buffer, ptr[i].base_ptr, ptr[i].bytes_used, PMIX_BYTE))) { if (PMIX_SUCCESS != (ret = pmix12_bfrop_pack_byte(regtypes, buffer, ptr[i].base_ptr, ptr[i].bytes_used, PMIX_BYTE))) {
return ret; return ret;
} }
} }
@ -692,8 +711,9 @@ pmix_status_t pmix12_bfrop_pack_buf(pmix_buffer_t *buffer, const void *src,
return PMIX_SUCCESS; return PMIX_SUCCESS;
} }
pmix_status_t pmix12_bfrop_pack_proc(pmix_buffer_t *buffer, const void *src, pmix_status_t pmix12_bfrop_pack_proc(pmix_pointer_array_t *regtypes,
int32_t num_vals, pmix_data_type_t type) pmix_buffer_t *buffer, const void *src,
int32_t num_vals, pmix_data_type_t type)
{ {
pmix_proc_t *proc; pmix_proc_t *proc;
int32_t i; int32_t i;
@ -703,18 +723,19 @@ pmix_status_t pmix12_bfrop_pack_proc(pmix_buffer_t *buffer, const void *src,
for (i = 0; i < num_vals; ++i) { for (i = 0; i < num_vals; ++i) {
char *ptr = proc[i].nspace; char *ptr = proc[i].nspace;
if (PMIX_SUCCESS != (ret = pmix12_bfrop_pack_string(buffer, &ptr, 1, PMIX_STRING))) { if (PMIX_SUCCESS != (ret = pmix12_bfrop_pack_string(regtypes, buffer, &ptr, 1, PMIX_STRING))) {
return ret; return ret;
} }
if (PMIX_SUCCESS != (ret = pmix12_bfrop_pack_int(buffer, &proc[i].rank, 1, PMIX_INT))) { if (PMIX_SUCCESS != (ret = pmix12_bfrop_pack_int(regtypes, buffer, &proc[i].rank, 1, PMIX_INT))) {
return ret; return ret;
} }
} }
return PMIX_SUCCESS; return PMIX_SUCCESS;
} }
pmix_status_t pmix12_bfrop_pack_app(pmix_buffer_t *buffer, const void *src, pmix_status_t pmix12_bfrop_pack_app(pmix_pointer_array_t *regtypes,
int32_t num_vals, pmix_data_type_t type) pmix_buffer_t *buffer, const void *src,
int32_t num_vals, pmix_data_type_t type)
{ {
pmix_app_t *app; pmix_app_t *app;
int32_t i, j, nvals; int32_t i, j, nvals;
@ -724,39 +745,39 @@ pmix_status_t pmix12_bfrop_pack_app(pmix_buffer_t *buffer, const void *src,
app = (pmix_app_t *) src; app = (pmix_app_t *) src;
for (i = 0; i < num_vals; ++i) { for (i = 0; i < num_vals; ++i) {
if (PMIX_SUCCESS != (ret = pmix12_bfrop_pack_string(buffer, &app[i].cmd, 1, PMIX_STRING))) { if (PMIX_SUCCESS != (ret = pmix12_bfrop_pack_string(regtypes, buffer, &app[i].cmd, 1, PMIX_STRING))) {
return ret; return ret;
} }
/* argv */ /* argv */
argc = pmix_argv_count(app[i].argv); argc = pmix_argv_count(app[i].argv);
if (PMIX_SUCCESS != (ret = pmix12_bfrop_pack_int(buffer, &argc, 1, PMIX_INT))) { if (PMIX_SUCCESS != (ret = pmix12_bfrop_pack_int(regtypes, buffer, &argc, 1, PMIX_INT))) {
return ret; return ret;
} }
for (j=0; j < argc; j++) { for (j=0; j < argc; j++) {
if (PMIX_SUCCESS != (ret = pmix12_bfrop_pack_string(buffer, &app[i].argv[j], 1, PMIX_STRING))) { if (PMIX_SUCCESS != (ret = pmix12_bfrop_pack_string(regtypes, buffer, &app[i].argv[j], 1, PMIX_STRING))) {
return ret; return ret;
} }
} }
/* env */ /* env */
nvals = pmix_argv_count(app[i].env); nvals = pmix_argv_count(app[i].env);
if (PMIX_SUCCESS != (ret = pmix12_bfrop_pack_int32(buffer, &nvals, 1, PMIX_INT32))) { if (PMIX_SUCCESS != (ret = pmix12_bfrop_pack_int32(regtypes, buffer, &nvals, 1, PMIX_INT32))) {
return ret; return ret;
} }
for (j=0; j < nvals; j++) { for (j=0; j < nvals; j++) {
if (PMIX_SUCCESS != (ret = pmix12_bfrop_pack_string(buffer, &app[i].env[j], 1, PMIX_STRING))) { if (PMIX_SUCCESS != (ret = pmix12_bfrop_pack_string(regtypes, buffer, &app[i].env[j], 1, PMIX_STRING))) {
return ret; return ret;
} }
} }
/* maxprocs */ /* maxprocs */
if (PMIX_SUCCESS != (ret = pmix12_bfrop_pack_int(buffer, &app[i].maxprocs, 1, PMIX_INT))) { if (PMIX_SUCCESS != (ret = pmix12_bfrop_pack_int(regtypes, buffer, &app[i].maxprocs, 1, PMIX_INT))) {
return ret; return ret;
} }
/* info array */ /* info array */
if (PMIX_SUCCESS != (ret = pmix12_bfrop_pack_sizet(buffer, &app[i].ninfo, 1, PMIX_SIZE))) { if (PMIX_SUCCESS != (ret = pmix12_bfrop_pack_sizet(regtypes, buffer, &app[i].ninfo, 1, PMIX_SIZE))) {
return ret; return ret;
} }
if (0 < app[i].ninfo) { if (0 < app[i].ninfo) {
if (PMIX_SUCCESS != (ret = pmix12_bfrop_pack_info(buffer, app[i].info, app[i].ninfo, PMIX_INFO))) { if (PMIX_SUCCESS != (ret = pmix12_bfrop_pack_info(regtypes, buffer, app[i].info, app[i].ninfo, PMIX_INFO))) {
return ret; return ret;
} }
} }
@ -765,8 +786,9 @@ pmix_status_t pmix12_bfrop_pack_app(pmix_buffer_t *buffer, const void *src,
} }
pmix_status_t pmix12_bfrop_pack_kval(pmix_buffer_t *buffer, const void *src, pmix_status_t pmix12_bfrop_pack_kval(pmix_pointer_array_t *regtypes,
int32_t num_vals, pmix_data_type_t type) pmix_buffer_t *buffer, const void *src,
int32_t num_vals, pmix_data_type_t type)
{ {
pmix_kval_t *ptr; pmix_kval_t *ptr;
int32_t i; int32_t i;
@ -776,11 +798,11 @@ pmix_status_t pmix12_bfrop_pack_kval(pmix_buffer_t *buffer, const void *src,
for (i = 0; i < num_vals; ++i) { for (i = 0; i < num_vals; ++i) {
/* pack the key */ /* pack the key */
if (PMIX_SUCCESS != (ret = pmix12_bfrop_pack_string(buffer, &ptr[i].key, 1, PMIX_STRING))) { if (PMIX_SUCCESS != (ret = pmix12_bfrop_pack_string(regtypes, buffer, &ptr[i].key, 1, PMIX_STRING))) {
return ret; return ret;
} }
/* pack the value */ /* pack the value */
if (PMIX_SUCCESS != (ret = pmix12_bfrop_pack_value(buffer, ptr[i].value, 1, ptr[i].value->type))) { if (PMIX_SUCCESS != (ret = pmix12_bfrop_pack_value(regtypes, buffer, ptr[i].value, 1, ptr[i].value->type))) {
return ret; return ret;
} }
} }
@ -788,8 +810,9 @@ pmix_status_t pmix12_bfrop_pack_kval(pmix_buffer_t *buffer, const void *src,
return PMIX_SUCCESS; return PMIX_SUCCESS;
} }
pmix_status_t pmix12_bfrop_pack_array(pmix_buffer_t *buffer, const void *src, pmix_status_t pmix12_bfrop_pack_array(pmix_pointer_array_t *regtypes,
int32_t num_vals, pmix_data_type_t type) pmix_buffer_t *buffer, const void *src,
int32_t num_vals, pmix_data_type_t type)
{ {
pmix_info_array_t *ptr; pmix_info_array_t *ptr;
int32_t i; int32_t i;
@ -799,12 +822,12 @@ pmix_status_t pmix12_bfrop_pack_array(pmix_buffer_t *buffer, const void *src,
for (i = 0; i < num_vals; ++i) { for (i = 0; i < num_vals; ++i) {
/* pack the size */ /* pack the size */
if (PMIX_SUCCESS != (ret = pmix12_bfrop_pack_sizet(buffer, &ptr[i].size, 1, PMIX_SIZE))) { if (PMIX_SUCCESS != (ret = pmix12_bfrop_pack_sizet(regtypes, buffer, &ptr[i].size, 1, PMIX_SIZE))) {
return ret; return ret;
} }
if (0 < ptr[i].size) { if (0 < ptr[i].size) {
/* pack the values */ /* pack the values */
if (PMIX_SUCCESS != (ret = pmix12_bfrop_pack_info(buffer, ptr[i].array, ptr[i].size, PMIX_INFO))) { if (PMIX_SUCCESS != (ret = pmix12_bfrop_pack_info(regtypes, buffer, ptr[i].array, ptr[i].size, PMIX_INFO))) {
return ret; return ret;
} }
} }
@ -813,8 +836,9 @@ pmix_status_t pmix12_bfrop_pack_array(pmix_buffer_t *buffer, const void *src,
return PMIX_SUCCESS; return PMIX_SUCCESS;
} }
pmix_status_t pmix12_bfrop_pack_modex(pmix_buffer_t *buffer, const void *src, pmix_status_t pmix12_bfrop_pack_modex(pmix_pointer_array_t *regtypes,
int32_t num_vals, pmix_data_type_t type) pmix_buffer_t *buffer, const void *src,
int32_t num_vals, pmix_data_type_t type)
{ {
pmix_modex_data_t *ptr; pmix_modex_data_t *ptr;
int32_t i; int32_t i;
@ -823,11 +847,11 @@ pmix_status_t pmix12_bfrop_pack_modex(pmix_buffer_t *buffer, const void *src,
ptr = (pmix_modex_data_t *) src; ptr = (pmix_modex_data_t *) src;
for (i = 0; i < num_vals; ++i) { for (i = 0; i < num_vals; ++i) {
if (PMIX_SUCCESS != (ret = pmix12_bfrop_pack_sizet(buffer, &ptr[i].size, 1, PMIX_SIZE))) { if (PMIX_SUCCESS != (ret = pmix12_bfrop_pack_sizet(regtypes, buffer, &ptr[i].size, 1, PMIX_SIZE))) {
return ret; return ret;
} }
if( 0 < ptr[i].size){ if( 0 < ptr[i].size){
if (PMIX_SUCCESS != (ret = pmix12_bfrop_pack_byte(buffer, ptr[i].blob, ptr[i].size, PMIX_UINT8))) { if (PMIX_SUCCESS != (ret = pmix12_bfrop_pack_byte(regtypes, buffer, ptr[i].blob, ptr[i].size, PMIX_UINT8))) {
return ret; return ret;
} }
} }
@ -835,14 +859,16 @@ pmix_status_t pmix12_bfrop_pack_modex(pmix_buffer_t *buffer, const void *src,
return PMIX_SUCCESS; return PMIX_SUCCESS;
} }
pmix_status_t pmix12_bfrop_pack_persist(pmix_buffer_t *buffer, const void *src, pmix_status_t pmix12_bfrop_pack_persist(pmix_pointer_array_t *regtypes,
int32_t num_vals, pmix_data_type_t type) pmix_buffer_t *buffer, const void *src,
int32_t num_vals, pmix_data_type_t type)
{ {
return pmix12_bfrop_pack_int(buffer, src, num_vals, PMIX_INT); return pmix12_bfrop_pack_int(regtypes, buffer, src, num_vals, PMIX_INT);
} }
pmix_status_t pmix12_bfrop_pack_bo(pmix_buffer_t *buffer, const void *src, pmix_status_t pmix12_bfrop_pack_bo(pmix_pointer_array_t *regtypes,
int32_t num_vals, pmix_data_type_t type) pmix_buffer_t *buffer, const void *src,
int32_t num_vals, pmix_data_type_t type)
{ {
pmix_status_t ret; pmix_status_t ret;
int i; int i;
@ -850,11 +876,11 @@ pmix_status_t pmix12_bfrop_pack_bo(pmix_buffer_t *buffer, const void *src,
bo = (pmix_byte_object_t*)src; bo = (pmix_byte_object_t*)src;
for (i=0; i < num_vals; i++) { for (i=0; i < num_vals; i++) {
if (PMIX_SUCCESS != (ret = pmix12_bfrop_pack_sizet(buffer, &bo[i].size, 1, PMIX_SIZE))) { if (PMIX_SUCCESS != (ret = pmix12_bfrop_pack_sizet(regtypes, buffer, &bo[i].size, 1, PMIX_SIZE))) {
return ret; return ret;
} }
if (0 < bo[i].size) { if (0 < bo[i].size) {
if (PMIX_SUCCESS != (ret = pmix12_bfrop_pack_byte(buffer, bo[i].bytes, bo[i].size, PMIX_BYTE))) { if (PMIX_SUCCESS != (ret = pmix12_bfrop_pack_byte(regtypes, buffer, bo[i].bytes, bo[i].size, PMIX_BYTE))) {
return ret; return ret;
} }
} }
@ -862,15 +888,17 @@ pmix_status_t pmix12_bfrop_pack_bo(pmix_buffer_t *buffer, const void *src,
return PMIX_SUCCESS; return PMIX_SUCCESS;
} }
pmix_status_t pmix12_bfrop_pack_ptr(pmix_buffer_t *buffer, const void *src, pmix_status_t pmix12_bfrop_pack_ptr(pmix_pointer_array_t *regtypes,
int32_t num_vals, pmix_data_type_t type) pmix_buffer_t *buffer, const void *src,
int32_t num_vals, pmix_data_type_t type)
{ {
/* v1.x has no concept of packing a pointer, so just return */ /* v1.x has no concept of packing a pointer, so just return */
return PMIX_SUCCESS; return PMIX_SUCCESS;
} }
pmix_status_t pmix12_bfrop_pack_scope(pmix_buffer_t *buffer, const void *src, pmix_status_t pmix12_bfrop_pack_scope(pmix_pointer_array_t *regtypes,
int32_t num_vals, pmix_data_type_t type) pmix_buffer_t *buffer, const void *src,
int32_t num_vals, pmix_data_type_t type)
{ {
pmix_scope_t *scope = (pmix_scope_t*)src; pmix_scope_t *scope = (pmix_scope_t*)src;
unsigned int *v1scope; unsigned int *v1scope;
@ -885,21 +913,23 @@ pmix_status_t pmix12_bfrop_pack_scope(pmix_buffer_t *buffer, const void *src,
for (i=0; i < num_vals; i++) { for (i=0; i < num_vals; i++) {
v1scope[i] = (unsigned int)scope[i]; v1scope[i] = (unsigned int)scope[i];
} }
ret = pmix12_bfrop_pack_int(buffer, (void*)v1scope, num_vals, PMIX_UINT); ret = pmix12_bfrop_pack_int(regtypes, buffer, (void*)v1scope, num_vals, PMIX_UINT);
free(v1scope); free(v1scope);
return ret; return ret;
} }
pmix_status_t pmix12_bfrop_pack_status(pmix_buffer_t *buffer, const void *src, pmix_status_t pmix12_bfrop_pack_status(pmix_pointer_array_t *regtypes,
int32_t num_vals, pmix_data_type_t type) pmix_buffer_t *buffer, const void *src,
int32_t num_vals, pmix_data_type_t type)
{ {
/* v1.2 declares pmix_status_t as an enum, which translates to int and /* v1.2 declares pmix_status_t as an enum, which translates to int and
* matches that of v2 */ * matches that of v2 */
return pmix12_bfrop_pack_int(buffer, src, num_vals, PMIX_INT); return pmix12_bfrop_pack_int(regtypes, buffer, src, num_vals, PMIX_INT);
} }
pmix_status_t pmix12_bfrop_pack_range(pmix_buffer_t *buffer, const void *src, pmix_status_t pmix12_bfrop_pack_range(pmix_pointer_array_t *regtypes,
int32_t num_vals, pmix_data_type_t type) pmix_buffer_t *buffer, const void *src,
int32_t num_vals, pmix_data_type_t type)
{ {
pmix_data_range_t *range = (pmix_data_range_t*)src; pmix_data_range_t *range = (pmix_data_range_t*)src;
unsigned int *v1range; unsigned int *v1range;
@ -914,13 +944,14 @@ pmix_status_t pmix12_bfrop_pack_range(pmix_buffer_t *buffer, const void *src,
for (i=0; i < num_vals; i++) { for (i=0; i < num_vals; i++) {
v1range[i] = (unsigned int)range[i]; v1range[i] = (unsigned int)range[i];
} }
ret = pmix12_bfrop_pack_int(buffer, (void*)v1range, num_vals, PMIX_UINT); ret = pmix12_bfrop_pack_int(regtypes, buffer, (void*)v1range, num_vals, PMIX_UINT);
free(v1range); free(v1range);
return ret; return ret;
} }
pmix_status_t pmix12_bfrop_pack_cmd(pmix_buffer_t *buffer, const void *src, pmix_status_t pmix12_bfrop_pack_cmd(pmix_pointer_array_t *regtypes,
int32_t num_vals, pmix_data_type_t type) pmix_buffer_t *buffer, const void *src,
int32_t num_vals, pmix_data_type_t type)
{ {
pmix_cmd_t *cmd = (pmix_cmd_t*)src; pmix_cmd_t *cmd = (pmix_cmd_t*)src;
int *v1cmd; int *v1cmd;
@ -935,48 +966,54 @@ pmix_status_t pmix12_bfrop_pack_cmd(pmix_buffer_t *buffer, const void *src,
for (i=0; i < num_vals; i++) { for (i=0; i < num_vals; i++) {
v1cmd[i] = cmd[i]; v1cmd[i] = cmd[i];
} }
ret = pmix12_bfrop_pack_int(buffer, (void*)v1cmd, num_vals, PMIX_INT); ret = pmix12_bfrop_pack_int(regtypes, buffer, (void*)v1cmd, num_vals, PMIX_INT);
free(v1cmd); free(v1cmd);
return ret; return ret;
} }
pmix_status_t pmix12_bfrop_pack_info_directives(pmix_buffer_t *buffer, const void *src, pmix_status_t pmix12_bfrop_pack_info_directives(pmix_pointer_array_t *regtypes,
int32_t num_vals, pmix_data_type_t type) pmix_buffer_t *buffer, const void *src,
int32_t num_vals, pmix_data_type_t type)
{ {
/* v1.x has no concept of an info directive, so just return */ /* v1.x has no concept of an info directive, so just return */
return PMIX_SUCCESS; return PMIX_SUCCESS;
} }
pmix_status_t pmix12_bfrop_pack_proc_state(pmix_buffer_t *buffer, const void *src, pmix_status_t pmix12_bfrop_pack_proc_state(pmix_pointer_array_t *regtypes,
int32_t num_vals, pmix_data_type_t type) pmix_buffer_t *buffer, const void *src,
int32_t num_vals, pmix_data_type_t type)
{ {
/* v1.x has no concept of proc state, so just return */ /* v1.x has no concept of proc state, so just return */
return PMIX_SUCCESS; return PMIX_SUCCESS;
} }
pmix_status_t pmix12_bfrop_pack_darray(pmix_buffer_t *buffer, const void *src, pmix_status_t pmix12_bfrop_pack_darray(pmix_pointer_array_t *regtypes,
pmix_buffer_t *buffer, const void *src,
int32_t num_vals, pmix_data_type_t type)
{
return PMIX_ERR_NOT_SUPPORTED;
}
pmix_status_t pmix12_bfrop_pack_proc_info(pmix_pointer_array_t *regtypes,
pmix_buffer_t *buffer, const void *src,
int32_t num_vals, pmix_data_type_t type)
{
return PMIX_ERR_NOT_SUPPORTED;
}
pmix_status_t pmix12_bfrop_pack_query(pmix_pointer_array_t *regtypes,
pmix_buffer_t *buffer, const void *src,
int32_t num_vals, pmix_data_type_t type) int32_t num_vals, pmix_data_type_t type)
{ {
return PMIX_ERR_NOT_SUPPORTED; return PMIX_ERR_NOT_SUPPORTED;
} }
pmix_status_t pmix12_bfrop_pack_proc_info(pmix_buffer_t *buffer, const void *src, pmix_status_t pmix12_bfrop_pack_rank(pmix_pointer_array_t *regtypes,
int32_t num_vals, pmix_data_type_t type) pmix_buffer_t *buffer, const void *src,
{
return PMIX_ERR_NOT_SUPPORTED;
}
pmix_status_t pmix12_bfrop_pack_query(pmix_buffer_t *buffer, const void *src,
int32_t num_vals, pmix_data_type_t type) int32_t num_vals, pmix_data_type_t type)
{
return PMIX_ERR_NOT_SUPPORTED;
}
pmix_status_t pmix12_bfrop_pack_rank(pmix_buffer_t *buffer, const void *src,
int32_t num_vals, pmix_data_type_t type)
{ {
/* v1 rank is just an int, not a separate data type - it is defined /* v1 rank is just an int, not a separate data type - it is defined
* to be an unint32 in v2 */ * to be an unint32 in v2 */
return pmix12_bfrop_pack_int(buffer, src, num_vals, PMIX_INT); return pmix12_bfrop_pack_int(regtypes, buffer, src, num_vals, PMIX_INT);
} }

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

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

@ -14,6 +14,8 @@
* Copyright (c) 2011-2013 Los Alamos National Security, LLC. All rights * Copyright (c) 2011-2013 Los Alamos National Security, LLC. All rights
* reserved. * reserved.
* Copyright (c) 2013-2017 Intel, Inc. All rights reserved. * Copyright (c) 2013-2017 Intel, Inc. All rights reserved.
* Copyright (c) 2019 Mellanox Technologies, Inc.
* All rights reserved.
* $COPYRIGHT$ * $COPYRIGHT$
* *
* Additional copyrights may follow * Additional copyrights may follow
@ -436,20 +438,22 @@ pmix_data_type_t pmix20_v21_to_v20_datatype(pmix_data_type_t v21type)
return v20type; return v20type;
} }
pmix_status_t pmix20_bfrop_store_data_type(pmix_buffer_t *buffer, pmix_data_type_t type) pmix_status_t pmix20_bfrop_store_data_type(pmix_pointer_array_t *regtypes,
pmix_buffer_t *buffer, pmix_data_type_t type)
{ {
pmix_data_type_t v20type; pmix_data_type_t v20type;
v20type = pmix20_v21_to_v20_datatype(type); v20type = pmix20_v21_to_v20_datatype(type);
return pmix20_bfrop_pack_datatype(buffer, &v20type, 1, PMIX_DATA_TYPE); return pmix20_bfrop_pack_datatype(regtypes, buffer, &v20type, 1, PMIX_DATA_TYPE);
} }
pmix_status_t pmix20_bfrop_get_data_type(pmix_buffer_t *buffer, pmix_data_type_t *type) pmix_status_t pmix20_bfrop_get_data_type(pmix_pointer_array_t *regtypes,
pmix_buffer_t *buffer, pmix_data_type_t *type)
{ {
int32_t n=1; int32_t n=1;
pmix_status_t rc; pmix_status_t rc;
rc = pmix20_bfrop_unpack_datatype(buffer, type, &n, PMIX_DATA_TYPE); rc = pmix20_bfrop_unpack_datatype(regtypes, buffer, type, &n, PMIX_DATA_TYPE);
return rc; return rc;
} }

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

@ -15,6 +15,8 @@
* Copyright (c) 2015 Research Organization for Information Science * Copyright (c) 2015 Research Organization for Information Science
* and Technology (RIST). All rights reserved. * and Technology (RIST). All rights reserved.
* Copyright (c) 2016 IBM Corporation. All rights reserved. * Copyright (c) 2016 IBM Corporation. All rights reserved.
* Copyright (c) 2019 Mellanox Technologies, Inc.
* All rights reserved.
* $COPYRIGHT$ * $COPYRIGHT$
* *
* Additional copyrights may follow * Additional copyrights may follow
@ -123,176 +125,254 @@ pmix_value_cmp_t pmix20_bfrop_value_cmp(pmix_value_t *p,
/* /*
* Specialized functions * Specialized functions
*/ */
pmix_status_t pmix20_bfrop_pack_buffer(pmix_buffer_t *buffer, const void *src, pmix_status_t pmix20_bfrop_pack_buffer(pmix_pointer_array_t *regtypes,
int32_t num_vals, pmix_data_type_t type); pmix_buffer_t *buffer,
const void *src, int32_t num_vals,
pmix_data_type_t type);
pmix_status_t pmix20_bfrop_unpack_buffer(pmix_buffer_t *buffer, void *dst, pmix_status_t pmix20_bfrop_unpack_buffer(pmix_pointer_array_t *regtypes,
pmix_buffer_t *buffer, void *dst,
int32_t *num_vals, pmix_data_type_t type); int32_t *num_vals, pmix_data_type_t type);
/* /*
* Internal pack functions * Internal pack functions
*/ */
pmix_status_t pmix20_bfrop_pack_bool(pmix_buffer_t *buffer, const void *src, pmix_status_t pmix20_bfrop_pack_bool(pmix_pointer_array_t *regtypes,
pmix_buffer_t *buffer, const void *src,
int32_t num_vals, pmix_data_type_t type); int32_t num_vals, pmix_data_type_t type);
pmix_status_t pmix20_bfrop_pack_byte(pmix_buffer_t *buffer, const void *src, pmix_status_t pmix20_bfrop_pack_byte(pmix_pointer_array_t *regtypes,
pmix_buffer_t *buffer, const void *src,
int32_t num_vals, pmix_data_type_t type); int32_t num_vals, pmix_data_type_t type);
pmix_status_t pmix20_bfrop_pack_string(pmix_buffer_t *buffer, const void *src, pmix_status_t pmix20_bfrop_pack_string(pmix_pointer_array_t *regtypes,
pmix_buffer_t *buffer, const void *src,
int32_t num_vals, pmix_data_type_t type); int32_t num_vals, pmix_data_type_t type);
pmix_status_t pmix20_bfrop_pack_sizet(pmix_buffer_t *buffer, const void *src, pmix_status_t pmix20_bfrop_pack_sizet(pmix_pointer_array_t *regtypes,
pmix_buffer_t *buffer, const void *src,
int32_t num_vals, pmix_data_type_t type); int32_t num_vals, pmix_data_type_t type);
pmix_status_t pmix20_bfrop_pack_pid(pmix_buffer_t *buffer, const void *src, pmix_status_t pmix20_bfrop_pack_pid(pmix_pointer_array_t *regtypes,
pmix_buffer_t *buffer, const void *src,
int32_t num_vals, pmix_data_type_t type); int32_t num_vals, pmix_data_type_t type);
pmix_status_t pmix20_bfrop_pack_int(pmix_buffer_t *buffer, const void *src, pmix_status_t pmix20_bfrop_pack_int(pmix_pointer_array_t *regtypes,
pmix_buffer_t *buffer, const void *src,
int32_t num_vals, pmix_data_type_t type); int32_t num_vals, pmix_data_type_t type);
pmix_status_t pmix20_bfrop_pack_int16(pmix_buffer_t *buffer, const void *src, pmix_status_t pmix20_bfrop_pack_int16(pmix_pointer_array_t *regtypes,
pmix_buffer_t *buffer, const void *src,
int32_t num_vals, pmix_data_type_t type); int32_t num_vals, pmix_data_type_t type);
pmix_status_t pmix20_bfrop_pack_int32(pmix_buffer_t *buffer, const void *src, pmix_status_t pmix20_bfrop_pack_int32(pmix_pointer_array_t *regtypes,
pmix_buffer_t *buffer, const void *src,
int32_t num_vals, pmix_data_type_t type); int32_t num_vals, pmix_data_type_t type);
pmix_status_t pmix20_bfrop_pack_datatype(pmix_buffer_t *buffer, const void *src, pmix_status_t pmix20_bfrop_pack_datatype(pmix_pointer_array_t *regtypes,
pmix_buffer_t *buffer, const void *src,
int32_t num_vals, pmix_data_type_t type); int32_t num_vals, pmix_data_type_t type);
pmix_status_t pmix20_bfrop_pack_int64(pmix_buffer_t *buffer, const void *src, pmix_status_t pmix20_bfrop_pack_int64(pmix_pointer_array_t *regtypes,
pmix_buffer_t *buffer, const void *src,
int32_t num_vals, pmix_data_type_t type); int32_t num_vals, pmix_data_type_t type);
pmix_status_t pmix20_bfrop_pack_float(pmix_buffer_t *buffer, const void *src, pmix_status_t pmix20_bfrop_pack_float(pmix_pointer_array_t *regtypes,
pmix_buffer_t *buffer, const void *src,
int32_t num_vals, pmix_data_type_t type); int32_t num_vals, pmix_data_type_t type);
pmix_status_t pmix20_bfrop_pack_double(pmix_buffer_t *buffer, const void *src, pmix_status_t pmix20_bfrop_pack_double(pmix_pointer_array_t *regtypes,
pmix_buffer_t *buffer, const void *src,
int32_t num_vals, pmix_data_type_t type); int32_t num_vals, pmix_data_type_t type);
pmix_status_t pmix20_bfrop_pack_time(pmix_buffer_t *buffer, const void *src, pmix_status_t pmix20_bfrop_pack_time(pmix_pointer_array_t *regtypes,
pmix_buffer_t *buffer, const void *src,
int32_t num_vals, pmix_data_type_t type); int32_t num_vals, pmix_data_type_t type);
pmix_status_t pmix20_bfrop_pack_timeval(pmix_buffer_t *buffer, const void *src, pmix_status_t pmix20_bfrop_pack_timeval(pmix_pointer_array_t *regtypes,
pmix_buffer_t *buffer, const void *src,
int32_t num_vals, pmix_data_type_t type); int32_t num_vals, pmix_data_type_t type);
pmix_status_t pmix20_bfrop_pack_time(pmix_buffer_t *buffer, const void *src, pmix_status_t pmix20_bfrop_pack_time(pmix_pointer_array_t *regtypes,
pmix_buffer_t *buffer, const void *src,
int32_t num_vals, pmix_data_type_t type); int32_t num_vals, pmix_data_type_t type);
pmix_status_t pmix20_bfrop_pack_status(pmix_buffer_t *buffer, const void *src, pmix_status_t pmix20_bfrop_pack_status(pmix_pointer_array_t *regtypes,
pmix_buffer_t *buffer, const void *src,
int32_t num_vals, pmix_data_type_t type); int32_t num_vals, pmix_data_type_t type);
pmix_status_t pmix20_bfrop_pack_value(pmix_buffer_t *buffer, const void *src, pmix_status_t pmix20_bfrop_pack_value(pmix_pointer_array_t *regtypes,
pmix_buffer_t *buffer, const void *src,
int32_t num_vals, pmix_data_type_t type); int32_t num_vals, pmix_data_type_t type);
pmix_status_t pmix20_bfrop_pack_proc(pmix_buffer_t *buffer, const void *src, pmix_status_t pmix20_bfrop_pack_proc(pmix_pointer_array_t *regtypes,
pmix_buffer_t *buffer, const void *src,
int32_t num_vals, pmix_data_type_t type); int32_t num_vals, pmix_data_type_t type);
pmix_status_t pmix20_bfrop_pack_app(pmix_buffer_t *buffer, const void *src, pmix_status_t pmix20_bfrop_pack_app(pmix_pointer_array_t *regtypes,
pmix_buffer_t *buffer, const void *src,
int32_t num_vals, pmix_data_type_t type); int32_t num_vals, pmix_data_type_t type);
pmix_status_t pmix20_bfrop_pack_info(pmix_buffer_t *buffer, const void *src, pmix_status_t pmix20_bfrop_pack_info(pmix_pointer_array_t *regtypes,
pmix_buffer_t *buffer, const void *src,
int32_t num_vals, pmix_data_type_t type); int32_t num_vals, pmix_data_type_t type);
pmix_status_t pmix20_bfrop_pack_buf(pmix_buffer_t *buffer, const void *src, pmix_status_t pmix20_bfrop_pack_buf(pmix_pointer_array_t *regtypes,
pmix_buffer_t *buffer, const void *src,
int32_t num_vals, pmix_data_type_t type); int32_t num_vals, pmix_data_type_t type);
pmix_status_t pmix20_bfrop_pack_kval(pmix_buffer_t *buffer, const void *src, pmix_status_t pmix20_bfrop_pack_kval(pmix_pointer_array_t *regtypes,
pmix_buffer_t *buffer, const void *src,
int32_t num_vals, pmix_data_type_t type); int32_t num_vals, pmix_data_type_t type);
pmix_status_t pmix20_bfrop_pack_modex(pmix_buffer_t *buffer, const void *src, pmix_status_t pmix20_bfrop_pack_modex(pmix_pointer_array_t *regtypes,
pmix_buffer_t *buffer, const void *src,
int32_t num_vals, pmix_data_type_t type); int32_t num_vals, pmix_data_type_t type);
pmix_status_t pmix20_bfrop_pack_persist(pmix_buffer_t *buffer, const void *src, pmix_status_t pmix20_bfrop_pack_persist(pmix_pointer_array_t *regtypes,
pmix_buffer_t *buffer, const void *src,
int32_t num_vals, pmix_data_type_t type); int32_t num_vals, pmix_data_type_t type);
pmix_status_t pmix20_bfrop_pack_scope(pmix_buffer_t *buffer, const void *src, pmix_status_t pmix20_bfrop_pack_scope(pmix_pointer_array_t *regtypes,
pmix_buffer_t *buffer, const void *src,
int32_t num_vals, pmix_data_type_t type); int32_t num_vals, pmix_data_type_t type);
pmix_status_t pmix20_bfrop_pack_range(pmix_buffer_t *buffer, const void *src, pmix_status_t pmix20_bfrop_pack_range(pmix_pointer_array_t *regtypes,
pmix_buffer_t *buffer, const void *src,
int32_t num_vals, pmix_data_type_t type); int32_t num_vals, pmix_data_type_t type);
pmix_status_t pmix20_bfrop_pack_cmd(pmix_buffer_t *buffer, const void *src, pmix_status_t pmix20_bfrop_pack_cmd(pmix_pointer_array_t *regtypes,
pmix_buffer_t *buffer, const void *src,
int32_t num_vals, pmix_data_type_t type); int32_t num_vals, pmix_data_type_t type);
pmix_status_t pmix20_bfrop_pack_infodirs(pmix_buffer_t *buffer, const void *src, pmix_status_t pmix20_bfrop_pack_infodirs(pmix_pointer_array_t *regtypes,
pmix_buffer_t *buffer, const void *src,
int32_t num_vals, pmix_data_type_t type); int32_t num_vals, pmix_data_type_t type);
pmix_status_t pmix20_bfrop_pack_bo(pmix_buffer_t *buffer, const void *src, pmix_status_t pmix20_bfrop_pack_bo(pmix_pointer_array_t *regtypes,
pmix_buffer_t *buffer, const void *src,
int32_t num_vals, pmix_data_type_t type); int32_t num_vals, pmix_data_type_t type);
pmix_status_t pmix20_bfrop_pack_pdata(pmix_buffer_t *buffer, const void *src, pmix_status_t pmix20_bfrop_pack_pdata(pmix_pointer_array_t *regtypes,
pmix_buffer_t *buffer, const void *src,
int32_t num_vals, pmix_data_type_t type); int32_t num_vals, pmix_data_type_t type);
pmix_status_t pmix20_bfrop_pack_ptr(pmix_buffer_t *buffer, const void *src, pmix_status_t pmix20_bfrop_pack_ptr(pmix_pointer_array_t *regtypes,
pmix_buffer_t *buffer, const void *src,
int32_t num_vals, pmix_data_type_t type); int32_t num_vals, pmix_data_type_t type);
pmix_status_t pmix20_bfrop_pack_pstate(pmix_buffer_t *buffer, const void *src, pmix_status_t pmix20_bfrop_pack_pstate(pmix_pointer_array_t *regtypes,
pmix_buffer_t *buffer, const void *src,
int32_t num_vals, pmix_data_type_t type); int32_t num_vals, pmix_data_type_t type);
pmix_status_t pmix20_bfrop_pack_pinfo(pmix_buffer_t *buffer, const void *src, pmix_status_t pmix20_bfrop_pack_pinfo(pmix_pointer_array_t *regtypes,
pmix_buffer_t *buffer, const void *src,
int32_t num_vals, pmix_data_type_t type); int32_t num_vals, pmix_data_type_t type);
pmix_status_t pmix20_bfrop_pack_darray(pmix_buffer_t *buffer, const void *src, pmix_status_t pmix20_bfrop_pack_darray(pmix_pointer_array_t *regtypes,
pmix_buffer_t *buffer, const void *src,
int32_t num_vals, pmix_data_type_t type); int32_t num_vals, pmix_data_type_t type);
pmix_status_t pmix20_bfrop_pack_query(pmix_buffer_t *buffer, const void *src, pmix_status_t pmix20_bfrop_pack_query(pmix_pointer_array_t *regtypes,
pmix_buffer_t *buffer, const void *src,
int32_t num_vals, pmix_data_type_t type); int32_t num_vals, pmix_data_type_t type);
pmix_status_t pmix20_bfrop_pack_rank(pmix_buffer_t *buffer, const void *src, pmix_status_t pmix20_bfrop_pack_rank(pmix_pointer_array_t *regtypes,
pmix_buffer_t *buffer, const void *src,
int32_t num_vals, pmix_data_type_t type); int32_t num_vals, pmix_data_type_t type);
pmix_status_t pmix20_bfrop_pack_alloc_directive(pmix_buffer_t *buffer, const void *src, pmix_status_t pmix20_bfrop_pack_alloc_directive(pmix_pointer_array_t *regtypes,
pmix_buffer_t *buffer, const void *src,
int32_t num_vals, pmix_data_type_t type); int32_t num_vals, pmix_data_type_t type);
/**** DEPRECATED ****/ /**** DEPRECATED ****/
pmix_status_t pmix20_bfrop_pack_array(pmix_buffer_t *buffer, const void *src, pmix_status_t pmix20_bfrop_pack_array(pmix_pointer_array_t *regtypes,
pmix_buffer_t *buffer, const void *src,
int32_t num_vals, pmix_data_type_t type); int32_t num_vals, pmix_data_type_t type);
/********************/ /********************/
/* /*
* Internal unpack functions * Internal unpack functions
*/ */
pmix_status_t pmix20_bfrop_unpack_bool(pmix_buffer_t *buffer, void *dest, pmix_status_t pmix20_bfrop_unpack_bool(pmix_pointer_array_t *regtypes,
pmix_buffer_t *buffer, void *dest,
int32_t *num_vals, pmix_data_type_t type); int32_t *num_vals, pmix_data_type_t type);
pmix_status_t pmix20_bfrop_unpack_byte(pmix_buffer_t *buffer, void *dest, pmix_status_t pmix20_bfrop_unpack_byte(pmix_pointer_array_t *regtypes,
pmix_buffer_t *buffer, void *dest,
int32_t *num_vals, pmix_data_type_t type); int32_t *num_vals, pmix_data_type_t type);
pmix_status_t pmix20_bfrop_unpack_string(pmix_buffer_t *buffer, void *dest, pmix_status_t pmix20_bfrop_unpack_string(pmix_pointer_array_t *regtypes,
pmix_buffer_t *buffer, void *dest,
int32_t *num_vals, pmix_data_type_t type); int32_t *num_vals, pmix_data_type_t type);
pmix_status_t pmix20_bfrop_unpack_sizet(pmix_buffer_t *buffer, void *dest, pmix_status_t pmix20_bfrop_unpack_sizet(pmix_pointer_array_t *regtypes,
pmix_buffer_t *buffer, void *dest,
int32_t *num_vals, pmix_data_type_t type); int32_t *num_vals, pmix_data_type_t type);
pmix_status_t pmix20_bfrop_unpack_pid(pmix_buffer_t *buffer, void *dest, pmix_status_t pmix20_bfrop_unpack_pid(pmix_pointer_array_t *regtypes,
pmix_buffer_t *buffer, void *dest,
int32_t *num_vals, pmix_data_type_t type); int32_t *num_vals, pmix_data_type_t type);
pmix_status_t pmix20_bfrop_unpack_int(pmix_buffer_t *buffer, void *dest, pmix_status_t pmix20_bfrop_unpack_int(pmix_pointer_array_t *regtypes,
pmix_buffer_t *buffer, void *dest,
int32_t *num_vals, pmix_data_type_t type); int32_t *num_vals, pmix_data_type_t type);
pmix_status_t pmix20_bfrop_unpack_int16(pmix_buffer_t *buffer, void *dest, pmix_status_t pmix20_bfrop_unpack_int16(pmix_pointer_array_t *regtypes,
pmix_buffer_t *buffer, void *dest,
int32_t *num_vals, pmix_data_type_t type); int32_t *num_vals, pmix_data_type_t type);
pmix_status_t pmix20_bfrop_unpack_int32(pmix_buffer_t *buffer, void *dest, pmix_status_t pmix20_bfrop_unpack_int32(pmix_pointer_array_t *regtypes,
pmix_buffer_t *buffer, void *dest,
int32_t *num_vals, pmix_data_type_t type); int32_t *num_vals, pmix_data_type_t type);
pmix_status_t pmix20_bfrop_unpack_datatype(pmix_buffer_t *buffer, void *dest, pmix_status_t pmix20_bfrop_unpack_datatype(pmix_pointer_array_t *regtypes,
pmix_buffer_t *buffer, void *dest,
int32_t *num_vals, pmix_data_type_t type); int32_t *num_vals, pmix_data_type_t type);
pmix_status_t pmix20_bfrop_unpack_int64(pmix_buffer_t *buffer, void *dest, pmix_status_t pmix20_bfrop_unpack_int64(pmix_pointer_array_t *regtypes,
pmix_buffer_t *buffer, void *dest,
int32_t *num_vals, pmix_data_type_t type); int32_t *num_vals, pmix_data_type_t type);
pmix_status_t pmix20_bfrop_unpack_float(pmix_buffer_t *buffer, void *dest, pmix_status_t pmix20_bfrop_unpack_float(pmix_pointer_array_t *regtypes,
pmix_buffer_t *buffer, void *dest,
int32_t *num_vals, pmix_data_type_t type); int32_t *num_vals, pmix_data_type_t type);
pmix_status_t pmix20_bfrop_unpack_double(pmix_buffer_t *buffer, void *dest, pmix_status_t pmix20_bfrop_unpack_double(pmix_pointer_array_t *regtypes,
pmix_buffer_t *buffer, void *dest,
int32_t *num_vals, pmix_data_type_t type); int32_t *num_vals, pmix_data_type_t type);
pmix_status_t pmix20_bfrop_unpack_timeval(pmix_buffer_t *buffer, void *dest, pmix_status_t pmix20_bfrop_unpack_timeval(pmix_pointer_array_t *regtypes,
pmix_buffer_t *buffer, void *dest,
int32_t *num_vals, pmix_data_type_t type); int32_t *num_vals, pmix_data_type_t type);
pmix_status_t pmix20_bfrop_unpack_time(pmix_buffer_t *buffer, void *dest, pmix_status_t pmix20_bfrop_unpack_time(pmix_pointer_array_t *regtypes,
pmix_buffer_t *buffer, void *dest,
int32_t *num_vals, pmix_data_type_t type); int32_t *num_vals, pmix_data_type_t type);
pmix_status_t pmix20_bfrop_unpack_status(pmix_buffer_t *buffer, void *dest, pmix_status_t pmix20_bfrop_unpack_status(pmix_pointer_array_t *regtypes,
int32_t *num_vals, pmix_data_type_t type); pmix_buffer_t *buffer, void *dest,
pmix_status_t pmix20_bfrop_unpack_value(pmix_buffer_t *buffer, void *dest,
int32_t *num_vals, pmix_data_type_t type);
pmix_status_t pmix20_bfrop_unpack_proc(pmix_buffer_t *buffer, void *dest,
int32_t *num_vals, pmix_data_type_t type);
pmix_status_t pmix20_bfrop_unpack_app(pmix_buffer_t *buffer, void *dest,
int32_t *num_vals, pmix_data_type_t type);
pmix_status_t pmix20_bfrop_unpack_info(pmix_buffer_t *buffer, void *dest,
int32_t *num_vals, pmix_data_type_t type);
pmix_status_t pmix20_bfrop_unpack_buf(pmix_buffer_t *buffer, void *dest,
int32_t *num_vals, pmix_data_type_t type);
pmix_status_t pmix20_bfrop_unpack_kval(pmix_buffer_t *buffer, void *dest,
int32_t *num_vals, pmix_data_type_t type);
pmix_status_t pmix20_bfrop_unpack_modex(pmix_buffer_t *buffer, void *dest,
int32_t *num_vals, pmix_data_type_t type);
pmix_status_t pmix20_bfrop_unpack_persist(pmix_buffer_t *buffer, void *dest,
int32_t *num_vals, pmix_data_type_t type);
pmix_status_t pmix20_bfrop_unpack_scope(pmix_buffer_t *buffer, void *dest,
int32_t *num_vals, pmix_data_type_t type);
pmix_status_t pmix20_bfrop_unpack_range(pmix_buffer_t *buffer, void *dest,
int32_t *num_vals, pmix_data_type_t type);
pmix_status_t pmix20_bfrop_unpack_cmd(pmix_buffer_t *buffer, void *dest,
int32_t *num_vals, pmix_data_type_t type);
pmix_status_t pmix20_bfrop_unpack_infodirs(pmix_buffer_t *buffer, void *dest,
int32_t *num_vals, pmix_data_type_t type); int32_t *num_vals, pmix_data_type_t type);
pmix_status_t pmix20_bfrop_unpack_bo(pmix_buffer_t *buffer, void *dest, pmix_status_t pmix20_bfrop_unpack_value(pmix_pointer_array_t *regtypes,
pmix_buffer_t *buffer, void *dest,
int32_t *num_vals, pmix_data_type_t type);
pmix_status_t pmix20_bfrop_unpack_proc(pmix_pointer_array_t *regtypes,
pmix_buffer_t *buffer, void *dest,
int32_t *num_vals, pmix_data_type_t type);
pmix_status_t pmix20_bfrop_unpack_app(pmix_pointer_array_t *regtypes,
pmix_buffer_t *buffer, void *dest,
int32_t *num_vals, pmix_data_type_t type);
pmix_status_t pmix20_bfrop_unpack_info(pmix_pointer_array_t *regtypes,
pmix_buffer_t *buffer, void *dest,
int32_t *num_vals, pmix_data_type_t type);
pmix_status_t pmix20_bfrop_unpack_buf(pmix_pointer_array_t *regtypes,
pmix_buffer_t *buffer, void *dest,
int32_t *num_vals, pmix_data_type_t type);
pmix_status_t pmix20_bfrop_unpack_kval(pmix_pointer_array_t *regtypes,
pmix_buffer_t *buffer, void *dest,
int32_t *num_vals, pmix_data_type_t type);
pmix_status_t pmix20_bfrop_unpack_modex(pmix_pointer_array_t *regtypes,
pmix_buffer_t *buffer, void *dest,
int32_t *num_vals, pmix_data_type_t type);
pmix_status_t pmix20_bfrop_unpack_persist(pmix_pointer_array_t *regtypes,
pmix_buffer_t *buffer, void *dest,
int32_t *num_vals, pmix_data_type_t type);
pmix_status_t pmix20_bfrop_unpack_scope(pmix_pointer_array_t *regtypes,
pmix_buffer_t *buffer, void *dest,
int32_t *num_vals, pmix_data_type_t type);
pmix_status_t pmix20_bfrop_unpack_range(pmix_pointer_array_t *regtypes,
pmix_buffer_t *buffer, void *dest,
int32_t *num_vals, pmix_data_type_t type);
pmix_status_t pmix20_bfrop_unpack_cmd(pmix_pointer_array_t *regtypes,
pmix_buffer_t *buffer, void *dest,
int32_t *num_vals, pmix_data_type_t type);
pmix_status_t pmix20_bfrop_unpack_infodirs(pmix_pointer_array_t *regtypes,
pmix_buffer_t *buffer, void *dest,
int32_t *num_vals, pmix_data_type_t type);
pmix_status_t pmix20_bfrop_unpack_bo(pmix_pointer_array_t *regtypes,
pmix_buffer_t *buffer, void *dest,
int32_t *num_vals, pmix_data_type_t type); int32_t *num_vals, pmix_data_type_t type);
pmix_status_t pmix20_bfrop_unpack_pdata(pmix_buffer_t *buffer, void *dest, pmix_status_t pmix20_bfrop_unpack_pdata(pmix_pointer_array_t *regtypes,
pmix_buffer_t *buffer, void *dest,
int32_t *num_vals, pmix_data_type_t type); int32_t *num_vals, pmix_data_type_t type);
pmix_status_t pmix20_bfrop_unpack_ptr(pmix_buffer_t *buffer, void *dest, pmix_status_t pmix20_bfrop_unpack_ptr(pmix_pointer_array_t *regtypes,
pmix_buffer_t *buffer, void *dest,
int32_t *num_vals, pmix_data_type_t type); int32_t *num_vals, pmix_data_type_t type);
pmix_status_t pmix20_bfrop_unpack_pstate(pmix_buffer_t *buffer, void *dest, pmix_status_t pmix20_bfrop_unpack_pstate(pmix_pointer_array_t *regtypes,
pmix_buffer_t *buffer, void *dest,
int32_t *num_vals, pmix_data_type_t type); int32_t *num_vals, pmix_data_type_t type);
pmix_status_t pmix20_bfrop_unpack_pinfo(pmix_buffer_t *buffer, void *dest, pmix_status_t pmix20_bfrop_unpack_pinfo(pmix_pointer_array_t *regtypes,
pmix_buffer_t *buffer, void *dest,
int32_t *num_vals, pmix_data_type_t type); int32_t *num_vals, pmix_data_type_t type);
pmix_status_t pmix20_bfrop_unpack_darray(pmix_buffer_t *buffer, void *dest, pmix_status_t pmix20_bfrop_unpack_darray(pmix_pointer_array_t *regtypes,
pmix_buffer_t *buffer, void *dest,
int32_t *num_vals, pmix_data_type_t type); int32_t *num_vals, pmix_data_type_t type);
pmix_status_t pmix20_bfrop_unpack_query(pmix_buffer_t *buffer, void *dest, pmix_status_t pmix20_bfrop_unpack_query(pmix_pointer_array_t *regtypes,
pmix_buffer_t *buffer, void *dest,
int32_t *num_vals, pmix_data_type_t type); int32_t *num_vals, pmix_data_type_t type);
pmix_status_t pmix20_bfrop_unpack_rank(pmix_buffer_t *buffer, void *dest, pmix_status_t pmix20_bfrop_unpack_rank(pmix_pointer_array_t *regtypes,
pmix_buffer_t *buffer, void *dest,
int32_t *num_vals, pmix_data_type_t type); int32_t *num_vals, pmix_data_type_t type);
pmix_status_t pmix20_bfrop_unpack_alloc_directive(pmix_buffer_t *buffer, void *dest, pmix_status_t pmix20_bfrop_unpack_alloc_directive(pmix_pointer_array_t *regtypes,
pmix_buffer_t *buffer, void *dest,
int32_t *num_vals, pmix_data_type_t type); int32_t *num_vals, pmix_data_type_t type);
/**** DEPRECATED ****/ /**** DEPRECATED ****/
pmix_status_t pmix20_bfrop_unpack_array(pmix_buffer_t *buffer, void *dest, pmix_status_t pmix20_bfrop_unpack_array(pmix_pointer_array_t *regtypes,
pmix_buffer_t *buffer, void *dest,
int32_t *num_vals, pmix_data_type_t type); int32_t *num_vals, pmix_data_type_t type);
/********************/ /********************/
@ -414,9 +494,11 @@ pmix_status_t pmix20_bfrop_print_array(char **output, char *prefix,
* Internal helper functions * Internal helper functions
*/ */
pmix_status_t pmix20_bfrop_store_data_type(pmix_buffer_t *buffer, pmix_data_type_t type); pmix_status_t pmix20_bfrop_store_data_type(pmix_pointer_array_t *regtypes,
pmix_buffer_t *buffer, pmix_data_type_t type);
pmix_status_t pmix20_bfrop_get_data_type(pmix_buffer_t *buffer, pmix_data_type_t *type); pmix_status_t pmix20_bfrop_get_data_type(pmix_pointer_array_t *regtypes,
pmix_buffer_t *buffer, pmix_data_type_t *type);
pmix_data_type_t pmix20_v21_to_v20_datatype(pmix_data_type_t v21type); pmix_data_type_t pmix20_v21_to_v20_datatype(pmix_data_type_t v21type);

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

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

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

@ -14,6 +14,8 @@
* Copyright (c) 2011-2013 Los Alamos National Security, LLC. All rights * Copyright (c) 2011-2013 Los Alamos National Security, LLC. All rights
* reserved. * reserved.
* Copyright (c) 2013-2018 Intel, Inc. All rights reserved. * Copyright (c) 2013-2018 Intel, Inc. All rights reserved.
* Copyright (c) 2019 Mellanox Technologies, Inc.
* All rights reserved.
* $COPYRIGHT$ * $COPYRIGHT$
* *
* Additional copyrights may follow * Additional copyrights may follow
@ -75,14 +77,18 @@ typedef struct pmix_modex_data {
size_t size; size_t size;
} pmix_modex_data_t; } pmix_modex_data_t;
static pmix_status_t pmix21_bfrop_pack_array(pmix_buffer_t *buffer, const void *src, static pmix_status_t pmix21_bfrop_pack_array(pmix_pointer_array_t *regtypes,
pmix_buffer_t *buffer, const void *src,
int32_t num_vals, pmix_data_type_t type); int32_t num_vals, pmix_data_type_t type);
static pmix_status_t pmix21_bfrop_pack_modex(pmix_buffer_t *buffer, const void *src, static pmix_status_t pmix21_bfrop_pack_modex(pmix_pointer_array_t *regtypes,
pmix_buffer_t *buffer, const void *src,
int32_t num_vals, pmix_data_type_t type); int32_t num_vals, pmix_data_type_t type);
static pmix_status_t pmix21_bfrop_unpack_array(pmix_buffer_t *buffer, void *dest, static pmix_status_t pmix21_bfrop_unpack_array(pmix_pointer_array_t *regtypes,
pmix_buffer_t *buffer, void *dest,
int32_t *num_vals, pmix_data_type_t type);
static pmix_status_t pmix21_bfrop_unpack_modex(pmix_pointer_array_t *regtypes,
pmix_buffer_t *buffer, void *dest,
int32_t *num_vals, pmix_data_type_t type); int32_t *num_vals, pmix_data_type_t type);
static pmix_status_t pmix21_bfrop_unpack_modex(pmix_buffer_t *buffer, void *dest,
int32_t *num_vals, pmix_data_type_t type);
static pmix_status_t pmix21_bfrop_copy_array(pmix_info_array_t **dest, static pmix_status_t pmix21_bfrop_copy_array(pmix_info_array_t **dest,
pmix_info_array_t *src, pmix_info_array_t *src,
pmix_data_type_t type); pmix_data_type_t type);
@ -479,7 +485,8 @@ static const char* data_type_string(pmix_data_type_t type)
} }
/**** DEPRECATED ****/ /**** DEPRECATED ****/
static pmix_status_t pmix21_bfrop_pack_array(pmix_buffer_t *buffer, const void *src, static pmix_status_t pmix21_bfrop_pack_array(pmix_pointer_array_t *regtypes,
pmix_buffer_t *buffer, const void *src,
int32_t num_vals, pmix_data_type_t type) int32_t num_vals, pmix_data_type_t type)
{ {
pmix_info_array_t *ptr; pmix_info_array_t *ptr;
@ -490,12 +497,12 @@ static pmix_status_t pmix21_bfrop_pack_array(pmix_buffer_t *buffer, const void *
for (i = 0; i < num_vals; ++i) { for (i = 0; i < num_vals; ++i) {
/* pack the size */ /* pack the size */
if (PMIX_SUCCESS != (ret = pmix_bfrops_base_pack_sizet(buffer, &ptr[i].size, 1, PMIX_SIZE))) { if (PMIX_SUCCESS != (ret = pmix_bfrops_base_pack_sizet(regtypes, buffer, &ptr[i].size, 1, PMIX_SIZE))) {
return ret; return ret;
} }
if (0 < ptr[i].size) { if (0 < ptr[i].size) {
/* pack the values */ /* pack the values */
if (PMIX_SUCCESS != (ret = pmix_bfrops_base_pack_info(buffer, ptr[i].array, ptr[i].size, PMIX_INFO))) { if (PMIX_SUCCESS != (ret = pmix_bfrops_base_pack_info(regtypes, buffer, ptr[i].array, ptr[i].size, PMIX_INFO))) {
return ret; return ret;
} }
} }
@ -504,8 +511,9 @@ static pmix_status_t pmix21_bfrop_pack_array(pmix_buffer_t *buffer, const void *
return PMIX_SUCCESS; return PMIX_SUCCESS;
} }
static pmix_status_t pmix21_bfrop_pack_modex(pmix_buffer_t *buffer, const void *src, static pmix_status_t pmix21_bfrop_pack_modex(pmix_pointer_array_t *regtypes,
int32_t num_vals, pmix_data_type_t type) pmix_buffer_t *buffer, const void *src,
int32_t num_vals, pmix_data_type_t type)
{ {
pmix_modex_data_t *ptr; pmix_modex_data_t *ptr;
int32_t i; int32_t i;
@ -514,11 +522,11 @@ static pmix_status_t pmix21_bfrop_pack_modex(pmix_buffer_t *buffer, const void *
ptr = (pmix_modex_data_t *) src; ptr = (pmix_modex_data_t *) src;
for (i = 0; i < num_vals; ++i) { for (i = 0; i < num_vals; ++i) {
if (PMIX_SUCCESS != (ret = pmix_bfrops_base_pack_sizet(buffer, &ptr[i].size, 1, PMIX_SIZE))) { if (PMIX_SUCCESS != (ret = pmix_bfrops_base_pack_sizet(regtypes, buffer, &ptr[i].size, 1, PMIX_SIZE))) {
return ret; return ret;
} }
if( 0 < ptr[i].size){ if( 0 < ptr[i].size){
if (PMIX_SUCCESS != (ret = pmix_bfrops_base_pack_byte(buffer, ptr[i].blob, ptr[i].size, PMIX_UINT8))) { if (PMIX_SUCCESS != (ret = pmix_bfrops_base_pack_byte(regtypes, buffer, ptr[i].blob, ptr[i].size, PMIX_UINT8))) {
return ret; return ret;
} }
} }
@ -529,7 +537,8 @@ static pmix_status_t pmix21_bfrop_pack_modex(pmix_buffer_t *buffer, const void *
/********************/ /********************/
/**** DEPRECATED ****/ /**** DEPRECATED ****/
static pmix_status_t pmix21_bfrop_unpack_array(pmix_buffer_t *buffer, void *dest, static pmix_status_t pmix21_bfrop_unpack_array(pmix_pointer_array_t *regtypes,
pmix_buffer_t *buffer, void *dest,
int32_t *num_vals, pmix_data_type_t type) int32_t *num_vals, pmix_data_type_t type)
{ {
pmix_info_array_t *ptr; pmix_info_array_t *ptr;
@ -548,13 +557,15 @@ static pmix_status_t pmix21_bfrop_unpack_array(pmix_buffer_t *buffer, void *dest
memset(&ptr[i], 0, sizeof(pmix_info_array_t)); memset(&ptr[i], 0, sizeof(pmix_info_array_t));
/* unpack the size of this array */ /* unpack the size of this array */
m=1; m=1;
if (PMIX_SUCCESS != (ret = pmix_bfrops_base_unpack_sizet(buffer, &ptr[i].size, &m, PMIX_SIZE))) { if (PMIX_SUCCESS != (ret = pmix_bfrops_base_unpack_sizet(regtypes, buffer,
&ptr[i].size, &m, PMIX_SIZE))) {
return ret; return ret;
} }
if (0 < ptr[i].size) { if (0 < ptr[i].size) {
ptr[i].array = (pmix_info_t*)malloc(ptr[i].size * sizeof(pmix_info_t)); ptr[i].array = (pmix_info_t*)malloc(ptr[i].size * sizeof(pmix_info_t));
m=ptr[i].size; m=ptr[i].size;
if (PMIX_SUCCESS != (ret = pmix_bfrops_base_unpack_value(buffer, ptr[i].array, &m, PMIX_INFO))) { if (PMIX_SUCCESS != (ret = pmix_bfrops_base_unpack_value(regtypes, buffer,
ptr[i].array, &m, PMIX_INFO))) {
return ret; return ret;
} }
} }
@ -562,8 +573,9 @@ static pmix_status_t pmix21_bfrop_unpack_array(pmix_buffer_t *buffer, void *dest
return PMIX_SUCCESS; return PMIX_SUCCESS;
} }
static pmix_status_t pmix21_bfrop_unpack_modex(pmix_buffer_t *buffer, void *dest, static pmix_status_t pmix21_bfrop_unpack_modex(pmix_pointer_array_t *regtypes,
int32_t *num_vals, pmix_data_type_t type) pmix_buffer_t *buffer, void *dest,
int32_t *num_vals, pmix_data_type_t type)
{ {
pmix_modex_data_t *ptr; pmix_modex_data_t *ptr;
int32_t i, n, m; int32_t i, n, m;
@ -579,13 +591,13 @@ static pmix_status_t pmix21_bfrop_unpack_modex(pmix_buffer_t *buffer, void *dest
memset(&ptr[i], 0, sizeof(pmix_modex_data_t)); memset(&ptr[i], 0, sizeof(pmix_modex_data_t));
/* unpack the number of bytes */ /* unpack the number of bytes */
m=1; m=1;
if (PMIX_SUCCESS != (ret = pmix_bfrops_base_unpack_sizet(buffer, &ptr[i].size, &m, PMIX_SIZE))) { if (PMIX_SUCCESS != (ret = pmix_bfrops_base_unpack_sizet(regtypes, buffer, &ptr[i].size, &m, PMIX_SIZE))) {
return ret; return ret;
} }
if (0 < ptr[i].size) { if (0 < ptr[i].size) {
ptr[i].blob = (uint8_t*)malloc(ptr[i].size * sizeof(uint8_t)); ptr[i].blob = (uint8_t*)malloc(ptr[i].size * sizeof(uint8_t));
m=ptr[i].size; m=ptr[i].size;
if (PMIX_SUCCESS != (ret = pmix_bfrops_base_unpack_byte(buffer, ptr[i].blob, &m, PMIX_UINT8))) { if (PMIX_SUCCESS != (ret = pmix_bfrops_base_unpack_byte(regtypes, buffer, ptr[i].blob, &m, PMIX_UINT8))) {
return ret; return ret;
} }
} }

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

@ -14,6 +14,8 @@
* Copyright (c) 2011-2013 Los Alamos National Security, LLC. All rights * Copyright (c) 2011-2013 Los Alamos National Security, LLC. All rights
* reserved. * reserved.
* Copyright (c) 2013-2018 Intel, Inc. All rights reserved. * Copyright (c) 2013-2018 Intel, Inc. All rights reserved.
* Copyright (c) 2019 Mellanox Technologies, Inc.
* All rights reserved.
* $COPYRIGHT$ * $COPYRIGHT$
* *
* Additional copyrights may follow * Additional copyrights may follow
@ -75,13 +77,17 @@ typedef struct pmix_modex_data {
size_t size; size_t size;
} pmix_modex_data_t; } pmix_modex_data_t;
static pmix_status_t pmix3_bfrop_pack_array(pmix_buffer_t *buffer, const void *src, static pmix_status_t pmix3_bfrop_pack_array(pmix_pointer_array_t *regtypes,
pmix_buffer_t *buffer, const void *src,
int32_t num_vals, pmix_data_type_t type); int32_t num_vals, pmix_data_type_t type);
static pmix_status_t pmix3_bfrop_pack_modex(pmix_buffer_t *buffer, const void *src, static pmix_status_t pmix3_bfrop_pack_modex(pmix_pointer_array_t *regtypes,
pmix_buffer_t *buffer, const void *src,
int32_t num_vals, pmix_data_type_t type); int32_t num_vals, pmix_data_type_t type);
static pmix_status_t pmix3_bfrop_unpack_array(pmix_buffer_t *buffer, void *dest, static pmix_status_t pmix3_bfrop_unpack_array(pmix_pointer_array_t *regtypes,
pmix_buffer_t *buffer, void *dest,
int32_t *num_vals, pmix_data_type_t type); int32_t *num_vals, pmix_data_type_t type);
static pmix_status_t pmix3_bfrop_unpack_modex(pmix_buffer_t *buffer, void *dest, static pmix_status_t pmix3_bfrop_unpack_modex(pmix_pointer_array_t *regtypes,
pmix_buffer_t *buffer, void *dest,
int32_t *num_vals, pmix_data_type_t type); int32_t *num_vals, pmix_data_type_t type);
static pmix_status_t pmix3_bfrop_copy_array(pmix_info_array_t **dest, static pmix_status_t pmix3_bfrop_copy_array(pmix_info_array_t **dest,
pmix_info_array_t *src, pmix_info_array_t *src,
@ -495,7 +501,8 @@ static const char* data_type_string(pmix_data_type_t type)
} }
/**** DEPRECATED ****/ /**** DEPRECATED ****/
static pmix_status_t pmix3_bfrop_pack_array(pmix_buffer_t *buffer, const void *src, static pmix_status_t pmix3_bfrop_pack_array(pmix_pointer_array_t *regtypes,
pmix_buffer_t *buffer, const void *src,
int32_t num_vals, pmix_data_type_t type) int32_t num_vals, pmix_data_type_t type)
{ {
pmix_info_array_t *ptr; pmix_info_array_t *ptr;
@ -506,12 +513,12 @@ static pmix_status_t pmix3_bfrop_pack_array(pmix_buffer_t *buffer, const void *s
for (i = 0; i < num_vals; ++i) { for (i = 0; i < num_vals; ++i) {
/* pack the size */ /* pack the size */
if (PMIX_SUCCESS != (ret = pmix_bfrops_base_pack_sizet(buffer, &ptr[i].size, 1, PMIX_SIZE))) { if (PMIX_SUCCESS != (ret = pmix_bfrops_base_pack_sizet(regtypes, buffer, &ptr[i].size, 1, PMIX_SIZE))) {
return ret; return ret;
} }
if (0 < ptr[i].size) { if (0 < ptr[i].size) {
/* pack the values */ /* pack the values */
if (PMIX_SUCCESS != (ret = pmix_bfrops_base_pack_info(buffer, ptr[i].array, ptr[i].size, PMIX_INFO))) { if (PMIX_SUCCESS != (ret = pmix_bfrops_base_pack_info(regtypes, buffer, ptr[i].array, ptr[i].size, PMIX_INFO))) {
return ret; return ret;
} }
} }
@ -520,7 +527,8 @@ static pmix_status_t pmix3_bfrop_pack_array(pmix_buffer_t *buffer, const void *s
return PMIX_SUCCESS; return PMIX_SUCCESS;
} }
static pmix_status_t pmix3_bfrop_pack_modex(pmix_buffer_t *buffer, const void *src, static pmix_status_t pmix3_bfrop_pack_modex(pmix_pointer_array_t *regtypes,
pmix_buffer_t *buffer, const void *src,
int32_t num_vals, pmix_data_type_t type) int32_t num_vals, pmix_data_type_t type)
{ {
pmix_modex_data_t *ptr; pmix_modex_data_t *ptr;
@ -530,11 +538,11 @@ static pmix_status_t pmix3_bfrop_pack_modex(pmix_buffer_t *buffer, const void *s
ptr = (pmix_modex_data_t *) src; ptr = (pmix_modex_data_t *) src;
for (i = 0; i < num_vals; ++i) { for (i = 0; i < num_vals; ++i) {
if (PMIX_SUCCESS != (ret = pmix_bfrops_base_pack_sizet(buffer, &ptr[i].size, 1, PMIX_SIZE))) { if (PMIX_SUCCESS != (ret = pmix_bfrops_base_pack_sizet(regtypes, buffer, &ptr[i].size, 1, PMIX_SIZE))) {
return ret; return ret;
} }
if( 0 < ptr[i].size){ if( 0 < ptr[i].size){
if (PMIX_SUCCESS != (ret = pmix_bfrops_base_pack_byte(buffer, ptr[i].blob, ptr[i].size, PMIX_UINT8))) { if (PMIX_SUCCESS != (ret = pmix_bfrops_base_pack_byte(regtypes, buffer, ptr[i].blob, ptr[i].size, PMIX_UINT8))) {
return ret; return ret;
} }
} }
@ -546,7 +554,8 @@ static pmix_status_t pmix3_bfrop_pack_modex(pmix_buffer_t *buffer, const void *s
/********************/ /********************/
/**** DEPRECATED ****/ /**** DEPRECATED ****/
static pmix_status_t pmix3_bfrop_unpack_array(pmix_buffer_t *buffer, void *dest, static pmix_status_t pmix3_bfrop_unpack_array(pmix_pointer_array_t *regtypes,
pmix_buffer_t *buffer, void *dest,
int32_t *num_vals, pmix_data_type_t type) int32_t *num_vals, pmix_data_type_t type)
{ {
pmix_info_array_t *ptr; pmix_info_array_t *ptr;
@ -565,13 +574,13 @@ static pmix_status_t pmix3_bfrop_unpack_array(pmix_buffer_t *buffer, void *dest,
memset(&ptr[i], 0, sizeof(pmix_info_array_t)); memset(&ptr[i], 0, sizeof(pmix_info_array_t));
/* unpack the size of this array */ /* unpack the size of this array */
m=1; m=1;
if (PMIX_SUCCESS != (ret = pmix_bfrops_base_unpack_sizet(buffer, &ptr[i].size, &m, PMIX_SIZE))) { if (PMIX_SUCCESS != (ret = pmix_bfrops_base_unpack_sizet(regtypes, buffer, &ptr[i].size, &m, PMIX_SIZE))) {
return ret; return ret;
} }
if (0 < ptr[i].size) { if (0 < ptr[i].size) {
ptr[i].array = (pmix_info_t*)malloc(ptr[i].size * sizeof(pmix_info_t)); ptr[i].array = (pmix_info_t*)malloc(ptr[i].size * sizeof(pmix_info_t));
m=ptr[i].size; m=ptr[i].size;
if (PMIX_SUCCESS != (ret = pmix_bfrops_base_unpack_value(buffer, ptr[i].array, &m, PMIX_INFO))) { if (PMIX_SUCCESS != (ret = pmix_bfrops_base_unpack_value(regtypes, buffer, ptr[i].array, &m, PMIX_INFO))) {
return ret; return ret;
} }
} }
@ -579,7 +588,8 @@ static pmix_status_t pmix3_bfrop_unpack_array(pmix_buffer_t *buffer, void *dest,
return PMIX_SUCCESS; return PMIX_SUCCESS;
} }
static pmix_status_t pmix3_bfrop_unpack_modex(pmix_buffer_t *buffer, void *dest, static pmix_status_t pmix3_bfrop_unpack_modex(pmix_pointer_array_t *regtypes,
pmix_buffer_t *buffer, void *dest,
int32_t *num_vals, pmix_data_type_t type) int32_t *num_vals, pmix_data_type_t type)
{ {
pmix_modex_data_t *ptr; pmix_modex_data_t *ptr;
@ -596,13 +606,13 @@ static pmix_status_t pmix3_bfrop_unpack_modex(pmix_buffer_t *buffer, void *dest,
memset(&ptr[i], 0, sizeof(pmix_modex_data_t)); memset(&ptr[i], 0, sizeof(pmix_modex_data_t));
/* unpack the number of bytes */ /* unpack the number of bytes */
m=1; m=1;
if (PMIX_SUCCESS != (ret = pmix_bfrops_base_unpack_sizet(buffer, &ptr[i].size, &m, PMIX_SIZE))) { if (PMIX_SUCCESS != (ret = pmix_bfrops_base_unpack_sizet(regtypes, buffer, &ptr[i].size, &m, PMIX_SIZE))) {
return ret; return ret;
} }
if (0 < ptr[i].size) { if (0 < ptr[i].size) {
ptr[i].blob = (uint8_t*)malloc(ptr[i].size * sizeof(uint8_t)); ptr[i].blob = (uint8_t*)malloc(ptr[i].size * sizeof(uint8_t));
m=ptr[i].size; m=ptr[i].size;
if (PMIX_SUCCESS != (ret = pmix_bfrops_base_unpack_byte(buffer, ptr[i].blob, &m, PMIX_UINT8))) { if (PMIX_SUCCESS != (ret = pmix_bfrops_base_unpack_byte(regtypes, buffer, ptr[i].blob, &m, PMIX_UINT8))) {
return ret; return ret;
} }
} }

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

@ -0,0 +1,50 @@
# -*- makefile -*-
#
# Copyright (c) 2004-2005 The Trustees of Indiana University and Indiana
# University Research and Technology
# Corporation. All rights reserved.
# Copyright (c) 2004-2005 The University of Tennessee and The University
# of Tennessee Research Foundation. All rights
# reserved.
# Copyright (c) 2004-2005 High Performance Computing Center Stuttgart,
# University of Stuttgart. All rights reserved.
# Copyright (c) 2004-2005 The Regents of the University of California.
# All rights reserved.
# Copyright (c) 2012 Los Alamos National Security, Inc. All rights reserved.
# Copyright (c) 2013-2019 Intel, Inc. All rights reserved.
# $COPYRIGHT$
#
# Additional copyrights may follow
#
# $HEADER$
#
headers = bfrop_pmix4.h
sources = \
bfrop_pmix4_component.c \
bfrop_pmix4.c
# Make the output library in this directory, and name it either
# mca_<type>_<name>.la (for DSO builds) or libmca_<type>_<name>.la
# (for static builds).
if MCA_BUILD_pmix_bfrops_v4_DSO
lib =
lib_sources =
component = mca_bfrops_v4.la
component_sources = $(headers) $(sources)
else
lib = libmca_bfrops_v4.la
lib_sources = $(headers) $(sources)
component =
component_sources =
endif
mcacomponentdir = $(pmixlibdir)
mcacomponent_LTLIBRARIES = $(component)
mca_bfrops_v4_la_SOURCES = $(component_sources)
mca_bfrops_v4_la_LDFLAGS = -module -avoid-version
noinst_LTLIBRARIES = $(lib)
libmca_bfrops_v4_la_SOURCES = $(lib_sources)
libmca_bfrops_v4_la_LDFLAGS = -module -avoid-version

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

@ -0,0 +1,463 @@
/*
* Copyright (c) 2004-2010 The Trustees of Indiana University and Indiana
* University Research and Technology
* Corporation. All rights reserved.
* Copyright (c) 2004-2011 The University of Tennessee and The University
* of Tennessee Research Foundation. All rights
* reserved.
* Copyright (c) 2004-2005 High Performance Computing Center Stuttgart,
* University of Stuttgart. All rights reserved.
* Copyright (c) 2004-2005 The Regents of the University of California.
* All rights reserved.
* Copyright (c) 2010-2011 Oak Ridge National Labs. All rights reserved.
* Copyright (c) 2011-2014 Cisco Systems, Inc. All rights reserved.
* Copyright (c) 2011-2014 Los Alamos National Security, LLC. All rights
* reserved.
* Copyright (c) 2014-2019 Intel, Inc. All rights reserved.
* $COPYRIGHT$
*
* Additional copyrights may follow
*
* $HEADER$
*
*/
#include <src/include/pmix_config.h>
#include "src/mca/bfrops/base/base.h"
#include "bfrop_pmix4.h"
static pmix_status_t init(void);
static void finalize(void);
static pmix_status_t pmix4_pack(pmix_buffer_t *buffer,
const void *src, int num_vals,
pmix_data_type_t type);
static pmix_status_t pmix4_unpack(pmix_buffer_t *buffer, void *dest,
int32_t *num_vals, pmix_data_type_t type);
static pmix_status_t pmix4_copy(void **dest, void *src,
pmix_data_type_t type);
static pmix_status_t pmix4_print(char **output, char *prefix,
void *src, pmix_data_type_t type);
static pmix_status_t register_type(const char *name,
pmix_data_type_t type,
pmix_bfrop_pack_fn_t pack,
pmix_bfrop_unpack_fn_t unpack,
pmix_bfrop_copy_fn_t copy,
pmix_bfrop_print_fn_t print);
static const char* data_type_string(pmix_data_type_t type);
pmix_bfrops_module_t pmix_bfrops_pmix4_module = {
.version = "v4",
.init = init,
.finalize = finalize,
.pack = pmix4_pack,
.unpack = pmix4_unpack,
.copy = pmix4_copy,
.print = pmix4_print,
.copy_payload = pmix_bfrops_base_copy_payload,
.value_xfer = pmix_bfrops_base_value_xfer,
.value_load = pmix_bfrops_base_value_load,
.value_unload = pmix_bfrops_base_value_unload,
.value_cmp = pmix_bfrops_base_value_cmp,
.register_type = register_type,
.data_type_string = data_type_string
};
static pmix_status_t init(void)
{
/* some standard types don't require anything special */
PMIX_REGISTER_TYPE("PMIX_BOOL", PMIX_BOOL,
pmix_bfrops_base_pack_bool,
pmix_bfrops_base_unpack_bool,
pmix_bfrops_base_std_copy,
pmix_bfrops_base_print_bool,
&mca_bfrops_v4_component.types);
PMIX_REGISTER_TYPE("PMIX_BYTE", PMIX_BYTE,
pmix_bfrops_base_pack_byte,
pmix_bfrops_base_unpack_byte,
pmix_bfrops_base_std_copy,
pmix_bfrops_base_print_byte,
&mca_bfrops_v4_component.types);
PMIX_REGISTER_TYPE("PMIX_STRING", PMIX_STRING,
pmix_bfrops_base_pack_string,
pmix_bfrops_base_unpack_string,
pmix_bfrops_base_copy_string,
pmix_bfrops_base_print_string,
&mca_bfrops_v4_component.types);
/* Register the rest of the standard generic types to point to internal functions */
PMIX_REGISTER_TYPE("PMIX_SIZE", PMIX_SIZE,
pmix_bfrops_base_pack_sizet,
pmix_bfrops_base_unpack_sizet,
pmix_bfrops_base_std_copy,
pmix_bfrops_base_print_size,
&mca_bfrops_v4_component.types);
PMIX_REGISTER_TYPE("PMIX_PID", PMIX_PID,
pmix_bfrops_base_pack_pid,
pmix_bfrops_base_unpack_pid,
pmix_bfrops_base_std_copy,
pmix_bfrops_base_print_pid,
&mca_bfrops_v4_component.types);
PMIX_REGISTER_TYPE("PMIX_INT", PMIX_INT,
pmix_bfrops_base_pack_int,
pmix_bfrops_base_unpack_int,
pmix_bfrops_base_std_copy,
pmix_bfrops_base_print_int,
&mca_bfrops_v4_component.types);
/* Register all the standard fixed types to point to base functions */
PMIX_REGISTER_TYPE("PMIX_INT8", PMIX_INT8,
pmix_bfrops_base_pack_byte,
pmix_bfrops_base_unpack_byte,
pmix_bfrops_base_std_copy,
pmix_bfrops_base_print_int8,
&mca_bfrops_v4_component.types);
PMIX_REGISTER_TYPE("PMIX_INT16", PMIX_INT16,
pmix_bfrops_base_pack_int16,
pmix_bfrops_base_unpack_int16,
pmix_bfrops_base_std_copy,
pmix_bfrops_base_print_int16,
&mca_bfrops_v4_component.types);
PMIX_REGISTER_TYPE("PMIX_INT32", PMIX_INT32,
pmix_bfrops_base_pack_int32,
pmix_bfrops_base_unpack_int32,
pmix_bfrops_base_std_copy,
pmix_bfrops_base_print_int32,
&mca_bfrops_v4_component.types);
PMIX_REGISTER_TYPE("PMIX_INT64", PMIX_INT64,
pmix_bfrops_base_pack_int64,
pmix_bfrops_base_unpack_int64,
pmix_bfrops_base_std_copy,
pmix_bfrops_base_print_int64,
&mca_bfrops_v4_component.types);
PMIX_REGISTER_TYPE("PMIX_UINT", PMIX_UINT,
pmix_bfrops_base_pack_int,
pmix_bfrops_base_unpack_int,
pmix_bfrops_base_std_copy,
pmix_bfrops_base_print_uint,
&mca_bfrops_v4_component.types);
PMIX_REGISTER_TYPE("PMIX_UINT8", PMIX_UINT8,
pmix_bfrops_base_pack_byte,
pmix_bfrops_base_unpack_byte,
pmix_bfrops_base_std_copy,
pmix_bfrops_base_print_uint8,
&mca_bfrops_v4_component.types);
PMIX_REGISTER_TYPE("PMIX_UINT16", PMIX_UINT16,
pmix_bfrops_base_pack_int16,
pmix_bfrops_base_unpack_int16,
pmix_bfrops_base_std_copy,
pmix_bfrops_base_print_uint16,
&mca_bfrops_v4_component.types);
PMIX_REGISTER_TYPE("PMIX_UINT32", PMIX_UINT32,
pmix_bfrops_base_pack_int32,
pmix_bfrops_base_unpack_int32,
pmix_bfrops_base_std_copy,
pmix_bfrops_base_print_uint32,
&mca_bfrops_v4_component.types);
PMIX_REGISTER_TYPE("PMIX_UINT64", PMIX_UINT64,
pmix_bfrops_base_pack_int64,
pmix_bfrops_base_unpack_int64,
pmix_bfrops_base_std_copy,
pmix_bfrops_base_print_uint64,
&mca_bfrops_v4_component.types);
PMIX_REGISTER_TYPE("PMIX_FLOAT", PMIX_FLOAT,
pmix_bfrops_base_pack_float,
pmix_bfrops_base_unpack_float,
pmix_bfrops_base_std_copy,
pmix_bfrops_base_print_float,
&mca_bfrops_v4_component.types);
PMIX_REGISTER_TYPE("PMIX_DOUBLE", PMIX_DOUBLE,
pmix_bfrops_base_pack_double,
pmix_bfrops_base_unpack_double,
pmix_bfrops_base_std_copy,
pmix_bfrops_base_print_double,
&mca_bfrops_v4_component.types);
PMIX_REGISTER_TYPE("PMIX_TIMEVAL", PMIX_TIMEVAL,
pmix_bfrops_base_pack_timeval,
pmix_bfrops_base_unpack_timeval,
pmix_bfrops_base_std_copy,
pmix_bfrops_base_print_timeval,
&mca_bfrops_v4_component.types);
PMIX_REGISTER_TYPE("PMIX_TIME", PMIX_TIME,
pmix_bfrops_base_pack_time,
pmix_bfrops_base_unpack_time,
pmix_bfrops_base_std_copy,
pmix_bfrops_base_print_time,
&mca_bfrops_v4_component.types);
PMIX_REGISTER_TYPE("PMIX_STATUS", PMIX_STATUS,
pmix_bfrops_base_pack_status,
pmix_bfrops_base_unpack_status,
pmix_bfrops_base_std_copy,
pmix_bfrops_base_print_status,
&mca_bfrops_v4_component.types);
PMIX_REGISTER_TYPE("PMIX_VALUE", PMIX_VALUE,
pmix_bfrops_base_pack_value,
pmix_bfrops_base_unpack_value,
pmix_bfrops_base_copy_value,
pmix_bfrops_base_print_value,
&mca_bfrops_v4_component.types);
PMIX_REGISTER_TYPE("PMIX_PROC", PMIX_PROC,
pmix_bfrops_base_pack_proc,
pmix_bfrops_base_unpack_proc,
pmix_bfrops_base_copy_proc,
pmix_bfrops_base_print_proc,
&mca_bfrops_v4_component.types);
PMIX_REGISTER_TYPE("PMIX_APP", PMIX_APP,
pmix_bfrops_base_pack_app,
pmix_bfrops_base_unpack_app,
pmix_bfrops_base_copy_app,
pmix_bfrops_base_print_app,
&mca_bfrops_v4_component.types);
PMIX_REGISTER_TYPE("PMIX_INFO", PMIX_INFO,
pmix_bfrops_base_pack_info,
pmix_bfrops_base_unpack_info,
pmix_bfrops_base_copy_info,
pmix_bfrops_base_print_info,
&mca_bfrops_v4_component.types);
PMIX_REGISTER_TYPE("PMIX_PDATA", PMIX_PDATA,
pmix_bfrops_base_pack_pdata,
pmix_bfrops_base_unpack_pdata,
pmix_bfrops_base_copy_pdata,
pmix_bfrops_base_print_pdata,
&mca_bfrops_v4_component.types);
PMIX_REGISTER_TYPE("PMIX_BUFFER", PMIX_BUFFER,
pmix_bfrops_base_pack_buf,
pmix_bfrops_base_unpack_buf,
pmix_bfrops_base_copy_buf,
pmix_bfrops_base_print_buf,
&mca_bfrops_v4_component.types);
PMIX_REGISTER_TYPE("PMIX_BYTE_OBJECT", PMIX_BYTE_OBJECT,
pmix_bfrops_base_pack_bo,
pmix_bfrops_base_unpack_bo,
pmix_bfrops_base_copy_bo,
pmix_bfrops_base_print_bo,
&mca_bfrops_v4_component.types);
PMIX_REGISTER_TYPE("PMIX_KVAL", PMIX_KVAL,
pmix_bfrops_base_pack_kval,
pmix_bfrops_base_unpack_kval,
pmix_bfrops_base_copy_kval,
pmix_bfrops_base_print_kval,
&mca_bfrops_v4_component.types);
/* these are fixed-sized values and can be done by base */
PMIX_REGISTER_TYPE("PMIX_PERSIST", PMIX_PERSIST,
pmix_bfrops_base_pack_persist,
pmix_bfrops_base_unpack_persist,
pmix_bfrops_base_std_copy,
pmix_bfrops_base_print_persist,
&mca_bfrops_v4_component.types);
PMIX_REGISTER_TYPE("PMIX_POINTER", PMIX_POINTER,
pmix_bfrops_base_pack_ptr,
pmix_bfrops_base_unpack_ptr,
pmix_bfrops_base_std_copy,
pmix_bfrops_base_print_ptr,
&mca_bfrops_v4_component.types);
PMIX_REGISTER_TYPE("PMIX_SCOPE", PMIX_SCOPE,
pmix_bfrops_base_pack_scope,
pmix_bfrops_base_unpack_scope,
pmix_bfrops_base_std_copy,
pmix_bfrops_base_std_copy,
&mca_bfrops_v4_component.types);
PMIX_REGISTER_TYPE("PMIX_DATA_RANGE", PMIX_DATA_RANGE,
pmix_bfrops_base_pack_range,
pmix_bfrops_base_unpack_range,
pmix_bfrops_base_std_copy,
pmix_bfrops_base_print_ptr,
&mca_bfrops_v4_component.types);
PMIX_REGISTER_TYPE("PMIX_COMMAND", PMIX_COMMAND,
pmix_bfrops_base_pack_cmd,
pmix_bfrops_base_unpack_cmd,
pmix_bfrops_base_std_copy,
pmix_bfrops_base_print_cmd,
&mca_bfrops_v4_component.types);
PMIX_REGISTER_TYPE("PMIX_INFO_DIRECTIVES", PMIX_INFO_DIRECTIVES,
pmix_bfrops_base_pack_info_directives,
pmix_bfrops_base_unpack_info_directives,
pmix_bfrops_base_std_copy,
pmix_bfrops_base_print_info_directives,
&mca_bfrops_v4_component.types);
PMIX_REGISTER_TYPE("PMIX_DATA_TYPE", PMIX_DATA_TYPE,
pmix_bfrops_base_pack_datatype,
pmix_bfrops_base_unpack_datatype,
pmix_bfrops_base_std_copy,
pmix_bfrops_base_print_datatype,
&mca_bfrops_v4_component.types);
PMIX_REGISTER_TYPE("PMIX_PROC_STATE", PMIX_PROC_STATE,
pmix_bfrops_base_pack_pstate,
pmix_bfrops_base_unpack_pstate,
pmix_bfrops_base_std_copy,
pmix_bfrops_base_print_pstate,
&mca_bfrops_v4_component.types);
PMIX_REGISTER_TYPE("PMIX_PROC_INFO", PMIX_PROC_INFO,
pmix_bfrops_base_pack_pinfo,
pmix_bfrops_base_unpack_pinfo,
pmix_bfrops_base_copy_pinfo,
pmix_bfrops_base_print_pinfo,
&mca_bfrops_v4_component.types);
PMIX_REGISTER_TYPE("PMIX_DATA_ARRAY", PMIX_DATA_ARRAY,
pmix_bfrops_base_pack_darray,
pmix_bfrops_base_unpack_darray,
pmix_bfrops_base_copy_darray,
pmix_bfrops_base_print_darray,
&mca_bfrops_v4_component.types);
PMIX_REGISTER_TYPE("PMIX_PROC_RANK", PMIX_PROC_RANK,
pmix_bfrops_base_pack_rank,
pmix_bfrops_base_unpack_rank,
pmix_bfrops_base_std_copy,
pmix_bfrops_base_print_rank,
&mca_bfrops_v4_component.types);
PMIX_REGISTER_TYPE("PMIX_QUERY", PMIX_QUERY,
pmix_bfrops_base_pack_query,
pmix_bfrops_base_unpack_query,
pmix_bfrops_base_copy_query,
pmix_bfrops_base_print_query,
&mca_bfrops_v4_component.types);
PMIX_REGISTER_TYPE("PMIX_COMPRESSED_STRING",
PMIX_COMPRESSED_STRING,
pmix_bfrops_base_pack_bo,
pmix_bfrops_base_unpack_bo,
pmix_bfrops_base_copy_bo,
pmix_bfrops_base_print_bo,
&mca_bfrops_v4_component.types);
PMIX_REGISTER_TYPE("PMIX_ALLOC_DIRECTIVE",
PMIX_ALLOC_DIRECTIVE,
pmix_bfrops_base_pack_alloc_directive,
pmix_bfrops_base_unpack_alloc_directive,
pmix_bfrops_base_std_copy,
pmix_bfrops_base_print_alloc_directive,
&mca_bfrops_v4_component.types);
PMIX_REGISTER_TYPE("PMIX_IOF_CHANNEL",
PMIX_IOF_CHANNEL,
pmix_bfrops_base_pack_iof_channel,
pmix_bfrops_base_unpack_iof_channel,
pmix_bfrops_base_std_copy,
pmix_bfrops_base_print_iof_channel,
&mca_bfrops_v4_component.types);
PMIX_REGISTER_TYPE("PMIX_ENVAR",
PMIX_ENVAR,
pmix_bfrops_base_pack_envar,
pmix_bfrops_base_unpack_envar,
pmix_bfrops_base_copy_envar,
pmix_bfrops_base_print_envar,
&mca_bfrops_v4_component.types);
PMIX_REGISTER_TYPE("PMIX_COORD",
PMIX_COORD,
pmix_bfrops_base_pack_coord,
pmix_bfrops_base_unpack_coord,
pmix_bfrops_base_copy_coord,
pmix_bfrops_base_print_coord,
&mca_bfrops_v4_component.types);
PMIX_REGISTER_TYPE("PMIX_REGATTR",
PMIX_REGATTR,
pmix_bfrops_base_pack_regattr,
pmix_bfrops_base_unpack_regattr,
pmix_bfrops_base_copy_regattr,
pmix_bfrops_base_print_regattr,
&mca_bfrops_v4_component.types);
return PMIX_SUCCESS;
}
static void finalize(void)
{
int n;
pmix_bfrop_type_info_t *info;
for (n=0; n < mca_bfrops_v4_component.types.size; n++) {
if (NULL != (info = (pmix_bfrop_type_info_t*)pmix_pointer_array_get_item(&mca_bfrops_v4_component.types, n))) {
PMIX_RELEASE(info);
pmix_pointer_array_set_item(&mca_bfrops_v4_component.types, n, NULL);
}
}
}
static pmix_status_t pmix4_pack(pmix_buffer_t *buffer,
const void *src, int num_vals,
pmix_data_type_t type)
{
/* kick the process off by passing this in to the base */
return pmix_bfrops_base_pack(&mca_bfrops_v4_component.types,
buffer, src, num_vals, type);
}
static pmix_status_t pmix4_unpack(pmix_buffer_t *buffer, void *dest,
int32_t *num_vals, pmix_data_type_t type)
{
/* kick the process off by passing this in to the base */
return pmix_bfrops_base_unpack(&mca_bfrops_v4_component.types,
buffer, dest, num_vals, type);
}
static pmix_status_t pmix4_copy(void **dest, void *src,
pmix_data_type_t type)
{
return pmix_bfrops_base_copy(&mca_bfrops_v4_component.types,
dest, src, type);
}
static pmix_status_t pmix4_print(char **output, char *prefix,
void *src, pmix_data_type_t type)
{
return pmix_bfrops_base_print(&mca_bfrops_v4_component.types,
output, prefix, src, type);
}
static pmix_status_t register_type(const char *name, pmix_data_type_t type,
pmix_bfrop_pack_fn_t pack,
pmix_bfrop_unpack_fn_t unpack,
pmix_bfrop_copy_fn_t copy,
pmix_bfrop_print_fn_t print)
{
PMIX_REGISTER_TYPE(name, type,
pack, unpack,
copy, print,
&mca_bfrops_v4_component.types);
return PMIX_SUCCESS;
}
static const char* data_type_string(pmix_data_type_t type)
{
return pmix_bfrops_base_data_type_string(&mca_bfrops_v4_component.types, type);
}

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

@ -0,0 +1,34 @@
/*
* Copyright (c) 2004-2008 The Trustees of Indiana University and Indiana
* University Research and Technology
* Corporation. All rights reserved.
* Copyright (c) 2004-2006 The University of Tennessee and The University
* of Tennessee Research Foundation. All rights
* reserved.
* Copyright (c) 2004-2005 High Performance Computing Center Stuttgart,
* University of Stuttgart. All rights reserved.
* Copyright (c) 2004-2005 The Regents of the University of California.
* All rights reserved.
* Copyright (c) 2016-2019 Intel, Inc. All rights reserved.
* $COPYRIGHT$
*
* Additional copyrights may follow
*
* $HEADER$
*/
#ifndef PMIX_BFROPS_PMIX4_H
#define PMIX_BFROPS_PMIX4_H
#include "src/mca/bfrops/bfrops.h"
BEGIN_C_DECLS
/* the component must be visible data for the linker to find it */
PMIX_EXPORT extern pmix_bfrops_base_component_t mca_bfrops_v4_component;
extern pmix_bfrops_module_t pmix_bfrops_pmix4_module;
END_C_DECLS
#endif /* PMIX_BFROPS_PMIX4_H */

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

@ -0,0 +1,99 @@
/* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil -*- */
/*
* Copyright (c) 2004-2008 The Trustees of Indiana University and Indiana
* University Research and Technology
* Corporation. All rights reserved.
* Copyright (c) 2004-2005 The University of Tennbfropsee and The University
* of Tennbfropsee Research Foundation. All rights
* reserved.
* Copyright (c) 2004-2005 High Performance Computing Center Stuttgart,
* University of Stuttgart. All rights reserved.
* Copyright (c) 2004-2005 The Regents of the University of California.
* All rights reserved.
* Copyright (c) 2015 Los Alamos National Security, LLC. All rights
* reserved.
* Copyright (c) 2016-2019 Intel, Inc. All rights reserved.
* $COPYRIGHT$
*
* Additional copyrights may follow
*
* $HEADER$
*
* These symbols are in a file by themselves to provide nice linker
* semantics. Since linkers generally pull in symbols by object
* files, keeping these symbols as the only symbols in this file
* prevents utility programs such as "ompi_info" from having to import
* entire components just to query their version and parameters.
*/
#include <src/include/pmix_config.h>
#include <pmix_common.h>
#include "src/include/types.h"
#include "src/include/pmix_globals.h"
#include "src/util/error.h"
#include "src/server/pmix_server_ops.h"
#include "src/mca/bfrops/base/base.h"
#include "bfrop_pmix4.h"
extern pmix_bfrops_module_t pmix_bfrops_pmix4_module;
static pmix_status_t component_open(void);
static pmix_status_t component_query(pmix_mca_base_module_t **module, int *priority);
static pmix_status_t component_close(void);
static pmix_bfrops_module_t* assign_module(void);
/*
* Instantiate the public struct with all of our public information
* and pointers to our public functions in it
*/
pmix_bfrops_base_component_t mca_bfrops_v4_component = {
.base = {
PMIX_BFROPS_BASE_VERSION_1_0_0,
/* Component name and version */
.pmix_mca_component_name = "v4",
PMIX_MCA_BASE_MAKE_VERSION(component, PMIX_MAJOR_VERSION, PMIX_MINOR_VERSION,
PMIX_RELEASE_VERSION),
/* Component open and close functions */
.pmix_mca_open_component = component_open,
.pmix_mca_close_component = component_close,
.pmix_mca_query_component = component_query,
},
.priority = 50,
.assign_module = assign_module
};
pmix_status_t component_open(void)
{
/* setup the types array */
PMIX_CONSTRUCT(&mca_bfrops_v4_component.types, pmix_pointer_array_t);
pmix_pointer_array_init(&mca_bfrops_v4_component.types, 42, INT_MAX, 16);
return PMIX_SUCCESS;
}
pmix_status_t component_query(pmix_mca_base_module_t **module, int *priority)
{
*priority = mca_bfrops_v4_component.priority;
*module = (pmix_mca_base_module_t *)&pmix_bfrops_pmix4_module;
return PMIX_SUCCESS;
}
pmix_status_t component_close(void)
{
PMIX_DESTRUCT(&mca_bfrops_v4_component.types);
return PMIX_SUCCESS;
}
static pmix_bfrops_module_t* assign_module(void)
{
pmix_output_verbose(10, pmix_bfrops_base_framework.framework_output,
"bfrops:pmix4x assigning module");
return &pmix_bfrops_pmix4_module;
}

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

@ -1,7 +1,7 @@
/* /*
* Copyright (c) 2015-2019 Intel, Inc. All rights reserved. * Copyright (c) 2015-2019 Intel, Inc. All rights reserved.
* Copyright (c) 2016-2018 IBM Corporation. All rights reserved. * Copyright (c) 2016-2018 IBM Corporation. All rights reserved.
* Copyright (c) 2016-2018 Mellanox Technologies, Inc. * Copyright (c) 2016-2019 Mellanox Technologies, Inc.
* All rights reserved. * All rights reserved.
* Copyright (c) 2018-2019 Research Organization for Information Science * Copyright (c) 2018-2019 Research Organization for Information Science
* and Technology (RIST). All rights reserved. * and Technology (RIST). All rights reserved.
@ -42,7 +42,7 @@
#include "src/client/pmix_client_ops.h" #include "src/client/pmix_client_ops.h"
#include "src/server/pmix_server_ops.h" #include "src/server/pmix_server_ops.h"
#include "src/util/argv.h" #include "src/util/argv.h"
#include "src/util/compress.h" #include "src/mca/pcompress/pcompress.h"
#include "src/util/error.h" #include "src/util/error.h"
#include "src/util/output.h" #include "src/util/output.h"
#include "src/util/pmix_environ.h" #include "src/util/pmix_environ.h"
@ -108,9 +108,8 @@ static inline pmix_peer_t * _client_peer(pmix_common_dstore_ctx_t *ds_ctx);
static inline int _my_client(const char *nspace, pmix_rank_t rank); static inline int _my_client(const char *nspace, pmix_rank_t rank);
static pmix_status_t _dstor_store_modex_cb(pmix_common_dstore_ctx_t *ds_ctx, static pmix_status_t _dstor_store_modex_cb(pmix_common_dstore_ctx_t *ds_ctx,
struct pmix_namespace_t *nspace, pmix_proc_t *proc,
pmix_list_t *cbs, pmix_buffer_t *pbkt);
pmix_byte_object_t *bo);
static pmix_status_t _dstore_store_nolock(pmix_common_dstore_ctx_t *ds_ctx, static pmix_status_t _dstore_store_nolock(pmix_common_dstore_ctx_t *ds_ctx,
ns_map_data_t *ns_map, ns_map_data_t *ns_map,
@ -2520,9 +2519,9 @@ static inline int _my_client(const char *nspace, pmix_rank_t rank)
* always contains data solely from remote procs, and we * always contains data solely from remote procs, and we
* shall store it accordingly */ * shall store it accordingly */
PMIX_EXPORT pmix_status_t pmix_common_dstor_store_modex(pmix_common_dstore_ctx_t *ds_ctx, PMIX_EXPORT pmix_status_t pmix_common_dstor_store_modex(pmix_common_dstore_ctx_t *ds_ctx,
struct pmix_namespace_t *nspace, struct pmix_namespace_t *nspace,
pmix_list_t *cbs, pmix_buffer_t *buf,
pmix_buffer_t *buf) void *cbdata)
{ {
pmix_status_t rc = PMIX_SUCCESS; pmix_status_t rc = PMIX_SUCCESS;
pmix_status_t rc1 = PMIX_SUCCESS; pmix_status_t rc1 = PMIX_SUCCESS;
@ -2542,7 +2541,9 @@ PMIX_EXPORT pmix_status_t pmix_common_dstor_store_modex(pmix_common_dstore_ctx_t
return rc; return rc;
} }
rc = pmix_gds_base_store_modex(nspace, cbs, buf, (pmix_gds_base_store_modex_cb_fn_t)_dstor_store_modex_cb, ds_ctx); rc = pmix_gds_base_store_modex(nspace, buf, ds_ctx,
(pmix_gds_base_store_modex_cb_fn_t)_dstor_store_modex_cb,
cbdata);
if (PMIX_SUCCESS != rc) { if (PMIX_SUCCESS != rc) {
PMIX_ERROR_LOG(rc); PMIX_ERROR_LOG(rc);
} }
@ -2560,15 +2561,11 @@ PMIX_EXPORT pmix_status_t pmix_common_dstor_store_modex(pmix_common_dstore_ctx_t
} }
static pmix_status_t _dstor_store_modex_cb(pmix_common_dstore_ctx_t *ds_ctx, static pmix_status_t _dstor_store_modex_cb(pmix_common_dstore_ctx_t *ds_ctx,
struct pmix_namespace_t *nspace, pmix_proc_t *proc,
pmix_list_t *cbs, pmix_buffer_t *pbkt)
pmix_byte_object_t *bo)
{ {
pmix_namespace_t *ns = (pmix_namespace_t*)nspace;
pmix_status_t rc = PMIX_SUCCESS; pmix_status_t rc = PMIX_SUCCESS;
int32_t cnt; int32_t cnt;
pmix_buffer_t pbkt;
pmix_proc_t proc;
pmix_kval_t *kv; pmix_kval_t *kv;
ns_map_data_t *ns_map; ns_map_data_t *ns_map;
pmix_buffer_t tmp; pmix_buffer_t tmp;
@ -2576,7 +2573,7 @@ static pmix_status_t _dstor_store_modex_cb(pmix_common_dstore_ctx_t *ds_ctx,
pmix_output_verbose(2, pmix_gds_base_framework.framework_output, pmix_output_verbose(2, pmix_gds_base_framework.framework_output,
"[%s:%d] gds:dstore:store_modex for nspace %s", "[%s:%d] gds:dstore:store_modex for nspace %s",
pmix_globals.myid.nspace, pmix_globals.myid.rank, pmix_globals.myid.nspace, pmix_globals.myid.rank,
ns->nspace); proc->nspace);
/* NOTE: THE BYTE OBJECT DELIVERED HERE WAS CONSTRUCTED /* NOTE: THE BYTE OBJECT DELIVERED HERE WAS CONSTRUCTED
* BY A SERVER, AND IS THEREFORE PACKED USING THE SERVER'S * BY A SERVER, AND IS THEREFORE PACKED USING THE SERVER'S
@ -2588,28 +2585,8 @@ static pmix_status_t _dstor_store_modex_cb(pmix_common_dstore_ctx_t *ds_ctx,
* the rank followed by pmix_kval_t's. The list of callbacks * the rank followed by pmix_kval_t's. The list of callbacks
* contains all local participants. */ * contains all local participants. */
/* setup the byte object for unpacking */
PMIX_CONSTRUCT(&pbkt, pmix_buffer_t);
/* the next step unfortunately NULLs the byte object's
* entries, so we need to ensure we restore them! */
PMIX_LOAD_BUFFER(pmix_globals.mypeer, &pbkt, bo->bytes, bo->size);
/* unload the proc that provided this data */
cnt = 1;
PMIX_BFROPS_UNPACK(rc, pmix_globals.mypeer, &pbkt, &proc, &cnt, PMIX_PROC);
if (PMIX_SUCCESS != rc) {
PMIX_ERROR_LOG(rc);
bo->bytes = pbkt.base_ptr;
bo->size = pbkt.bytes_used; // restore the incoming data
pbkt.base_ptr = NULL;
PMIX_DESTRUCT(&pbkt);
return rc;
}
/* don't store blobs to the sm dstore from local clients */ /* don't store blobs to the sm dstore from local clients */
if (_my_client(proc.nspace, proc.rank)) { if (_my_client(proc->nspace, proc->rank)) {
bo->bytes = pbkt.base_ptr;
bo->size = pbkt.bytes_used; // restore the incoming data
pbkt.base_ptr = NULL;
PMIX_DESTRUCT(&pbkt);
return PMIX_SUCCESS; return PMIX_SUCCESS;
} }
@ -2619,16 +2596,12 @@ static pmix_status_t _dstor_store_modex_cb(pmix_common_dstore_ctx_t *ds_ctx,
/* unpack the remaining values until we hit the end of the buffer */ /* unpack the remaining values until we hit the end of the buffer */
cnt = 1; cnt = 1;
kv = PMIX_NEW(pmix_kval_t); kv = PMIX_NEW(pmix_kval_t);
PMIX_BFROPS_UNPACK(rc, pmix_globals.mypeer, &pbkt, kv, &cnt, PMIX_KVAL); PMIX_BFROPS_UNPACK(rc, pmix_globals.mypeer, pbkt, kv, &cnt, PMIX_KVAL);
while (PMIX_SUCCESS == rc) { while (PMIX_SUCCESS == rc) {
/* store this in the hash table */ /* store this in the hash table */
PMIX_GDS_STORE_KV(rc, pmix_globals.mypeer, &proc, PMIX_REMOTE, kv); PMIX_GDS_STORE_KV(rc, pmix_globals.mypeer, proc, PMIX_REMOTE, kv);
if (PMIX_SUCCESS != rc) { if (PMIX_SUCCESS != rc) {
PMIX_ERROR_LOG(rc); PMIX_ERROR_LOG(rc);
bo->bytes = pbkt.base_ptr;
bo->size = pbkt.bytes_used; // restore the incoming data
pbkt.base_ptr = NULL;
PMIX_DESTRUCT(&pbkt);
return rc; return rc;
} }
@ -2642,7 +2615,7 @@ static pmix_status_t _dstor_store_modex_cb(pmix_common_dstore_ctx_t *ds_ctx,
/* proceed to the next element */ /* proceed to the next element */
kv = PMIX_NEW(pmix_kval_t); kv = PMIX_NEW(pmix_kval_t);
cnt = 1; cnt = 1;
PMIX_BFROPS_UNPACK(rc, pmix_globals.mypeer, &pbkt, kv, &cnt, PMIX_KVAL); PMIX_BFROPS_UNPACK(rc, pmix_globals.mypeer, pbkt, kv, &cnt, PMIX_KVAL);
} }
/* Release the kv that didn't received the value /* Release the kv that didn't received the value
@ -2662,18 +2635,14 @@ static pmix_status_t _dstor_store_modex_cb(pmix_common_dstore_ctx_t *ds_ctx,
PMIX_UNLOAD_BUFFER(&tmp, kv->value->data.bo.bytes, kv->value->data.bo.size); PMIX_UNLOAD_BUFFER(&tmp, kv->value->data.bo.bytes, kv->value->data.bo.size);
/* Get the namespace map element for the process "proc" */ /* Get the namespace map element for the process "proc" */
if (NULL == (ns_map = ds_ctx->session_map_search(ds_ctx, proc.nspace))) { if (NULL == (ns_map = ds_ctx->session_map_search(ds_ctx, proc->nspace))) {
rc = PMIX_ERROR; rc = PMIX_ERROR;
PMIX_ERROR_LOG(rc); PMIX_ERROR_LOG(rc);
bo->bytes = pbkt.base_ptr;
bo->size = pbkt.bytes_used; // restore the incoming data
pbkt.base_ptr = NULL;
PMIX_DESTRUCT(&pbkt);
return rc; return rc;
} }
/* Store all keys at once */ /* Store all keys at once */
rc = _dstore_store_nolock(ds_ctx, ns_map, proc.rank, kv); rc = _dstore_store_nolock(ds_ctx, ns_map, proc->rank, kv);
if (PMIX_SUCCESS != rc) { if (PMIX_SUCCESS != rc) {
PMIX_ERROR_LOG(rc); PMIX_ERROR_LOG(rc);
} }
@ -2682,12 +2651,6 @@ static pmix_status_t _dstor_store_modex_cb(pmix_common_dstore_ctx_t *ds_ctx,
PMIX_RELEASE(kv); PMIX_RELEASE(kv);
PMIX_DESTRUCT(&tmp); PMIX_DESTRUCT(&tmp);
/* Reset the input buffer */
bo->bytes = pbkt.base_ptr;
bo->size = pbkt.bytes_used;
pbkt.base_ptr = NULL;
PMIX_DESTRUCT(&pbkt);
return rc; return rc;
} }

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

@ -1,5 +1,5 @@
/* /*
* Copyright (c) 2018 Mellanox Technologies, Inc. * Copyright (c) 2018-2019 Mellanox Technologies, Inc.
* All rights reserved. * All rights reserved.
* Copyright (c) 2018 Intel, Inc. All rights reserved. * Copyright (c) 2018 Intel, Inc. All rights reserved.
* Copyright (c) 2018 IBM Corporation. All rights reserved. * Copyright (c) 2018 IBM Corporation. All rights reserved.
@ -75,6 +75,6 @@ PMIX_EXPORT pmix_status_t pmix_common_dstor_fetch(pmix_common_dstore_ctx_t *ds_c
pmix_list_t *kvs); pmix_list_t *kvs);
PMIX_EXPORT pmix_status_t pmix_common_dstor_store_modex(pmix_common_dstore_ctx_t *ds_ctx, PMIX_EXPORT pmix_status_t pmix_common_dstor_store_modex(pmix_common_dstore_ctx_t *ds_ctx,
struct pmix_namespace_t *nspace, struct pmix_namespace_t *nspace,
pmix_list_t *cbs, pmix_buffer_t *buff,
pmix_buffer_t *buff); void *cbdata);
#endif #endif

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

@ -3,7 +3,7 @@
* Copyright (c) 2016 IBM Corporation. All rights reserved. * Copyright (c) 2016 IBM Corporation. All rights reserved.
* Copyright (c) 2016-2017 Mellanox Technologies, Inc. * Copyright (c) 2016-2017 Mellanox Technologies, Inc.
* All rights reserved. * All rights reserved.
* Copyright (c) 2018 Research Organization for Information Science * Copyright (c) 2018-2019 Research Organization for Information Science
* and Technology (RIST). All rights reserved. * and Technology (RIST). All rights reserved.
* *
* $COPYRIGHT$ * $COPYRIGHT$
@ -30,6 +30,11 @@
#ifdef HAVE_SYS_AUXV_H #ifdef HAVE_SYS_AUXV_H
#include <sys/auxv.h> #include <sys/auxv.h>
#if PMIX_HAVE_LIBEV
/* EV_NONE is macro-defined in <elf.h> that is included by <sys/auxv.h>
* and used in an enum in <event.h> from libev, so #undef it to fix an issue*/
#undef EV_NONE
#endif
#endif #endif
#include <pmix_common.h> #include <pmix_common.h>

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

@ -15,6 +15,8 @@
* Copyright (c) 2015 Research Organization for Information Science * Copyright (c) 2015 Research Organization for Information Science
* and Technology (RIST). All rights reserved. * and Technology (RIST). All rights reserved.
* Copyright (c) 2018 IBM Corporation. All rights reserved. * Copyright (c) 2018 IBM Corporation. All rights reserved.
* Copyright (c) 2019 Mellanox Technologies, Inc.
* All rights reserved.
* $COPYRIGHT$ * $COPYRIGHT$
* *
* Additional copyrights may follow * Additional copyrights may follow
@ -77,11 +79,10 @@ struct pmix_gds_globals_t {
}; };
typedef struct pmix_gds_globals_t pmix_gds_globals_t; typedef struct pmix_gds_globals_t pmix_gds_globals_t;
typedef void * pmix_gds_base_store_modex_cbdata_t; typedef void * pmix_gds_base_ctx_t;
typedef pmix_status_t (*pmix_gds_base_store_modex_cb_fn_t)(pmix_gds_base_store_modex_cbdata_t cbdata, typedef pmix_status_t (*pmix_gds_base_store_modex_cb_fn_t)(pmix_gds_base_ctx_t ctx,
struct pmix_namespace_t *nspace, pmix_proc_t *proc,
pmix_list_t *cbs, pmix_buffer_t *pbkt);
pmix_byte_object_t *bo);
PMIX_EXPORT extern pmix_gds_globals_t pmix_gds_globals; PMIX_EXPORT extern pmix_gds_globals_t pmix_gds_globals;
@ -106,10 +107,10 @@ PMIX_EXPORT pmix_status_t pmix_gds_base_setup_fork(const pmix_proc_t *proc,
char ***env); char ***env);
PMIX_EXPORT pmix_status_t pmix_gds_base_store_modex(struct pmix_namespace_t *nspace, PMIX_EXPORT pmix_status_t pmix_gds_base_store_modex(struct pmix_namespace_t *nspace,
pmix_list_t *cbs, pmix_buffer_t * buff,
pmix_buffer_t *xfer, pmix_gds_base_ctx_t ctx,
pmix_gds_base_store_modex_cb_fn_t cb_fn, pmix_gds_base_store_modex_cb_fn_t cb_fn,
pmix_gds_base_store_modex_cbdata_t cbdata); void *cbdata);
END_C_DECLS END_C_DECLS

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

@ -1,7 +1,7 @@
/* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil -*- */ /* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil -*- */
/* /*
* Copyright (c) 2015-2017 Intel, Inc. All rights reserved. * Copyright (c) 2015-2019 Intel, Inc. All rights reserved.
* Copyright (c) 2016 Mellanox Technologies, Inc. * Copyright (c) 2016-2019 Mellanox Technologies, Inc.
* All rights reserved. * All rights reserved.
* Copyright (c) 2018 IBM Corporation. All rights reserved. * Copyright (c) 2018 IBM Corporation. All rights reserved.
* Copyright (c) 2018 Research Organization for Information Science * Copyright (c) 2018 Research Organization for Information Science
@ -24,6 +24,7 @@
#include "src/util/error.h" #include "src/util/error.h"
#include "src/mca/gds/base/base.h" #include "src/mca/gds/base/base.h"
#include "src/server/pmix_server_ops.h"
char* pmix_gds_base_get_available_modules(void) char* pmix_gds_base_get_available_modules(void)
@ -88,19 +89,24 @@ pmix_status_t pmix_gds_base_setup_fork(const pmix_proc_t *proc,
} }
pmix_status_t pmix_gds_base_store_modex(struct pmix_namespace_t *nspace, pmix_status_t pmix_gds_base_store_modex(struct pmix_namespace_t *nspace,
pmix_list_t *cbs, pmix_buffer_t * buff,
pmix_buffer_t * buff, pmix_gds_base_ctx_t ctx,
pmix_gds_base_store_modex_cb_fn_t cb_fn, pmix_gds_base_store_modex_cb_fn_t cb_fn,
pmix_gds_base_store_modex_cbdata_t cbdata) void *cbdata)
{ {
pmix_status_t rc = PMIX_SUCCESS; pmix_status_t rc = PMIX_SUCCESS;
pmix_namespace_t * ns = (pmix_namespace_t *)nspace;
pmix_buffer_t bkt; pmix_buffer_t bkt;
pmix_byte_object_t bo, bo2; pmix_byte_object_t bo, bo2;
int32_t cnt = 1; int32_t cnt = 1;
char byte; char byte;
pmix_collect_t ctype; pmix_collect_t ctype;
bool have_ctype = false; bool have_ctype = false;
pmix_server_trkr_t *trk = (pmix_server_trkr_t*)cbdata;
pmix_proc_t proc;
pmix_buffer_t pbkt;
pmix_rank_t rel_rank;
pmix_nspace_caddy_t *nm;
bool found;
/* Loop over the enclosed byte object envelopes and /* Loop over the enclosed byte object envelopes and
* store them in our GDS module */ * store them in our GDS module */
@ -129,7 +135,7 @@ pmix_status_t pmix_gds_base_store_modex(struct pmix_namespace_t *nspace,
if (have_ctype) { if (have_ctype) {
if (ctype != (pmix_collect_t)byte) { if (ctype != (pmix_collect_t)byte) {
rc = PMIX_ERR_INVALID_ARG; rc = PMIX_ERR_INVALID_ARG;
PMIX_DESTRUCT(&bkt); pbkt.base_ptr = NULL;
goto error; goto error;
} }
} }
@ -149,11 +155,54 @@ pmix_status_t pmix_gds_base_store_modex(struct pmix_namespace_t *nspace,
* shared memory region, then the data may be available * shared memory region, then the data may be available
* right away - but the client still has to be notified * right away - but the client still has to be notified
* of its presence. */ * of its presence. */
rc = cb_fn(cbdata, (struct pmix_namespace_t *)ns, cbs, &bo2);
/* setup the byte object for unpacking */
PMIX_CONSTRUCT(&pbkt, pmix_buffer_t);
PMIX_LOAD_BUFFER(pmix_globals.mypeer, &pbkt, bo2.bytes, bo2.size);
/* unload the proc that provided this data */
cnt = 1;
PMIX_BFROPS_UNPACK(rc, pmix_globals.mypeer, &pbkt, &rel_rank, &cnt,
PMIX_PROC_RANK);
if (PMIX_SUCCESS != rc) { if (PMIX_SUCCESS != rc) {
PMIX_ERROR_LOG(rc);
pbkt.base_ptr = NULL;
PMIX_DESTRUCT(&pbkt);
PMIX_DESTRUCT(&bkt); PMIX_DESTRUCT(&bkt);
goto error; goto error;
} }
found = false;
/* calculate proc form the relative rank */
if (pmix_list_get_size(&trk->nslist) == 1) {
found = true;
nm = (pmix_nspace_caddy_t*)pmix_list_get_first(&trk->nslist);
} else {
PMIX_LIST_FOREACH(nm, &trk->nslist, pmix_nspace_caddy_t) {
if (rel_rank < nm->ns->nprocs) {
found = true;
break;
}
rel_rank -= nm->ns->nprocs;
}
}
if (false == found) {
rc = PMIX_ERR_NOT_FOUND;
PMIX_ERROR_LOG(rc);
pbkt.base_ptr = NULL;
PMIX_DESTRUCT(&pbkt);
PMIX_DESTRUCT(&bkt);
goto error;
}
PMIX_PROC_LOAD(&proc, nm->ns->nspace, rel_rank);
rc = cb_fn(ctx, &proc, &pbkt);
if (PMIX_SUCCESS != rc) {
pbkt.base_ptr = NULL;
PMIX_DESTRUCT(&pbkt);
PMIX_DESTRUCT(&bkt);
goto error;
}
pbkt.base_ptr = NULL;
PMIX_DESTRUCT(&pbkt);
PMIX_BYTE_OBJECT_DESTRUCT(&bo2); PMIX_BYTE_OBJECT_DESTRUCT(&bo2);
/* get the next blob */ /* get the next blob */
cnt = 1; cnt = 1;

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

@ -1,7 +1,7 @@
/* /*
* Copyright (c) 2015-2018 Intel, Inc. All rights reserved. * Copyright (c) 2015-2018 Intel, Inc. All rights reserved.
* Copyright (c) 2016-2018 IBM Corporation. All rights reserved. * Copyright (c) 2016-2018 IBM Corporation. All rights reserved.
* Copyright (c) 2016-2018 Mellanox Technologies, Inc. * Copyright (c) 2016-2019 Mellanox Technologies, Inc.
* All rights reserved. * All rights reserved.
* Copyright (c) 2018 Research Organization for Information Science * Copyright (c) 2018 Research Organization for Information Science
* and Technology (RIST). All rights reserved. * and Technology (RIST). All rights reserved.
@ -119,10 +119,10 @@ static pmix_status_t ds12_store(const pmix_proc_t *proc,
* always contains data solely from remote procs, and we * always contains data solely from remote procs, and we
* shall store it accordingly */ * shall store it accordingly */
static pmix_status_t ds12_store_modex(struct pmix_namespace_t *nspace, static pmix_status_t ds12_store_modex(struct pmix_namespace_t *nspace,
pmix_list_t *cbs, pmix_buffer_t *buf,
pmix_buffer_t *buf) void *cbdata)
{ {
return pmix_common_dstor_store_modex(ds12_ctx, nspace, cbs, buf); return pmix_common_dstor_store_modex(ds12_ctx, nspace, buf, cbdata);
} }
static pmix_status_t ds12_fetch(const pmix_proc_t *proc, static pmix_status_t ds12_fetch(const pmix_proc_t *proc,

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

@ -1,7 +1,7 @@
/* /*
* Copyright (c) 2015-2018 Intel, Inc. All rights reserved. * Copyright (c) 2015-2018 Intel, Inc. All rights reserved.
* Copyright (c) 2016-2018 IBM Corporation. All rights reserved. * Copyright (c) 2016-2018 IBM Corporation. All rights reserved.
* Copyright (c) 2016-2018 Mellanox Technologies, Inc. * Copyright (c) 2016-2019 Mellanox Technologies, Inc.
* All rights reserved. * All rights reserved.
* Copyright (c) 2018 Research Organization for Information Science * Copyright (c) 2018 Research Organization for Information Science
* and Technology (RIST). All rights reserved. * and Technology (RIST). All rights reserved.
@ -107,10 +107,10 @@ static pmix_status_t ds21_store(const pmix_proc_t *proc,
* always contains data solely from remote procs, and we * always contains data solely from remote procs, and we
* shall store it accordingly */ * shall store it accordingly */
static pmix_status_t ds21_store_modex(struct pmix_namespace_t *nspace, static pmix_status_t ds21_store_modex(struct pmix_namespace_t *nspace,
pmix_list_t *cbs, pmix_buffer_t *buf,
pmix_buffer_t *buf) void *cbdata)
{ {
return pmix_common_dstor_store_modex(ds21_ctx, nspace, cbs, buf); return pmix_common_dstor_store_modex(ds21_ctx, nspace, buf, cbdata);
} }
static pmix_status_t ds21_fetch(const pmix_proc_t *proc, static pmix_status_t ds21_fetch(const pmix_proc_t *proc,

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

@ -3,7 +3,6 @@
* All rights reserved. * All rights reserved.
* Copyright (c) 2019 Research Organization for Information Science * Copyright (c) 2019 Research Organization for Information Science
* and Technology (RIST). All rights reserved. * and Technology (RIST). All rights reserved.
* Copyright (c) 2019 Intel, Inc. All rights reserved.
* $COPYRIGHT$ * $COPYRIGHT$
* *
* Additional copyrights may follow * Additional copyrights may follow

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

@ -1,6 +1,6 @@
/* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil -*- */ /* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil -*- */
/* /*
* Copyright (c) 2016-2018 Mellanox Technologies, Inc. * Copyright (c) 2016-2019 Mellanox Technologies, Inc.
* All rights reserved. * All rights reserved.
* Copyright (c) 2016-2018 Intel, Inc. All rights reserved. * Copyright (c) 2016-2018 Intel, Inc. All rights reserved.
* Copyright (c) 2018 IBM Corporation. All rights reserved. * Copyright (c) 2018 IBM Corporation. All rights reserved.
@ -234,17 +234,14 @@ typedef pmix_status_t (*pmix_gds_base_module_store_fn_t)(const pmix_proc_t *proc
* ranks - a list of pmix_rank_info_t for the local ranks from this * ranks - a list of pmix_rank_info_t for the local ranks from this
* nspace - this is to be used to filter the cbs list * nspace - this is to be used to filter the cbs list
* *
* cbs - a list of pmix_server_caddy_t's that contain the pmix_peer_t * cbdata - pointer to modex callback data
* pointers of the local participants. The list can be used to
* identify those participants corresponding to this nspace
* (and thus, GDS component)
* *
* bo - pointer to the byte object containing the data * bo - pointer to the byte object containing the data
* *
*/ */
typedef pmix_status_t (*pmix_gds_base_module_store_modex_fn_t)(struct pmix_namespace_t *ns, typedef pmix_status_t (*pmix_gds_base_module_store_modex_fn_t)(struct pmix_namespace_t *ns,
pmix_list_t *cbs, pmix_buffer_t *buff,
pmix_buffer_t *buff); void *cbdata);
/** /**
* define a convenience macro for storing modex byte objects * define a convenience macro for storing modex byte objects
@ -253,17 +250,16 @@ typedef pmix_status_t (*pmix_gds_base_module_store_modex_fn_t)(struct pmix_names
* *
* n - pointer to the pmix_namespace_t this blob is to be stored for * n - pointer to the pmix_namespace_t this blob is to be stored for
* *
* l - pointer to pmix_list_t containing pmix_server_caddy_t objects
* of the local_cbs of the collective tracker
*
* b - pointer to pmix_byte_object_t containing the data * b - pointer to pmix_byte_object_t containing the data
*
* t - pointer to the modex server tracker
*/ */
#define PMIX_GDS_STORE_MODEX(r, n, l, b) \ #define PMIX_GDS_STORE_MODEX(r, n, b, t) \
do { \ do { \
pmix_output_verbose(1, pmix_gds_base_output, \ pmix_output_verbose(1, pmix_gds_base_output, \
"[%s:%d] GDS STORE MODEX WITH %s", \ "[%s:%d] GDS STORE MODEX WITH %s", \
__FILE__, __LINE__, (n)->compat.gds->name); \ __FILE__, __LINE__, (n)->compat.gds->name); \
(r) = (n)->compat.gds->store_modex((struct pmix_namespace_t*)n, l, b); \ (r) = (n)->compat.gds->store_modex((struct pmix_namespace_t*)n, b, t); \
} while (0) } while (0)
/** /**

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

@ -1,9 +1,9 @@
/* /*
* Copyright (c) 2015-2018 Intel, Inc. All rights reserved. * Copyright (c) 2015-2019 Intel, Inc. All rights reserved.
* Copyright (c) 2016-2018 IBM Corporation. All rights reserved. * Copyright (c) 2016-2018 IBM Corporation. All rights reserved.
* Copyright (c) 2018 Research Organization for Information Science * Copyright (c) 2018 Research Organization for Information Science
* and Technology (RIST). All rights reserved. * and Technology (RIST). All rights reserved.
* Copyright (c) 2018 Mellanox Technologies, Inc. * Copyright (c) 2018-2019 Mellanox Technologies, Inc.
* All rights reserved. * All rights reserved.
* *
* $COPYRIGHT$ * $COPYRIGHT$
@ -37,7 +37,7 @@
#include "src/client/pmix_client_ops.h" #include "src/client/pmix_client_ops.h"
#include "src/server/pmix_server_ops.h" #include "src/server/pmix_server_ops.h"
#include "src/util/argv.h" #include "src/util/argv.h"
#include "src/util/compress.h" #include "src/mca/pcompress/base/base.h"
#include "src/util/error.h" #include "src/util/error.h"
#include "src/util/hash.h" #include "src/util/hash.h"
#include "src/util/output.h" #include "src/util/output.h"
@ -67,13 +67,12 @@ static pmix_status_t hash_store(const pmix_proc_t *proc,
pmix_kval_t *kv); pmix_kval_t *kv);
static pmix_status_t hash_store_modex(struct pmix_namespace_t *ns, static pmix_status_t hash_store_modex(struct pmix_namespace_t *ns,
pmix_list_t *cbs, pmix_buffer_t *buff,
pmix_buffer_t *buff); void *cbdata);
static pmix_status_t _hash_store_modex(void * cbdata, static pmix_status_t _hash_store_modex(pmix_gds_base_ctx_t ctx,
struct pmix_namespace_t *ns, pmix_proc_t *proc,
pmix_list_t *cbs, pmix_buffer_t *pbkt);
pmix_byte_object_t *bo);
static pmix_status_t hash_fetch(const pmix_proc_t *proc, static pmix_status_t hash_fetch(const pmix_proc_t *proc,
pmix_scope_t scope, bool copy, pmix_scope_t scope, bool copy,
@ -487,7 +486,7 @@ pmix_status_t hash_cache_job_info(struct pmix_namespace_t *ns,
/* if the value contains a string that is longer than the /* if the value contains a string that is longer than the
* limit, then compress it */ * limit, then compress it */
if (PMIX_STRING_SIZE_CHECK(kp2->value)) { if (PMIX_STRING_SIZE_CHECK(kp2->value)) {
if (pmix_util_compress_string(kp2->value->data.string, &tmp, &len)) { if (pmix_compress.compress_string(kp2->value->data.string, &tmp, &len)) {
if (NULL == tmp) { if (NULL == tmp) {
PMIX_ERROR_LOG(PMIX_ERR_NOMEM); PMIX_ERROR_LOG(PMIX_ERR_NOMEM);
rc = PMIX_ERR_NOMEM; rc = PMIX_ERR_NOMEM;
@ -524,7 +523,7 @@ pmix_status_t hash_cache_job_info(struct pmix_namespace_t *ns,
/* if the value contains a string that is longer than the /* if the value contains a string that is longer than the
* limit, then compress it */ * limit, then compress it */
if (PMIX_STRING_SIZE_CHECK(kp2->value)) { if (PMIX_STRING_SIZE_CHECK(kp2->value)) {
if (pmix_util_compress_string(kp2->value->data.string, &tmp, &len)) { if (pmix_compress.compress_string(kp2->value->data.string, &tmp, &len)) {
if (NULL == tmp) { if (NULL == tmp) {
rc = PMIX_ERR_NOMEM; rc = PMIX_ERR_NOMEM;
PMIX_ERROR_LOG(rc); PMIX_ERROR_LOG(rc);
@ -852,7 +851,7 @@ static pmix_status_t hash_store_job_info(const char *nspace,
/* if the value contains a string that is longer than the /* if the value contains a string that is longer than the
* limit, then compress it */ * limit, then compress it */
if (PMIX_STRING_SIZE_CHECK(kp2->value)) { if (PMIX_STRING_SIZE_CHECK(kp2->value)) {
if (pmix_util_compress_string(kp2->value->data.string, &tmp, &len)) { if (pmix_compress.compress_string(kp2->value->data.string, &tmp, &len)) {
if (NULL == tmp) { if (NULL == tmp) {
PMIX_ERROR_LOG(PMIX_ERR_NOMEM); PMIX_ERROR_LOG(PMIX_ERR_NOMEM);
rc = PMIX_ERR_NOMEM; rc = PMIX_ERR_NOMEM;
@ -1032,7 +1031,7 @@ static pmix_status_t hash_store_job_info(const char *nspace,
/* if the value contains a string that is longer than the /* if the value contains a string that is longer than the
* limit, then compress it */ * limit, then compress it */
if (PMIX_STRING_SIZE_CHECK(kptr->value)) { if (PMIX_STRING_SIZE_CHECK(kptr->value)) {
if (pmix_util_compress_string(kptr->value->data.string, &tmp, &len)) { if (pmix_compress.compress_string(kptr->value->data.string, &tmp, &len)) {
if (NULL == tmp) { if (NULL == tmp) {
PMIX_ERROR_LOG(PMIX_ERR_NOMEM); PMIX_ERROR_LOG(PMIX_ERR_NOMEM);
rc = PMIX_ERR_NOMEM; rc = PMIX_ERR_NOMEM;
@ -1190,33 +1189,30 @@ static pmix_status_t hash_store(const pmix_proc_t *proc,
* always contains data solely from remote procs, and we * always contains data solely from remote procs, and we
* shall store it accordingly */ * shall store it accordingly */
static pmix_status_t hash_store_modex(struct pmix_namespace_t *nspace, static pmix_status_t hash_store_modex(struct pmix_namespace_t *nspace,
pmix_list_t *cbs, pmix_buffer_t *buf,
pmix_buffer_t *buf) { void *cbdata) {
return pmix_gds_base_store_modex(nspace, cbs, buf, _hash_store_modex, NULL); return pmix_gds_base_store_modex(nspace, buf, NULL,
_hash_store_modex, cbdata);
} }
static pmix_status_t _hash_store_modex(void * cbdata, static pmix_status_t _hash_store_modex(pmix_gds_base_ctx_t ctx,
struct pmix_namespace_t *nspace, pmix_proc_t *proc,
pmix_list_t *cbs, pmix_buffer_t *pbkt)
pmix_byte_object_t *bo)
{ {
pmix_namespace_t *ns = (pmix_namespace_t*)nspace;
pmix_hash_trkr_t *trk, *t; pmix_hash_trkr_t *trk, *t;
pmix_status_t rc = PMIX_SUCCESS; pmix_status_t rc = PMIX_SUCCESS;
int32_t cnt; int32_t cnt;
pmix_buffer_t pbkt;
pmix_proc_t proc;
pmix_kval_t *kv; pmix_kval_t *kv;
pmix_output_verbose(2, pmix_gds_base_framework.framework_output, pmix_output_verbose(2, pmix_gds_base_framework.framework_output,
"[%s:%d] gds:hash:store_modex for nspace %s", "[%s:%d] gds:hash:store_modex for nspace %s",
pmix_globals.myid.nspace, pmix_globals.myid.rank, pmix_globals.myid.nspace, pmix_globals.myid.rank,
ns->nspace); proc->nspace);
/* find the hash table for this nspace */ /* find the hash table for this nspace */
trk = NULL; trk = NULL;
PMIX_LIST_FOREACH(t, &myhashes, pmix_hash_trkr_t) { PMIX_LIST_FOREACH(t, &myhashes, pmix_hash_trkr_t) {
if (0 == strcmp(ns->nspace, t->ns)) { if (0 == strcmp(proc->nspace, t->ns)) {
trk = t; trk = t;
break; break;
} }
@ -1224,7 +1220,7 @@ static pmix_status_t _hash_store_modex(void * cbdata,
if (NULL == trk) { if (NULL == trk) {
/* create one */ /* create one */
trk = PMIX_NEW(pmix_hash_trkr_t); trk = PMIX_NEW(pmix_hash_trkr_t);
trk->ns = strdup(ns->nspace); trk->ns = strdup(proc->nspace);
pmix_list_append(&myhashes, &trk->super); pmix_list_append(&myhashes, &trk->super);
} }
@ -1234,41 +1230,26 @@ static pmix_status_t _hash_store_modex(void * cbdata,
* the rank followed by pmix_kval_t's. The list of callbacks * the rank followed by pmix_kval_t's. The list of callbacks
* contains all local participants. */ * contains all local participants. */
/* setup the byte object for unpacking */ PMIX_BFROPS_UNPACK(rc, pmix_globals.mypeer, pbkt, proc, &cnt, PMIX_PROC);
PMIX_CONSTRUCT(&pbkt, pmix_buffer_t);
/* the next step unfortunately NULLs the byte object's
* entries, so we need to ensure we restore them! */
PMIX_LOAD_BUFFER(pmix_globals.mypeer, &pbkt, bo->bytes, bo->size);
/* unload the proc that provided this data */
cnt = 1;
PMIX_BFROPS_UNPACK(rc, pmix_globals.mypeer, &pbkt, &proc, &cnt, PMIX_PROC);
if (PMIX_SUCCESS != rc) { if (PMIX_SUCCESS != rc) {
PMIX_ERROR_LOG(rc); PMIX_ERROR_LOG(rc);
bo->bytes = pbkt.base_ptr;
bo->size = pbkt.bytes_used; // restore the incoming data
pbkt.base_ptr = NULL;
PMIX_DESTRUCT(&pbkt);
return rc; return rc;
} }
/* unpack the remaining values until we hit the end of the buffer */ /* unpack the remaining values until we hit the end of the buffer */
cnt = 1; cnt = 1;
kv = PMIX_NEW(pmix_kval_t); kv = PMIX_NEW(pmix_kval_t);
PMIX_BFROPS_UNPACK(rc, pmix_globals.mypeer, &pbkt, kv, &cnt, PMIX_KVAL); PMIX_BFROPS_UNPACK(rc, pmix_globals.mypeer, pbkt, kv, &cnt, PMIX_KVAL);
while (PMIX_SUCCESS == rc) { while (PMIX_SUCCESS == rc) {
/* store this in the hash table */ /* store this in the hash table */
if (PMIX_SUCCESS != (rc = pmix_hash_store(&trk->remote, proc.rank, kv))) { if (PMIX_SUCCESS != (rc = pmix_hash_store(&trk->remote, proc->rank, kv))) {
PMIX_ERROR_LOG(rc); PMIX_ERROR_LOG(rc);
bo->bytes = pbkt.base_ptr;
bo->size = pbkt.bytes_used; // restore the incoming data
pbkt.base_ptr = NULL;
PMIX_DESTRUCT(&pbkt);
return rc; return rc;
} }
PMIX_RELEASE(kv); // maintain accounting as the hash increments the ref count PMIX_RELEASE(kv); // maintain accounting as the hash increments the ref count
/* continue along */ /* continue along */
kv = PMIX_NEW(pmix_kval_t); kv = PMIX_NEW(pmix_kval_t);
cnt = 1; cnt = 1;
PMIX_BFROPS_UNPACK(rc, pmix_globals.mypeer, &pbkt, kv, &cnt, PMIX_KVAL); PMIX_BFROPS_UNPACK(rc, pmix_globals.mypeer, pbkt, kv, &cnt, PMIX_KVAL);
} }
PMIX_RELEASE(kv); // maintain accounting PMIX_RELEASE(kv); // maintain accounting
if (PMIX_ERR_UNPACK_READ_PAST_END_OF_BUFFER != rc) { if (PMIX_ERR_UNPACK_READ_PAST_END_OF_BUFFER != rc) {
@ -1276,10 +1257,6 @@ static pmix_status_t _hash_store_modex(void * cbdata,
} else { } else {
rc = PMIX_SUCCESS; rc = PMIX_SUCCESS;
} }
bo->bytes = pbkt.base_ptr;
bo->size = pbkt.bytes_used; // restore the incoming data
pbkt.base_ptr = NULL;
PMIX_DESTRUCT(&pbkt);
return rc; return rc;
} }

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

@ -0,0 +1,37 @@
#
# Copyright (c) 2004-2010 The Trustees of Indiana University and Indiana
# University Research and Technology
# Corporation. All rights reserved.
# Copyright (c) 2010-2014 Cisco Systems, Inc. All rights reserved.
# Copyright (c) 2019 Intel, Inc. All rights reserved.
# $COPYRIGHT$
#
# Additional copyrights may follow
#
# $HEADER$
#
# main library setup
noinst_LTLIBRARIES = libmca_pcompress.la
libmca_pcompress_la_SOURCES =
# local files
headers = pcompress.h
libmca_pcompress_la_SOURCES += $(headers)
# Ensure that the man pages are rebuilt if the pmix_config.h file
# changes; a "good enough" way to know if configure was run again (and
# therefore the release date or version may have changed)
$(nodist_man_MANS): $(top_builddir)/pmix/include/pmix_config.h
# Conditionally install the header files
if WANT_INSTALL_HEADERS
pmixdir = $(pmixincludedir)/$(subdir)
nobase_pmix_HEADERS = $(headers)
endif
include base/Makefile.am
distclean-local:
rm -f base/static-components.h
rm -f $(nodist_man_MANS)

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

@ -0,0 +1,20 @@
#
# Copyright (c) 2004-2010 The Trustees of Indiana University and Indiana
# University Research and Technology
# Corporation. All rights reserved.
# Copyright (c) 2014 Cisco Systems, Inc. All rights reserved.
# Copyright (c) 2019 Intel, Inc. All rights reserved.
# $COPYRIGHT$
#
# Additional copyrights may follow
#
# $HEADER$
#
headers += \
base/base.h
libmca_pcompress_la_SOURCES += \
base/pcompress_base_frame.c \
base/pcompress_base_select.c \
base/pcompress_base_fns.c

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

@ -0,0 +1,87 @@
/*
* Copyright (c) 2004-2010 The Trustees of Indiana University and Indiana
* University Research and Technology
* Corporation. All rights reserved.
*
* Copyright (c) 2019 Intel, Inc. All rights reserved.
* $COPYRIGHT$
*
* Additional copyrights may follow
*
* $HEADER$
*/
#ifndef PMIX_COMPRESS_BASE_H
#define PMIX_COMPRESS_BASE_H
#include "pmix_config.h"
#include "src/mca/pcompress/pcompress.h"
#include "src/util/pmix_environ.h"
#include "src/mca/base/base.h"
/*
* Global functions for MCA overall COMPRESS
*/
#if defined(c_plusplus) || defined(__cplusplus)
extern "C" {
#endif
/* define a macro for quickly checking if a string exceeds the
* compression limit */
#define PMIX_STRING_SIZE_CHECK(s) \
(PMIX_STRING == (s)->type && NULL != (s)->data.string && pmix_compress_base.compress_limit < strlen((s)->data.string))
#define PMIX_VALUE_COMPRESSED_STRING_UNPACK(s) \
do { \
char *tmp; \
/* if this is a compressed string, then uncompress it */ \
if (PMIX_COMPRESSED_STRING == (s)->type) { \
pmix_compress.decompress_string(&tmp, (uint8_t*)(s)->data.bo.bytes, \
(s)->data.bo.size); \
if (NULL == tmp) { \
PMIX_ERROR_LOG(PMIX_ERR_NOMEM); \
rc = PMIX_ERR_NOMEM; \
PMIX_VALUE_RELEASE(s); \
val = NULL; \
} else { \
PMIX_VALUE_DESTRUCT(s); \
(s)->data.string = tmp; \
(s)->type = PMIX_STRING; \
} \
} \
} while(0)
typedef struct {
size_t compress_limit;
} pmix_compress_base_t;
PMIX_EXPORT extern pmix_compress_base_t pmix_compress_base;
/**
* Select an available component.
*
* @retval OPAL_SUCCESS Upon Success
* @retval OPAL_NOT_FOUND If no component can be selected
* @retval OPAL_ERROR Upon other failure
*
*/
PMIX_EXPORT int pmix_compress_base_select(void);
/**
* Globals
*/
PMIX_EXPORT extern pmix_mca_base_framework_t pmix_pcompress_base_framework;
PMIX_EXPORT extern pmix_compress_base_module_t pmix_compress;
/**
*
*/
PMIX_EXPORT int pmix_compress_base_tar_create(char ** target);
PMIX_EXPORT int pmix_compress_base_tar_extract(char ** target);
#if defined(c_plusplus) || defined(__cplusplus)
}
#endif
#endif /* PMIX_COMPRESS_BASE_H */

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

@ -0,0 +1,138 @@
/*
* Copyright (c) 2004-2010 The Trustees of Indiana University.
* All rights reserved.
* Copyright (c) 2015 Research Organization for Information Science
* and Technology (RIST). All rights reserved.
*
* Copyright (c) 2018 Amazon.com, Inc. or its affiliates. All Rights reserved.
* Copyright (c) 2019 Intel, Inc. All rights reserved.
* $COPYRIGHT$
*
* Additional copyrights may follow
*
* $HEADER$
*/
#include "pmix_config.h"
#include <string.h>
#include <sys/wait.h>
#if HAVE_SYS_TYPES_H
#include <sys/types.h>
#endif
#if HAVE_UNISTD_H
#include <unistd.h>
#endif
#ifdef HAVE_FCNTL_H
#include <fcntl.h>
#endif /* HAVE_FCNTL_H */
#ifdef HAVE_SYS_STAT_H
#include <sys/stat.h>
#endif
#include "pmix_common.h"
#include "src/mca/mca.h"
#include "src/mca/base/base.h"
#include "src/util/os_dirpath.h"
#include "src/util/output.h"
#include "src/util/argv.h"
#include "src/util/printf.h"
#include "src/mca/pcompress/pcompress.h"
#include "src/mca/pcompress/base/base.h"
/******************
* Local Function Defs
******************/
/******************
* Object stuff
******************/
int pmix_compress_base_tar_create(char ** target)
{
int exit_status = PMIX_SUCCESS;
char *tar_target = NULL;
char **argv = NULL;
pid_t child_pid = 0;
int status = 0;
pmix_asprintf(&tar_target, "%s.tar", *target);
child_pid = fork();
if( 0 == child_pid ) { /* Child */
char *cmd;
pmix_asprintf(&cmd, "tar -cf %s %s", tar_target, *target);
argv = pmix_argv_split(cmd, ' ');
status = execvp(argv[0], argv);
pmix_output(0, "compress:base: Tar:: Failed to exec child [%s] status = %d\n", cmd, status);
exit(PMIX_ERROR);
}
else if(0 < child_pid) {
waitpid(child_pid, &status, 0);
if( !WIFEXITED(status) ) {
exit_status = PMIX_ERROR;
goto cleanup;
}
free(*target);
*target = strdup(tar_target);
}
else {
exit_status = PMIX_ERROR;
goto cleanup;
}
cleanup:
if( NULL != tar_target ) {
free(tar_target);
}
return exit_status;
}
int pmix_compress_base_tar_extract(char ** target)
{
int exit_status = PMIX_SUCCESS;
char **argv = NULL;
pid_t child_pid = 0;
int status = 0;
child_pid = fork();
if( 0 == child_pid ) { /* Child */
char *cmd;
pmix_asprintf(&cmd, "tar -xf %s", *target);
argv = pmix_argv_split(cmd, ' ');
status = execvp(argv[0], argv);
pmix_output(0, "compress:base: Tar:: Failed to exec child [%s] status = %d\n", cmd, status);
exit(PMIX_ERROR);
}
else if(0 < child_pid) {
waitpid(child_pid, &status, 0);
if( !WIFEXITED(status) ) {
exit_status = PMIX_ERROR;
goto cleanup;
}
/* Strip off the '.tar' */
(*target)[strlen(*target)-4] = '\0';
}
else {
exit_status = PMIX_ERROR;
goto cleanup;
}
cleanup:
return exit_status;
}
/******************
* Local Functions
******************/

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

@ -0,0 +1,89 @@
/* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil -*- */
/*
* Copyright (c) 2004-2010 The Trustees of Indiana University.
* All rights reserved.
* Copyright (c) 2011-2013 Los Alamos National Security, LLC.
* All rights reserved.
* Copyright (c) 2015 Research Organization for Information Science
* and Technology (RIST). All rights reserved.
* Copyright (c) 2019 Intel, Inc. All rights reserved.
* $COPYRIGHT$
*
* Additional copyrights may follow
*
* $HEADER$
*/
#include "pmix_config.h"
#include "src/mca/base/base.h"
#include "src/mca/pcompress/base/base.h"
#include "src/mca/pcompress/base/static-components.h"
/*
* Globals
*/
static bool compress_block(char *instring,
uint8_t **outbytes,
size_t *nbytes)
{
return false;
}
static bool decompress_block(char **outstring,
uint8_t *inbytes, size_t len)
{
return false;
}
pmix_compress_base_module_t pmix_compress = {
NULL, /* init */
NULL, /* finalize */
NULL, /* compress */
NULL, /* compress_nb */
NULL, /* decompress */
NULL, /* decompress_nb */
compress_block,
decompress_block
};
pmix_compress_base_t pmix_compress_base = {0};
pmix_compress_base_component_t pmix_compress_base_selected_component = {{0}};
static int pmix_compress_base_register(pmix_mca_base_register_flag_t flags)
{
pmix_compress_base.compress_limit = 4096;
(void) pmix_mca_base_var_register("pmix", "compress", "base", "limit",
"Threshold beyond which data will be compressed",
PMIX_MCA_BASE_VAR_TYPE_SIZE_T, NULL, 0, 0, PMIX_INFO_LVL_3,
PMIX_MCA_BASE_VAR_SCOPE_READONLY, &pmix_compress_base.compress_limit);
return PMIX_SUCCESS;
}
/**
* Function for finding and opening either all MCA components,
* or the one that was specifically requested via a MCA parameter.
*/
static int pmix_compress_base_open(pmix_mca_base_open_flag_t flags)
{
/* Open up all available components */
return pmix_mca_base_framework_components_open(&pmix_pcompress_base_framework, flags);
}
static int pmix_compress_base_close(void)
{
/* Call the component's finalize routine */
if( NULL != pmix_compress.finalize ) {
pmix_compress.finalize();
}
/* Close all available modules that are open */
return pmix_mca_base_framework_components_close (&pmix_pcompress_base_framework, NULL);
}
PMIX_MCA_BASE_FRAMEWORK_DECLARE(pmix, pcompress, "PCOMPRESS MCA",
pmix_compress_base_register, pmix_compress_base_open,
pmix_compress_base_close, mca_pcompress_base_static_components, 0);

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

@ -0,0 +1,58 @@
/* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil -*- */
/*
* Copyright (c) 2004-2010 The Trustees of Indiana University.
* All rights reserved.
* Copyright (c) 2015 Research Organization for Information Science
* and Technology (RIST). All rights reserved.
*
* Copyright (c) 2015 Los Alamos National Security, LLC. All rights
* reserved.
* Copyright (c) 2019 Intel, Inc. All rights reserved.
* $COPYRIGHT$
*
* Additional copyrights may follow
*
* $HEADER$
*/
#include "pmix_config.h"
#ifdef HAVE_UNISTD_H
#include "unistd.h"
#endif
#include "pmix_common.h"
#include "src/util/output.h"
#include "src/mca/mca.h"
#include "src/mca/base/base.h"
#include "src/mca/pcompress/base/base.h"
int pmix_compress_base_select(void)
{
int ret = PMIX_SUCCESS;
pmix_compress_base_component_t *best_component = NULL;
pmix_compress_base_module_t *best_module = NULL;
/*
* Select the best component
*/
if( PMIX_SUCCESS != pmix_mca_base_select("pcompress", pmix_pcompress_base_framework.framework_output,
&pmix_pcompress_base_framework.framework_components,
(pmix_mca_base_module_t **) &best_module,
(pmix_mca_base_component_t **) &best_component, NULL) ) {
/* This will only happen if no component was selected,
* in which case we use the default one */
goto cleanup;
}
/* Initialize the winner */
if (NULL != best_module) {
if (PMIX_SUCCESS != (ret = best_module->init()) ) {
goto cleanup;
}
pmix_compress = *best_module;
}
cleanup:
return ret;
}

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

@ -0,0 +1,155 @@
/* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil -*- */
/*
* Copyright (c) 2004-2010 The Trustees of Indiana University and Indiana
* University Research and Technology
* Corporation. All rights reserved.
* Copyright (c) 2015 Los Alamos National Security, LLC. All rights
* reserved.
*
* Copyright (c) 2019 Intel, Inc. All rights reserved.
* $COPYRIGHT$
*
* Additional copyrights may follow
*
* $HEADER$
*/
/**
* @file
*
* Compression Framework
*
* General Description:
*
* The PMIX Compress framework has been created to provide an abstract interface
* to the compression agent library on the host machine. This fromework is useful
* when distributing files that can be compressed before sending to dimish the
* load on the network.
*
*/
#ifndef PMIX_MCA_COMPRESS_H
#define PMIX_MCA_COMPRESS_H
#include "pmix_config.h"
#include "src/mca/mca.h"
#include "src/mca/base/base.h"
#include "src/class/pmix_object.h"
#if defined(c_plusplus) || defined(__cplusplus)
extern "C" {
#endif
/**
* Module initialization function.
* Returns PMIX_SUCCESS
*/
typedef int (*pmix_compress_base_module_init_fn_t)
(void);
/**
* Module finalization function.
* Returns PMIX_SUCCESS
*/
typedef int (*pmix_compress_base_module_finalize_fn_t)
(void);
/**
* Compress the file provided
*
* Arguments:
* fname = Filename to compress
* cname = Compressed filename
* postfix = postfix added to filename to create compressed filename
* Returns:
* PMIX_SUCCESS on success, ow PMIX_ERROR
*/
typedef int (*pmix_compress_base_module_compress_fn_t)
(char * fname, char **cname, char **postfix);
typedef int (*pmix_compress_base_module_compress_nb_fn_t)
(char * fname, char **cname, char **postfix, pid_t *child_pid);
/**
* Decompress the file provided
*
* Arguments:
* fname = Filename to compress
* cname = Compressed filename
* Returns:
* PMIX_SUCCESS on success, ow PMIX_ERROR
*/
typedef int (*pmix_compress_base_module_decompress_fn_t)
(char * cname, char **fname);
typedef int (*pmix_compress_base_module_decompress_nb_fn_t)
(char * cname, char **fname, pid_t *child_pid);
/**
* Compress a string
*
* Arguments:
*
*/
typedef bool (*pmix_compress_base_module_compress_string_fn_t)(char *instring,
uint8_t **outbytes,
size_t *nbytes);
typedef bool (*pmix_compress_base_module_decompress_string_fn_t)(char **outstring,
uint8_t *inbytes, size_t len);
/**
* Structure for COMPRESS components.
*/
struct pmix_compress_base_component_2_0_0_t {
/** PMIX_MCA base component */
pmix_mca_base_component_t base_version;
/** PMIX_MCA base data */
pmix_mca_base_component_data_t base_data;
/** Verbosity Level */
int verbose;
/** Output Handle for pmix_output */
int output_handle;
/** Default Priority */
int priority;
};
typedef struct pmix_compress_base_component_2_0_0_t pmix_compress_base_component_2_0_0_t;
typedef struct pmix_compress_base_component_2_0_0_t pmix_compress_base_component_t;
/**
* Structure for COMPRESS modules
*/
struct pmix_compress_base_module_1_0_0_t {
/** Initialization Function */
pmix_compress_base_module_init_fn_t init;
/** Finalization Function */
pmix_compress_base_module_finalize_fn_t finalize;
/** Compress interface */
pmix_compress_base_module_compress_fn_t compress;
pmix_compress_base_module_compress_nb_fn_t compress_nb;
/** Decompress Interface */
pmix_compress_base_module_decompress_fn_t decompress;
pmix_compress_base_module_decompress_nb_fn_t decompress_nb;
/* COMPRESS STRING */
pmix_compress_base_module_compress_string_fn_t compress_string;
pmix_compress_base_module_decompress_string_fn_t decompress_string;
};
typedef struct pmix_compress_base_module_1_0_0_t pmix_compress_base_module_1_0_0_t;
typedef struct pmix_compress_base_module_1_0_0_t pmix_compress_base_module_t;
PMIX_EXPORT extern pmix_compress_base_module_t pmix_compress;
/**
* Macro for use in components that are of type COMPRESS
*/
#define PMIX_COMPRESS_BASE_VERSION_2_0_0 \
PMIX_MCA_BASE_VERSION_1_0_0("pcompress", 2, 0, 0)
#if defined(c_plusplus) || defined(__cplusplus)
}
#endif
#endif /* PMIX_COMPRESS_H */

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

@ -0,0 +1,42 @@
#
# Copyright (c) 2004-2010 The Trustees of Indiana University.
# All rights reserved.
# Copyright (c) 2014-2015 Cisco Systems, Inc. All rights reserved.
# Copyright (c) 2017 IBM Corporation. All rights reserved.
# Copyright (c) 2019 Intel, Inc. All rights reserved.
# $COPYRIGHT$
#
# Additional copyrights may follow
#
# $HEADER$
#
AM_CPPFLAGS = $(pcompress_zlib_CPPFLAGS)
sources = \
compress_zlib.h \
compress_zlib_component.c \
compress_zlib.c
# Make the output library in this directory, and name it either
# mca_<type>_<name>.la (for DSO builds) or libmca_<type>_<name>.la
# (for static builds).
if MCA_BUILD_pmix_pcompress_zlib_DSO
component_noinst =
component_install = mca_pcompress_zlib.la
else
component_noinst = libmca_pcompress_zlib.la
component_install =
endif
mcacomponentdir = $(pmixlibdir)
mcacomponent_LTLIBRARIES = $(component_install)
mca_pcompress_zlib_la_SOURCES = $(sources)
mca_pcompress_zlib_la_LDFLAGS = -module -avoid-version $(pcompress_zlib_LDFLAGS)
mca_pcompress_zlib_la_LIBADD = $(pcompress_zlib_LIBS)
noinst_LTLIBRARIES = $(component_noinst)
libmca_pcompress_zlib_la_SOURCES = $(sources)
libmca_pcompress_zlib_la_LDFLAGS = -module -avoid-version $(pcompress_zlib_LDFLAGS)
libmca_pcompress_zlib_la_LIBADD = $(pcompress_zlib_LIBS)

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

@ -1,6 +1,13 @@
/* /*
* Copyright (c) 2016 Intel, Inc. All rights reserved. * Copyright (c) 2004-2010 The Trustees of Indiana University.
* Copyright (c) 2017 Cisco Systems, Inc. All rights reserved. * All rights reserved.
* Copyright (c) 2010 Oracle and/or its affiliates. All rights reserved.
*
* Copyright (c) 2014 Cisco Systems, Inc. All rights reserved.
* Copyright (c) 2015 Research Organization for Information Science
* and Technology (RIST). All rights reserved.
* Copyright (c) 2018 Amazon.com, Inc. or its affiliates. All Rights reserved.
* Copyright (c) 2019 Intel, Inc. All rights reserved.
* $COPYRIGHT$ * $COPYRIGHT$
* *
* Additional copyrights may follow * Additional copyrights may follow
@ -8,24 +15,43 @@
* $HEADER$ * $HEADER$
*/ */
#include <src/include/pmix_config.h> #include "pmix_config.h"
#include <stdlib.h>
#ifdef HAVE_STRING_H
#include <string.h> #include <string.h>
#endif #include <sys/types.h>
#ifdef HAVE_ZLIB_H #include <sys/wait.h>
#include <sys/stat.h>
#if HAVE_UNISTD_H
#include <unistd.h>
#endif /* HAVE_UNISTD_H */
#include <zlib.h> #include <zlib.h>
#endif
#include "src/include/pmix_globals.h" #include "src/util/pmix_environ.h"
#include "src/util/compress.h" #include "src/util/output.h"
#include "src/util/argv.h"
#include "src/util/pmix_environ.h"
#include "src/util/printf.h"
#if PMIX_HAVE_ZLIB #include "pmix_common.h"
bool pmix_util_compress_string(char *instring, #include "src/util/basename.h"
uint8_t **outbytes,
size_t *nbytes) #include "src/mca/pcompress/base/base.h"
#include "compress_zlib.h"
int pmix_compress_zlib_module_init(void)
{
return PMIX_SUCCESS;
}
int pmix_compress_zlib_module_finalize(void)
{
return PMIX_SUCCESS;
}
bool pmix_compress_zlib_compress_block(char *instring,
uint8_t **outbytes,
size_t *nbytes)
{ {
z_stream strm; z_stream strm;
size_t len, outlen; size_t len, outlen;
@ -75,23 +101,14 @@ bool pmix_util_compress_string(char *instring,
/* bring over the compressed data */ /* bring over the compressed data */
memcpy(ptr, tmp, outlen-sizeof(uint32_t)); memcpy(ptr, tmp, outlen-sizeof(uint32_t));
free(tmp); free(tmp);
pmix_output_verbose(10, pmix_globals.debug_output, pmix_output_verbose(2, pmix_pcompress_base_framework.framework_output,
"JOBDATA COMPRESS INPUT STRING OF LEN %d OUTPUT SIZE %lu", "COMPRESS INPUT STRING OF LEN %d OUTPUT SIZE %lu",
inlen, outlen-sizeof(uint32_t)); inlen, outlen-sizeof(uint32_t));
return true; // we did the compression return true; // we did the compression
} }
#else
bool pmix_util_compress_string(char *instring,
uint8_t **outbytes,
size_t *nbytes)
{
return false; // we did not compress
}
#endif
#if PMIX_HAVE_ZLIB bool pmix_compress_zlib_uncompress_block(char **outstring,
void pmix_util_uncompress_string(char **outstring, uint8_t *inbytes, size_t len)
uint8_t *inbytes, size_t len)
{ {
uint8_t *dest; uint8_t *dest;
int32_t len2; int32_t len2;
@ -104,21 +121,21 @@ void pmix_util_uncompress_string(char **outstring,
/* the first 4 bytes contains the uncompressed size */ /* the first 4 bytes contains the uncompressed size */
memcpy(&len2, inbytes, sizeof(uint32_t)); memcpy(&len2, inbytes, sizeof(uint32_t));
pmix_output_verbose(10, pmix_globals.debug_output, pmix_output_verbose(2, pmix_pcompress_base_framework.framework_output,
"DECOMPRESSING INPUT OF LEN %lu OUTPUT %d", len, len2); "DECOMPRESSING INPUT OF LEN %lu OUTPUT %d", len, len2);
/* setting destination to the fully decompressed size, +1 to /* setting destination to the fully decompressed size, +1 to
* hold the NULL terminator */ * hold the NULL terminator */
dest = (uint8_t*)malloc(len2+1); dest = (uint8_t*)malloc(len2+1);
if (NULL == dest) { if (NULL == dest) {
return; return false;
} }
memset(dest, 0, len2+1); memset(dest, 0, len2+1);
memset (&strm, 0, sizeof (strm)); memset (&strm, 0, sizeof (strm));
if (Z_OK != inflateInit(&strm)) { if (Z_OK != inflateInit(&strm)) {
free(dest); free(dest);
return; return false;
} }
strm.avail_in = len; strm.avail_in = len;
strm.next_in = (uint8_t*)(inbytes + sizeof(uint32_t)); strm.next_in = (uint8_t*)(inbytes + sizeof(uint32_t));
@ -130,19 +147,7 @@ void pmix_util_uncompress_string(char **outstring,
/* ensure this is NULL terminated! */ /* ensure this is NULL terminated! */
dest[len2] = '\0'; dest[len2] = '\0';
*outstring = (char*)dest; *outstring = (char*)dest;
pmix_output_verbose(10, pmix_globals.debug_output, pmix_output_verbose(2, pmix_pcompress_base_framework.framework_output,
"\tFINAL LEN: %lu CODE: %d", strlen(*outstring), rc); "\tFINAL LEN: %lu CODE: %d", strlen(*outstring), rc);
return; return true;
} }
#else
/* this can never actually be used - there is no way we should
* receive a PMIX_COMPRESSED_STRING unless we compressed it,
* which means PMIX_HAVE_ZLIB must have been true. Still, we
* include the stub just to avoid requiring #if's in the rest
* of the code */
void pmix_util_uncompress_string(char **outstring,
uint8_t *inbytes, size_t len)
{
*outstring = NULL;
}
#endif

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

@ -0,0 +1,55 @@
/*
* Copyright (c) 2004-2010 The Trustees of Indiana University.
* All rights reserved.
* Copyright (c) 2019 Intel, Inc. All rights reserved.
* $COPYRIGHT$
*
* Additional copyrights may follow
*
* $HEADER$
*/
/**
* @file
*
* ZLIB COMPRESS component
*
* Uses the zlib library
*/
#ifndef MCA_COMPRESS_ZLIB_EXPORT_H
#define MCA_COMPRESS_ZLIB_EXPORT_H
#include "pmix_config.h"
#include "src/util/output.h"
#include "src/mca/mca.h"
#include "src/mca/pcompress/pcompress.h"
#if defined(c_plusplus) || defined(__cplusplus)
extern "C" {
#endif
extern pmix_mca_base_component_t mca_pcompress_zlib_component;
/*
* Module functions
*/
int pmix_compress_zlib_module_init(void);
int pmix_compress_zlib_module_finalize(void);
/*
* Actual funcationality
*/
bool pmix_compress_zlib_compress_block(char *instring,
uint8_t **outbytes,
size_t *nbytes);
bool pmix_compress_zlib_uncompress_block(char **outstring,
uint8_t *inbytes, size_t len);
#if defined(c_plusplus) || defined(__cplusplus)
}
#endif
#endif /* MCA_COMPRESS_ZLIB_EXPORT_H */

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

@ -0,0 +1,88 @@
/* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil -*- */
/*
* Copyright (c) 2004-2010 The Trustees of Indiana University.
* All rights reserved.
* Copyright (c) 2015 Los Alamos National Security, LLC. All rights
* reserved.
* Copyright (c) 2019 Intel, Inc. All rights reserved.
* $COPYRIGHT$
*
* Additional copyrights may follow
*
* $HEADER$
*/
#include "pmix_config.h"
#include "pmix_common.h"
#include "src/mca/pcompress/base/base.h"
#include "compress_zlib.h"
/*
* Public string for version number
*/
const char *pmix_compress_zlib_component_version_string =
"PMIX COMPRESS zlib MCA component version " PMIX_VERSION;
/*
* Local functionality
*/
static int compress_zlib_open(void);
static int compress_zlib_close(void);
static int compress_zlib_query(pmix_mca_base_module_t **module, int *priority);
/*
* Instantiate the public struct with all of our public information
* and pointer to our public functions in it
*/
PMIX_EXPORT pmix_mca_base_component_t mca_pcompress_zlib_component = {
/* Handle the general mca_component_t struct containing
* meta information about the component zlib
*/
PMIX_COMPRESS_BASE_VERSION_2_0_0,
/* Component name and version */
.pmix_mca_component_name = "zlib",
PMIX_MCA_BASE_MAKE_VERSION(component, PMIX_MAJOR_VERSION, PMIX_MINOR_VERSION,
PMIX_RELEASE_VERSION),
/* Component open and close functions */
.pmix_mca_open_component = compress_zlib_open,
.pmix_mca_close_component = compress_zlib_close,
.pmix_mca_query_component = compress_zlib_query
};
/*
* Zlib module
*/
static pmix_compress_base_module_t loc_module = {
/** Initialization Function */
.init = pmix_compress_zlib_module_init,
/** Finalization Function */
.finalize = pmix_compress_zlib_module_finalize,
/** Compress Function */
.compress_string = pmix_compress_zlib_compress_block,
/** Decompress Function */
.decompress_string = pmix_compress_zlib_uncompress_block,
};
static int compress_zlib_open(void)
{
return PMIX_SUCCESS;
}
static int compress_zlib_close(void)
{
return PMIX_SUCCESS;
}
static int compress_zlib_query(pmix_mca_base_module_t **module, int *priority)
{
*module = (pmix_mca_base_module_t *)&loc_module;
*priority = 50;
return PMIX_SUCCESS;
}

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

@ -2,7 +2,7 @@
# #
# Copyright (c) 2009-2015 Cisco Systems, Inc. All rights reserved. # Copyright (c) 2009-2015 Cisco Systems, Inc. All rights reserved.
# Copyright (c) 2013 Los Alamos National Security, LLC. All rights reserved. # Copyright (c) 2013 Los Alamos National Security, LLC. All rights reserved.
# Copyright (c) 2013-2017 Intel, Inc. All rights reserved. # Copyright (c) 2013-2019 Intel, Inc. All rights reserved.
# $COPYRIGHT$ # $COPYRIGHT$
# #
# Additional copyrights may follow # Additional copyrights may follow
@ -10,10 +10,13 @@
# $HEADER$ # $HEADER$
# #
# MCA_zlib_CONFIG([action-if-found], [action-if-not-found]) # MCA_pcompress_zlib_CONFIG([action-if-can-compile],
# -------------------------------------------------------------------- # [action-if-cant-compile])
AC_DEFUN([PMIX_ZLIB_CONFIG],[ # ------------------------------------------------
PMIX_VAR_SCOPE_PUSH([pmix_zlib_dir pmix_zlib_libdir pmix_zlib_standard_lib_location pmix_zlib_standard_header_location]) AC_DEFUN([MCA_pmix_pcompress_zlib_CONFIG],[
AC_CONFIG_FILES([src/mca/pcompress/zlib/Makefile])
PMIX_VAR_SCOPE_PUSH([pmix_zlib_dir pmix_zlib_libdir pmix_zlib_standard_lib_location pmix_zlib_standard_header_location pmix_check_zlib_save_CPPFLAGS pmix_check_zlib_save_LDFLAGS pmix_check_zlib_save_LIBS])
AC_ARG_WITH([zlib], AC_ARG_WITH([zlib],
[AC_HELP_STRING([--with-zlib=DIR], [AC_HELP_STRING([--with-zlib=DIR],
@ -23,12 +26,17 @@ AC_DEFUN([PMIX_ZLIB_CONFIG],[
[AC_HELP_STRING([--with-zlib-libdir=DIR], [AC_HELP_STRING([--with-zlib-libdir=DIR],
[Search for zlib libraries in DIR ])]) [Search for zlib libraries in DIR ])])
pmix_check_zlib_save_CPPFLAGS="$CPPFLAGS"
pmix_check_zlib_save_LDFLAGS="$LDFLAGS"
pmix_check_zlib_save_LIBS="$LIBS"
pmix_zlib_support=0 pmix_zlib_support=0
if test "$with_zlib" != "no"; then if test "$with_zlib" != "no"; then
AC_MSG_CHECKING([for zlib in]) AC_MSG_CHECKING([for zlib in])
if test ! -z "$with_zlib" && test "$with_zlib" != "yes"; then if test ! -z "$with_zlib" && test "$with_zlib" != "yes"; then
pmix_zlib_dir=$with_zlib pmix_zlib_dir=$with_zlib
pmix_zlib_source=$with_zlib
pmix_zlib_standard_header_location=no pmix_zlib_standard_header_location=no
pmix_zlib_standard_lib_location=no pmix_zlib_standard_lib_location=no
AS_IF([test -z "$with_zlib_libdir" || test "$with_zlib_libdir" = "yes"], AS_IF([test -z "$with_zlib_libdir" || test "$with_zlib_libdir" = "yes"],
@ -44,6 +52,7 @@ AC_DEFUN([PMIX_ZLIB_CONFIG],[
[AC_MSG_RESULT([$with_zlib_libdir])]) [AC_MSG_RESULT([$with_zlib_libdir])])
else else
AC_MSG_RESULT([(default search paths)]) AC_MSG_RESULT([(default search paths)])
pmix_zlib_source=standard
pmix_zlib_standard_header_location=yes pmix_zlib_standard_header_location=yes
pmix_zlib_standard_lib_location=yes pmix_zlib_standard_lib_location=yes
fi fi
@ -51,7 +60,7 @@ AC_DEFUN([PMIX_ZLIB_CONFIG],[
[pmix_zlib_libdir="$with_zlib_libdir" [pmix_zlib_libdir="$with_zlib_libdir"
pmix_zlib_standard_lib_location=no]) pmix_zlib_standard_lib_location=no])
PMIX_CHECK_PACKAGE([pmix_zlib], PMIX_CHECK_PACKAGE([pcompress_zlib],
[zlib.h], [zlib.h],
[z], [z],
[deflate], [deflate],
@ -60,18 +69,6 @@ AC_DEFUN([PMIX_ZLIB_CONFIG],[
[$pmix_zlib_libdir], [$pmix_zlib_libdir],
[pmix_zlib_support=1], [pmix_zlib_support=1],
[pmix_zlib_support=0]) [pmix_zlib_support=0])
if test $pmix_zlib_support = "1"; then
LIBS="$LIBS -lz"
PMIX_EMBEDDED_LIBS="$PMIX_EMBEDDED_LIBS -lz"
if test "$pmix_zlib_standard_header_location" != "yes"; then
PMIX_EMBEDDED_CPPFLAGS="$PMIX_EMBEDDED_CPPFLAGS $pmix_zlib_CPPFLAGS"
CPPFLAGS="$CPPFLAGS $pmix_zlib_CPPFLAGS"
fi
if test "$pmix_zlib_standard_lib_location" != "yes"; then
PMIX_EMBEDDED_LDFLAGS="$PMIX_EMBEDDED_LDFLAGS $pmix_zlib_LDFLAGS"
LDFLAGS="$LDFLAGS $pmix_zlib_LDFLAGS"
fi
fi
fi fi
if test ! -z "$with_zlib" && test "$with_zlib" != "no" && test "$pmix_zlib_support" != "1"; then if test ! -z "$with_zlib" && test "$with_zlib" != "no" && test "$pmix_zlib_support" != "1"; then
@ -86,7 +83,20 @@ AC_DEFUN([PMIX_ZLIB_CONFIG],[
AC_MSG_RESULT([yes]) AC_MSG_RESULT([yes])
fi fi
AC_DEFINE_UNQUOTED([PMIX_HAVE_ZLIB], [$pmix_zlib_support], CPPFLAGS="$pmix_check_zlib_save_CPPFLAGS"
[Whether or not we have zlib support]) LDFLAGS="$pmix_check_zlib_save_LDFLAGS"
LIBS="$pmix_check_zlib_save_LIBS"
AS_IF([test "$pmix_zlib_support" = "1"],
[$1
PMIX_SUMMARY_ADD([[External Packages]],[[ZLIB]], [pmix_zlib], [yes ($pmix_zlib_source)])],
[$2])
# substitute in the things needed to build psm2
AC_SUBST([pcompress_zlib_CFLAGS])
AC_SUBST([pcompress_zlib_CPPFLAGS])
AC_SUBST([pcompress_zlib_LDFLAGS])
AC_SUBST([pcompress_zlib_LIBS])
PMIX_VAR_SCOPE_POP PMIX_VAR_SCOPE_POP
])dnl ])dnl

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

@ -101,16 +101,14 @@ pmix_status_t pmix_pnet_base_allocate(char *nspace,
} }
} }
/* process the allocation request */ /* process the allocation request */
for (n=0; n < ninfo; n++) { PMIX_LIST_FOREACH(active, &pmix_pnet_globals.actives, pmix_pnet_base_active_module_t) {
PMIX_LIST_FOREACH(active, &pmix_pnet_globals.actives, pmix_pnet_base_active_module_t) { if (NULL != active->module->allocate) {
if (NULL != active->module->allocate) { if (PMIX_SUCCESS == (rc = active->module->allocate(nptr, info, ninfo, ilist))) {
if (PMIX_SUCCESS == (rc = active->module->allocate(nptr, &info[n], ilist))) { break;
break; }
} if (PMIX_ERR_TAKE_NEXT_OPTION != rc) {
if (PMIX_ERR_TAKE_NEXT_OPTION != rc) { /* true error */
/* true error */ return rc;
return rc;
}
} }
} }
} }

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

@ -1,5 +1,5 @@
/* /*
* Copyright (c) 2015-2018 Intel, Inc. All rights reserved. * Copyright (c) 2015-2019 Intel, Inc. All rights reserved.
* Copyright (c) 2016 IBM Corporation. All rights reserved. * Copyright (c) 2016 IBM Corporation. All rights reserved.
* *
* $COPYRIGHT$ * $COPYRIGHT$
@ -53,7 +53,7 @@
static pmix_status_t opa_init(void); static pmix_status_t opa_init(void);
static void opa_finalize(void); static void opa_finalize(void);
static pmix_status_t allocate(pmix_namespace_t *nptr, static pmix_status_t allocate(pmix_namespace_t *nptr,
pmix_info_t *info, pmix_info_t info[], size_t ninfo,
pmix_list_t *ilist); pmix_list_t *ilist);
static pmix_status_t setup_local_network(pmix_namespace_t *nptr, static pmix_status_t setup_local_network(pmix_namespace_t *nptr,
pmix_info_t info[], pmix_info_t info[],
@ -230,19 +230,22 @@ static char* transports_print(uint64_t *unique_key)
* this function MUST pack it for transport as the host will * this function MUST pack it for transport as the host will
* not know how to do so */ * not know how to do so */
static pmix_status_t allocate(pmix_namespace_t *nptr, static pmix_status_t allocate(pmix_namespace_t *nptr,
pmix_info_t *info, pmix_info_t info[], size_t ninfo,
pmix_list_t *ilist) pmix_list_t *ilist)
{ {
uint64_t unique_key[2]; uint64_t unique_key[2];
char *string_key, *cs_env; char *string_key, *cs_env;
int fd_rand; int fd_rand;
size_t bytes_read; size_t bytes_read, n, m, p;
pmix_kval_t *kv; pmix_kval_t *kv;
bool envars, seckeys; bool envars = false, seckeys = false, netalloc = false;
pmix_status_t rc; pmix_status_t rc;
pmix_proc_t pname;
envars = false; pmix_coord_t coord;
seckeys = false; pmix_buffer_t bucket;
pmix_info_t *iptr;
pmix_pnet_node_t *nd;
pmix_pnet_local_procs_t *lp;
pmix_output_verbose(2, pmix_pnet_base_framework.framework_output, pmix_output_verbose(2, pmix_pnet_base_framework.framework_output,
"pnet:opa:allocate for nspace %s", nptr->nspace); "pnet:opa:allocate for nspace %s", nptr->nspace);
@ -251,14 +254,33 @@ static pmix_status_t allocate(pmix_namespace_t *nptr,
return PMIX_ERR_TAKE_NEXT_OPTION; return PMIX_ERR_TAKE_NEXT_OPTION;
} }
if (PMIX_CHECK_KEY(info, PMIX_SETUP_APP_ENVARS)) { for (n=0; n < ninfo; n++) {
envars = PMIX_INFO_TRUE(info); if (PMIX_CHECK_KEY(&info[n], PMIX_SETUP_APP_ENVARS)) {
} else if (PMIX_CHECK_KEY(info, PMIX_SETUP_APP_ALL)) { envars = PMIX_INFO_TRUE(&info[n]);
envars = PMIX_INFO_TRUE(info); } else if (PMIX_CHECK_KEY(&info[n], PMIX_SETUP_APP_ALL)) {
seckeys = PMIX_INFO_TRUE(info); envars = PMIX_INFO_TRUE(&info[n]);
} else if (PMIX_CHECK_KEY(info, PMIX_SETUP_APP_NONENVARS) || seckeys = PMIX_INFO_TRUE(&info[n]);
PMIX_CHECK_KEY(info, PMIX_ALLOC_NETWORK_SEC_KEY)) { } else if (PMIX_CHECK_KEY(&info[n], PMIX_SETUP_APP_NONENVARS)) {
seckeys = PMIX_INFO_TRUE(info); seckeys = PMIX_INFO_TRUE(&info[n]);
} else if (PMIX_CHECK_KEY(&info[n], PMIX_ALLOC_NETWORK)) {
iptr = (pmix_info_t*)info[n].value.data.darray->array;
m = info[n].value.data.darray->size;
for (p=0; p < m; p++) {
if (PMIX_CHECK_KEY(&iptr[p], PMIX_ALLOC_NETWORK_SEC_KEY)) {
seckeys = PMIX_INFO_TRUE(&iptr[p]);
} else if (PMIX_CHECK_KEY(&iptr[p], PMIX_ALLOC_NETWORK_ID)) {
/* need to track the request by this ID */
} else if (PMIX_CHECK_KEY(&iptr[p], PMIX_SETUP_APP_ENVARS)) {
envars = PMIX_INFO_TRUE(&iptr[p]);
} else if (PMIX_CHECK_KEY(&iptr[p], PMIX_SETUP_APP_ALL)) {
envars = PMIX_INFO_TRUE(&iptr[p]);
seckeys = PMIX_INFO_TRUE(&iptr[p]);
} else if (PMIX_CHECK_KEY(&iptr[p], PMIX_SETUP_APP_NONENVARS)) {
seckeys = PMIX_INFO_TRUE(&iptr[p]);
}
}
netalloc = true;
}
} }
if (seckeys) { if (seckeys) {
@ -307,10 +329,6 @@ static pmix_status_t allocate(pmix_namespace_t *nptr,
pmix_list_append(ilist, &kv->super); pmix_list_append(ilist, &kv->super);
free(cs_env); free(cs_env);
free(string_key); free(string_key);
if (!envars) {
/* providing envars does not constitute allocating resources */
return PMIX_ERR_TAKE_NEXT_OPTION;
}
} }
if (envars) { if (envars) {
@ -323,13 +341,70 @@ static pmix_status_t allocate(pmix_namespace_t *nptr,
rc = pmix_pnet_base_harvest_envars(mca_pnet_opa_component.include, rc = pmix_pnet_base_harvest_envars(mca_pnet_opa_component.include,
mca_pnet_opa_component.exclude, mca_pnet_opa_component.exclude,
ilist); ilist);
if (PMIX_SUCCESS == rc) { if (PMIX_SUCCESS != rc) {
return PMIX_ERR_TAKE_NEXT_OPTION; return rc;
} }
return rc;
} }
} }
if (netalloc) {
/* assign a simulated coordinate to each process. For now, we
* assume there is one device per node. Thus, the coordinate of
* all procs on a node will be the network coord of the device
* on that node. We'll assign device coordinates with a simple
* round-robin algo */
coord.y = 0;
coord.z = 0;
PMIX_LOAD_NSPACE(pname.nspace, nptr->nspace);
PMIX_CONSTRUCT(&bucket, pmix_buffer_t);
PMIX_LIST_FOREACH(nd, &pmix_pnet_globals.nodes, pmix_pnet_node_t) {
/* find the job on this node */
PMIX_LIST_FOREACH(lp, &nd->local_jobs, pmix_pnet_local_procs_t) {
if (0 == strcmp(nptr->nspace, lp->nspace)) {
/* assign the coord for each proc - in our case,
* we shall assign an x-coord based on local rank
* and the y-coord will represent the node */
for (n=0; n < lp->np; n++) {
coord.x = n;
pname.rank = lp->ranks[n];
/* pack this value */
PMIX_BFROPS_PACK(rc, pmix_globals.mypeer, &bucket, &pname, 1, PMIX_PROC);
if (PMIX_SUCCESS != rc) {
PMIX_ERROR_LOG(rc);
PMIX_DESTRUCT(&bucket);
return rc;
}
PMIX_BFROPS_PACK(rc, pmix_globals.mypeer, &bucket, &coord, 1, PMIX_COORD);
if (PMIX_SUCCESS != rc) {
PMIX_ERROR_LOG(rc);
PMIX_DESTRUCT(&bucket);
return rc;
}
}
break;
}
}
coord.y++;
}
/* pass that up */
kv = PMIX_NEW(pmix_kval_t);
if (NULL == kv) {
PMIX_DESTRUCT(&bucket);
return PMIX_ERR_OUT_OF_RESOURCE;
}
kv->key = strdup(PMIX_PNET_OPA_BLOB);
kv->value = (pmix_value_t*)malloc(sizeof(pmix_value_t));
if (NULL == kv->value) {
PMIX_DESTRUCT(&bucket);
PMIX_RELEASE(kv);
return PMIX_ERR_OUT_OF_RESOURCE;
}
kv->value->type = PMIX_BYTE_OBJECT;
/* unload the buffer into a byte object */
PMIX_UNLOAD_BUFFER(&bucket, kv->value->data.bo.bytes, kv->value->data.bo.size);
pmix_list_append(ilist, &kv->super);
}
/* we don't currently manage OPA resources */ /* we don't currently manage OPA resources */
return PMIX_ERR_TAKE_NEXT_OPTION; return PMIX_ERR_TAKE_NEXT_OPTION;
} }
@ -343,15 +418,14 @@ static pmix_status_t setup_local_network(pmix_namespace_t *nptr,
pmix_output_verbose(2, pmix_pnet_base_framework.framework_output, pmix_output_verbose(2, pmix_pnet_base_framework.framework_output,
"pnet: opa setup_local_network"); "pnet: opa setup_local_network for nspace %s", nptr->nspace);
if (NULL != info) { if (NULL != info) {
for (n=0; n < ninfo; n++) { for (n=0; n < ninfo; n++) {
if (0 == strncmp(info[n].key, PMIX_PNET_OPA_BLOB, PMIX_MAX_KEYLEN)) { if (0 == strncmp(info[n].key, PMIX_PNET_OPA_BLOB, PMIX_MAX_KEYLEN)) {
/* the byte object contains a packed blob that needs to be /* the byte object contains a packed blob that needs to be
* cached until we determine we have local procs for this * cached until we determine we have local procs for this
* nspace, and then delivered to the local OPA driver when * nspace */
* we have a means for doing so */
kv = PMIX_NEW(pmix_kval_t); kv = PMIX_NEW(pmix_kval_t);
if (NULL == kv) { if (NULL == kv) {
return PMIX_ERR_NOMEM; return PMIX_ERR_NOMEM;
@ -384,9 +458,16 @@ static pmix_status_t setup_fork(pmix_namespace_t *nptr,
char ***env) char ***env)
{ {
pmix_kval_t *kv, *next; pmix_kval_t *kv, *next;
pmix_data_array_t dinfo;
pmix_info_t info[2], stinfo;
int cnt;
pmix_status_t rc;
pmix_buffer_t bkt;
pmix_proc_t pname;
pmix_coord_t coord;
pmix_output_verbose(2, pmix_pnet_base_framework.framework_output, pmix_output_verbose(2, pmix_pnet_base_framework.framework_output,
"pnet: opa setup fork"); "pnet: opa setup fork for nspace: %s", nptr->nspace);
/* if there are any cached nspace prep blobs, execute them, /* if there are any cached nspace prep blobs, execute them,
* ensuring that we only do so once per nspace - note that * ensuring that we only do so once per nspace - note that
@ -395,8 +476,44 @@ static pmix_status_t setup_fork(pmix_namespace_t *nptr,
PMIX_LIST_FOREACH_SAFE(kv, next, &nptr->setup_data, pmix_kval_t) { PMIX_LIST_FOREACH_SAFE(kv, next, &nptr->setup_data, pmix_kval_t) {
if (0 == strcmp(kv->key, PMIX_PNET_OPA_BLOB)) { if (0 == strcmp(kv->key, PMIX_PNET_OPA_BLOB)) {
pmix_list_remove_item(&nptr->setup_data, &kv->super); pmix_list_remove_item(&nptr->setup_data, &kv->super);
/* deliver to the local lib */ /* setup to unpack the blob */
PMIX_CONSTRUCT(&bkt,pmix_buffer_t);
PMIX_LOAD_BUFFER(pmix_globals.mypeer, &bkt,
kv->value->data.bo.bytes,
kv->value->data.bo.size);
/* there will be an entry for each proc in the nspace */
PMIX_INFO_CONSTRUCT(&stinfo);
PMIX_LOAD_KEY(stinfo.key, PMIX_PROC_DATA);
stinfo.value.type = PMIX_DATA_ARRAY;
stinfo.value.data.darray = &dinfo;
dinfo.type = PMIX_INFO;
dinfo.size = 2;
dinfo.array = info;
/* unpack all the entries */
cnt = 1;
PMIX_BFROPS_UNPACK(rc, pmix_globals.mypeer,
&bkt, &pname, &cnt, PMIX_PROC);
while (PMIX_SUCCESS == rc) {
/* unpack the coord of this proc */
cnt = 1;
PMIX_BFROPS_UNPACK(rc, pmix_globals.mypeer,
&bkt, &coord, &cnt, PMIX_COORD);
if (PMIX_SUCCESS != rc) {
PMIX_ERROR_LOG(rc);
break;
}
/* cache the info on the job */
PMIX_INFO_LOAD(&info[0], PMIX_RANK, &pname.rank, PMIX_PROC_RANK);
PMIX_INFO_LOAD(&info[1], PMIX_NETWORK_COORDINATE, &coord, PMIX_COORD);
PMIX_GDS_CACHE_JOB_INFO(rc, pmix_globals.mypeer, nptr,
&stinfo, 1);
/* unpack next entry */
cnt = 1;
PMIX_BFROPS_UNPACK(rc, pmix_globals.mypeer,
&bkt, &pname, &cnt, PMIX_PROC);
}
PMIX_RELEASE(kv); PMIX_RELEASE(kv);
break;
} }
} }
return PMIX_SUCCESS; return PMIX_SUCCESS;

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

@ -1,5 +1,5 @@
/* /*
* Copyright (c) 2015-2018 Intel, Inc. All rights reserved. * Copyright (c) 2015-2019 Intel, Inc. All rights reserved.
* *
* $COPYRIGHT$ * $COPYRIGHT$
* *
@ -24,6 +24,7 @@ typedef struct {
char *excparms; char *excparms;
char **include; char **include;
char **exclude; char **exclude;
int radix;
} pmix_pnet_opa_component_t; } pmix_pnet_opa_component_t;
/* the component must be visible data for the linker to find it */ /* the component must be visible data for the linker to find it */

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

@ -12,7 +12,7 @@
* All rights reserved. * All rights reserved.
* Copyright (c) 2015 Los Alamos National Security, LLC. All rights * Copyright (c) 2015 Los Alamos National Security, LLC. All rights
* reserved. * reserved.
* Copyright (c) 2016-2018 Intel, Inc. All rights reserved. * Copyright (c) 2016-2019 Intel, Inc. All rights reserved.
* $COPYRIGHT$ * $COPYRIGHT$
* *
* Additional copyrights may follow * Additional copyrights may follow
@ -66,7 +66,8 @@ pmix_pnet_opa_component_t mca_pnet_opa_component = {
} }
}, },
.include = NULL, .include = NULL,
.exclude = NULL .exclude = NULL,
.radix = 64
}; };
static pmix_status_t component_register(void) static pmix_status_t component_register(void)
@ -95,6 +96,13 @@ static pmix_status_t component_register(void)
mca_pnet_opa_component.exclude = pmix_argv_split(mca_pnet_opa_component.excparms, ','); mca_pnet_opa_component.exclude = pmix_argv_split(mca_pnet_opa_component.excparms, ',');
} }
(void)pmix_mca_base_component_var_register(component, "radix",
"Radix for simulating the network coordinates",
PMIX_MCA_BASE_VAR_TYPE_INT, NULL, 0, 0,
PMIX_INFO_LVL_2,
PMIX_MCA_BASE_VAR_SCOPE_LOCAL,
&mca_pnet_opa_component.radix);
return PMIX_SUCCESS; return PMIX_SUCCESS;
} }

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

@ -4,7 +4,7 @@
* *
* Copyright (c) 2015-2018 Research Organization for Information Science * Copyright (c) 2015-2018 Research Organization for Information Science
* and Technology (RIST). All rights reserved. * and Technology (RIST). All rights reserved.
* Copyright (c) 2018 Intel, Inc. All rights reserved. * Copyright (c) 2018-2019 Intel, Inc. All rights reserved.
* $COPYRIGHT$ * $COPYRIGHT$
* *
* Additional copyrights may follow * Additional copyrights may follow
@ -61,7 +61,7 @@ typedef void (*pmix_pnet_base_module_fini_fn_t)(void);
* for forwarding to compute nodes, or allocation of static endpts * for forwarding to compute nodes, or allocation of static endpts
*/ */
typedef pmix_status_t (*pmix_pnet_base_module_allocate_fn_t)(pmix_namespace_t *nptr, typedef pmix_status_t (*pmix_pnet_base_module_allocate_fn_t)(pmix_namespace_t *nptr,
pmix_info_t *info, pmix_info_t info[], size_t ninfo,
pmix_list_t *ilist); pmix_list_t *ilist);
/** /**

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

@ -50,7 +50,7 @@
static pmix_status_t tcp_init(void); static pmix_status_t tcp_init(void);
static void tcp_finalize(void); static void tcp_finalize(void);
static pmix_status_t allocate(pmix_namespace_t *nptr, static pmix_status_t allocate(pmix_namespace_t *nptr,
pmix_info_t *info, pmix_info_t info[], size_t ninfo,
pmix_list_t *ilist); pmix_list_t *ilist);
static pmix_status_t setup_local_network(pmix_namespace_t *nptr, static pmix_status_t setup_local_network(pmix_namespace_t *nptr,
pmix_info_t info[], pmix_info_t info[],
@ -298,7 +298,7 @@ static inline void generate_key(uint64_t* unique_key) {
* undoubtedly be vastly improved/optimized */ * undoubtedly be vastly improved/optimized */
static pmix_status_t allocate(pmix_namespace_t *nptr, static pmix_status_t allocate(pmix_namespace_t *nptr,
pmix_info_t *info, pmix_info_t info[], size_t ninfo,
pmix_list_t *ilist) pmix_list_t *ilist)
{ {
uint64_t unique_key[2]; uint64_t unique_key[2];
@ -308,7 +308,7 @@ static pmix_status_t allocate(pmix_namespace_t *nptr,
pmix_status_t rc; pmix_status_t rc;
pmix_info_t *requests = NULL; pmix_info_t *requests = NULL;
char **reqs, *cptr; char **reqs, *cptr;
bool allocated = false, seckey = false; bool allocated = false, seckey = false, envars = false;
tcp_port_tracker_t *trk; tcp_port_tracker_t *trk;
tcp_available_ports_t *avail, *aptr; tcp_available_ports_t *avail, *aptr;
pmix_list_t mylist; pmix_list_t mylist;
@ -330,41 +330,49 @@ static pmix_status_t allocate(pmix_namespace_t *nptr,
/* check directives to see if a crypto key and/or /* check directives to see if a crypto key and/or
* network resource allocations requested */ * network resource allocations requested */
PMIX_CONSTRUCT(&mylist, pmix_list_t); for (n=0; n < ninfo; n++) {
if (PMIX_CHECK_KEY(info, PMIX_SETUP_APP_ENVARS) || if (PMIX_CHECK_KEY(&info[n], PMIX_SETUP_APP_ENVARS) ||
PMIX_CHECK_KEY(info, PMIX_SETUP_APP_ALL)) { PMIX_CHECK_KEY(&info[n], PMIX_SETUP_APP_ALL)) {
envars = PMIX_INFO_TRUE(&info[n]);
} else if (PMIX_CHECK_KEY(info, PMIX_ALLOC_NETWORK)) {
/* this info key includes an array of pmix_info_t, each providing
* a key (that is to be used as the key for the allocated ports) and
* a number of ports to allocate for that key */
if (PMIX_DATA_ARRAY != info->value.type ||
NULL == info->value.data.darray ||
PMIX_INFO != info->value.data.darray->type ||
NULL == info->value.data.darray->array) {
/* they made an error */
PMIX_ERROR_LOG(PMIX_ERR_BAD_PARAM);
return PMIX_ERR_BAD_PARAM;
}
requests = (pmix_info_t*)info->value.data.darray->array;
nreqs = info->value.data.darray->size;
}
}
if (envars) {
if (NULL != mca_pnet_tcp_component.include) { if (NULL != mca_pnet_tcp_component.include) {
pmix_output_verbose(2, pmix_pnet_base_framework.framework_output, pmix_output_verbose(2, pmix_pnet_base_framework.framework_output,
"pnet: tcp harvesting envars %s excluding %s", "pnet: tcp harvesting envars %s excluding %s",
(NULL == mca_pnet_tcp_component.incparms) ? "NONE" : mca_pnet_tcp_component.incparms, (NULL == mca_pnet_tcp_component.incparms) ? "NONE" : mca_pnet_tcp_component.incparms,
(NULL == mca_pnet_tcp_component.excparms) ? "NONE" : mca_pnet_tcp_component.excparms); (NULL == mca_pnet_tcp_component.excparms) ? "NONE" : mca_pnet_tcp_component.excparms);
rc = pmix_pnet_base_harvest_envars(mca_pnet_tcp_component.include, rc = pmix_pnet_base_harvest_envars(mca_pnet_tcp_component.include,
mca_pnet_tcp_component.exclude, mca_pnet_tcp_component.exclude,
ilist); ilist);
return rc; if (PMIX_SUCCESS != rc) {
return rc;
}
} }
return PMIX_SUCCESS; }
} else if (!PMIX_CHECK_KEY(info, PMIX_ALLOC_NETWORK)) {
/* not a network allocation request */ if (NULL == requests) {
return PMIX_SUCCESS; return PMIX_ERR_TAKE_NEXT_OPTION;
} }
pmix_output_verbose(2, pmix_pnet_base_framework.framework_output, pmix_output_verbose(2, pmix_pnet_base_framework.framework_output,
"pnet:tcp:allocate alloc_network for nspace %s", "pnet:tcp:allocate alloc_network for nspace %s",
nptr->nspace); nptr->nspace);
/* this info key includes an array of pmix_info_t, each providing
* a key (that is to be used as the key for the allocated ports) and
* a number of ports to allocate for that key */
if (PMIX_DATA_ARRAY != info->value.type ||
NULL == info->value.data.darray ||
PMIX_INFO != info->value.data.darray->type ||
NULL == info->value.data.darray->array) {
/* they made an error */
PMIX_ERROR_LOG(PMIX_ERR_BAD_PARAM);
return PMIX_ERR_BAD_PARAM;
}
requests = (pmix_info_t*)info->value.data.darray->array;
nreqs = info->value.data.darray->size;
/* cycle thru the provided array and see if this refers to /* cycle thru the provided array and see if this refers to
* tcp/udp-based resources - there is no required ordering * tcp/udp-based resources - there is no required ordering
* of the keys, so just have to do a search */ * of the keys, so just have to do a search */
@ -408,6 +416,7 @@ static pmix_status_t allocate(pmix_namespace_t *nptr,
return PMIX_ERR_BAD_PARAM; return PMIX_ERR_BAD_PARAM;
} }
PMIX_CONSTRUCT(&mylist, pmix_list_t);
/* must include the idkey */ /* must include the idkey */
kv = PMIX_NEW(pmix_kval_t); kv = PMIX_NEW(pmix_kval_t);
if (NULL == kv) { if (NULL == kv) {

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

@ -47,7 +47,7 @@
static pmix_status_t test_init(void); static pmix_status_t test_init(void);
static void test_finalize(void); static void test_finalize(void);
static pmix_status_t allocate(pmix_namespace_t *nptr, static pmix_status_t allocate(pmix_namespace_t *nptr,
pmix_info_t *info, pmix_info_t info[], size_t ninfo,
pmix_list_t *ilist); pmix_list_t *ilist);
static pmix_status_t setup_local_network(pmix_namespace_t *nptr, static pmix_status_t setup_local_network(pmix_namespace_t *nptr,
pmix_info_t info[], pmix_info_t info[],
@ -95,11 +95,11 @@ static void test_finalize(void)
* this function MUST pack it for transport as the host will * this function MUST pack it for transport as the host will
* not know how to do so */ * not know how to do so */
static pmix_status_t allocate(pmix_namespace_t *nptr, static pmix_status_t allocate(pmix_namespace_t *nptr,
pmix_info_t *info, pmix_info_t info[], size_t ninfo,
pmix_list_t *ilist) pmix_list_t *ilist)
{ {
pmix_kval_t *kv; pmix_kval_t *kv;
bool seckey = false; bool seckey = false, envars = false;
pmix_list_t mylist; pmix_list_t mylist;
size_t n, nreqs=0; size_t n, nreqs=0;
pmix_info_t *requests = NULL; pmix_info_t *requests = NULL;
@ -126,9 +126,27 @@ static pmix_status_t allocate(pmix_namespace_t *nptr,
} }
/* check directives to see if a crypto key and/or /* check directives to see if a crypto key and/or
* network resource allocations requested */ * network resource allocations requested */
PMIX_CONSTRUCT(&mylist, pmix_list_t); for (n=0; n < ninfo; n++) {
if (0 == strncmp(info->key, PMIX_SETUP_APP_ENVARS, PMIX_MAX_KEYLEN) || if (PMIX_CHECK_KEY(&info[n], PMIX_SETUP_APP_ENVARS) ||
0 == strncmp(info->key, PMIX_SETUP_APP_ALL, PMIX_MAX_KEYLEN)) { PMIX_CHECK_KEY(&info[n], PMIX_SETUP_APP_ALL)) {
envars = PMIX_INFO_TRUE(&info[n]);
} else if (PMIX_CHECK_KEY(&info[n], PMIX_ALLOC_NETWORK_ID)) {
/* this info key includes an array of pmix_info_t, each providing
* a key (that is to be used as the key for the allocated ports) and
* a number of ports to allocate for that key */
if (PMIX_DATA_ARRAY != info->value.type ||
NULL == info->value.data.darray ||
PMIX_INFO != info->value.data.darray->type ||
NULL == info->value.data.darray->array) {
/* just process something for test */
goto process;
}
requests = (pmix_info_t*)info->value.data.darray->array;
nreqs = info->value.data.darray->size;
}
}
if (envars) {
kv = PMIX_NEW(pmix_kval_t); kv = PMIX_NEW(pmix_kval_t);
if (NULL == kv) { if (NULL == kv) {
return PMIX_ERR_NOMEM; return PMIX_ERR_NOMEM;
@ -142,27 +160,16 @@ static pmix_status_t allocate(pmix_namespace_t *nptr,
kv->value->type = PMIX_ENVAR; kv->value->type = PMIX_ENVAR;
PMIX_ENVAR_LOAD(&kv->value->data.envar, "PMIX_TEST_ENVAR", "1", ':'); PMIX_ENVAR_LOAD(&kv->value->data.envar, "PMIX_TEST_ENVAR", "1", ':');
pmix_list_append(ilist, &kv->super); pmix_list_append(ilist, &kv->super);
return PMIX_SUCCESS; }
} else if (0 != strncmp(info->key, PMIX_ALLOC_NETWORK_ID, PMIX_MAX_KEYLEN)) {
return PMIX_SUCCESS; if (NULL == requests) {
return PMIX_ERR_TAKE_NEXT_OPTION;
} }
pmix_output_verbose(2, pmix_pnet_base_framework.framework_output, pmix_output_verbose(2, pmix_pnet_base_framework.framework_output,
"pnet:test:allocate alloc_network for nspace %s", "pnet:test:allocate alloc_network for nspace %s",
nptr->nspace); nptr->nspace);
/* this info key includes an array of pmix_info_t, each providing
* a key (that is to be used as the key for the allocated ports) and
* a number of ports to allocate for that key */
if (PMIX_DATA_ARRAY != info->value.type ||
NULL == info->value.data.darray ||
PMIX_INFO != info->value.data.darray->type ||
NULL == info->value.data.darray->array) {
/* just process something for test */
goto process;
}
requests = (pmix_info_t*)info->value.data.darray->array;
nreqs = info->value.data.darray->size;
/* cycle thru the provided array and get the ID key */ /* cycle thru the provided array and get the ID key */
for (n=0; n < nreqs; n++) { for (n=0; n < nreqs; n++) {
if (0 == strncmp(requests[n].key, PMIX_ALLOC_NETWORK_ID, PMIX_MAX_KEYLEN)) { if (0 == strncmp(requests[n].key, PMIX_ALLOC_NETWORK_ID, PMIX_MAX_KEYLEN)) {
@ -183,6 +190,7 @@ static pmix_status_t allocate(pmix_namespace_t *nptr,
if (NULL == idkey) { if (NULL == idkey) {
idkey = "TESTKEY"; idkey = "TESTKEY";
} }
PMIX_CONSTRUCT(&mylist, pmix_list_t);
/* must include the idkey */ /* must include the idkey */
kv = PMIX_NEW(pmix_kval_t); kv = PMIX_NEW(pmix_kval_t);

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

@ -11,7 +11,7 @@
* 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) 2012-2013 Los Alamos National Security, Inc. All rights reserved. * Copyright (c) 2012-2013 Los Alamos National Security, Inc. All rights reserved.
* Copyright (c) 2014-2019 Intel, Inc. All rights reserved. * Copyright (c) 2014-2017 Intel, Inc. All rights reserved.
* Copyright (c) 2015-2016 Research Organization for Information Science * Copyright (c) 2015-2016 Research Organization for Information Science
* and Technology (RIST). All rights reserved. * and Technology (RIST). All rights reserved.
* Copyright (c) 2019 IBM Corporation. All rights reserved. * Copyright (c) 2019 IBM Corporation. All rights reserved.

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

@ -1,5 +1,5 @@
/* /*
* Copyright (c) 2015-2019 Intel, Inc. All rights reserved. * Copyright (c) 2015-2018 Intel, Inc. All rights reserved.
* Copyright (c) 2016-2019 IBM Corporation. All rights reserved. * Copyright (c) 2016-2019 IBM Corporation. All rights reserved.
* Copyright (c) 2018 Research Organization for Information Science * Copyright (c) 2018 Research Organization for Information Science
* and Technology (RIST). All rights reserved. * and Technology (RIST). All rights reserved.

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

@ -12,7 +12,7 @@
* All rights reserved. * All rights reserved.
* Copyright (c) 2007-2011 Cisco Systems, Inc. All rights reserved. * Copyright (c) 2007-2011 Cisco Systems, Inc. All rights reserved.
* Copyright (c) 2012-2013 Los Alamos National Security, Inc. All rights reserved. * Copyright (c) 2012-2013 Los Alamos National Security, Inc. All rights reserved.
* Copyright (c) 2014-2019 Intel, Inc. All rights reserved. * Copyright (c) 2014-2017 Intel, Inc. All rights reserved.
* Copyright (c) 2019 IBM Corporation. All rights reserved. * Copyright (c) 2019 IBM Corporation. All rights reserved.
* $COPYRIGHT$ * $COPYRIGHT$
* *

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

@ -7,6 +7,8 @@
* All rights reserved. * All rights reserved.
* *
* Copyright (c) 2017-2018 Intel, Inc. All rights reserved. * Copyright (c) 2017-2018 Intel, Inc. All rights reserved.
* Copyright (c) 2019 Research Organization for Information Science
* and Technology (RIST). All rights reserved.
* $COPYRIGHT$ * $COPYRIGHT$
* *
* Additional copyrights may follow * Additional copyrights may follow
@ -15,7 +17,6 @@
*/ */
#include <src/include/pmix_config.h> #include <src/include/pmix_config.h>
#include <src/include/types.h>
#include <pmix_common.h> #include <pmix_common.h>
#include <stdio.h> #include <stdio.h>

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

@ -1,8 +1,8 @@
/* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil -*- */ /* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil -*- */
/* /*
* Copyright (c) 2014-2017 Intel, Inc. All rights reserved. * Copyright (c) 2014-2017 Intel, Inc. All rights reserved.
* Copyright (c) 2014-2016 Research Organization for Information Science * Copyright (c) 2014-2019 Research Organization for Information Science
* and Technology (RIST). All rights reserved. * and Technology (RIST). All rights reserved.
* Copyright (c) 2014-2015 Artem Y. Polyakov <artpol84@gmail.com>. * Copyright (c) 2014-2015 Artem Y. Polyakov <artpol84@gmail.com>.
* All rights reserved. * All rights reserved.
* Copyright (c) 2016 Mellanox Technologies, Inc. * Copyright (c) 2016 Mellanox Technologies, Inc.
@ -17,7 +17,6 @@
#include <src/include/pmix_config.h> #include <src/include/pmix_config.h>
#include <src/include/types.h>
#include <src/include/pmix_stdint.h> #include <src/include/pmix_stdint.h>
#include <src/include/pmix_socket_errno.h> #include <src/include/pmix_socket_errno.h>

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

@ -2,8 +2,8 @@
* Copyright (c) 2014-2019 Intel, Inc. All rights reserved. * Copyright (c) 2014-2019 Intel, Inc. All rights reserved.
* Copyright (c) 2014 Artem Y. Polyakov <artpol84@gmail.com>. * Copyright (c) 2014 Artem Y. Polyakov <artpol84@gmail.com>.
* All rights reserved. * All rights reserved.
* Copyright (c) 2015-2017 Research Organization for Information Science * Copyright (c) 2015-2019 Research Organization for Information Science
* and Technology (RIST). All rights reserved. * and Technology (RIST). All rights reserved.
* Copyright (c) 2016 Mellanox Technologies, Inc. * Copyright (c) 2016 Mellanox Technologies, Inc.
* All rights reserved. * All rights reserved.
* Copyright (c) 2016 IBM Corporation. All rights reserved. * Copyright (c) 2016 IBM Corporation. All rights reserved.
@ -15,7 +15,6 @@
*/ */
#include <src/include/pmix_config.h> #include <src/include/pmix_config.h>
#include <src/include/types.h>
#include <src/include/pmix_stdint.h> #include <src/include/pmix_stdint.h>
#include <src/include/pmix_socket_errno.h> #include <src/include/pmix_socket_errno.h>
@ -55,13 +54,6 @@ static void _notify_complete(pmix_status_t status, void *cbdata)
PMIX_RELEASE(chain); PMIX_RELEASE(chain);
} }
static void _timeout(int sd, short args, void *cbdata)
{
pmix_server_trkr_t *trk = (pmix_server_trkr_t*)cbdata;
PMIX_RELEASE(trk);
}
static void lcfn(pmix_status_t status, void *cbdata) static void lcfn(pmix_status_t status, void *cbdata)
{ {
pmix_peer_t *peer = (pmix_peer_t*)cbdata; pmix_peer_t *peer = (pmix_peer_t*)cbdata;
@ -76,7 +68,6 @@ void pmix_ptl_base_lost_connection(pmix_peer_t *peer, pmix_status_t err)
pmix_ptl_posted_recv_t *rcv; pmix_ptl_posted_recv_t *rcv;
pmix_buffer_t buf; pmix_buffer_t buf;
pmix_ptl_hdr_t hdr; pmix_ptl_hdr_t hdr;
struct timeval tv = {1200, 0};
pmix_proc_t proc; pmix_proc_t proc;
pmix_status_t rc; pmix_status_t rc;
@ -114,59 +105,60 @@ void pmix_ptl_base_lost_connection(pmix_peer_t *peer, pmix_status_t err)
/* remove it from the list */ /* remove it from the list */
pmix_list_remove_item(&trk->local_cbs, &rinfo->super); pmix_list_remove_item(&trk->local_cbs, &rinfo->super);
PMIX_RELEASE(rinfo); PMIX_RELEASE(rinfo);
trk->lost_connection = true; // mark that a peer's connection was lost /* if the host has already been called for this tracker,
if (0 == pmix_list_get_size(&trk->local_cbs)) { * then do nothing here - just wait for the host to return
/* this tracker is complete, so release it - there * from the operation */
* is nobody waiting for a response */ if (trk->host_called) {
pmix_list_remove_item(&pmix_server_globals.collectives, &trk->super); continue;
/* do NOT release the tracker here as the host may
* have a copy they will return later. However, they
* might never call back, so set a LONG timeout to
* we avoid a memory leak if they don't */
pmix_event_evtimer_set(pmix_globals.evbase, &trk->ev,
_timeout, trk);
pmix_event_evtimer_add(&trk->ev, &tv);
trk->event_active = true;
break;
} }
/* if there are other participants waiting for a response, if (trk->def_complete && trk->nlocal == pmix_list_get_size(&trk->local_cbs)) {
* we need to let them know that this proc has disappeared /* if this is a local-only collective, then resolve it now */
* as otherwise the collective will never complete */ if (trk->local) {
if (PMIX_FENCENB_CMD == trk->type) { /* everyone else has called in - we need to let them know
if (NULL != trk->modexcbfunc) { * that this proc has disappeared
/* do NOT release the tracker here as the host may * as otherwise the collective will never complete */
* have a copy they will return later. However, they if (PMIX_FENCENB_CMD == trk->type) {
* might never call back, so set a LONG timeout to if (NULL != trk->modexcbfunc) {
* we avoid a memory leak if they don't */ trk->modexcbfunc(PMIX_ERR_LOST_CONNECTION_TO_CLIENT, NULL, 0, trk, NULL, NULL);
pmix_event_evtimer_set(pmix_globals.evbase, &trk->ev, }
_timeout, trk); } else if (PMIX_CONNECTNB_CMD == trk->type) {
pmix_event_evtimer_add(&trk->ev, &tv); if (NULL != trk->op_cbfunc) {
trk->event_active = true; trk->op_cbfunc(PMIX_ERR_LOST_CONNECTION_TO_CLIENT, trk);
trk->modexcbfunc(PMIX_ERR_LOST_CONNECTION_TO_CLIENT, NULL, 0, trk, NULL, NULL); }
} } else if (PMIX_DISCONNECTNB_CMD == trk->type) {
} else if (PMIX_CONNECTNB_CMD == trk->type) { if (NULL != trk->op_cbfunc) {
if (NULL != trk->op_cbfunc) { trk->op_cbfunc(PMIX_ERR_LOST_CONNECTION_TO_CLIENT, trk);
/* do NOT release the tracker here as the host may }
* have a copy they will return later. However, they }
* might never call back, so set a LONG timeout to } else {
* we avoid a memory leak if they don't */ /* if the host has not been called, then we need to see if
pmix_event_evtimer_set(pmix_globals.evbase, &trk->ev, * the collective is locally complete without this lost
_timeout, trk); * participant. If so, then we need to pass the call
pmix_event_evtimer_add(&trk->ev, &tv); * up to the host as otherwise the global collective will hang */
trk->event_active = true; if (PMIX_FENCENB_CMD == trk->type) {
trk->op_cbfunc(PMIX_ERR_LOST_CONNECTION_TO_CLIENT, trk); trk->host_called = true;
} rc = pmix_host_server.fence_nb(trk->pcs, trk->npcs,
} else if (PMIX_DISCONNECTNB_CMD == trk->type) { trk->info, trk->ninfo,
if (NULL != trk->op_cbfunc) { NULL, 0, trk->modexcbfunc, trk);
/* do NOT release the tracker here as the host may if (PMIX_SUCCESS != rc) {
* have a copy they will return later. However, they pmix_list_remove_item(&pmix_server_globals.collectives, &trk->super);
* might never call back, so set a LONG timeout to PMIX_RELEASE(trk);
* we avoid a memory leak if they don't */ }
pmix_event_evtimer_set(pmix_globals.evbase, &trk->ev, } else if (PMIX_CONNECTNB_CMD == trk->type) {
_timeout, trk); trk->host_called = true;
pmix_event_evtimer_add(&trk->ev, &tv); rc = pmix_host_server.connect(trk->pcs, trk->npcs, trk->info, trk->ninfo, trk->op_cbfunc, trk);
trk->event_active = true; if (PMIX_SUCCESS != rc) {
trk->op_cbfunc(PMIX_ERR_LOST_CONNECTION_TO_CLIENT, trk); pmix_list_remove_item(&pmix_server_globals.collectives, &trk->super);
PMIX_RELEASE(trk);
}
} else if (PMIX_DISCONNECTNB_CMD == trk->type) {
trk->host_called = true;
rc = pmix_host_server.disconnect(trk->pcs, trk->npcs, trk->info, trk->ninfo, trk->op_cbfunc, trk);
if (PMIX_SUCCESS != rc) {
pmix_list_remove_item(&pmix_server_globals.collectives, &trk->super);
PMIX_RELEASE(trk);
}
}
} }
} }
} }

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

@ -24,6 +24,7 @@
*/ */
#include <src/include/pmix_config.h> #include <src/include/pmix_config.h>
#include "src/include/pmix_globals.h"
#ifdef HAVE_FCNTL_H #ifdef HAVE_FCNTL_H
#include <fcntl.h> #include <fcntl.h>
@ -50,7 +51,6 @@
#include <sys/sysctl.h> #include <sys/sysctl.h>
#endif #endif
#include "src/include/pmix_globals.h"
#include "src/include/pmix_socket_errno.h" #include "src/include/pmix_socket_errno.h"
#include "src/client/pmix_client_ops.h" #include "src/client/pmix_client_ops.h"
#include "src/server/pmix_server_ops.h" #include "src/server/pmix_server_ops.h"
@ -152,7 +152,17 @@ static pmix_status_t connect_to_peer(struct pmix_peer_t *peer,
/* if I am a client, then we need to look for the appropriate /* if I am a client, then we need to look for the appropriate
* connection info in the environment */ * connection info in the environment */
if (PMIX_PROC_IS_CLIENT(pmix_globals.mypeer)) { if (PMIX_PROC_IS_CLIENT(pmix_globals.mypeer)) {
if (NULL != (evar = getenv("PMIX_SERVER_URI3"))) { if (NULL != (evar = getenv("PMIX_SERVER_URI4"))) {
/* we are talking to a v3 server */
pmix_client_globals.myserver->proc_type = PMIX_PROC_SERVER | PMIX_PROC_V3;
pmix_output_verbose(2, pmix_ptl_base_framework.framework_output,
"V3 SERVER DETECTED");
/* must use the v3 bfrops module */
pmix_globals.mypeer->nptr->compat.bfrops = pmix_bfrops_base_assign_module(NULL);
if (NULL == pmix_globals.mypeer->nptr->compat.bfrops) {
return PMIX_ERR_INIT;
}
} else if (NULL != (evar = getenv("PMIX_SERVER_URI3"))) {
/* we are talking to a v3 server */ /* we are talking to a v3 server */
pmix_client_globals.myserver->proc_type = PMIX_PROC_SERVER | PMIX_PROC_V3; pmix_client_globals.myserver->proc_type = PMIX_PROC_SERVER | PMIX_PROC_V3;
pmix_output_verbose(2, pmix_ptl_base_framework.framework_output, pmix_output_verbose(2, pmix_ptl_base_framework.framework_output,
@ -251,14 +261,8 @@ static pmix_status_t connect_to_peer(struct pmix_peer_t *peer,
continue; continue;
} }
/* otherwise, we don't know which one to use */ /* otherwise, we don't know which one to use */
free(server_nspace); rc = PMIX_ERR_BAD_PARAM;
if (NULL != suri) { goto cleanup;
free(suri);
}
if (NULL != rendfile) {
free(rendfile);
}
return PMIX_ERR_BAD_PARAM;
} }
server_nspace = strdup(info[n].value.data.string); server_nspace = strdup(info[n].value.data.string);
} else if (PMIX_CHECK_KEY(&info[n], PMIX_SERVER_URI)) { } else if (PMIX_CHECK_KEY(&info[n], PMIX_SERVER_URI)) {
@ -269,14 +273,8 @@ static pmix_status_t connect_to_peer(struct pmix_peer_t *peer,
continue; continue;
} }
/* otherwise, we don't know which one to use */ /* otherwise, we don't know which one to use */
free(suri); rc = PMIX_ERR_BAD_PARAM;
if (NULL != server_nspace) { goto cleanup;
free(server_nspace);
}
if (NULL != rendfile) {
free(rendfile);
}
return PMIX_ERR_BAD_PARAM;
} }
suri = strdup(info[n].value.data.string); suri = strdup(info[n].value.data.string);
} else if (PMIX_CHECK_KEY(&info[n], PMIX_CONNECT_RETRY_DELAY)) { } else if (PMIX_CHECK_KEY(&info[n], PMIX_CONNECT_RETRY_DELAY)) {
@ -327,13 +325,16 @@ static pmix_status_t connect_to_peer(struct pmix_peer_t *peer,
if (sysctl(mib, 2, &argmax, &size, NULL, 0) == -1) { if (sysctl(mib, 2, &argmax, &size, NULL, 0) == -1) {
fprintf(stderr, "sysctl() argmax failed\n"); fprintf(stderr, "sysctl() argmax failed\n");
return -1; rc = PMIX_ERR_NO_PERMISSIONS;
goto cleanup;
} }
/* Allocate space for the arguments. */ /* Allocate space for the arguments. */
procargs = (char *)malloc(argmax); procargs = (char *)malloc(argmax);
if (procargs == NULL) if (procargs == NULL) {
return -1; rc = -1;
goto cleanup;
}
/* Make a sysctl() call to get the raw argument space of the process. */ /* Make a sysctl() call to get the raw argument space of the process. */
mib[0] = CTL_KERN; mib[0] = CTL_KERN;
@ -344,7 +345,8 @@ static pmix_status_t connect_to_peer(struct pmix_peer_t *peer,
if (sysctl(mib, 3, procargs, &size, NULL, 0) == -1) { if (sysctl(mib, 3, procargs, &size, NULL, 0) == -1) {
fprintf(stderr, "Lacked permissions\n");; fprintf(stderr, "Lacked permissions\n");;
return 0; rc = PMIX_ERR_NO_PERMISSIONS;
goto cleanup;
} }
memcpy(&nargs, procargs, sizeof(nargs)); memcpy(&nargs, procargs, sizeof(nargs));
@ -417,10 +419,6 @@ static pmix_status_t connect_to_peer(struct pmix_peer_t *peer,
gethostname(myhost, sizeof(myhost)); gethostname(myhost, sizeof(myhost));
/* if we were given a URI via MCA param, then look no further */ /* if we were given a URI via MCA param, then look no further */
if (NULL != suri) { if (NULL != suri) {
if (NULL != server_nspace) {
free(server_nspace);
server_nspace = NULL;
}
/* if the string starts with "file:", then they are pointing /* if the string starts with "file:", then they are pointing
* us to a file we need to read to get the URI itself */ * us to a file we need to read to get the URI itself */
if (0 == strncmp(suri, "file:", 5)) { if (0 == strncmp(suri, "file:", 5)) {
@ -430,13 +428,8 @@ static pmix_status_t connect_to_peer(struct pmix_peer_t *peer,
rc = parse_uri_file(&suri[5], &suri2, &nspace, &rank); rc = parse_uri_file(&suri[5], &suri2, &nspace, &rank);
if (PMIX_SUCCESS != rc) { if (PMIX_SUCCESS != rc) {
free(suri); free(suri);
if (NULL != rendfile) { rc = PMIX_ERR_UNREACH;
free(rendfile); goto cleanup;
}
if (NULL != iptr) {
PMIX_INFO_FREE(iptr, niptr);
}
return PMIX_ERR_UNREACH;
} }
free(suri); free(suri);
suri = suri2; suri = suri2;
@ -445,13 +438,8 @@ static pmix_status_t connect_to_peer(struct pmix_peer_t *peer,
p = strchr(suri, ';'); p = strchr(suri, ';');
if (NULL == p) { if (NULL == p) {
free(suri); free(suri);
if (NULL != rendfile) { rc = PMIX_ERR_BAD_PARAM;
free(rendfile); goto cleanup;
}
if (NULL != iptr) {
PMIX_INFO_FREE(iptr, niptr);
}
return PMIX_ERR_BAD_PARAM;
} }
*p = '\0'; *p = '\0';
p++; p++;
@ -462,13 +450,8 @@ static pmix_status_t connect_to_peer(struct pmix_peer_t *peer,
if (NULL == p) { if (NULL == p) {
free(suri2); free(suri2);
free(suri); free(suri);
if (NULL != rendfile) { rc = PMIX_ERR_BAD_PARAM;
free(rendfile); goto cleanup;
}
if (NULL != iptr) {
PMIX_INFO_FREE(iptr, niptr);
}
return PMIX_ERR_BAD_PARAM;
} }
*p = '\0'; *p = '\0';
p++; p++;
@ -485,24 +468,9 @@ static pmix_status_t connect_to_peer(struct pmix_peer_t *peer,
if (NULL != nspace) { if (NULL != nspace) {
free(nspace); free(nspace);
} }
free(suri); goto cleanup;
if (NULL != rendfile) {
free(rendfile);
}
if (NULL != iptr) {
PMIX_INFO_FREE(iptr, niptr);
}
return rc;
} }
/* cleanup */ /* cleanup */
free(suri);
suri = NULL;
if (NULL != rendfile) {
free(rendfile);
}
if (NULL != iptr) {
PMIX_INFO_FREE(iptr, niptr);
}
goto complete; goto complete;
} }
@ -527,29 +495,17 @@ static pmix_status_t connect_to_peer(struct pmix_peer_t *peer,
goto complete; goto complete;
} }
} }
/* cleanup */
if (NULL != nspace) {
free(nspace);
}
if (NULL != suri) {
free(suri);
}
free(rendfile);
if (NULL != iptr) {
PMIX_INFO_FREE(iptr, niptr);
}
/* since they gave us a specific rendfile and we couldn't /* since they gave us a specific rendfile and we couldn't
* connect to it, return an error */ * connect to it, return an error */
return PMIX_ERR_UNREACH; rc = PMIX_ERR_UNREACH;
goto cleanup;
} }
/* if they asked for system-level first or only, we start there */ /* if they asked for system-level first or only, we start there */
if (system_level || system_level_only) { if (system_level || system_level_only) {
if (0 > asprintf(&filename, "%s/pmix.sys.%s", mca_ptl_tcp_component.system_tmpdir, myhost)) { if (0 > asprintf(&filename, "%s/pmix.sys.%s", mca_ptl_tcp_component.system_tmpdir, myhost)) {
if (NULL != iptr) { rc = PMIX_ERR_NOMEM;
PMIX_INFO_FREE(iptr, niptr); goto cleanup;
}
return PMIX_ERR_NOMEM;
} }
pmix_output_verbose(2, pmix_ptl_base_framework.framework_output, pmix_output_verbose(2, pmix_ptl_base_framework.framework_output,
"ptl:tcp:tool looking for system server at %s", "ptl:tcp:tool looking for system server at %s",
@ -563,9 +519,6 @@ static pmix_status_t connect_to_peer(struct pmix_peer_t *peer,
/* go ahead and try to connect */ /* go ahead and try to connect */
if (PMIX_SUCCESS == try_connect(suri, &sd, iptr, niptr)) { if (PMIX_SUCCESS == try_connect(suri, &sd, iptr, niptr)) {
/* don't free nspace - we will use it below */ /* don't free nspace - we will use it below */
if (NULL != iptr) {
PMIX_INFO_FREE(iptr, niptr);
}
goto complete; goto complete;
} }
free(nspace); free(nspace);
@ -578,26 +531,15 @@ static pmix_status_t connect_to_peer(struct pmix_peer_t *peer,
if (system_level_only) { if (system_level_only) {
pmix_output_verbose(2, pmix_ptl_base_framework.framework_output, pmix_output_verbose(2, pmix_ptl_base_framework.framework_output,
"ptl:tcp: connecting to system failed"); "ptl:tcp: connecting to system failed");
if (NULL != suri) { rc = PMIX_ERR_UNREACH;
free(suri); goto cleanup;
}
if (NULL != iptr) {
PMIX_INFO_FREE(iptr, niptr);
}
return PMIX_ERR_UNREACH;
} }
/* if they gave us a pid, then look for it */ /* if they gave us a pid, then look for it */
if (0 != pid) { if (0 != pid) {
if (NULL != server_nspace) {
free(server_nspace);
server_nspace = NULL;
}
if (0 > asprintf(&filename, "pmix.%s.tool.%d", myhost, pid)) { if (0 > asprintf(&filename, "pmix.%s.tool.%d", myhost, pid)) {
if (NULL != iptr) { rc = PMIX_ERR_NOMEM;
PMIX_INFO_FREE(iptr, niptr); goto cleanup;
}
return PMIX_ERR_NOMEM;
} }
pmix_output_verbose(2, pmix_ptl_base_framework.framework_output, pmix_output_verbose(2, pmix_ptl_base_framework.framework_output,
"ptl:tcp:tool searching for given session server %s", "ptl:tcp:tool searching for given session server %s",
@ -609,28 +551,17 @@ static pmix_status_t connect_to_peer(struct pmix_peer_t *peer,
if (PMIX_SUCCESS == rc) { if (PMIX_SUCCESS == rc) {
goto complete; goto complete;
} }
if (NULL != suri) {
free(suri);
}
if (NULL != nspace) {
free(nspace);
}
if (NULL != iptr) {
PMIX_INFO_FREE(iptr, niptr);
}
/* since they gave us a specific pid and we couldn't /* since they gave us a specific pid and we couldn't
* connect to it, return an error */ * connect to it, return an error */
return PMIX_ERR_UNREACH; rc = PMIX_ERR_UNREACH;
goto cleanup;
} }
/* if they gave us an nspace, then look for it */ /* if they gave us an nspace, then look for it */
if (NULL != server_nspace) { if (NULL != server_nspace) {
if (0 > asprintf(&filename, "pmix.%s.tool.%s", myhost, server_nspace)) { if (0 > asprintf(&filename, "pmix.%s.tool.%s", myhost, server_nspace)) {
free(server_nspace); rc = PMIX_ERR_NOMEM;
if (NULL != iptr) { goto cleanup;
PMIX_INFO_FREE(iptr, niptr);
}
return PMIX_ERR_NOMEM;
} }
free(server_nspace); free(server_nspace);
server_nspace = NULL; server_nspace = NULL;
@ -644,18 +575,10 @@ static pmix_status_t connect_to_peer(struct pmix_peer_t *peer,
if (PMIX_SUCCESS == rc) { if (PMIX_SUCCESS == rc) {
goto complete; goto complete;
} }
if (NULL != suri) {
free(suri);
}
if (NULL != nspace) {
free(nspace);
}
if (NULL != iptr) {
PMIX_INFO_FREE(iptr, niptr);
}
/* since they gave us a specific nspace and we couldn't /* since they gave us a specific nspace and we couldn't
* connect to it, return an error */ * connect to it, return an error */
return PMIX_ERR_UNREACH; rc = PMIX_ERR_UNREACH;
goto cleanup;
} }
/* they didn't give us a pid, so we will search to see what session-level /* they didn't give us a pid, so we will search to see what session-level
@ -664,13 +587,8 @@ static pmix_status_t connect_to_peer(struct pmix_peer_t *peer,
* one session per user on a node */ * one session per user on a node */
if (0 > asprintf(&filename, "pmix.%s.tool", myhost)) { if (0 > asprintf(&filename, "pmix.%s.tool", myhost)) {
if (NULL != suri) { rc = PMIX_ERR_NOMEM;
free(suri); goto cleanup;
}
if (NULL != iptr) {
PMIX_INFO_FREE(iptr, niptr);
}
return PMIX_ERR_NOMEM;
} }
pmix_output_verbose(2, pmix_ptl_base_framework.framework_output, pmix_output_verbose(2, pmix_ptl_base_framework.framework_output,
"ptl:tcp:tool searching for session server %s", "ptl:tcp:tool searching for session server %s",
@ -680,19 +598,8 @@ static pmix_status_t connect_to_peer(struct pmix_peer_t *peer,
filename, iptr, niptr, &sd, &nspace, &rank, &suri); filename, iptr, niptr, &sd, &nspace, &rank, &suri);
free(filename); free(filename);
if (PMIX_SUCCESS != rc) { if (PMIX_SUCCESS != rc) {
if (NULL != nspace){ rc = PMIX_ERR_UNREACH;
free(nspace); goto cleanup;
}
if (NULL != suri) {
free(suri);
}
if (NULL != iptr) {
PMIX_INFO_FREE(iptr, niptr);
}
return PMIX_ERR_UNREACH;
}
if (NULL != iptr) {
PMIX_INFO_FREE(iptr, niptr);
} }
complete: complete:
@ -701,14 +608,9 @@ static pmix_status_t connect_to_peer(struct pmix_peer_t *peer,
/* do a final bozo check */ /* do a final bozo check */
if (NULL == nspace || PMIX_RANK_WILDCARD == rank) { if (NULL == nspace || PMIX_RANK_WILDCARD == rank) {
if (NULL != nspace) {
free(nspace);
}
if (NULL != suri) {
free(suri);
}
CLOSE_THE_SOCKET(sd); CLOSE_THE_SOCKET(sd);
return PMIX_ERR_UNREACH; rc = PMIX_ERR_UNREACH;
goto cleanup;
} }
/* mark the connection as made */ /* mark the connection as made */
pmix_globals.connected = true; pmix_globals.connected = true;
@ -766,11 +668,24 @@ static pmix_status_t connect_to_peer(struct pmix_peer_t *peer,
pmix_ptl_base_send_handler, pmix_client_globals.myserver); pmix_ptl_base_send_handler, pmix_client_globals.myserver);
pmix_client_globals.myserver->send_ev_active = false; pmix_client_globals.myserver->send_ev_active = false;
free(nspace); cleanup:
if (NULL != nspace) {
free(nspace);
}
if (NULL != iptr) {
PMIX_INFO_FREE(iptr, niptr);
}
if (NULL != rendfile) {
free(rendfile);
}
if (NULL != suri) { if (NULL != suri) {
free(suri); free(suri);
} }
return PMIX_SUCCESS; if (NULL != server_nspace) {
free(server_nspace);
server_nspace = NULL;
}
return rc;
} }
static pmix_status_t send_recv(struct pmix_peer_t *peer, static pmix_status_t send_recv(struct pmix_peer_t *peer,

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

@ -15,7 +15,7 @@
* Copyright (c) 2016-2019 Intel, Inc. All rights reserved. * Copyright (c) 2016-2019 Intel, Inc. All rights reserved.
* Copyright (c) 2017-2018 Research Organization for Information Science * Copyright (c) 2017-2018 Research Organization for Information Science
* and Technology (RIST). All rights reserved. * and Technology (RIST). All rights reserved.
* Copyright (c) 2018 IBM Corporation. All rights reserved. * Copyright (c) 2018-2019 IBM Corporation. All rights reserved.
* $COPYRIGHT$ * $COPYRIGHT$
* *
* Additional copyrights may follow * Additional copyrights may follow
@ -555,7 +555,7 @@ static pmix_status_t setup_listener(pmix_info_t info[], size_t ninfo,
} }
lt = PMIX_NEW(pmix_listener_t); lt = PMIX_NEW(pmix_listener_t);
lt->varname = strdup("PMIX_SERVER_URI3:PMIX_SERVER_URI2:PMIX_SERVER_URI21"); lt->varname = strdup("PMIX_SERVER_URI4:PMIX_SERVER_URI3:PMIX_SERVER_URI2:PMIX_SERVER_URI21");
lt->protocol = PMIX_PROTOCOL_V2; lt->protocol = PMIX_PROTOCOL_V2;
lt->ptl = (struct pmix_ptl_module_t*)&pmix_ptl_tcp_module; lt->ptl = (struct pmix_ptl_module_t*)&pmix_ptl_tcp_module;
lt->cbfunc = connection_handler; lt->cbfunc = connection_handler;
@ -1880,7 +1880,7 @@ static void process_cbfunc(int sd, short args, void *cbdata)
/* probably cannot send an error reply if we are out of memory */ /* probably cannot send an error reply if we are out of memory */
return; return;
} }
info->peerid = peer->index; peer->info->peerid = peer->index;
/* start the events for this tool */ /* start the events for this tool */
pmix_event_assign(&peer->recv_event, pmix_globals.evbase, peer->sd, pmix_event_assign(&peer->recv_event, pmix_globals.evbase, peer->sd,

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

@ -14,6 +14,8 @@
* Copyright (c) 2011-2013 Los Alamos National Security, LLC. All rights * Copyright (c) 2011-2013 Los Alamos National Security, LLC. All rights
* reserved. * reserved.
* Copyright (c) 2013-2018 Intel, Inc. All rights reserved. * Copyright (c) 2013-2018 Intel, Inc. All rights reserved.
* Copyright (c) 2019 Research Organization for Information Science
* and Technology (RIST). All rights reserved.
* $COPYRIGHT$ * $COPYRIGHT$
* *
* Additional copyrights may follow * Additional copyrights may follow
@ -611,7 +613,7 @@ void pmix_usock_send_handler(int sd, short flags, void *cbdata)
return; return;
} else { } else {
// report the error // report the error
event_del(&peer->send_event); pmix_event_del(&peer->send_event);
peer->send_ev_active = false; peer->send_ev_active = false;
PMIX_RELEASE(msg); PMIX_RELEASE(msg);
peer->send_msg = NULL; peer->send_msg = NULL;

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

@ -12,7 +12,7 @@
* Copyright (c) 2008-2015 Cisco Systems, Inc. All rights reserved. * Copyright (c) 2008-2015 Cisco Systems, Inc. All rights reserved.
* Copyright (c) 2010-2015 Los Alamos National Security, LLC. * Copyright (c) 2010-2015 Los Alamos National Security, LLC.
* All rights reserved. * All rights reserved.
* Copyright (c) 2013-2018 Intel, Inc. All rights reserved. * Copyright (c) 2013-2019 Intel, Inc. All rights reserved.
* Copyright (c) 2016-2018 Research Organization for Information Science * Copyright (c) 2016-2018 Research Organization for Information Science
* and Technology (RIST). All rights reserved. * and Technology (RIST). All rights reserved.
* $COPYRIGHT$ * $COPYRIGHT$
@ -28,12 +28,14 @@
#include "src/class/pmix_object.h" #include "src/class/pmix_object.h"
#include "src/client/pmix_client_ops.h" #include "src/client/pmix_client_ops.h"
#include "src/common/pmix_attributes.h"
#include "src/util/output.h" #include "src/util/output.h"
#include "src/util/keyval_parse.h" #include "src/util/keyval_parse.h"
#include "src/util/show_help.h" #include "src/util/show_help.h"
#include "src/mca/base/base.h" #include "src/mca/base/base.h"
#include "src/mca/base/pmix_mca_base_var.h" #include "src/mca/base/pmix_mca_base_var.h"
#include "src/mca/bfrops/base/base.h" #include "src/mca/bfrops/base/base.h"
#include "src/mca/pcompress/base/base.h"
#include "src/mca/gds/base/base.h" #include "src/mca/gds/base/base.h"
#include "src/mca/pif/base/base.h" #include "src/mca/pif/base/base.h"
#include "src/mca/pinstalldirs/base/base.h" #include "src/mca/pinstalldirs/base/base.h"
@ -63,6 +65,8 @@ void pmix_rte_finalize(void)
return; return;
} }
/* release the attribute support trackers */
pmix_release_registered_attrs();
/* close plog */ /* close plog */
(void)pmix_mca_base_framework_close(&pmix_plog_base_framework); (void)pmix_mca_base_framework_close(&pmix_plog_base_framework);
@ -79,6 +83,9 @@ void pmix_rte_finalize(void)
/* close bfrops */ /* close bfrops */
(void)pmix_mca_base_framework_close(&pmix_bfrops_base_framework); (void)pmix_mca_base_framework_close(&pmix_bfrops_base_framework);
/* close compress */
(void)pmix_mca_base_framework_close(&pmix_pcompress_base_framework);
/* close GDS */ /* close GDS */
(void)pmix_mca_base_framework_close(&pmix_gds_base_framework); (void)pmix_mca_base_framework_close(&pmix_gds_base_framework);
@ -116,6 +123,7 @@ void pmix_rte_finalize(void)
} }
PMIX_DESTRUCT(&pmix_globals.notifications); PMIX_DESTRUCT(&pmix_globals.notifications);
PMIX_LIST_DESTRUCT(&pmix_globals.iof_requests); PMIX_LIST_DESTRUCT(&pmix_globals.iof_requests);
PMIX_LIST_DESTRUCT(&pmix_globals.stdin_targets);
/* now safe to release the event base */ /* now safe to release the event base */
if (!pmix_globals.external_evbase) { if (!pmix_globals.external_evbase) {

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

@ -32,16 +32,16 @@
#ifdef HAVE_UNISTD_H #ifdef HAVE_UNISTD_H
#include <unistd.h> #include <unistd.h>
#endif #endif
#include PMIX_EVENT_HEADER
#include "event2/thread.h"
#include <pmix_rename.h> #include <pmix_rename.h>
#include "src/include/pmix_globals.h"
#include "src/util/output.h" #include "src/util/output.h"
#include "src/util/show_help.h" #include "src/util/show_help.h"
#include "src/mca/base/base.h" #include "src/mca/base/base.h"
#include "src/mca/base/pmix_mca_base_var.h" #include "src/mca/base/pmix_mca_base_var.h"
#include "src/mca/bfrops/base/base.h" #include "src/mca/bfrops/base/base.h"
#include "src/mca/pcompress/base/base.h"
#include "src/mca/gds/base/base.h" #include "src/mca/gds/base/base.h"
#include "src/mca/pif/base/base.h" #include "src/mca/pif/base/base.h"
#include "src/mca/pinstalldirs/base/base.h" #include "src/mca/pinstalldirs/base/base.h"
@ -52,6 +52,7 @@
#include "src/mca/ptl/base/base.h" #include "src/mca/ptl/base/base.h"
#include "src/client/pmix_client_ops.h" #include "src/client/pmix_client_ops.h"
#include "src/common/pmix_attributes.h"
#include "src/event/pmix_event.h" #include "src/event/pmix_event.h"
#include "src/include/types.h" #include "src/include/types.h"
#include "src/util/error.h" #include "src/util/error.h"
@ -66,7 +67,10 @@ PMIX_EXPORT int pmix_initialized = 0;
PMIX_EXPORT bool pmix_init_called = false; PMIX_EXPORT bool pmix_init_called = false;
/* we have to export the pmix_globals object so /* we have to export the pmix_globals object so
* all plugins can access it. However, it is included * all plugins can access it. However, it is included
* in the pmix_rename.h file for external protection */ * in the pmix_rename.h file for external protection.
* Initialize only those entries that are not covered
* by MCA params or are complex structures initialized
* below */
PMIX_EXPORT pmix_globals_t pmix_globals = { PMIX_EXPORT pmix_globals_t pmix_globals = {
.init_cntr = 0, .init_cntr = 0,
.mypeer = NULL, .mypeer = NULL,
@ -78,7 +82,8 @@ PMIX_EXPORT pmix_globals_t pmix_globals = {
.debug_output = -1, .debug_output = -1,
.connected = false, .connected = false,
.commits_pending = false, .commits_pending = false,
.mygds = NULL .mygds = NULL,
.pushstdin = false
}; };
@ -176,9 +181,10 @@ int pmix_rte_init(pmix_proc_type_t type,
error = "notification hotel init"; error = "notification hotel init";
goto return_error; goto return_error;
} }
/* and setup the iof request tracking list */ /* and setup the iof request tracking list */
PMIX_CONSTRUCT(&pmix_globals.iof_requests, pmix_list_t); PMIX_CONSTRUCT(&pmix_globals.iof_requests, pmix_list_t);
/* setup the stdin forwarding target list */
PMIX_CONSTRUCT(&pmix_globals.stdin_targets, pmix_list_t);
/* Setup client verbosities as all procs are allowed to /* Setup client verbosities as all procs are allowed to
* access client APIs */ * access client APIs */
@ -285,6 +291,16 @@ int pmix_rte_init(pmix_proc_type_t type,
goto return_error; goto return_error;
} }
/* open and select the compress framework */
if (PMIX_SUCCESS != (ret = pmix_mca_base_framework_open(&pmix_pcompress_base_framework, 0)) ) {
error = "pmix_pcompress_base_open";
goto return_error;
}
if (PMIX_SUCCESS != (ret = pmix_compress_base_select()) ) {
error = "pmix_pcompress_base_select";
goto return_error;
}
/* open the ptl and select the active plugins */ /* open the ptl and select the active plugins */
if (PMIX_SUCCESS != (ret = pmix_mca_base_framework_open(&pmix_ptl_base_framework, 0)) ) { if (PMIX_SUCCESS != (ret = pmix_mca_base_framework_open(&pmix_ptl_base_framework, 0)) ) {
error = "pmix_ptl_base_open"; error = "pmix_ptl_base_open";
@ -346,6 +362,9 @@ int pmix_rte_init(pmix_proc_type_t type,
goto return_error; goto return_error;
} }
/* initialize the attribute support system */
pmix_init_registered_attrs();
/* if an external event base wasn't provide, create one */ /* if an external event base wasn't provide, create one */
if (!pmix_globals.external_evbase) { if (!pmix_globals.external_evbase) {
/* tell libevent that we need thread support */ /* tell libevent that we need thread support */

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

@ -17,8 +17,8 @@
* Copyright (c) 2010-2014 Los Alamos National Security, LLC. * Copyright (c) 2010-2014 Los Alamos National Security, LLC.
* All rights reserved. * All rights reserved.
* Copyright (c) 2014 Hochschule Esslingen. All rights reserved. * Copyright (c) 2014 Hochschule Esslingen. All rights reserved.
* Copyright (c) 2015 Research Organization for Information Science * Copyright (c) 2015-2019 Research Organization for Information Science
* and Technology (RIST). All rights reserved. * and Technology (RIST). All rights reserved.
* Copyright (c) 2015-2018 Mellanox Technologies, Inc. * Copyright (c) 2015-2018 Mellanox Technologies, Inc.
* All rights reserved. * All rights reserved.
* Copyright (c) 2016-2019 Intel, Inc. All rights reserved. * Copyright (c) 2016-2019 Intel, Inc. All rights reserved.
@ -31,7 +31,6 @@
#include "pmix_config.h" #include "pmix_config.h"
#include "src/include/types.h"
#include "src/mca/base/pmix_mca_base_var.h" #include "src/mca/base/pmix_mca_base_var.h"
#include "src/runtime/pmix_rte.h" #include "src/runtime/pmix_rte.h"
#include "src/util/timings.h" #include "src/util/timings.h"

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

@ -1,8 +1,8 @@
/* /*
* Copyright (c) 2014-2017 Intel, Inc. All rights reserved. * Copyright (c) 2014-2017 Intel, Inc. All rights reserved.
* Copyright (c) 2015 Cisco Systems, Inc. All rights reserved. * Copyright (c) 2015 Cisco Systems, Inc. All rights reserved.
* Copyright (c) 2017 Research Organization for Information Science * Copyright (c) 2017-2019 Research Organization for Information Science
* and Technology (RIST). All rights reserved. * and Technology (RIST). All rights reserved.
* $COPYRIGHT$ * $COPYRIGHT$
* *
* Additional copyrights may follow * Additional copyrights may follow
@ -11,7 +11,6 @@
*/ */
#include <src/include/pmix_config.h> #include <src/include/pmix_config.h>
#include "src/include/types.h"
#ifdef HAVE_UNISTD_H #ifdef HAVE_UNISTD_H
#include <unistd.h> #include <unistd.h>
@ -47,6 +46,12 @@ typedef struct {
bool engine_constructed; bool engine_constructed;
pmix_thread_t engine; pmix_thread_t engine;
#if PMIX_HAVE_LIBEV
ev_async async;
pthread_mutex_t mutex;
pthread_cond_t cond;
pmix_list_t list;
#endif
} pmix_progress_tracker_t; } pmix_progress_tracker_t;
static void tracker_constructor(pmix_progress_tracker_t *p) static void tracker_constructor(pmix_progress_tracker_t *p)
@ -56,6 +61,10 @@ static void tracker_constructor(pmix_progress_tracker_t *p)
p->ev_base = NULL; p->ev_base = NULL;
p->ev_active = false; p->ev_active = false;
p->engine_constructed = false; p->engine_constructed = false;
#if PMIX_HAVE_LIBEV
pthread_mutex_init(&p->mutex, NULL);
PMIX_CONSTRUCT(&p->list, pmix_list_t);
#endif
} }
static void tracker_destructor(pmix_progress_tracker_t *p) static void tracker_destructor(pmix_progress_tracker_t *p)
@ -71,6 +80,10 @@ static void tracker_destructor(pmix_progress_tracker_t *p)
if (p->engine_constructed) { if (p->engine_constructed) {
PMIX_DESTRUCT(&p->engine); PMIX_DESTRUCT(&p->engine);
} }
#if PMIX_HAVE_LIBEV
pthread_mutex_destroy(&p->mutex);
PMIX_LIST_DESTRUCT(&p->list);
#endif
} }
static PMIX_CLASS_INSTANCE(pmix_progress_tracker_t, static PMIX_CLASS_INSTANCE(pmix_progress_tracker_t,
@ -78,6 +91,114 @@ static PMIX_CLASS_INSTANCE(pmix_progress_tracker_t,
tracker_constructor, tracker_constructor,
tracker_destructor); tracker_destructor);
#if PMIX_HAVE_LIBEV
typedef enum {
PMIX_EVENT_ACTIVE,
PMIX_EVENT_ADD,
PMIX_EVENT_DEL
} pmix_event_type_t;
typedef struct {
pmix_list_item_t super;
struct event *ev;
struct timeval *tv;
int res;
short ncalls;
pmix_event_type_t type;
} pmix_event_caddy_t;
static PMIX_CLASS_INSTANCE(pmix_event_caddy_t,
pmix_list_item_t,
NULL, NULL);
static pmix_progress_tracker_t* pmix_progress_tracker_get_by_base(struct event_base *);
static void pmix_libev_ev_async_cb (EV_P_ ev_async *w, int revents)
{
pmix_progress_tracker_t *trk = pmix_progress_tracker_get_by_base((struct event_base *)EV_A);
assert(NULL != trk);
pthread_mutex_lock (&trk->mutex);
pmix_event_caddy_t *cd, *next;
PMIX_LIST_FOREACH_SAFE(cd, next, &trk->list, pmix_event_caddy_t) {
switch (cd->type) {
case PMIX_EVENT_ADD:
(void)event_add(cd->ev, cd->tv);
break;
case PMIX_EVENT_DEL:
(void)event_del(cd->ev);
break;
case PMIX_EVENT_ACTIVE:
(void)event_active(cd->ev, cd->res, cd->ncalls);
break;
}
pmix_list_remove_item(&trk->list, &cd->super);
PMIX_RELEASE(cd);
}
pthread_mutex_unlock (&trk->mutex);
}
int pmix_event_add(struct event *ev, struct timeval *tv) {
int res;
pmix_progress_tracker_t *trk = pmix_progress_tracker_get_by_base(ev->ev_base);
if ((NULL != trk) && !pthread_equal(pthread_self(), trk->engine.t_handle)) {
pmix_event_caddy_t *cd = PMIX_NEW(pmix_event_caddy_t);
cd->type = PMIX_EVENT_ADD;
cd->ev = ev;
cd->tv = tv;
pthread_mutex_lock(&trk->mutex);
pmix_list_append(&trk->list, &cd->super);
ev_async_send ((struct ev_loop *)trk->ev_base, &trk->async);
pthread_mutex_unlock(&trk->mutex);
res = PMIX_SUCCESS;
} else {
res = event_add(ev, tv);
}
return res;
}
int pmix_event_del(struct event *ev) {
int res;
pmix_progress_tracker_t *trk = pmix_progress_tracker_get_by_base(ev->ev_base);
if ((NULL != trk) && !pthread_equal(pthread_self(), trk->engine.t_handle)) {
pmix_event_caddy_t *cd = PMIX_NEW(pmix_event_caddy_t);
cd->type = PMIX_EVENT_DEL;
cd->ev = ev;
pthread_mutex_lock(&trk->mutex);
pmix_list_append(&trk->list, &cd->super);
ev_async_send ((struct ev_loop *)trk->ev_base, &trk->async);
pthread_mutex_unlock(&trk->mutex);
res = PMIX_SUCCESS;
} else {
res = event_del(ev);
}
return res;
}
void pmix_event_active (struct event *ev, int res, short ncalls) {
pmix_progress_tracker_t *trk = pmix_progress_tracker_get_by_base(ev->ev_base);
if ((NULL != trk) && !pthread_equal(pthread_self(), trk->engine.t_handle)) {
pmix_event_caddy_t *cd = PMIX_NEW(pmix_event_caddy_t);
cd->type = PMIX_EVENT_ACTIVE;
cd->ev = ev;
cd->res = res;
cd->ncalls = ncalls;
pthread_mutex_lock(&trk->mutex);
pmix_list_append(&trk->list, &cd->super);
ev_async_send ((struct ev_loop *)trk->ev_base, &trk->async);
pthread_mutex_unlock(&trk->mutex);
} else {
event_active(ev, res, ncalls);
}
}
void pmix_event_base_loopbreak (pmix_event_base_t *ev_base) {
pmix_progress_tracker_t *trk = pmix_progress_tracker_get_by_base(ev_base);
assert(NULL != trk);
ev_async_send ((struct ev_loop *)trk->ev_base, &trk->async);
}
#endif
static bool inited = false; static bool inited = false;
static pmix_list_t tracking; static pmix_list_t tracking;
static struct timeval long_timeout = { static struct timeval long_timeout = {
@ -116,7 +237,6 @@ static void stop_progress_engine(pmix_progress_tracker_t *trk)
{ {
assert(trk->ev_active); assert(trk->ev_active);
trk->ev_active = false; trk->ev_active = false;
/* break the event loop - this will cause the loop to exit upon /* break the event loop - this will cause the loop to exit upon
completion of any current event */ completion of any current event */
pmix_event_base_loopbreak(trk->ev_base); pmix_event_base_loopbreak(trk->ev_base);
@ -190,6 +310,11 @@ pmix_event_base_t *pmix_progress_thread_init(const char *name)
dummy_timeout_cb, trk); dummy_timeout_cb, trk);
pmix_event_add(&trk->block, &long_timeout); pmix_event_add(&trk->block, &long_timeout);
#if PMIX_HAVE_LIBEV
ev_async_init (&trk->async, pmix_libev_ev_async_cb);
ev_async_start((struct ev_loop *)trk->ev_base, &trk->async);
#endif
/* construct the thread object */ /* construct the thread object */
PMIX_CONSTRUCT(&trk->engine, pmix_thread_t); PMIX_CONSTRUCT(&trk->engine, pmix_thread_t);
trk->engine_constructed = true; trk->engine_constructed = true;
@ -300,6 +425,21 @@ int pmix_progress_thread_pause(const char *name)
return PMIX_ERR_NOT_FOUND; return PMIX_ERR_NOT_FOUND;
} }
#if PMIX_HAVE_LIBEV
static pmix_progress_tracker_t* pmix_progress_tracker_get_by_base(pmix_event_base_t *base) {
pmix_progress_tracker_t *trk;
if (inited) {
PMIX_LIST_FOREACH(trk, &tracking, pmix_progress_tracker_t) {
if(trk->ev_base == base) {
return trk;
}
}
}
return NULL;
}
#endif
int pmix_progress_thread_resume(const char *name) int pmix_progress_thread_resume(const char *name)
{ {
pmix_progress_tracker_t *trk; pmix_progress_tracker_t *trk;

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

@ -1,11 +1,11 @@
/* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil -*- */ /* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil -*- */
/* /*
* Copyright (c) 2014-2019 Intel, Inc. All rights reserved. * Copyright (c) 2014-2019 Intel, Inc. All rights reserved.
* Copyright (c) 2014-2018 Research Organization for Information Science * Copyright (c) 2014-2019 Research Organization for Information Science
* and Technology (RIST). All rights reserved. * and Technology (RIST). All rights reserved.
* Copyright (c) 2014-2015 Artem Y. Polyakov <artpol84@gmail.com>. * Copyright (c) 2014-2015 Artem Y. Polyakov <artpol84@gmail.com>.
* All rights reserved. * All rights reserved.
* Copyright (c) 2016 Mellanox Technologies, Inc. * Copyright (c) 2016-2019 Mellanox Technologies, Inc.
* All rights reserved. * All rights reserved.
* Copyright (c) 2016-2018 IBM Corporation. All rights reserved. * Copyright (c) 2016-2018 IBM Corporation. All rights reserved.
* Copyright (c) 2018 Cisco Systems, Inc. All rights reserved * Copyright (c) 2018 Cisco Systems, Inc. All rights reserved
@ -18,7 +18,6 @@
#include <src/include/pmix_config.h> #include <src/include/pmix_config.h>
#include <src/include/types.h>
#include <src/include/pmix_stdint.h> #include <src/include/pmix_stdint.h>
#include <src/include/pmix_socket_errno.h> #include <src/include/pmix_socket_errno.h>
@ -49,9 +48,9 @@
#endif #endif
#include <ctype.h> #include <ctype.h>
#include <sys/stat.h> #include <sys/stat.h>
#include PMIX_EVENT_HEADER
#include PMIX_EVENT2_THREAD_HEADER
#include "src/common/pmix_attributes.h"
#include "src/util/argv.h" #include "src/util/argv.h"
#include "src/util/error.h" #include "src/util/error.h"
#include "src/util/name_fns.h" #include "src/util/name_fns.h"
@ -408,6 +407,12 @@ PMIX_EXPORT pmix_status_t PMIx_server_init(pmix_server_module_t *module,
2, PMIX_FWD_STDERR_CHANNEL, pmix_iof_write_handler); 2, PMIX_FWD_STDERR_CHANNEL, pmix_iof_write_handler);
} }
/* register our attributes */
if (PMIX_SUCCESS != (rc = pmix_register_server_attrs())) {
PMIX_RELEASE_THREAD(&pmix_global_lock);
return rc;
}
/* start listening for connections */ /* start listening for connections */
if (PMIX_SUCCESS != pmix_ptl_base_start_listening(info, ninfo)) { if (PMIX_SUCCESS != pmix_ptl_base_start_listening(info, ninfo)) {
pmix_show_help("help-pmix-server.txt", "listener-thread-start", true); pmix_show_help("help-pmix-server.txt", "listener-thread-start", true);
@ -504,7 +509,6 @@ PMIX_EXPORT pmix_status_t PMIx_server_finalize(void)
/* close the pnet framework */ /* close the pnet framework */
(void)pmix_mca_base_framework_close(&pmix_pnet_base_framework); (void)pmix_mca_base_framework_close(&pmix_pnet_base_framework);
PMIX_RELEASE_THREAD(&pmix_global_lock); PMIX_RELEASE_THREAD(&pmix_global_lock);
PMIX_DESTRUCT_LOCK(&pmix_global_lock); PMIX_DESTRUCT_LOCK(&pmix_global_lock);
@ -2299,11 +2303,6 @@ static void _mdxcbfunc(int sd, short argc, void *cbdata)
/* if we get here, then there are processes waiting /* if we get here, then there are processes waiting
* for a response */ * for a response */
/* if the timer is active, clear it */
if (tracker->event_active) {
pmix_event_del(&tracker->ev);
}
/* pass the blobs being returned */ /* pass the blobs being returned */
PMIX_CONSTRUCT(&xfer, pmix_buffer_t); PMIX_CONSTRUCT(&xfer, pmix_buffer_t);
PMIX_LOAD_BUFFER(pmix_globals.mypeer, &xfer, scd->data, scd->ndata); PMIX_LOAD_BUFFER(pmix_globals.mypeer, &xfer, scd->data, scd->ndata);
@ -2345,7 +2344,7 @@ static void _mdxcbfunc(int sd, short argc, void *cbdata)
} }
PMIX_LIST_FOREACH(nptr, &nslist, pmix_nspace_caddy_t) { PMIX_LIST_FOREACH(nptr, &nslist, pmix_nspace_caddy_t) {
PMIX_GDS_STORE_MODEX(rc, nptr->ns, &tracker->local_cbs, &xfer); PMIX_GDS_STORE_MODEX(rc, nptr->ns, &xfer, tracker);
if (PMIX_SUCCESS != rc) { if (PMIX_SUCCESS != rc) {
PMIX_ERROR_LOG(rc); PMIX_ERROR_LOG(rc);
break; break;
@ -2388,12 +2387,7 @@ static void _mdxcbfunc(int sd, short argc, void *cbdata)
xfer.bytes_used = 0; xfer.bytes_used = 0;
PMIX_DESTRUCT(&xfer); PMIX_DESTRUCT(&xfer);
if (!tracker->lost_connection) { pmix_list_remove_item(&pmix_server_globals.collectives, &tracker->super);
/* if this tracker has gone thru the "lost_connection" procedure,
* then it has already been removed from the list - otherwise,
* remove it now */
pmix_list_remove_item(&pmix_server_globals.collectives, &tracker->super);
}
PMIX_RELEASE(tracker); PMIX_RELEASE(tracker);
PMIX_LIST_DESTRUCT(&nslist); PMIX_LIST_DESTRUCT(&nslist);
@ -2646,12 +2640,7 @@ static void _cnct(int sd, short args, void *cbdata)
if (NULL != nspaces) { if (NULL != nspaces) {
pmix_argv_free(nspaces); pmix_argv_free(nspaces);
} }
if (!tracker->lost_connection) { pmix_list_remove_item(&pmix_server_globals.collectives, &tracker->super);
/* if this tracker has gone thru the "lost_connection" procedure,
* then it has already been removed from the list - otherwise,
* remove it now */
pmix_list_remove_item(&pmix_server_globals.collectives, &tracker->super);
}
PMIX_RELEASE(tracker); PMIX_RELEASE(tracker);
/* we are done */ /* we are done */
@ -2728,12 +2717,7 @@ static void _discnct(int sd, short args, void *cbdata)
cleanup: cleanup:
/* cleanup the tracker -- the host RM is responsible for /* cleanup the tracker -- the host RM is responsible for
* telling us when to remove the nspace from our data */ * telling us when to remove the nspace from our data */
if (!tracker->lost_connection) { pmix_list_remove_item(&pmix_server_globals.collectives, &tracker->super);
/* if this tracker has gone thru the "lost_connection" procedure,
* then it has already been removed from the list - otherwise,
* remove it now */
pmix_list_remove_item(&pmix_server_globals.collectives, &tracker->super);
}
PMIX_RELEASE(tracker); PMIX_RELEASE(tracker);
/* we are done */ /* we are done */
@ -2886,7 +2870,7 @@ static void query_cbfunc(pmix_status_t status,
pmix_status_t rc; pmix_status_t rc;
pmix_output_verbose(2, pmix_server_globals.base_output, pmix_output_verbose(2, pmix_server_globals.base_output,
"pmix:query callback with status %d", status); "pmix:query callback with status %s", PMIx_Error_string(status));
reply = PMIX_NEW(pmix_buffer_t); reply = PMIX_NEW(pmix_buffer_t);
if (NULL == reply) { if (NULL == reply) {

Некоторые файлы не были показаны из-за слишком большого количества измененных файлов Показать больше