1
1

Sync to latest PMIx master and PMIx reference server

Signed-off-by: Ralph Castain <rhc@open-mpi.org>
This commit is contained in:
Ralph Castain 2017-03-11 12:50:38 -08:00
parent df8df0d2f3
commit c6bc3ccb76
58 changed files with 1315 additions and 298 deletions

91
config/orte_check_moab.m4 Normal file
View File

@ -0,0 +1,91 @@
# -*- shell-script -*-
#
# 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) 2009-2016 Cisco Systems, Inc. All rights reserved.
# Copyright (c) 2016 Los Alamos National Security, LLC. All rights
# reserved.
# Copyright (c) 2017 Intel, Inc. All rights reserved.
# $COPYRIGHT$
#
# Additional copyrights may follow
#
# $HEADER$
#
# ORTE_CHECK_MOAB(prefix, [action-if-found], [action-if-not-found])
# --------------------------------------------------------
AC_DEFUN([ORTE_CHECK_MOAB],[
if test -z "$orte_check_moab_happy" ; then
OPAL_VAR_SCOPE_PUSH([orte_check_moab_$1_save_CPPFLAGS orte_check_moab_$1_save_LDFLAGS orte_check_moab_$1_save_LIBS])
AC_ARG_WITH([moab],
[AC_HELP_STRING([--with-moab],
[Build MOAB scheduler component (default: yes)])])
OPAL_CHECK_WITHDIR([moab], [$with_moab], [mapi.h])
AC_ARG_WITH([moab-libdir],
[AC_HELP_STRING([--with-moab-libdir=DIR],
[Search for Moab libraries in DIR])])
OPAL_CHECK_WITHDIR([moab-libdir], [$with_moab_libdir], [libmoab.*])
orte_check_moab_happy="yes"
AS_IF([test "$with_moab" = "no"],
[orte_check_moab_happy=no])
AS_IF([test $orte_check_moab_happy = yes],
[AC_MSG_CHECKING([looking for moab in])
AS_IF([test "$with_moab" != "yes"],
[orte_moab_dir=$with_moab
AC_MSG_RESULT([($orte_moab_dir)])],
[AC_MSG_RESULT([(default search paths)])])
AS_IF([test ! -z "$with_moab_libdir" && \
test "$with_moab_libdir" != "yes"],
[orte_moab_libdir=$with_moab_libdir])
])
orte_check_moab_$1_save_CPPFLAGS=$CPPFLAGS
orte_check_moab_$1_save_LDFLAGS=$LDFLAGS
orte_check_moab_$1_save_LIBS=$LIBS
AS_IF([test $orte_check_moab_happy = yes],
[OPAL_CHECK_PACKAGE([orte_check_moab],
[mapi.h],
[cmoab],
[MCCJobGetRemainingTime],
[],
[$orte_moab_dir],
[$orte_moab_libdir],
[],
[orte_check_moab_happy=no])])
CPPFLAGS=$orte_check_moab_$1_save_CPPFLAGS
LDFLAGS=$orte_check_moab_$1_save_LDFLAGS
LIBS=$orte_check_moab_$1_save_LIBS
OPAL_SUMMARY_ADD([[Resource Managers]],[[Moab]],[$1],[$orte_check_moab_happy])
OPAL_VAR_SCOPE_POP
fi
if test $orte_check_moab_happy = yes ; then
$1_CPPFLAGS="[$]$1_CPPFLAGS $orte_check_moab_CPPFLAGS"
$1_LIBS="[$]$1_LIBS $orte_check_moab_LIBS"
$1_LDFLAGS="[$]$1_LDFLAGS $orte_check_moab_LDFLAGS"
AC_SUBST($1_CPPFLAGS)
AC_SUBST($1_LDFLAGS)
AC_SUBST($1_LIBS)
fi
AS_IF([test "$orte_check_moab_happy" = "yes"],
[$2],
[$3])
])

View File

@ -30,7 +30,7 @@ greek=
# command, or with the date (if "git describe" fails) in the form of
# "date<date>".
repo_rev=git129dc44
repo_rev=git4cdd5e0
# If tarball_version is not empty, it is used as the version string in
# the tarball filename, regardless of all other versions listed in
@ -44,7 +44,7 @@ tarball_version=
# The date when this release was created
date="Feb 22, 2017"
date="Mar 11, 2017"
# The shared library version of each of PMIx's public libraries.
# These versions are maintained in accordance with the "Library

View File

@ -729,7 +729,6 @@ AC_DEFUN([PMIX_DEFINE_ARGS],[
[AC_HELP_STRING([--enable-dlopen],
[Whether build should attempt to use dlopen (or
similar) to dynamically load components.
Disabling dlopen implies --disable-pdl-dlopen
(default: enabled)])])
AS_IF([test "$enable_dlopen" = "no"],
[enable_mca_dso="no"
@ -738,6 +737,8 @@ AC_DEFUN([PMIX_DEFINE_ARGS],[
AC_MSG_RESULT([no])],
[PMIX_ENABLE_DLOPEN_SUPPORT=1
AC_MSG_RESULT([yes])])
AC_DEFINE_UNQUOTED(PMIX_ENABLE_DLOPEN_SUPPORT, $PMIX_ENABLE_DLOPEN_SUPPORT,
[Whether we want to enable dlopen support])
# Embedded mode, or standalone?
AC_MSG_CHECKING([if embedded mode is enabled])

View File

@ -12,7 +12,9 @@
# All rights reserved.
# Copyright (c) 2012-2015 Cisco Systems, Inc. All rights reserved.
# Copyright (c) 2012 Oracle and/or its affiliates. All rights reserved.
# Copyright (c) 2014 Intel, Inc. All rights reserved.
# Copyright (c) 2014-2017 Intel, Inc. All rights reserved.
# Copyright (c) 2017 Research Organization for Information Science
# and Technology (RIST). All rights reserved.
# $COPYRIGHT$
#
# Additional copyrights may follow
@ -76,7 +78,7 @@ AC_DEFUN([_PMIX_CHECK_PACKAGE_LIB], [
[ # libdir was specified - search only there
$1_LDFLAGS="$$1_LDFLAGS -L$6"
LDFLAGS="$LDFLAGS -L$6"
AC_CHECK_LIB([$2], [$3],
AC_SEARCH_LIBS([$3], [$2],
[pmix_check_package_lib_happy="yes"],
[pmix_check_package_lib_happy="no"], [$4])
AS_IF([test "$pmix_check_package_lib_happy" = "no"],
@ -88,7 +90,7 @@ AC_DEFUN([_PMIX_CHECK_PACKAGE_LIB], [
AS_IF([test "$pmix_check_package_libdir" = "" || test "$pmix_check_package_libdir" = "/usr" || test "$pmix_check_package_libdir" = "/usr/local"],
[ # try as is...
AC_VERBOSE([looking for library without search path])
AC_CHECK_LIB([$2], [$3],
AC_SEARCH_LIBS([$3], [$2],
[pmix_check_package_lib_happy="yes"],
[pmix_check_package_lib_happy="no"], [$4])
AS_IF([test "$pmix_check_package_lib_happy" = "no"],
@ -102,7 +104,7 @@ AC_DEFUN([_PMIX_CHECK_PACKAGE_LIB], [
[$1_LDFLAGS="$$1_LDFLAGS -L$pmix_check_package_libdir/lib"
LDFLAGS="$LDFLAGS -L$pmix_check_package_libdir/lib"
AC_VERBOSE([looking for library in lib])
AC_CHECK_LIB([$2], [$3],
AC_SEARCH_LIBS([$3], [$2],
[pmix_check_package_lib_happy="yes"],
[pmix_check_package_lib_happy="no"], [$4])
AS_IF([test "$pmix_check_package_lib_happy" = "no"],
@ -116,7 +118,7 @@ AC_DEFUN([_PMIX_CHECK_PACKAGE_LIB], [
[$1_LDFLAGS="$$1_LDFLAGS -L$pmix_check_package_libdir/lib64"
LDFLAGS="$LDFLAGS -L$pmix_check_package_libdir/lib64"
AC_VERBOSE([looking for library in lib64])
AC_CHECK_LIB([$2], [$3],
AC_SEARCH_LIBS([$3], [$2],
[pmix_check_package_lib_happy="yes"],
[pmix_check_package_lib_happy="no"], [$4])
AS_IF([test "$pmix_check_package_lib_happy" = "no"],
@ -128,6 +130,14 @@ AC_DEFUN([_PMIX_CHECK_PACKAGE_LIB], [
AS_IF([test "$pmix_check_package_lib_happy" = "yes"],
[$1_LIBS="-l$2 $4"
$7], [$8])
AS_IF([test "$pmix_check_package_lib_happy" = "yes"],
[ # The result of AC SEARCH_LIBS is cached in $ac_cv_search_[function]
AS_IF([test "$ac_cv_search_$3" != "no" &&
test "$ac_cv_search_$3" != "none required"],
[$1_LIBS="$ac_cv_search_$3 $4"],
[$1_LIBS="$4"])
$7],
[$8])
AS_VAR_POPDEF([pmix_Lib])dnl
])

View File

@ -2,7 +2,7 @@
#
# Copyright (c) 2009-2015 Cisco Systems, Inc. All rights reserved.
# Copyright (c) 2013 Los Alamos National Security, LLC. All rights reserved.
# Copyright (c) 2013-2016 Intel, Inc. All rights reserved
# Copyright (c) 2013-2017 Intel, Inc. All rights reserved.
# $COPYRIGHT$
#
# Additional copyrights may follow
@ -33,10 +33,6 @@ AC_DEFUN([PMIX_LIBEVENT_CONFIG],[
AC_DEFINE_UNQUOTED([PMIX_EVENT2_THREAD_HEADER], [$PMIX_EVENT2_THREAD_HEADER],
[Location of event2/thread.h])
AC_MSG_RESULT([$PMIX_EVENT2_THREAD_HEADER])
CPPFLAGS="$CPPFLAGS $PMIX_EVENT_CPPFLAGS"
LDFLAGS="$LDFLAGS $PMIX_EVENT_LDFLAGS"
LIBS="$LIBS $PMIX_EVENT_LIBS"
])
AC_DEFUN([_PMIX_LIBEVENT_EMBEDDED_MODE],[
@ -45,9 +41,6 @@ AC_DEFUN([_PMIX_LIBEVENT_EMBEDDED_MODE],[
PMIX_EVENT_HEADER="$with_libevent_header"
PMIX_EVENT2_THREAD_HEADER="$with_libevent_header"
PMIX_EVENT_CPPFLAGS=
PMIX_EVENT_LIB=
PMIX_EVENT_LDFLAGS=
])
@ -96,10 +89,9 @@ AC_DEFUN([_PMIX_LIBEVENT_EXTERNAL],[
[AC_MSG_WARN([LIBEVENT SUPPORT NOT FOUND])
AC_MSG_ERROR([CANNOT CONTINE])])
CPPFLAGS="$pmix_libevent_CPPFLAGS $CPPFLAGS"
LIBS="$pmix_libevent_LIBS $LIBS"
LDFLAGS="$pmix_libevent_LDFLAGS $LDFLAGS"
PMIX_FLAGS_APPEND_UNIQ(CPPFLAGS, $pmix_libevent_CPPFLAGS)
PMIX_FLAGS_APPEND_UNIQ(LIBS, $pmix_libevent_LIBS)
PMIX_FLAGS_APPEND_UNIQ(LDFLAGS, $pmix_libevent_LDFLAGS)
# Ensure that this libevent has the symbol
# "evthread_set_lock_callbacks", which will only exist if
@ -120,11 +112,6 @@ AC_DEFUN([_PMIX_LIBEVENT_EXTERNAL],[
# Set output variables
PMIX_EVENT_HEADER="<event.h>"
PMIX_EVENT2_THREAD_HEADER="<event2/thread.h>"
PMIX_EVENT_LIB="-levent -levent_pthreads"
AS_IF([test "$pmix_event_dir" != ""],
[PMIX_EVENT_CPPFLAGS="-I$pmix_event_dir/include"])
AS_IF([test "$pmix_event_libdir" != ""],
[PMIX_EVENT_LDFLAGS="-L$pmix_event_libdir"])
PMIX_VAR_SCOPE_POP
])dnl

View File

@ -19,7 +19,7 @@
# Copyright (c) 2012 Oracle and/or its affiliates. All rights reserved.
# Copyright (c) 2013 Mellanox Technologies, Inc.
# All rights reserved.
# Copyright (c) 2014-2016 Intel, Inc. All rights reserved.
# Copyright (c) 2014-2017 Intel, Inc. All rights reserved.
# Copyright (c) 2016 IBM Corporation. All rights reserved.
# Copyright (c) 2016 Research Organization for Information Science
# and Technology (RIST). All rights reserved.
@ -190,6 +190,11 @@ AS_IF([test -z "$CC_FOR_BUILD"],[
PMIX_SETUP_CC
# Cleanup duplicate flags
PMIX_FLAGS_UNIQ(CPPFLAGS)
PMIX_FLAGS_UNIQ(LDFLAGS)
PMIX_FLAGS_UNIQ(LIBS)
#
# Delayed the substitution of CFLAGS and CXXFLAGS until now because
# they may have been modified throughout the course of this script.
@ -206,6 +211,12 @@ AC_MSG_RESULT([$CPPFLAGS])
AC_MSG_CHECKING([final CFLAGS])
AC_MSG_RESULT([$CFLAGS])
AC_MSG_CHECKING([final LDFLAGS])
AC_MSG_RESULT([$LDFLAGS])
AC_MSG_CHECKING([final LIBS])
AC_MSG_RESULT([$LIBS])
####################################################################
# Version information
####################################################################

View File

@ -11,7 +11,7 @@
# All rights reserved.
# Copyright (c) 2006-2010 Cisco Systems, Inc. All rights reserved.
# Copyright (c) 2012-2013 Los Alamos National Security, Inc. All rights reserved.
# Copyright (c) 2013-2016 Intel, Inc. All rights reserved
# Copyright (c) 2013-2017 Intel, Inc. All rights reserved.
# $COPYRIGHT$
#
# Additional copyrights may follow
@ -21,16 +21,10 @@
AM_CPPFLAGS = -I$(top_builddir)/src -I$(top_builddir)/src/include -I$(top_builddir)/include -I$(top_builddir)/include/pmix
noinst_PROGRAMS = client dmodex dynamic fault pub tool
noinst_PROGRAMS = client dmodex dynamic fault pub tool debugger debuggerd alloc
if !WANT_HIDDEN
# these examples use internal symbols
# use --disable-visibility
noinst_PROGRAMS += debugger debuggerd
endif
if !WANT_HIDDEN
# this example uses internal symbols
# use --disable-visibility
noinst_PROGRAMS += server
endif
@ -38,7 +32,6 @@ client_SOURCES = client.c
client_LDFLAGS = $(PMIX_PKG_CONFIG_LDFLAGS)
client_LDADD = $(top_builddir)/src/libpmix.la
if !WANT_HIDDEN
debugger_SOURCES = debugger.c
debugger_LDFLAGS = $(PMIX_PKG_CONFIG_LDFLAGS)
debugger_LDADD = $(top_builddir)/src/libpmix.la
@ -46,7 +39,11 @@ debugger_LDADD = $(top_builddir)/src/libpmix.la
debuggerd_SOURCES = debuggerd.c
debuggerd_LDFLAGS = $(PMIX_PKG_CONFIG_LDFLAGS)
debuggerd_LDADD = $(top_builddir)/src/libpmix.la
endif
alloc_SOURCES = alloc.c
alloc_LDFLAGS = $(PMIX_PKG_CONFIG_LDFLAGS)
alloc_LDADD = $(top_builddir)/src/libpmix.la
dmodex_SOURCES = dmodex.c
dmodex_LDFLAGS = $(PMIX_PKG_CONFIG_LDFLAGS)
@ -69,8 +66,6 @@ tool_LDFLAGS = $(PMIX_PKG_CONFIG_LDFLAGS)
tool_LDADD = $(top_builddir)/src/libpmix.la
if !WANT_HIDDEN
# this example uses internal symbols
# use --disable-visibility
server_SOURCES = server.c
server_LDFLAGS = $(PMIX_PKG_CONFIG_LDFLAGS)
server_LDADD = $(top_builddir)/src/libpmix.la

View File

@ -0,0 +1,235 @@
/*
* 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) 2006-2013 Los Alamos National Security, LLC.
* 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) 2013-2017 Intel, Inc. All rights reserved.
* Copyright (c) 2015 Mellanox Technologies, Inc. All rights reserved.
* $COPYRIGHT$
*
* Additional copyrights may follow
*
* $HEADER$
*
*/
#include <stdbool.h>
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#include <time.h>
#include <pmix.h>
/* define a structure for collecting returned
* info from an allocation request */
typedef struct {
volatile bool active;
pmix_info_t *info;
size_t ninfo;
} mydata_t;
static volatile bool waiting_for_allocation = true;
/* this is a callback function for the PMIx_Query and
* PMIx_Allocate APIs. The query will callback with a status indicating
* if the request could be fully satisfied, partially
* satisfied, or completely failed. The info parameter
* contains an array of the returned data, with the
* info->key field being the key that was provided in
* the query call. Thus, you can correlate the returned
* data in the info->value field to the requested key.
*
* Once we have dealt with the returned data, we must
* call the release_fn so that the PMIx library can
* cleanup */
static void infocbfunc(pmix_status_t status,
pmix_info_t *info, size_t ninfo,
void *cbdata,
pmix_release_cbfunc_t release_fn,
void *release_cbdata)
{
mydata_t *mq = (mydata_t*)cbdata;
size_t n;
fprintf(stderr, "Allocation request returned %s", PMIx_Error_string(status));
/* save the returned info - the PMIx library "owns" it
* and will release it and perform other cleanup actions
* when release_fn is called */
if (0 < ninfo) {
PMIX_INFO_CREATE(mq->info, ninfo);
mq->ninfo = ninfo;
for (n=0; n < ninfo; n++) {
fprintf(stderr, "Transferring %s\n", info[n].key);
PMIX_INFO_XFER(&mq->info[n], &info[n]);
}
}
/* let the library release the data and cleanup from
* the operation */
if (NULL != release_fn) {
release_fn(release_cbdata);
}
/* release the block */
mq->active = false;
}
/* this is an event notification function that we explicitly request
* be called when the PMIX_ERR_ALLOC_COMPLETE notification is issued.
* We could catch it in the general event notification function and test
* the status to see if it was "alloc complete", but it often is simpler
* to declare a use-specific notification callback point. In this case,
* we are asking to know when the allocation request completes */
static void release_fn(size_t evhdlr_registration_id,
pmix_status_t status,
const pmix_proc_t *source,
pmix_info_t info[], size_t ninfo,
pmix_info_t results[], size_t nresults,
pmix_event_notification_cbfunc_fn_t cbfunc,
void *cbdata)
{
/* tell the event handler state machine that we are the last step */
if (NULL != cbfunc) {
cbfunc(PMIX_EVENT_ACTION_COMPLETE, NULL, 0, NULL, NULL, cbdata);
}
/* flag that the allocation is complete so we can exit */
waiting_for_allocation = false;
}
/* event handler registration is done asynchronously because it
* may involve the PMIx server registering with the host RM for
* external events. So we provide a callback function that returns
* the status of the request (success or an error), plus a numerical index
* to the registered event. The index is used later on to deregister
* an event handler - if we don't explicitly deregister it, then the
* PMIx server will do so when it see us exit */
static void evhandler_reg_callbk(pmix_status_t status,
size_t evhandler_ref,
void *cbdata)
{
volatile int *active = (volatile int*)cbdata;
if (PMIX_SUCCESS != status) {
fprintf(stderr, "EVENT HANDLER REGISTRATION FAILED WITH STATUS %d, ref=%lu\n",
status, (unsigned long)evhandler_ref);
}
*active = status;
}
int main(int argc, char **argv)
{
pmix_proc_t myproc;
int rc;
pmix_value_t value;
pmix_value_t *val = &value;
pmix_proc_t proc;
uint32_t nprocs;
pmix_info_t *info;
uint64_t nnodes = 12;
mydata_t mydata;
pmix_query_t *query;
char *myallocation = "MYALLOCATION";
volatile int active;
pmix_status_t code = PMIX_NOTIFY_ALLOC_COMPLETE;
/* init us */
if (PMIX_SUCCESS != (rc = PMIx_Init(&myproc, NULL, 0))) {
fprintf(stderr, "Client ns %s rank %d: PMIx_Init failed: %d\n", myproc.nspace, myproc.rank, rc);
exit(0);
}
fprintf(stderr, "Client ns %s rank %d: Running\n", myproc.nspace, myproc.rank);
/* get our universe size */
PMIX_PROC_CONSTRUCT(&proc);
(void)strncpy(proc.nspace, myproc.nspace, PMIX_MAX_NSLEN);
proc.rank = PMIX_RANK_WILDCARD;
if (PMIX_SUCCESS != (rc = PMIx_Get(&proc, PMIX_UNIV_SIZE, NULL, 0, &val))) {
fprintf(stderr, "Client ns %s rank %d: PMIx_Get universe size failed: %d\n", myproc.nspace, myproc.rank, rc);
goto done;
}
nprocs = val->data.uint32;
PMIX_VALUE_RELEASE(val);
fprintf(stderr, "Client %s:%d universe size %d\n", myproc.nspace, myproc.rank, nprocs);
/* initialize the return info struct */
mydata.info = NULL;
mydata.ninfo = 0;
if (0 == myproc.rank) {
/* try to get an allocation */
mydata.active = true;
PMIX_INFO_CREATE(info, 2);
PMIX_INFO_LOAD(&info[0], PMIX_ALLOC_NUM_NODES, &nnodes, PMIX_UINT64);
PMIX_INFO_LOAD(&info[0], PMIX_ALLOC_ID, myallocation, PMIX_STRING);
if (PMIX_SUCCESS != (rc = PMIx_Allocation_request_nb(PMIX_ALLOC_NEW, info, 2, infocbfunc, NULL))) {
fprintf(stderr, "Client ns %s rank %d: PMIx_Allocation_request_nb failed: %d\n", myproc.nspace, myproc.rank, rc);
goto done;
}
while (mydata.active) {
usleep(10);
}
PMIX_INFO_FREE(info, 2);
if (NULL != mydata.info) {
PMIX_INFO_FREE(mydata.info, mydata.ninfo);
}
} else if (1 == myproc.rank) {
/* register a handler specifically for when the allocation
* operation completes */
PMIX_INFO_CREATE(info, 1);
PMIX_INFO_LOAD(&info[0], PMIX_ALLOC_ID, myallocation, PMIX_STRING);
active = -1;
PMIx_Register_event_handler(&code, 1, info, 1,
release_fn, evhandler_reg_callbk, (void*)&active);
while (-1 == active) {
usleep(10);
}
if (0 != active) {
exit(active);
}
PMIX_INFO_FREE(info, 1);
/* now wait to hear that the request is complete */
while (waiting_for_allocation) {
usleep(10);
}
} else {
/* I am not the root rank, so let me wait a little while and then
* query the status of the allocation request */
usleep(10);
PMIX_QUERY_CREATE(query, 1);
PMIX_ARGV_APPEND(query[0].keys, PMIX_QUERY_ALLOC_STATUS);
PMIX_INFO_CREATE(query[0].qualifiers, 1);
PMIX_INFO_LOAD(&query[0].qualifiers[0], PMIX_ALLOC_ID, myallocation, PMIX_STRING);
mydata.active = true;
if (PMIX_SUCCESS != (rc = PMIx_Query_info_nb(query, 1, infocbfunc, (void*)&mydata))) {
fprintf(stderr, "PMIx_Query_info failed: %d\n", rc);
goto done;
}
while (mydata.active) {
usleep(10);
}
PMIX_QUERY_FREE(query, 1);
}
done:
/* finalize us */
fprintf(stderr, "Client ns %s rank %d: Finalizing\n", myproc.nspace, myproc.rank);
if (PMIX_SUCCESS != (rc = PMIx_Finalize(NULL, 0))) {
fprintf(stderr, "Client ns %s rank %d:PMIx_Finalize failed: %d\n", myproc.nspace, myproc.rank, rc);
} else {
fprintf(stderr, "Client ns %s rank %d:PMIx_Finalize successfully completed\n", myproc.nspace, myproc.rank);
}
fflush(stderr);
return(0);
}

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 2013-2016 Intel, Inc. All rights reserved
* Copyright (c) 2013-2017 Intel, Inc. All rights reserved.
* Copyright (c) 2016 Research Organization for Information Science
* and Technology (RIST). All rights reserved.
*
@ -437,6 +437,41 @@ pmix_status_t PMIx_Log_nb(const pmix_info_t data[], size_t ndata,
const pmix_info_t directives[], size_t ndirs,
pmix_op_cbfunc_t cbfunc, void *cbdata);
/* Request an allocation operation from the host resource manager.
* Several broad categories are envisioned, including the ability to:
*
* - request allocation of additional resources, including memory,
* bandwidth, and compute. This should be accomplished in a
* non-blocking manner so that the application can continue to
* progress while waiting for resources to become available. Note
* that the new allocation will be disjoint from (i.e., not
* affiliated with) the allocation of the requestor - thus the
* termination of one allocation will not impact the other.
*
* - extend the reservation on currently allocated resources, subject
* to scheduling availability and priorities. This includes extending
* the time limit on current resources, and/or requesting additional
* resources be allocated to the requesting job. Any additional
* allocated resources will be considered as part of the current
* allocation, and thus will be released at the same time.
*
* - release currently allocated resources that are no longer required.
* This is intended to support partial release of resources since all
* resources are normally released upon termination of the job. The
* identified use-cases include resource variations across discrete steps
* of a workflow, as well as applications that spawn sub-jobs and/or
* dynamically grow/shrink over time
*
* - "lend" resources back to the scheduler with an expectation of getting
* them back at some later time in the job. This can be a proactive
* operation (e.g., to save on computing costs when resources are
* temporarily not required), or in response to scheduler requests in
* lieue of preemption. A corresponding ability to "reacquire" resources
* previously released is included.
*/
pmix_status_t PMIx_Allocation_request_nb(pmix_alloc_directive_t directive,
pmix_info_t *info, size_t ninfo,
pmix_info_cbfunc_t cbfunc, void *cbdata);
#if defined(c_plusplus) || defined(__cplusplus)
}

View File

@ -300,6 +300,8 @@ typedef uint32_t pmix_rank_t;
#define PMIX_QUERY_LOCAL_ONLY "pmix.qry.local" // constrain the query to local information only
#define PMIX_QUERY_REPORT_AVG "pmix.qry.avg" // report average values
#define PMIX_QUERY_REPORT_MINMAX "pmix.qry.minmax" // report minimum and maximum value
#define PMIX_QUERY_ALLOC_STATUS "pmix.query.alloc" // (char*) string identifier of the allocation whose status
// is being requested
/* log attributes */
#define PMIX_LOG_STDERR "pmix.log.stderr" // (char*) log string to stderr
@ -322,6 +324,24 @@ typedef uint32_t pmix_rank_t;
#define PMIX_SET_ENVAR "pmix.set.envar" // (char*) string "key=value" value shall be put into the environment
#define PMIX_UNSET_ENVAR "pmix.unset.envar" // (char*) unset envar specified in string
/* attributes relating to allocations */
#define PMIX_ALLOC_ID "pmix.alloc.id" // (char*) provide a string identifier for this allocation request
// which can later be used to query status of the request
#define PMIX_TIME_REMAINING "pmix.time.remaining" // (uint32_t) get number of seconds remaining in allocation
#define PMIX_ALLOC_NUM_NODES "pmix.alloc.nnodes" // (uint64_t) number of nodes
#define PMIX_ALLOC_NODE_LIST "pmix.alloc.nlist" // (char*) regex of specific nodes
#define PMIX_ALLOC_NUM_CPUS "pmix.alloc.ncpus" // (uint64_t) number of cpus
#define PMIX_ALLOC_NUM_CPU_LIST "pmix.alloc.ncpulist" // (char*) regex of #cpus for each node
#define PMIX_ALLOC_CPU_LIST "pmix.alloc.cpulist" // (char*) regex of specific cpus indicating the cpus involved.
#define PMIX_ALLOC_MEM_SIZE "pmix.alloc.msize" // (float) number of Mbytes
#define PMIX_ALLOC_NETWORK "pmix.alloc.net" // (array) array of pmix_info_t describing network resources. If not
// given as part of an info struct that identifies the
// impacted nodes, then the description will be applied
// across all nodes in the requestor's allocation
#define PMIX_ALLOC_NETWORK_ID "pmix.alloc.netid" // (char*) name of network
#define PMIX_ALLOC_BANDWIDTH "pmix.alloc.bw" // (float) Mbits/sec
#define PMIX_ALLOC_NETWORK_QOS "pmix.alloc.netqos" // (char*) quality of service level
#define PMIX_ALLOC_TIME "pmix.alloc.time" // (uint32_t) time in seconds
/**** PROCESS STATE DEFINITIONS ****/
typedef uint8_t pmix_proc_state_t;
@ -365,53 +385,90 @@ typedef uint8_t pmix_proc_state_t;
typedef int pmix_status_t;
#define PMIX_SUCCESS (PMIX_ERR_BASE)
#define PMIX_ERROR (PMIX_ERR_BASE - 1) // general error
/* v1.x error values - must be fixed in place for backward
* compatability. Note that some number of these have been
* deprecated and may not be returned by v2.x and above
* clients or servers. However, they must always be
* at least defined to ensure older codes will compile */
#define PMIX_SUCCESS 0
#define PMIX_ERROR -1 // general error
#define PMIX_ERR_SILENT -2 // internal-only
/* debugger release flag */
#define PMIX_ERR_DEBUGGER_RELEASE (PMIX_ERR_BASE - 2)
#define PMIX_ERR_DEBUGGER_RELEASE -3
/* fault tolerance */
#define PMIX_ERR_PROC_RESTART (PMIX_ERR_BASE - 3)
#define PMIX_ERR_PROC_CHECKPOINT (PMIX_ERR_BASE - 4)
#define PMIX_ERR_PROC_MIGRATE (PMIX_ERR_BASE - 5)
#define PMIX_ERR_UPDATE_ENDPOINTS (PMIX_ERR_BASE - 6)
#define PMIX_ERR_PROC_RESTART -4
#define PMIX_ERR_PROC_CHECKPOINT -5
#define PMIX_ERR_PROC_MIGRATE -6
/* abort */
#define PMIX_ERR_PROC_ABORTED (PMIX_ERR_BASE - 7)
#define PMIX_ERR_PROC_REQUESTED_ABORT (PMIX_ERR_BASE - 8)
#define PMIX_ERR_PROC_ABORTING (PMIX_ERR_BASE - 9)
#define PMIX_ERR_PROC_ABORTED -7
#define PMIX_ERR_PROC_REQUESTED_ABORT -8
#define PMIX_ERR_PROC_ABORTING -9
/* communication failures */
#define PMIX_ERR_UNREACH (PMIX_ERR_BASE - 10)
#define PMIX_ERR_LOST_CONNECTION_TO_SERVER (PMIX_ERR_BASE - 11)
#define PMIX_ERR_LOST_PEER_CONNECTION (PMIX_ERR_BASE - 12)
#define PMIX_ERR_LOST_CONNECTION_TO_CLIENT (PMIX_ERR_BASE - 13)
/* used by the query system */
#define PMIX_QUERY_PARTIAL_SUCCESS (PMIX_ERR_BASE - 14)
#define PMIX_ERR_SERVER_FAILED_REQUEST -10
#define PMIX_EXISTS -11
#define PMIX_ERR_INVALID_CRED -12 // internal-only
#define PMIX_ERR_HANDSHAKE_FAILED -13 // internal-only
#define PMIX_ERR_READY_FOR_HANDSHAKE -14 // internal-only
#define PMIX_ERR_WOULD_BLOCK -15
#define PMIX_ERR_UNKNOWN_DATA_TYPE -16 // internal-only
#define PMIX_ERR_PROC_ENTRY_NOT_FOUND -17 // internal-only
#define PMIX_ERR_TYPE_MISMATCH -18 // internal-only
#define PMIX_ERR_UNPACK_INADEQUATE_SPACE -19 // internal-only
#define PMIX_ERR_UNPACK_FAILURE -20 // internal-only
#define PMIX_ERR_PACK_FAILURE -21 // internal-only
#define PMIX_ERR_PACK_MISMATCH -22 // internal-only
#define PMIX_ERR_NO_PERMISSIONS -23
#define PMIX_ERR_TIMEOUT -24
#define PMIX_ERR_UNREACH -25
#define PMIX_ERR_IN_ERRNO -26 // internal-only
#define PMIX_ERR_BAD_PARAM -27
#define PMIX_ERR_RESOURCE_BUSY -28 // internal-only
#define PMIX_ERR_OUT_OF_RESOURCE -29
#define PMIX_ERR_DATA_VALUE_NOT_FOUND -30
#define PMIX_ERR_INIT -31
#define PMIX_ERR_NOMEM -32 // internal-only
#define PMIX_ERR_INVALID_ARG -33 // internal-only
#define PMIX_ERR_INVALID_KEY -34 // internal-only
#define PMIX_ERR_INVALID_KEY_LENGTH -35 // internal-only
#define PMIX_ERR_INVALID_VAL -36 // internal-only
#define PMIX_ERR_INVALID_VAL_LENGTH -37 // internal-only
#define PMIX_ERR_INVALID_LENGTH -38 // internal-only
#define PMIX_ERR_INVALID_NUM_ARGS -39 // internal-only
#define PMIX_ERR_INVALID_ARGS -40 // internal-only
#define PMIX_ERR_INVALID_NUM_PARSED -41 // internal-only
#define PMIX_ERR_INVALID_KEYVALP -42 // internal-only
#define PMIX_ERR_INVALID_SIZE -43
#define PMIX_ERR_INVALID_NAMESPACE -44
#define PMIX_ERR_SERVER_NOT_AVAIL -45 // internal-only
#define PMIX_ERR_NOT_FOUND -46
#define PMIX_ERR_NOT_SUPPORTED -47
#define PMIX_ERR_NOT_IMPLEMENTED -48
#define PMIX_ERR_COMM_FAILURE -49
#define PMIX_ERR_UNPACK_READ_PAST_END_OF_BUFFER -50 // internal-only
/* define a starting point for v2.x error values */
#define PMIX_ERR_V2X_BASE -100
/* v2.x communication errors */
#define PMIX_ERR_LOST_CONNECTION_TO_SERVER (PMIX_ERR_V2X_BASE - 1)
#define PMIX_ERR_LOST_PEER_CONNECTION (PMIX_ERR_V2X_BASE - 2)
#define PMIX_ERR_LOST_CONNECTION_TO_CLIENT (PMIX_ERR_V2X_BASE - 3)
/* used by the query system */
#define PMIX_QUERY_PARTIAL_SUCCESS (PMIX_ERR_V2X_BASE - 4)
#define PMIX_NOTIFY_ALLOC_COMPLETE (PMIX_ERR_V2X_BASE - 5)
/* define a starting point for operational error constants so
* we avoid renumbering when making additions */
#define PMIX_ERR_OP_BASE -100
#define PMIX_ERR_OP_BASE PMIX_ERR_V2X_BASE-30
/* operational */
#define PMIX_ERR_NO_PERMISSIONS (PMIX_ERR_OP_BASE - 1)
#define PMIX_ERR_TIMEOUT (PMIX_ERR_OP_BASE - 2)
#define PMIX_ERR_WOULD_BLOCK (PMIX_ERR_OP_BASE - 3)
#define PMIX_EXISTS (PMIX_ERR_OP_BASE - 4)
#define PMIX_ERR_SERVER_FAILED_REQUEST (PMIX_ERR_OP_BASE - 5)
#define PMIX_ERR_NOT_SUPPORTED (PMIX_ERR_OP_BASE - 6)
#define PMIX_ERR_NOT_FOUND (PMIX_ERR_OP_BASE - 7)
#define PMIX_ERR_BAD_PARAM (PMIX_ERR_OP_BASE - 8)
#define PMIX_ERR_DATA_VALUE_NOT_FOUND (PMIX_ERR_OP_BASE - 9)
#define PMIX_ERR_OUT_OF_RESOURCE (PMIX_ERR_OP_BASE - 10)
#define PMIX_ERR_INVALID_NAMESPACE (PMIX_ERR_OP_BASE - 11)
#define PMIX_ERR_INVALID_SIZE (PMIX_ERR_OP_BASE - 12)
#define PMIX_ERR_INIT (PMIX_ERR_OP_BASE - 13)
#define PMIX_ERR_EVENT_REGISTRATION (PMIX_ERR_OP_BASE - 14)
#define PMIX_ERR_JOB_TERMINATED (PMIX_ERR_OP_BASE - 15)
#define PMIX_ERR_UPDATE_ENDPOINTS (PMIX_ERR_OP_BASE - 16)
/* define a starting point for system error constants so
* we avoid renumbering when making additions */
#define PMIX_ERR_SYS_BASE -200
#define PMIX_ERR_SYS_BASE PMIX_ERR_OP_BASE-100
/* system failures */
#define PMIX_ERR_NODE_DOWN (PMIX_ERR_SYS_BASE - 1)
@ -420,7 +477,7 @@ typedef int pmix_status_t;
/* define a starting point for event handler error constants so
* we avoid renumbering when making additions */
#define PMIX_ERR_EVHDLR_BASE -300
#define PMIX_ERR_EVHDLR_BASE PMIX_ERR_SYS_BASE-100
/* used by event handlers */
#define PMIX_EVENT_NO_ACTION_TAKEN (PMIX_ERR_EVHDLR_BASE - 1)
@ -487,10 +544,14 @@ typedef uint16_t pmix_data_type_t;
#define PMIX_PROC_RANK 40
#define PMIX_QUERY 41
#define PMIX_COMPRESSED_STRING 42 // string compressed with zlib
#define PMIX_ALLOC_DIRECTIVE 43
/**** DEPRECATED ****/
#define PMIX_INFO_ARRAY 43
#define PMIX_INFO_ARRAY 44
/********************/
/* define a boundary for implementers so they can add their own data types */
#define PMIX_DATA_TYPE_MAX 500
/* define a scope for data "put" by PMI per the following:
*
@ -534,6 +595,22 @@ typedef uint32_t pmix_info_directives_t;
#define PMIX_INFO_REQD 0x0001
/* define a set of directives for allocation requests */
typedef uint8_t pmix_alloc_directive_t;
#define PMIX_ALLOC_NEW 1 // new allocation is being requested. The resulting allocation will be
// disjoint (i.e., not connected in a job sense) from the requesting allocation
#define PMIX_ALLOC_EXTEND 2 // extend the existing allocation, either in time or as additional resources
#define PMIX_ALLOC_RELEASE 3 // release part of the existing allocation. Attributes in the accompanying
// pmix\_info\_t array may be used to specify permanent release of the
// identified resources, or "lending" of those resources for some period
// of time.
#define PMIX_ALLOC_REAQUIRE 4 // reacquire resources that were previously "lent" back to the scheduler
/* define a value boundary beyond which implementers are free
* to define their own directive values */
#define PMIX_ALLOC_EXTERNAL 128
/**** PMIX BYTE OBJECT ****/
typedef struct pmix_byte_object {
char *bytes;
@ -1321,6 +1398,7 @@ pmix_status_t PMIx_Notify_event(pmix_status_t status,
* - pmix_data_range_t (PMIX_DATA_RANGE)
* - pmix_info_directives_t (PMIX_INFO_DIRECTIVES)
* - pmix_data_type_t (PMIX_DATA_TYPE)
* - pmix_alloc_directive_t (PMIX_ALLOC_DIRECTIVE)
*/
const char* PMIx_Error_string(pmix_status_t status);
const char* PMIx_Proc_state_string(pmix_proc_state_t state);
@ -1329,7 +1407,7 @@ const char* PMIx_Persistence_string(pmix_persistence_t persist);
const char* PMIx_Data_range_string(pmix_data_range_t range);
const char* PMIx_Info_directives_string(pmix_info_directives_t directives);
const char* PMIx_Data_type_string(pmix_data_type_t type);
const char* PMIx_Alloc_directive_string(pmix_alloc_directive_t directive);
/* Get the PMIx version string. Note that the provided string is
* statically defined and must NOT be free'd */

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 2013-2016 Intel, Inc. All rights reserved
* Copyright (c) 2013-2017 Intel, Inc. All rights reserved.
* Copyright (c) 2015 Artem Y. Polyakov <artpol84@gmail.com>.
* All rights reserved.
* Copyright (c) 2015 Research Organization for Information Science
@ -322,7 +322,14 @@ typedef void (*pmix_server_log_fn_t)(const pmix_proc_t *client,
const pmix_info_t directives[], size_t ndirs,
pmix_op_cbfunc_t cbfunc, void *cbdata);
/* Request allocation modifications on behalf of a client */
typedef pmix_status_t (*pmix_server_alloc_fn_t)(const pmix_proc_t *client,
pmix_alloc_directive_t directive,
const pmix_info_t data[], size_t ndata,
pmix_info_cbfunc_t cbfunc, void *cbdata);
typedef struct pmix_server_module_2_0_0_t {
/* v1x interfaces */
pmix_server_client_connected_fn_t client_connected;
pmix_server_client_finalized_fn_t client_finalized;
pmix_server_abort_fn_t abort;
@ -336,11 +343,13 @@ typedef struct pmix_server_module_2_0_0_t {
pmix_server_disconnect_fn_t disconnect;
pmix_server_register_events_fn_t register_events;
pmix_server_deregister_events_fn_t deregister_events;
pmix_server_notify_event_fn_t notify_event;
pmix_server_listener_fn_t listener;
/* v2x interfaces */
pmix_server_notify_event_fn_t notify_event;
pmix_server_query_fn_t query;
pmix_server_tool_connection_fn_t tool_connected;
pmix_server_log_fn_t log;
pmix_server_alloc_fn_t allocate;
} pmix_server_module_t;
/**** SERVER SUPPORT INIT/FINALIZE FUNCTIONS ****/

View File

@ -174,6 +174,10 @@ pmix_status_t pmix_bfrop_copy_payload(pmix_buffer_t *dest, pmix_buffer_t *src)
datasize = sizeof(pmix_proc_state_t);
break;
case PMIX_ALLOC_DIRECTIVE:
datasize = sizeof(pmix_alloc_directive_t);
break;
default:
return PMIX_ERR_UNKNOWN_DATA_TYPE;
}

View File

@ -316,6 +316,8 @@ pmix_status_t pmix_bfrop_pack_query(pmix_buffer_t *buffer, const void *src,
int32_t num_vals, pmix_data_type_t type);
pmix_status_t pmix_bfrop_pack_rank(pmix_buffer_t *buffer, const void *src,
int32_t num_vals, pmix_data_type_t type);
pmix_status_t pmix_bfrop_pack_alloc_directive(pmix_buffer_t *buffer, const void *src,
int32_t num_vals, pmix_data_type_t type);
/**** DEPRECATED ****/
pmix_status_t pmix_bfrop_pack_array(pmix_buffer_t *buffer, const void *src,
int32_t num_vals, pmix_data_type_t type);
@ -396,6 +398,8 @@ pmix_status_t pmix_bfrop_unpack_query(pmix_buffer_t *buffer, void *dest,
int32_t *num_vals, pmix_data_type_t type);
pmix_status_t pmix_bfrop_unpack_rank(pmix_buffer_t *buffer, void *dest,
int32_t *num_vals, pmix_data_type_t type);
pmix_status_t pmix_bfrop_unpack_alloc_directive(pmix_buffer_t *buffer, void *dest,
int32_t *num_vals, pmix_data_type_t type);
/**** DEPRECATED ****/
pmix_status_t pmix_bfrop_unpack_array(pmix_buffer_t *buffer, void *dest,
int32_t *num_vals, pmix_data_type_t type);
@ -506,6 +510,9 @@ pmix_status_t pmix_bfrop_print_query(char **output, char *prefix,
pmix_query_t *src, pmix_data_type_t type);
pmix_status_t pmix_bfrop_print_rank(char **output, char *prefix,
pmix_rank_t *src, pmix_data_type_t type);
pmix_status_t pmix_bfrop_print_alloc_directive(char **output, char *prefix,
pmix_alloc_directive_t *src,
pmix_data_type_t type);
/**** DEPRECATED ****/
pmix_status_t pmix_bfrop_print_array(char **output, char *prefix,
pmix_info_array_t *src,

View File

@ -424,6 +424,13 @@ pmix_status_t pmix_bfrop_open(void)
pmix_bfrop_copy_bo,
pmix_bfrop_print_bo);
PMIX_REGISTER_TYPE("PMIX_ALLOC_DIRECTIVE",
PMIX_ALLOC_DIRECTIVE,
pmix_bfrop_pack_alloc_directive,
pmix_bfrop_unpack_alloc_directive,
pmix_bfrop_std_copy,
pmix_bfrop_print_alloc_directive);
/**** DEPRECATED ****/
PMIX_REGISTER_TYPE("PMIX_INFO_ARRAY", PMIX_INFO_ARRAY,
pmix_bfrop_pack_array,

View File

@ -10,7 +10,7 @@
* Copyright (c) 2004-2005 The Regents of the University of California.
* All rights reserved.
* Copyright (c) 2011-2013 Cisco Systems, Inc. All rights reserved.
* Copyright (c) 2014-2016 Intel, Inc. All rights reserved.
* Copyright (c) 2014-2017 Intel, Inc. All rights reserved.
* Copyright (c) 2015 Research Organization for Information Science
* and Technology (RIST). All rights reserved.
* Copyright (c) 2016 Mellanox Technologies, Inc.
@ -1006,6 +1006,12 @@ pmix_status_t pmix_bfrop_pack_query(pmix_buffer_t *buffer, const void *src,
return PMIX_SUCCESS;
}
pmix_status_t pmix_bfrop_pack_alloc_directive(pmix_buffer_t *buffer, const void *src,
int32_t num_vals, pmix_data_type_t type)
{
return pmix_bfrop_pack_byte(buffer, src, num_vals, PMIX_UINT8);
}
/**** DEPRECATED ****/
pmix_status_t pmix_bfrop_pack_array(pmix_buffer_t *buffer, const void *src,

View File

@ -10,7 +10,7 @@
* 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) 2014-2016 Intel, Inc. All rights reserved.
* Copyright (c) 2014-2017 Intel, Inc. All rights reserved.
* Copyright (c) 2016 Mellanox Technologies, Inc.
* All rights reserved.
* Copyright (c) 2016 IBM Corporation. All rights reserved.
@ -1079,12 +1079,12 @@ pmix_status_t pmix_bfrop_print_scope(char **output, char *prefix,
if (0 > asprintf(output, "%sData type: PMIX_SCOPE\tValue: %s",
prefx, PMIx_Scope_string(*src))) {
return PMIX_ERR_NOMEM;
}
if (prefx != prefix) {
free(prefx);
}
}
if (prefx != prefix) {
free(prefx);
}
return PMIX_SUCCESS;
return PMIX_SUCCESS;
}
pmix_status_t pmix_bfrop_print_range(char **output, char *prefix,
@ -1105,13 +1105,14 @@ pmix_status_t pmix_bfrop_print_range(char **output, char *prefix,
if (0 > asprintf(output, "%sData type: PMIX_DATA_RANGE\tValue: %s",
prefx, PMIx_Data_range_string(*src))) {
return PMIX_ERR_NOMEM;
}
if (prefx != prefix) {
free(prefx);
}
if (prefx != prefix) {
free(prefx);
}
return PMIX_SUCCESS;
}
return PMIX_SUCCESS;
}
pmix_status_t pmix_bfrop_print_cmd(char **output, char *prefix,
pmix_cmd_t *src,
pmix_data_type_t type)
@ -1130,12 +1131,12 @@ pmix_status_t pmix_bfrop_print_cmd(char **output, char *prefix,
if (0 > asprintf(output, "%sData type: PMIX_CMD\tValue: %s",
prefx, pmix_command_string(*src))) {
return PMIX_ERR_NOMEM;
}
if (prefx != prefix) {
free(prefx);
}
}
if (prefx != prefix) {
free(prefx);
}
return PMIX_SUCCESS;
return PMIX_SUCCESS;
}
pmix_status_t pmix_bfrop_print_infodirs(char **output, char *prefix,
@ -1156,12 +1157,12 @@ pmix_status_t pmix_bfrop_print_infodirs(char **output, char *prefix,
if (0 > asprintf(output, "%sData type: PMIX_INFO_DIRECTIVES\tValue: %s",
prefx, PMIx_Info_directives_string(*src))) {
return PMIX_ERR_NOMEM;
}
if (prefx != prefix) {
free(prefx);
}
}
if (prefx != prefix) {
free(prefx);
}
return PMIX_SUCCESS;
return PMIX_SUCCESS;
}
pmix_status_t pmix_bfrop_print_bo(char **output, char *prefix,
@ -1431,6 +1432,33 @@ pmix_status_t pmix_bfrop_print_rank(char **output, char *prefix,
return PMIX_SUCCESS;
}
pmix_status_t pmix_bfrop_print_alloc_directive(char **output, char *prefix,
pmix_alloc_directive_t *src,
pmix_data_type_t type)
{
char *prefx;
/* deal with NULL prefix */
if (NULL == prefix) {
if (0 > asprintf(&prefx, " ")) {
return PMIX_ERR_NOMEM;
}
} else {
prefx = prefix;
}
if (0 > asprintf(output, "%sData type: PMIX_ALLOC_DIRECTIVE\tValue: %s",
prefx, PMIx_Alloc_directive_string(*src))) {
return PMIX_ERR_NOMEM;
}
if (prefx != prefix) {
free(prefx);
}
return PMIX_SUCCESS;
}
/**** DEPRECATED ****/
pmix_status_t pmix_bfrop_print_array(char **output, char *prefix,
pmix_info_array_t *src, pmix_data_type_t type)

View File

@ -10,7 +10,7 @@
* 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) 2014-2016 Intel, Inc. All rights reserved.
* Copyright (c) 2014-2017 Intel, Inc. All rights reserved.
* Copyright (c) 2015 Research Organization for Information Science
* and Technology (RIST). All rights reserved.
* Copyright (c) 2016 Mellanox Technologies, Inc.
@ -1359,6 +1359,13 @@ pmix_status_t pmix_bfrop_unpack_query(pmix_buffer_t *buffer, void *dest,
return PMIX_SUCCESS;
}
pmix_status_t pmix_bfrop_unpack_alloc_directive(pmix_buffer_t *buffer, void *dest,
int32_t *num_vals, pmix_data_type_t type)
{
return pmix_bfrop_unpack_byte(buffer, dest, num_vals, PMIX_UINT8);
}
/**** DEPRECATED ****/
pmix_status_t pmix_bfrop_unpack_array(pmix_buffer_t *buffer, void *dest,
int32_t *num_vals, pmix_data_type_t type)

View File

@ -1,7 +1,8 @@
/* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil -*- */
/*
* Copyright (c) 2012-2016 Cisco Systems, Inc. All rights reserved.
* Copyright (c) 2012 Los Alamos National Security, LLC. All rights reserved
* Copyright (c) 2015-2016 Intel, Inc. All rights reserved
* Copyright (c) 2015-2017 Intel, Inc. All rights reserved.
* $COPYRIGHT$
*
* Additional copyrights may follow
@ -83,10 +84,10 @@ int pmix_hotel_init(pmix_hotel_t *h, int num_rooms,
/* Create this room's event (but don't add it) */
if (NULL != h->evbase) {
event_assign(&(h->rooms[i].eviction_timer_event),
h->evbase,
-1, 0, local_eviction_callback,
&(h->eviction_args[i]));
pmix_event_assign(&(h->rooms[i].eviction_timer_event),
h->evbase,
-1, 0, local_eviction_callback,
&(h->eviction_args[i]));
}
}
@ -114,7 +115,7 @@ static void destructor(pmix_hotel_t *h)
if (NULL != h->evbase) {
for (i = 0; i < h->num_rooms; ++i) {
if (NULL != h->rooms[i].occupant) {
event_del(&(h->rooms[i].eviction_timer_event));
pmix_event_del(&(h->rooms[i].eviction_timer_event));
}
}
}

View File

@ -1,7 +1,8 @@
/* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil -*- */
/*
* Copyright (c) 2012-2016 Cisco Systems, Inc. All rights reserved.
* Copyright (c) 2012 Los Alamos National Security, LLC. All rights reserved
* Copyright (c) 2015-2016 Intel, Inc. All rights reserved.
* Copyright (c) 2015-2017 Intel, Inc. All rights reserved.
* $COPYRIGHT$
*
* Additional copyrights may follow
@ -201,8 +202,8 @@ static inline int pmix_hotel_checkin(pmix_hotel_t *hotel,
/* Assign the event and make it pending */
if (NULL != hotel->evbase) {
event_add(&(room->eviction_timer_event),
&(hotel->eviction_timeout));
pmix_event_add(&(room->eviction_timer_event),
&(hotel->eviction_timeout));
}
return PMIX_SUCCESS;
@ -226,8 +227,8 @@ static inline void pmix_hotel_checkin_with_res(pmix_hotel_t *hotel,
/* Assign the event and make it pending */
if (NULL != hotel->evbase) {
event_add(&(room->eviction_timer_event),
&(hotel->eviction_timeout));
pmix_event_add(&(room->eviction_timer_event),
&(hotel->eviction_timeout));
}
}
@ -257,7 +258,7 @@ static inline void pmix_hotel_checkout(pmix_hotel_t *hotel, int room_num)
pmix_hotel.c:local_eviction_callback(). */
room->occupant = NULL;
if (NULL != hotel->evbase) {
event_del(&(room->eviction_timer_event));
pmix_event_del(&(room->eviction_timer_event));
}
hotel->last_unoccupied_room++;
assert(hotel->last_unoccupied_room < hotel->num_rooms);

View File

@ -745,7 +745,7 @@ request:
respond:
/* if a callback was provided, execute it */
if (NULL != cb && NULL != cb->value_cbfunc) {
if (NULL != cb->value_cbfunc) {
if (NULL != val) {
/* if this is a compressed string, then uncompress it */
if (PMIX_COMPRESSED_STRING == val->type) {

View File

@ -1,6 +1,6 @@
/* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil -*- */
/*
* Copyright (c) 2014-2016 Intel, Inc. All rights reserved.
* Copyright (c) 2014-2017 Intel, Inc. All rights reserved.
* Copyright (c) 2016 Mellanox Technologies, Inc.
* All rights reserved.
* Copyright (c) 2016 IBM Corporation. All rights reserved.
@ -115,18 +115,24 @@ PMIX_EXPORT pmix_status_t PMIx_Query_info_nb(pmix_query_t queries[], size_t nque
/* if we are the server, then we just issue the query and
* return the response */
if (PMIX_PROC_SERVER == pmix_globals.proc_type) {
if (NULL == pmix_host_server.query) {
/* nothing we can do */
return PMIX_ERR_NOT_SUPPORTED;
}
pmix_output_verbose(2, pmix_globals.debug_output,
"pmix:query handed to RM");
pmix_host_server.query(&pmix_globals.myid,
queries, nqueries,
cbfunc, cbdata);
rc = PMIX_SUCCESS;
if (NULL == pmix_host_server.query) {
/* nothing we can do */
return PMIX_ERR_NOT_SUPPORTED;
}
pmix_output_verbose(2, pmix_globals.debug_output,
"pmix:query handed to RM");
pmix_host_server.query(&pmix_globals.myid,
queries, nqueries,
cbfunc, cbdata);
rc = PMIX_SUCCESS;
} else {
/* if we are a client, then relay this request to the server */
/* if we aren't connected, don't attempt to send */
if (!pmix_globals.connected) {
return PMIX_ERR_UNREACH;
}
cd = PMIX_NEW(pmix_query_caddy_t);
cd->cbfunc = cbfunc;
cd->cbdata = cbdata;
@ -157,3 +163,87 @@ PMIX_EXPORT pmix_status_t PMIx_Query_info_nb(pmix_query_t queries[], size_t nque
}
return rc;
}
PMIX_EXPORT pmix_status_t PMIx_Allocation_request_nb(pmix_alloc_directive_t directive,
pmix_info_t *info, size_t ninfo,
pmix_info_cbfunc_t cbfunc, void *cbdata)
{
pmix_buffer_t *msg;
pmix_cmd_t cmd = PMIX_ALLOC_CMD;
pmix_status_t rc;
pmix_query_caddy_t *cb;
pmix_output_verbose(2, pmix_globals.debug_output,
"pmix: allocate called");
if (pmix_globals.init_cntr <= 0) {
return PMIX_ERR_INIT;
}
/* if we are the server, then we just issue the request and
* return the response */
if (PMIX_PROC_SERVER == pmix_globals.proc_type) {
if (NULL == pmix_host_server.allocate) {
/* nothing we can do */
return PMIX_ERR_NOT_SUPPORTED;
}
pmix_output_verbose(2, pmix_globals.debug_output,
"pmix:allocate handed to RM");
rc = pmix_host_server.allocate(&pmix_globals.myid,
directive,
info, ninfo,
cbfunc, cbdata);
return rc;
}
/* if we are a client, then relay this request to the server */
/* if we aren't connected, don't attempt to send */
if (!pmix_globals.connected) {
return PMIX_ERR_UNREACH;
}
msg = PMIX_NEW(pmix_buffer_t);
/* pack the cmd */
if (PMIX_SUCCESS != (rc = pmix_bfrop.pack(msg, &cmd, 1, PMIX_CMD))) {
PMIX_ERROR_LOG(rc);
PMIX_RELEASE(msg);
return rc;
}