1
1

Merge pull request #3141 from rhc54/topic/sync

Sync to latest PMIx master and PMIx reference server
Этот коммит содержится в:
Ralph Castain 2017-03-11 15:53:18 -08:00 коммит произвёл GitHub
родитель df8df0d2f3 c6bc3ccb76
Коммит 74125ecc7a
58 изменённых файлов: 1315 добавлений и 298 удалений

91
config/orte_check_moab.m4 Обычный файл
Просмотреть файл

@ -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])
])

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

@ -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

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

@ -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])

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

@ -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
])

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

@ -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

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

@ -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
####################################################################

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

@ -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

235
opal/mca/pmix/pmix2x/pmix/examples/alloc.c Обычный файл
Просмотреть файл

@ -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);
}

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

@ -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)
}

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

@ -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 */

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

@ -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 ****/

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

@ -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;
}

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

@ -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,

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

@ -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,

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

@ -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,

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

@ -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)

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

@ -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)

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

@ -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));
}
}
}

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

@ -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);

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

@ -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) {

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

@ -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;
}
/* pack the directive */
if (PMIX_SUCCESS != (rc = pmix_bfrop.pack(msg, &directive, 1, PMIX_ALLOC_DIRECTIVE))) {
PMIX_ERROR_LOG(rc);
PMIX_RELEASE(msg);
return rc;
}
/* pack the info */
if (PMIX_SUCCESS != (rc = pmix_bfrop.pack(msg, &ninfo, 1, PMIX_SIZE))) {
PMIX_ERROR_LOG(rc);
PMIX_RELEASE(msg);
return rc;
}
if (0 < ninfo) {
if (PMIX_SUCCESS != (rc = pmix_bfrop.pack(msg, info, ninfo, PMIX_INFO))) {
PMIX_ERROR_LOG(rc);
PMIX_RELEASE(msg);
return rc;
}
}
/* create a callback object as we need to pass it to the
* recv routine so we know which callback to use when
* the return message is recvd */
cb = PMIX_NEW(pmix_query_caddy_t);
cb->cbfunc = cbfunc;
cb->cbdata = cbdata;
/* push the message into our event base to send to the server */
if (PMIX_SUCCESS != (rc = pmix_ptl.send_recv(&pmix_client_globals.myserver, msg, query_cbfunc, (void*)cb))){
PMIX_RELEASE(msg);
PMIX_RELEASE(cb);
}
return rc;
}

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

@ -11,7 +11,7 @@
* All rights reserved.
* Copyright (c) 2007-2012 Los Alamos National Security, LLC.
* All rights reserved.
* Copyright (c) 2014-2016 Intel, Inc. All rights reserved.
* Copyright (c) 2014-2017 Intel, Inc. All rights reserved.
* $COPYRIGHT$
*
* Additional copyrights may follow
@ -37,7 +37,7 @@
#include "src/buffer_ops/internal.h"
#include "src/include/pmix_globals.h"
const char* PMIx_Proc_state_string(pmix_proc_state_t state)
PMIX_EXPORT const char* PMIx_Proc_state_string(pmix_proc_state_t state)
{
switch(state) {
case PMIX_PROC_STATE_UNDEF:
@ -87,7 +87,7 @@ const char* PMIx_Proc_state_string(pmix_proc_state_t state)
}
}
const char* PMIx_Scope_string(pmix_scope_t scope)
PMIX_EXPORT const char* PMIx_Scope_string(pmix_scope_t scope)
{
switch(scope) {
case PMIX_SCOPE_UNDEF:
@ -103,7 +103,7 @@ const char* PMIx_Scope_string(pmix_scope_t scope)
}
}
const char* PMIx_Persistence_string(pmix_persistence_t persist)
PMIX_EXPORT const char* PMIx_Persistence_string(pmix_persistence_t persist)
{
switch(persist) {
case PMIX_PERSIST_INDEF:
@ -121,7 +121,7 @@ const char* PMIx_Persistence_string(pmix_persistence_t persist)
}
}
const char* PMIx_Data_range_string(pmix_data_range_t range)
PMIX_EXPORT const char* PMIx_Data_range_string(pmix_data_range_t range)
{
switch(range) {
case PMIX_RANGE_UNDEF:
@ -143,7 +143,7 @@ const char* PMIx_Data_range_string(pmix_data_range_t range)
}
}
const char* PMIx_Info_directives_string(pmix_info_directives_t directives)
PMIX_EXPORT const char* PMIx_Info_directives_string(pmix_info_directives_t directives)
{
switch(directives) {
case PMIX_INFO_REQD:
@ -153,7 +153,24 @@ const char* PMIx_Info_directives_string(pmix_info_directives_t directives)
}
}
const char* pmix_command_string(pmix_cmd_t cmd)
PMIX_EXPORT const char* PMIx_Alloc_directive_string(pmix_alloc_directive_t directive)
{
switch(directive) {
case PMIX_ALLOC_NEW:
return "NEW";
case PMIX_ALLOC_EXTEND:
return "EXTEND";
case PMIX_ALLOC_RELEASE:
return "RELEASE";
case PMIX_ALLOC_REAQUIRE:
return "REACQUIRE";
default:
return "UNSPECIFIED";
}
}
PMIX_EXPORT const char* pmix_command_string(pmix_cmd_t cmd)
{
switch(cmd) {
case PMIX_REQ_CMD:
@ -193,7 +210,7 @@ const char* pmix_command_string(pmix_cmd_t cmd)
}
}
const char* PMIx_Data_type_string(pmix_data_type_t type)
PMIX_EXPORT const char* PMIx_Data_type_string(pmix_data_type_t type)
{
pmix_bfrop_type_info_t *info;

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

@ -1,7 +1,8 @@
/* -*- 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) 2014-2017 Research Organization for Information Science
* Copyright (c) 2014-2017 Intel, Inc. All rights reserved.
* and Technology (RIST). All rights reserved.
* Copyright (c) 2014-2015 Artem Y. Polyakov <artpol84@gmail.com>.
* All rights reserved.
@ -88,10 +89,10 @@ static void pdes(pmix_peer_t *p)
CLOSE_THE_SOCKET(p->sd);
}
if (p->send_ev_active) {
event_del(&p->send_event);
pmix_event_del(&p->send_event);
}
if (p->recv_ev_active) {
event_del(&p->recv_event);
pmix_event_del(&p->recv_event);
}
if (NULL != p->info) {
@ -256,6 +257,8 @@ static void qcon(pmix_query_caddy_t *p)
{
p->queries = NULL;
p->nqueries = 0;
p->info = NULL;
p->ninfo = 0;
p->cbfunc = NULL;
p->cbdata = NULL;
p->relcbfunc = NULL;

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

@ -1,3 +1,4 @@
/* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil -*- */
/*
* Copyright (c) 2004-2005 The Trustees of Indiana University and Indiana
* University Research and Technology
@ -70,7 +71,8 @@ typedef enum {
PMIX_REGEVENTS_CMD,
PMIX_DEREGEVENTS_CMD,
PMIX_QUERY_CMD,
PMIX_LOG_CMD
PMIX_LOG_CMD,
PMIX_ALLOC_CMD
} pmix_cmd_t;
/* provide a "pretty-print" function for cmds */
@ -212,6 +214,8 @@ typedef struct {
pmix_status_t status;
pmix_query_t *queries;
size_t nqueries;
pmix_info_t *info;
size_t ninfo;
pmix_info_cbfunc_t cbfunc;
pmix_release_cbfunc_t relcbfunc;
void *cbdata;
@ -328,12 +332,12 @@ typedef struct {
} pmix_info_caddy_t;
PMIX_CLASS_DECLARATION(pmix_info_caddy_t);
#define PMIX_THREADSHIFT(r, c) \
do { \
(r)->active = true; \
event_assign(&((r)->ev), pmix_globals.evbase, \
-1, EV_WRITE, (c), (r)); \
event_active(&((r)->ev), EV_WRITE, 1); \
#define PMIX_THREADSHIFT(r, c) \
do { \
(r)->active = true; \
pmix_event_assign(&((r)->ev), pmix_globals.evbase, \
-1, EV_WRITE, (c), (r)); \
pmix_event_active(&((r)->ev), EV_WRITE, 1); \
} while (0)

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

@ -9,7 +9,7 @@
* University of Stuttgart. All rights reserved.
* Copyright (c) 2004-2005 The Regents of the University of California.
* All rights reserved.
* Copyright (c) 2014-2016 Intel, Inc. All rights reserved.
* Copyright (c) 2014-2017 Intel, Inc. All rights reserved.
* Copyright (c) 2015 Mellanox Technologies, Inc.
* All rights reserved.
* $COPYRIGHT$
@ -242,7 +242,7 @@ typedef struct event pmix_event_t;
/* Basic event APIs */
#define pmix_event_enable_debug_mode() event_enable_debug_mode()
#define pmix_event_set(b, x, fd, fg, cb, arg) event_assign((x), (b), (fd), (fg), (event_callback_fn) (cb), (arg))
#define pmix_event_assign(x, b, fd, fg, cb, arg) event_assign((x), (b), (fd), (fg), (event_callback_fn) (cb), (arg))
#define pmix_event_add(ev, tv) event_add((ev), (tv))
@ -254,4 +254,6 @@ typedef struct event pmix_event_t;
#define pmix_event_loop(b, fg) event_base_loop((b), (fg))
#define pmix_event_active(x, y, z) event_active((x), (y), (z))
#endif /* PMIX_TYPES_H */

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

@ -1,7 +1,7 @@
dnl -*- shell-script -*-
dnl
dnl Copyright (c) 2010-2015 Cisco Systems, Inc. All rights reserved.
dnl Copyright (c) 2016 Intel, Inc. All right reserved
dnl Copyright (c) 2016-2017 Intel, Inc. All rights reserved.
dnl Copyright (c) 2016 Research Organization for Information Science
dnl and Technology (RIST). All rights reserved.
dnl $COPYRIGHT$
@ -27,7 +27,7 @@ AC_DEFUN([MCA_pmix_pdl_CONFIG],[
# (we still need to configure them all so that things like "make
# dist" work", but we just want the MCA system to (artificially)
# conclude that it can't build any of the components.
AS_IF([test $PMIX_ENABLE_DLOPEN_SUPPORT -eq 0],
AS_IF([test "$enable_dlopen" = "no"],
[want_pdl=0], [want_pdl=1])
MCA_CONFIGURE_FRAMEWORK([pdl], [$want_pdl])
@ -35,7 +35,7 @@ AC_DEFUN([MCA_pmix_pdl_CONFIG],[
# If we found no suitable static pdl component and dlopen support
# was not specifically disabled, this is an error.
AS_IF([test "$MCA_pmix_pdl_STATIC_COMPONENTS" = "" && \
test $PMIX_ENABLE_DLOPEN_SUPPORT -ne 0],
test "$enable_dlopen" != "no"],
[AC_MSG_WARN([Did not find a suitable static pmix pdl component])
AC_MSG_WARN([You might need to install libltld (and its headers) or])
AC_MSG_WARN([specify --disable-dlopen to configure.])

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

@ -44,13 +44,13 @@ AC_DEFUN([MCA_pmix_pdl_pdlopen_CONFIG],[
dnl This is effectively a back-door for PMIX developers to
dnl force the use of the libltdl pdl component.
AC_ARG_ENABLE([dlopen],
[AS_HELP_STRING([--disable-dlopen],
AC_ARG_ENABLE([dl-dlopen],
[AS_HELP_STRING([--disable-dl-dlopen],
[Disable the "dlopen" PDL component (and probably force the use of the "libltdl" PDL component).])
])
pmix_pdl_pdlopen_happy=no
AS_IF([test "$enable_dlopen" != "no"],
AS_IF([test "$enable_dl_dlopen" != "no"],
[PMIX_CHECK_PACKAGE([pmix_pdl_pdlopen],
[dlfcn.h],
[dl],

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

@ -33,6 +33,9 @@
#ifdef HAVE_FCNTL_H
#include <fcntl.h>
#endif
#ifdef HAVE_SYS_STAT_H
#include <sys/stat.h>
#endif
#include "src/mca/mca.h"
#include "src/mca/base/base.h"

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

@ -252,8 +252,8 @@ static void* listen_thread(void *obj)
pending_connection = PMIX_NEW(pmix_pending_connection_t);
pending_connection->protocol = lt->protocol;
pending_connection->ptl = lt->ptl;
event_assign(&pending_connection->ev, pmix_globals.evbase, -1,
EV_WRITE, lt->cbfunc, pending_connection);
pmix_event_assign(&pending_connection->ev, pmix_globals.evbase, -1,
EV_WRITE, lt->cbfunc, pending_connection);
pending_connection->sd = accept(lt->socket,
(struct sockaddr*)&(pending_connection->addr),
&addrlen);
@ -285,7 +285,7 @@ static void* listen_thread(void *obj)
"listen_thread: new connection: (%d, %d)",
pending_connection->sd, pmix_socket_errno);
/* activate the event */
event_active(&pending_connection->ev, EV_WRITE, 1);
pmix_event_active(&pending_connection->ev, EV_WRITE, 1);
accepted_connections++;
}
} while (accepted_connections > 0);

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

@ -65,11 +65,11 @@ static void lost_connection(pmix_peer_t *peer, pmix_status_t err)
/* stop all events */
if (peer->recv_ev_active) {
event_del(&peer->recv_event);
pmix_event_del(&peer->recv_event);
peer->recv_ev_active = false;
}
if (peer->send_ev_active) {
event_del(&peer->send_event);
pmix_event_del(&peer->send_event);
peer->send_ev_active = false;
}
if (NULL != peer->recv_msg) {
@ -304,7 +304,7 @@ void pmix_ptl_base_send_handler(int sd, short flags, void *cbdata)
return;
} else {
// report the error
event_del(&peer->send_event);
pmix_event_del(&peer->send_event);
peer->send_ev_active = false;
PMIX_RELEASE(msg);
peer->send_msg = NULL;
@ -324,7 +324,7 @@ void pmix_ptl_base_send_handler(int sd, short flags, void *cbdata)
/* if nothing else to do unregister for send event notifications */
if (NULL == peer->send_msg && peer->send_ev_active) {
event_del(&peer->send_event);
pmix_event_del(&peer->send_event);
peer->send_ev_active = false;
}
}
@ -452,11 +452,11 @@ void pmix_ptl_base_recv_handler(int sd, short flags, void *cbdata)
err_close:
/* stop all events */
if (peer->recv_ev_active) {
event_del(&peer->recv_event);
pmix_event_del(&peer->recv_event);
peer->recv_ev_active = false;
}
if (peer->send_ev_active) {
event_del(&peer->send_event);
pmix_event_del(&peer->send_event);
peer->send_ev_active = false;
}
if (NULL != peer->recv_msg) {
@ -502,7 +502,7 @@ void pmix_ptl_base_send(int sd, short args, void *cbdata)
}
/* ensure the send event is active */
if (!(queue->peer)->send_ev_active) {
event_add(&(queue->peer)->send_event, 0);
pmix_event_add(&(queue->peer)->send_event, 0);
(queue->peer)->send_ev_active = true;
}
PMIX_RELEASE(queue);
@ -563,7 +563,7 @@ void pmix_ptl_base_send_recv(int fd, short args, void *cbdata)
}
/* ensure the send event is active */
if (!ms->peer->send_ev_active) {
event_add(&ms->peer->send_event, 0);
pmix_event_add(&ms->peer->send_event, 0);
ms->peer->send_ev_active = true;
}
/* cleanup */

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

@ -193,9 +193,9 @@ PMIX_CLASS_DECLARATION(pmix_listener_t);
pmix_output_verbose(5, pmix_globals.debug_output, \
"[%s:%d] post msg", \
__FILE__, __LINE__); \
event_assign(&((ms)->ev), pmix_globals.evbase, -1, \
EV_WRITE, pmix_ptl_base_process_msg, (ms)); \
event_active(&((ms)->ev), EV_WRITE, 1); \
pmix_event_assign(&((ms)->ev), pmix_globals.evbase, -1, \
EV_WRITE, pmix_ptl_base_process_msg, (ms)); \
pmix_event_active(&((ms)->ev), EV_WRITE, 1); \
} while (0)
#define PMIX_SND_CADDY(c, h, s) \
@ -237,7 +237,7 @@ PMIX_CLASS_DECLARATION(pmix_listener_t);
} \
/* ensure the send event is active */ \
if (!(p)->send_ev_active && 0 <= (p)->sd) { \
event_add(&(p)->send_event, 0); \
pmix_event_add(&(p)->send_event, 0); \
(p)->send_ev_active = true; \
} \
} while (0)

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

@ -310,20 +310,20 @@ static pmix_status_t connect_to_peer(struct pmix_peer_t *peer,
pmix_ptl_base_set_nonblocking(sd);
/* setup recv event */
event_assign(&pmix_client_globals.myserver.recv_event,
pmix_globals.evbase,
pmix_client_globals.myserver.sd,
EV_READ | EV_PERSIST,
pmix_ptl_base_recv_handler, &pmix_client_globals.myserver);
event_add(&pmix_client_globals.myserver.recv_event, 0);
pmix_event_assign(&pmix_client_globals.myserver.recv_event,
pmix_globals.evbase,
pmix_client_globals.myserver.sd,
EV_READ | EV_PERSIST,
pmix_ptl_base_recv_handler, &pmix_client_globals.myserver);
pmix_event_add(&pmix_client_globals.myserver.recv_event, 0);
pmix_client_globals.myserver.recv_ev_active = true;
/* setup send event */
event_assign(&pmix_client_globals.myserver.send_event,
pmix_globals.evbase,
pmix_client_globals.myserver.sd,
EV_WRITE|EV_PERSIST,
pmix_ptl_base_send_handler, &pmix_client_globals.myserver);
pmix_event_assign(&pmix_client_globals.myserver.send_event,
pmix_globals.evbase,
pmix_client_globals.myserver.sd,
EV_WRITE|EV_PERSIST,
pmix_ptl_base_send_handler, &pmix_client_globals.myserver);
pmix_client_globals.myserver.send_ev_active = false;
return PMIX_SUCCESS;
@ -345,9 +345,9 @@ static pmix_status_t send_recv(struct pmix_peer_t *peer,
ms->bfr = bfr;
ms->cbfunc = cbfunc;
ms->cbdata = cbdata;
event_assign(&ms->ev, pmix_globals.evbase, -1,
EV_WRITE, pmix_ptl_base_send_recv, ms);
event_active(&ms->ev, EV_WRITE, 1);
pmix_event_assign(&ms->ev, pmix_globals.evbase, -1,
EV_WRITE, pmix_ptl_base_send_recv, ms);
pmix_event_active(&ms->ev, EV_WRITE, 1);
return PMIX_SUCCESS;
}
@ -366,9 +366,9 @@ static pmix_status_t send_oneway(struct pmix_peer_t *peer,
q->peer = peer;
q->buf = bfr;
q->tag = tag;
event_assign(&q->ev, pmix_globals.evbase, -1,
EV_WRITE, pmix_ptl_base_send, q);
event_active(&q->ev, EV_WRITE, 1);
pmix_event_assign(&q->ev, pmix_globals.evbase, -1,
EV_WRITE, pmix_ptl_base_send, q);
pmix_event_active(&q->ev, EV_WRITE, 1);
return PMIX_SUCCESS;
}

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

@ -1010,12 +1010,12 @@ static void connection_handler(int sd, short args, void *cbdata)
pmix_ptl_base_set_nonblocking(pnd->sd);
/* start the events for this client */
event_assign(&peer->recv_event, pmix_globals.evbase, pnd->sd,
EV_READ|EV_PERSIST, pmix_ptl_base_recv_handler, peer);
event_add(&peer->recv_event, NULL);
pmix_event_assign(&peer->recv_event, pmix_globals.evbase, pnd->sd,
EV_READ|EV_PERSIST, pmix_ptl_base_recv_handler, peer);
pmix_event_add(&peer->recv_event, NULL);
peer->recv_ev_active = true;
event_assign(&peer->send_event, pmix_globals.evbase, pnd->sd,
EV_WRITE|EV_PERSIST, pmix_ptl_base_send_handler, peer);
pmix_event_assign(&peer->send_event, pmix_globals.evbase, pnd->sd,
EV_WRITE|EV_PERSIST, pmix_ptl_base_send_handler, peer);
pmix_output_verbose(2, pmix_ptl_base_framework.framework_output,
"pmix:server client %s:%u has connected on socket %d",
peer->info->nptr->nspace, peer->info->rank, peer->sd);
@ -1151,12 +1151,12 @@ static void process_cbfunc(int sd, short args, void *cbdata)
}
/* start the events for this tool */
event_assign(&peer->recv_event, pmix_globals.evbase, pnd->sd,
EV_READ|EV_PERSIST, pmix_ptl_base_recv_handler, peer);
event_add(&peer->recv_event, NULL);
pmix_event_assign(&peer->recv_event, pmix_globals.evbase, pnd->sd,
EV_READ|EV_PERSIST, pmix_ptl_base_recv_handler, peer);
pmix_event_add(&peer->recv_event, NULL);
peer->recv_ev_active = true;
event_assign(&peer->send_event, pmix_globals.evbase, pnd->sd,
EV_WRITE|EV_PERSIST, pmix_ptl_base_send_handler, peer);
pmix_event_assign(&peer->send_event, pmix_globals.evbase, pnd->sd,
EV_WRITE|EV_PERSIST, pmix_ptl_base_send_handler, peer);
pmix_output_verbose(2, pmix_ptl_base_framework.framework_output,
"pmix:server tool %s:%d has connected on socket %d",
peer->info->nptr->nspace, peer->info->rank, peer->sd);

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

@ -164,20 +164,20 @@ static pmix_status_t connect_to_peer(struct pmix_peer_t *peer,
pmix_ptl_base_set_nonblocking(sd);
/* setup recv event */
event_assign(&pmix_client_globals.myserver.recv_event,
pmix_globals.evbase,
pmix_client_globals.myserver.sd,
EV_READ | EV_PERSIST,
pmix_ptl_base_recv_handler, &pmix_client_globals.myserver);
event_add(&pmix_client_globals.myserver.recv_event, 0);
pmix_event_assign(&pmix_client_globals.myserver.recv_event,
pmix_globals.evbase,
pmix_client_globals.myserver.sd,
EV_READ | EV_PERSIST,
pmix_ptl_base_recv_handler, &pmix_client_globals.myserver);
pmix_event_add(&pmix_client_globals.myserver.recv_event, 0);
pmix_client_globals.myserver.recv_ev_active = true;
/* setup send event */
event_assign(&pmix_client_globals.myserver.send_event,
pmix_globals.evbase,
pmix_client_globals.myserver.sd,
EV_WRITE|EV_PERSIST,
pmix_ptl_base_send_handler, &pmix_client_globals.myserver);
pmix_event_assign(&pmix_client_globals.myserver.send_event,
pmix_globals.evbase,
pmix_client_globals.myserver.sd,
EV_WRITE|EV_PERSIST,
pmix_ptl_base_send_handler, &pmix_client_globals.myserver);
pmix_client_globals.myserver.send_ev_active = false;
return PMIX_SUCCESS;
@ -199,9 +199,9 @@ static pmix_status_t send_recv(struct pmix_peer_t *peer,
ms->bfr = bfr;
ms->cbfunc = cbfunc;
ms->cbdata = cbdata;
event_assign(&ms->ev, pmix_globals.evbase, -1,
EV_WRITE, pmix_ptl_base_send_recv, ms);
event_active(&ms->ev, EV_WRITE, 1);
pmix_event_assign(&ms->ev, pmix_globals.evbase, -1,
EV_WRITE, pmix_ptl_base_send_recv, ms);
pmix_event_active(&ms->ev, EV_WRITE, 1);
return PMIX_SUCCESS;
}
@ -220,9 +220,9 @@ static pmix_status_t send_oneway(struct pmix_peer_t *peer,
q->peer = peer;
q->buf = bfr;
q->tag = tag;
event_assign(&q->ev, pmix_globals.evbase, -1,
EV_WRITE, pmix_ptl_base_send, q);
event_active(&q->ev, EV_WRITE, 1);
pmix_event_assign(&q->ev, pmix_globals.evbase, -1,
EV_WRITE, pmix_ptl_base_send, q);
pmix_event_active(&q->ev, EV_WRITE, 1);
return PMIX_SUCCESS;
}

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

@ -346,9 +346,9 @@ static void listener_cb(int incoming_sd, void *cbdata)
incoming_sd);
pending_connection = PMIX_NEW(pmix_pending_connection_t);
pending_connection->sd = incoming_sd;
event_assign(&pending_connection->ev, pmix_globals.evbase, -1,
EV_WRITE, connection_handler, pending_connection);
event_active(&pending_connection->ev, EV_WRITE, 1);
pmix_event_assign(&pending_connection->ev, pmix_globals.evbase, -1,
EV_WRITE, connection_handler, pending_connection);
pmix_event_active(&pending_connection->ev, EV_WRITE, 1);
}
/* Parse init-ack message:
@ -603,12 +603,12 @@ static void connection_handler(int sd, short args, void *cbdata)
}
/* start the events for this client */
event_assign(&psave->recv_event, pmix_globals.evbase, pnd->sd,
EV_READ|EV_PERSIST, pmix_ptl_base_recv_handler, psave);
event_add(&psave->recv_event, NULL);
pmix_event_assign(&psave->recv_event, pmix_globals.evbase, pnd->sd,
EV_READ|EV_PERSIST, pmix_ptl_base_recv_handler, psave);
pmix_event_add(&psave->recv_event, NULL);
psave->recv_ev_active = true;
event_assign(&psave->send_event, pmix_globals.evbase, pnd->sd,
EV_WRITE|EV_PERSIST, pmix_ptl_base_send_handler, psave);
pmix_event_assign(&psave->send_event, pmix_globals.evbase, pnd->sd,
EV_WRITE|EV_PERSIST, pmix_ptl_base_send_handler, psave);
pmix_output_verbose(2, pmix_ptl_base_framework.framework_output,
"pmix:server client %s:%u has connected on socket %d",
psave->info->nptr->nspace, psave->info->rank, psave->sd);

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

@ -1,5 +1,5 @@
/*
* Copyright (c) 2014-2016 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) 2017 Research Organization for Information Science
* and Technology (RIST). All rights reserved.
@ -228,7 +228,7 @@ pmix_event_base_t *pmix_progress_thread_init(const char *name)
/* add an event to the new event base (if there are no events,
pmix_event_loop() will return immediately) */
pmix_event_set(trk->ev_base, &trk->block, -1, PMIX_EV_PERSIST,
pmix_event_assign(&trk->block, trk->ev_base, -1, PMIX_EV_PERSIST,
dummy_timeout_cb, trk);
pmix_event_add(&trk->block, &long_timeout);

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

@ -2119,7 +2119,12 @@ static void query_cbfunc(pmix_status_t status,
// send reply
PMIX_SERVER_QUEUE_REPLY(cd->peer, cd->hdr.tag, reply);
// cleanup
PMIX_QUERY_FREE(qcd->queries, qcd->nqueries);
if (NULL != qcd->queries) {
PMIX_QUERY_FREE(qcd->queries, qcd->nqueries);
}
if (NULL != qcd->info) {
PMIX_INFO_FREE(qcd->info, qcd->ninfo);
}
PMIX_RELEASE(qcd);
PMIX_RELEASE(cd);
}
@ -2244,7 +2249,7 @@ static pmix_status_t server_switchyard(pmix_peer_t *peer, uint32_t tag,
/* turn off the recv event - we shouldn't hear anything
* more from this proc */
if (peer->recv_ev_active) {
event_del(&peer->recv_event);
pmix_event_del(&peer->recv_event);
peer->recv_ev_active = false;
}
/* let the network libraries cleanup */
@ -2334,6 +2339,12 @@ static pmix_status_t server_switchyard(pmix_peer_t *peer, uint32_t tag,
return rc;
}
if (PMIX_ALLOC_CMD == cmd) {
PMIX_PEER_CADDY(cd, peer, tag);
rc = pmix_server_alloc(peer, buf, query_cbfunc, cd);
return rc;
}
return PMIX_ERR_NOT_SUPPORTED;
}

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

@ -705,8 +705,7 @@ static void dmdx_cbfunc(pmix_status_t status,
"[%s:%d] queue dmdx reply for %s:%u",
__FILE__, __LINE__,
caddy->lcd->proc.nspace, caddy->lcd->proc.rank);
event_assign(&caddy->ev, pmix_globals.evbase, -1, EV_WRITE,
_process_dmdx_reply, caddy);
event_priority_set(&caddy->ev, 0);
event_active(&caddy->ev, EV_WRITE, 1);
pmix_event_assign(&caddy->ev, pmix_globals.evbase, -1, EV_WRITE,
_process_dmdx_reply, caddy);
pmix_event_active(&caddy->ev, EV_WRITE, 1);
}

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

@ -1501,6 +1501,66 @@ pmix_status_t pmix_server_log(pmix_peer_t *peer,
return rc;
}
pmix_status_t pmix_server_alloc(pmix_peer_t *peer,
pmix_buffer_t *buf,
pmix_info_cbfunc_t cbfunc,
void *cbdata)
{
int32_t cnt;
pmix_status_t rc;
pmix_query_caddy_t *cd;
pmix_proc_t proc;
pmix_alloc_directive_t directive;
pmix_output_verbose(2, pmix_globals.debug_output,
"recvd query from client");
if (NULL == pmix_host_server.allocate) {
return PMIX_ERR_NOT_SUPPORTED;
}
cd = PMIX_NEW(pmix_query_caddy_t);
cd->cbdata = cbdata;
/* unpack the directive */
cnt = 1;
if (PMIX_SUCCESS != (rc = pmix_bfrop.unpack(buf, &directive, &cnt, PMIX_ALLOC_DIRECTIVE))) {
PMIX_ERROR_LOG(rc);
goto exit;
}
/* unpack the number of info objects */
cnt = 1;
if (PMIX_SUCCESS != (rc = pmix_bfrop.unpack(buf, &cd->ninfo, &cnt, PMIX_SIZE))) {
PMIX_ERROR_LOG(rc);
goto exit;
}
/* unpack the info */
if (0 < cd->ninfo) {
PMIX_INFO_CREATE(cd->info, cd->ninfo);
cnt = cd->ninfo;
if (PMIX_SUCCESS != (rc = pmix_bfrop.unpack(buf, cd->info, &cnt, PMIX_INFO))) {
PMIX_ERROR_LOG(rc);
goto exit;
}
}
/* setup the requesting peer name */
(void)strncpy(proc.nspace, peer->info->nptr->nspace, PMIX_MAX_NSLEN);
proc.rank = peer->info->rank;
/* ask the host to execute the request */
if (PMIX_SUCCESS != (rc = pmix_host_server.allocate(&proc, directive,
cd->info, cd->ninfo,
cbfunc, cd))) {
goto exit;
}
return PMIX_SUCCESS;
exit:
PMIX_RELEASE(cd);
return rc;
}
/***** INSTANCE SERVER LIBRARY CLASSES *****/
static void tcon(pmix_server_trkr_t *t)

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

@ -1,6 +1,6 @@
/* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil -*- */
/*
* Copyright (c) 2015-2016 Intel, Inc. All rights reserved
* Copyright (c) 2015-2017 Intel, Inc. All rights reserved.
* Copyright (c) 2015 Artem Y. Polyakov <artpol84@gmail.com>.
* All rights reserved.
* Copyright (c) 2015 Mellanox Technologies, Inc.
@ -132,9 +132,9 @@ typedef struct {
#define PMIX_EXECUTE_COLLECTIVE(c, t, f) \
do { \
PMIX_SETUP_COLLECTIVE(c, t); \
event_assign(&((c)->ev), pmix_globals.evbase, -1, \
EV_WRITE, (f), (c)); \
event_active(&((c)->ev), EV_WRITE, 1); \
pmix_event_assign(&((c)->ev), pmix_globals.evbase, -1, \
EV_WRITE, (f), (c)); \
pmix_event_active(&((c)->ev), EV_WRITE, 1); \
} while (0)
@ -213,6 +213,11 @@ pmix_status_t pmix_server_log(pmix_peer_t *peer,
pmix_op_cbfunc_t cbfunc,
void *cbdata);
pmix_status_t pmix_server_alloc(pmix_peer_t *peer,
pmix_buffer_t *buf,
pmix_info_cbfunc_t cbfunc,
void *cbdata);
pmix_status_t pmix_server_event_recvd_from_client(pmix_peer_t *peer,
pmix_buffer_t *buf,
pmix_op_cbfunc_t cbfunc,

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

@ -3,6 +3,7 @@
* All rights reserved.
* Copyright (c) 2017 Research Organization for Information Science
* and Technology (RIST). All rights reserved.
* Copyright (c) 2017 Intel, Inc. All rights reserved.
* $COPYRIGHT$
*
* Additional copyrights may follow
@ -62,24 +63,38 @@ int _mmap_segment_create(pmix_sm_seg_t *sm_seg, const char *file_name, size_t si
}
/* size backing file - note the use of real_size here */
#ifdef HAVE_POSIX_FALLOCATE
if (0 != posix_fallocate(sm_seg->seg_id, 0, size)) {
if (0 != (rc = posix_fallocate(sm_seg->seg_id, 0, size))) {
pmix_output_verbose(2, pmix_globals.debug_output,
"sys call posix_fallocate(2) fail\n");
if (ENOSPC == errno) {
if (ENOSPC == rc) {
rc = PMIX_ERR_OUT_OF_RESOURCE;
} else {
goto out;
} else if ((ENOTSUP != rc)
#ifdef EOPNOTSUPP
&& (EOPNOTSUPP != rc)
#endif
){
rc = PMIX_ERROR;
goto out;
}
goto out;
/* else:
* Not supported by OS and/or filesystem.
* Must fall-back to ftruncate().
*/
} else {
goto map_memory;
}
#else
#endif
if (0 != ftruncate(sm_seg->seg_id, size)) {
pmix_output_verbose(2, pmix_globals.debug_output,
"sys call ftruncate(2) fail\n");
rc = PMIX_ERROR;
goto out;
} else {
rc = PMIX_SUCCESS;
}
#endif
map_memory:
if (MAP_FAILED == (seg_addr = mmap(NULL, size,
PROT_READ | PROT_WRITE, MAP_SHARED,
sm_seg->seg_id, 0))) {

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

@ -11,7 +11,7 @@
* All rights reserved.
* Copyright (c) 2007-2012 Los Alamos National Security, LLC.
* All rights reserved.
* Copyright (c) 2014-2016 Intel, Inc. All rights reserved.
* Copyright (c) 2014-2017 Intel, Inc. All rights reserved.
* $COPYRIGHT$
*
* Additional copyrights may follow
@ -35,7 +35,7 @@
#include "src/include/pmix_globals.h"
#include "src/util/error.h"
const char* PMIx_Error_string(pmix_status_t errnum)
PMIX_EXPORT const char* PMIx_Error_string(pmix_status_t errnum)
{
switch(errnum) {
case PMIX_ERR_UNPACK_READ_PAST_END_OF_BUFFER:
@ -155,6 +155,8 @@ const char* PMIx_Error_string(pmix_status_t errnum)
return "PMIX_ERR_JOB_TERMINATED";
case PMIX_MAX_ERR_CONSTANT:
return "PMIX_ERR_WILDCARD";
case PMIX_NOTIFY_ALLOC_COMPLETE:
return "PMIX ALLOC OPERATION COMPLETE";
case PMIX_SUCCESS:
return "SUCCESS";
default:

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

@ -9,7 +9,7 @@
* University of Stuttgart. All rights reserved.
* Copyright (c) 2004-2005 The Regents of the University of California.
* 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
@ -29,33 +29,6 @@
BEGIN_C_DECLS
/* internal error codes - never exposed outside of the library */
#define PMIX_ERR_INVALID_CRED (PMIX_INTERNAL_ERR_BASE - 1)
#define PMIX_ERR_HANDSHAKE_FAILED (PMIX_INTERNAL_ERR_BASE - 2)
#define PMIX_ERR_READY_FOR_HANDSHAKE (PMIX_INTERNAL_ERR_BASE - 3)
#define PMIX_ERR_UNKNOWN_DATA_TYPE (PMIX_INTERNAL_ERR_BASE - 4)
#define PMIX_ERR_TYPE_MISMATCH (PMIX_INTERNAL_ERR_BASE - 5)
#define PMIX_ERR_UNPACK_INADEQUATE_SPACE (PMIX_INTERNAL_ERR_BASE - 6)
#define PMIX_ERR_UNPACK_FAILURE (PMIX_INTERNAL_ERR_BASE - 7)
#define PMIX_ERR_PACK_FAILURE (PMIX_INTERNAL_ERR_BASE - 8)
#define PMIX_ERR_PACK_MISMATCH (PMIX_INTERNAL_ERR_BASE - 9)
#define PMIX_ERR_PROC_ENTRY_NOT_FOUND (PMIX_INTERNAL_ERR_BASE - 10)
#define PMIX_ERR_UNPACK_READ_PAST_END_OF_BUFFER (PMIX_INTERNAL_ERR_BASE - 11)
#define PMIX_ERR_SERVER_NOT_AVAIL (PMIX_INTERNAL_ERR_BASE - 12)
#define PMIX_ERR_INVALID_KEYVALP (PMIX_INTERNAL_ERR_BASE - 13)
#define PMIX_ERR_INVALID_NUM_PARSED (PMIX_INTERNAL_ERR_BASE - 14)
#define PMIX_ERR_INVALID_ARGS (PMIX_INTERNAL_ERR_BASE - 15)
#define PMIX_ERR_INVALID_NUM_ARGS (PMIX_INTERNAL_ERR_BASE - 16)
#define PMIX_ERR_INVALID_LENGTH (PMIX_INTERNAL_ERR_BASE - 17)
#define PMIX_ERR_INVALID_VAL_LENGTH (PMIX_INTERNAL_ERR_BASE - 18)
#define PMIX_ERR_INVALID_VAL (PMIX_INTERNAL_ERR_BASE - 19)
#define PMIX_ERR_INVALID_KEY_LENGTH (PMIX_INTERNAL_ERR_BASE - 20)
#define PMIX_ERR_INVALID_KEY (PMIX_INTERNAL_ERR_BASE - 21)
#define PMIX_ERR_INVALID_ARG (PMIX_INTERNAL_ERR_BASE - 22)
#define PMIX_ERR_NOMEM (PMIX_INTERNAL_ERR_BASE - 23)
#define PMIX_ERR_IN_ERRNO (PMIX_INTERNAL_ERR_BASE - 24)
#define PMIX_ERR_SILENT (PMIX_INTERNAL_ERR_BASE - 25)
#define PMIX_ERR_UNKNOWN_DATATYPE (PMIX_INTERNAL_ERR_BASE - 26)
#define PMIX_ERR_RESOURCE_BUSY (PMIX_INTERNAL_ERR_BASE - 27)
#define PMIX_ERR_NOT_AVAILABLE (PMIX_INTERNAL_ERR_BASE - 28)
#define PMIX_ERR_FATAL (PMIX_INTERNAL_ERR_BASE - 29)
#define PMIX_ERR_VALUE_OUT_OF_BOUNDS (PMIX_INTERNAL_ERR_BASE - 30)

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

@ -13,7 +13,7 @@
* 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-2016 Intel, Inc. All rights reserved.
* Copyright (c) 2013-2017 Intel, Inc. All rights reserved.
* Copyright (c) 2015 Mellanox Technologies, Inc. All rights reserved.
* $COPYRIGHT$
*
@ -204,23 +204,13 @@ int main(int argc, char **argv)
(void)asprintf(&tmp, "%s-%d-remote-%d", proc.nspace, n, j);
if (PMIX_SUCCESS != (rc = PMIx_Get(&proc, tmp, NULL, 0, &val))) {
pmix_output(0, "Client ns %s rank %d cnt %d: PMIx_Get %s failed: %s",
myproc.nspace, myproc.rank, j, tmp, PMIx_Error_string(rc));
/* this data should _not_ be found as we are on the same node
* and the data was "put" with a PMIX_REMOTE scope */
pmix_output(0, "Client ns %s rank %d cnt %d: PMIx_Get %s returned correct", myproc.nspace, myproc.rank, j, tmp);
continue;
}
if (PMIX_STRING != val->type) {
pmix_output(0, "Client ns %s rank %d cnt %d: PMIx_Get %s returned wrong type: %d", myproc.nspace, myproc.rank, j, tmp, val->type);
PMIX_VALUE_RELEASE(val);
free(tmp);
continue;
}
if (0 != strcmp(val->data.string, "1234")) {
pmix_output(0, "Client ns %s rank %d cnt %d: PMIx_Get %s returned wrong value: %s", myproc.nspace, myproc.rank, j, tmp, val->data.string);
PMIX_VALUE_RELEASE(val);
free(tmp);
continue;
}
pmix_output(0, "Client ns %s rank %d cnt %d: PMIx_Get %s returned correct", myproc.nspace, myproc.rank, j, tmp);
pmix_output(0, "Client ns %s rank %d cnt %d: PMIx_Get %s returned remote data for a local proc",
myproc.nspace, myproc.rank, j, tmp);
PMIX_VALUE_RELEASE(val);
free(tmp);
}

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

@ -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-2017 Mellanox Technologies, Inc.
@ -551,8 +551,12 @@ int parse_replace(char *replace_param, int store, int *key_num) {
while(NULL != pch) {
pch++;
ech = strchr(pch, ',');
if (NULL != ech || (strlen(pch) > 0)) {
snprintf(tmp_str, ech - pch + 1, "%s", pch);
if (strlen(pch) > 0) {
if (NULL != ech) {
snprintf(tmp_str, ech - pch + 1, "%s", pch);
} else {
snprintf(tmp_str, strlen(pch) + 1, "%s", pch);
}
if ((0 == is_digit(tmp_str)) || ((atoi(tmp_str) + 1) > cnt)) {
ret = 1;
break;
@ -631,4 +635,3 @@ int get_all_ranks_from_namespace(test_params params, char *nspace, pmix_proc_t *
}
return PMIX_SUCCESS;
}

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

@ -1,5 +1,5 @@
/*
* Copyright (c) 2015-2016 Intel, Inc. All rights reserved.
* Copyright (c) 2015-2017 Intel, Inc. All rights reserved.
* $COPYRIGHT$
*
* Additional copyrights may follow
@ -75,6 +75,7 @@ ORTE_DECLSPEC int orte_schizo_base_setup_child(orte_job_t *jobdat,
orte_proc_t *child,
orte_app_context_t *app);
ORTE_DECLSPEC orte_schizo_launch_environ_t orte_schizo_base_check_launch_environment(void);
ORTE_DECLSPEC long orte_schizo_base_get_remaining_time(void);
ORTE_DECLSPEC void orte_schizo_base_finalize(void);
END_C_DECLS

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

@ -1,5 +1,5 @@
/*
* Copyright (c) 2015-2016 Intel, Inc. All rights reserved.
* Copyright (c) 2015-2017 Intel, Inc. All rights reserved.
* Copyright (c) 2015 Research Organization for Information Science
* and Technology (RIST). All rights reserved.
* $COPYRIGHT$
@ -44,6 +44,7 @@ orte_schizo_base_module_t orte_schizo = {
.setup_fork = orte_schizo_base_setup_fork,
.setup_child = orte_schizo_base_setup_child,
.check_launch_environment = orte_schizo_base_check_launch_environment,
.get_remaining_time = orte_schizo_base_get_remaining_time,
.finalize = orte_schizo_base_finalize
};
@ -103,4 +104,3 @@ MCA_BASE_FRAMEWORK_DECLARE(orte, schizo, "ORTE Schizo Subsystem",
OBJ_CLASS_INSTANCE(orte_schizo_base_active_module_t,
opal_list_item_t,
NULL, NULL);

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

@ -1,6 +1,6 @@
/* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil -*- */
/*
* Copyright (c) 2015-2016 Intel, Inc. All rights reserved.
* Copyright (c) 2015-2017 Intel, Inc. All rights reserved.
* $COPYRIGHT$
*
* Additional copyrights may follow
@ -161,6 +161,22 @@ orte_schizo_launch_environ_t orte_schizo_base_check_launch_environment(void)
return ORTE_SCHIZO_UNDETERMINED;
}
long orte_schizo_base_get_remaining_time(void)
{
long rc;
orte_schizo_base_active_module_t *mod;
OPAL_LIST_FOREACH(mod, &orte_schizo_base.active_modules, orte_schizo_base_active_module_t) {
if (NULL != mod->module->get_remaining_time) {
rc = mod->module->get_remaining_time();
if (ORTE_ERR_TAKE_NEXT_OPTION != rc) {
return rc;
}
}
}
return -1;
}
void orte_schizo_base_finalize(void)
{
orte_schizo_base_active_module_t *mod;

38
orte/mca/schizo/moab/Makefile.am Обычный файл
Просмотреть файл

@ -0,0 +1,38 @@
#
# Copyright (c) 2016-2017 Intel, Inc. All rights reserved.
# $COPYRIGHT$
#
# Additional copyrights may follow
#
# $HEADER$
#
AM_CPPFLAGS= $(schizo_moab_CPPFLAGS)
sources = \
schizo_moab_component.c \
schizo_moab.h \
schizo_moab.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_orte_schizo_moab_DSO
component_noinst =
component_install = mca_schizo_moab.la
else
component_noinst = libmca_schizo_moab.la
component_install =
endif
mcacomponentdir = $(ortelibdir)
mcacomponent_LTLIBRARIES = $(component_install)
mca_schizo_moab_la_SOURCES = $(sources)
mca_schizo_moab_la_LDFLAGS = -module -avoid-version $(schizo_moab_LDFLAGS)
mca_schizo_moab_la_LIBADD = $(schizo_moab_LIBS)
noinst_LTLIBRARIES = $(component_noinst)
libmca_schizo_moab_la_SOURCES = $(sources)
libmca_schizo_moab_la_LDFLAGS = -module -avoid-version $(schizo_moab_LDFLAGS)
libmca_schizo_moab_la_LIBADD = $(schizo_moab_LIBS)

41
orte/mca/schizo/moab/configure.m4 Обычный файл
Просмотреть файл

@ -0,0 +1,41 @@
# -*- 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-2010 Cisco Systems, Inc. All rights reserved.
# Copyright (c) 2011-2013 Los Alamos National Security, LLC.
# All rights reserved.
# Copyright (c) 2016-2017 Intel, Inc. All rights reserved.
# $COPYRIGHT$
#
# Additional copyrights may follow
#
# $HEADER$
#
# MCA_schizo_moab_CONFIG([action-if-found], [action-if-not-found])
# -----------------------------------------------------------
AC_DEFUN([MCA_orte_schizo_moab_CONFIG],[
AC_CONFIG_FILES([orte/mca/schizo/moab/Makefile])
ORTE_CHECK_MOAB([schizo_moab], [schizo_moab_good=1], [schizo_moab_good=0])
# if check worked, set wrapper flags if so.
# Evaluate succeed / fail
AS_IF([test "$schizo_moab_good" = "1"],
[$1],
[$2])
# set build flags to use in makefile
AC_SUBST([schizo_moab_CPPFLAGS])
AC_SUBST([schizo_moab_LDFLAGS])
AC_SUBST([schizo_moab_LIBS])
])dnl

7
orte/mca/schizo/moab/owner.txt Обычный файл
Просмотреть файл

@ -0,0 +1,7 @@
#
# owner/status file
# owner: institution that is responsible for this package
# status: e.g. active, maintenance, unmaintained
#
owner: INTEL
status: active

110
orte/mca/schizo/moab/schizo_moab.c Обычный файл
Просмотреть файл

@ -0,0 +1,110 @@
/*
* Copyright (c) 2016-2017 Intel, Inc. All rights reserved.
* Copyright (c) 2016 Mellanox Technologies Ltd. All rights reserved.
* $COPYRIGHT$
*
* Additional copyrights may follow
*
* $HEADER$
*
*/
#include "orte_config.h"
#include "orte/types.h"
#include "opal/types.h"
#ifdef HAVE_UNISTD_H
#include <unistd.h>
#endif
#include <ctype.h>
#include "opal/util/argv.h"
#include "opal/util/basename.h"
#include "opal/util/opal_environ.h"
#include "orte/runtime/orte_globals.h"
#include "orte/util/name_fns.h"
#include "orte/mca/schizo/base/base.h"
#include "schizo_moab.h"
static orte_schizo_launch_environ_t check_launch_environment(void);
static void finalize(void);
static long get_rem_time(void);
orte_schizo_base_module_t orte_schizo_moab_module = {
.check_launch_environment = check_launch_environment,
.get_remaining_time = get_rem_time,
.finalize = finalize
};
static char **pushed_envs = NULL;
static char **pushed_vals = NULL;
static orte_schizo_launch_environ_t myenv;
static bool myenvdefined = false;
static orte_schizo_launch_environ_t check_launch_environment(void)
{
int i;
if (myenvdefined) {
return myenv;
}
myenvdefined = true;
/* we were only selected because MOAB was detected
* and we are an app, so no need to further check
* that here. Instead, see if we were direct launched
* vs launched via mpirun */
if (NULL != orte_process_info.my_daemon_uri) {
/* nope */
myenv = ORTE_SCHIZO_NATIVE_LAUNCHED;
opal_argv_append_nosize(&pushed_envs, OPAL_MCA_PREFIX"ess");
opal_argv_append_nosize(&pushed_vals, "pmi");
goto setup;
}
/* see if we are in a MOAB allocation */
if (NULL == getenv("PBS_NODEFILE")) {
/* nope */
myenv = ORTE_SCHIZO_UNDETERMINED;
return myenv;
}
/* we don't support direct launch by Moab, so we must
* be a singleton */
opal_argv_append_nosize(&pushed_envs, OPAL_MCA_PREFIX"ess");
opal_argv_append_nosize(&pushed_vals, "singleton");
myenv = ORTE_SCHIZO_MANAGED_SINGLETON;
setup:
opal_output_verbose(1, orte_schizo_base_framework.framework_output,
"schizo:moab DECLARED AS %s", orte_schizo_base_print_env(myenv));
if (NULL != pushed_envs) {
for (i=0; NULL != pushed_envs[i]; i++) {
opal_setenv(pushed_envs[i], pushed_vals[i], true, &environ);
}
}
return myenv;
}
static long get_rem_time(void)
{
long time;
MCCJobGetRemainingTime(NULL, NULL, &time, NULL);
return time;
}
static void finalize(void)
{
int i;
if (NULL != pushed_envs) {
for (i=0; NULL != pushed_envs[i]; i++) {
opal_unsetenv(pushed_envs[i], &environ);
}
opal_argv_free(pushed_envs);
opal_argv_free(pushed_vals);
}
}

28
orte/mca/schizo/moab/schizo_moab.h Обычный файл
Просмотреть файл

@ -0,0 +1,28 @@
/*
* Copyright (c) 2016-2017 Intel, Inc. All rights reserved.
* $COPYRIGHT$
*
* Additional copyrights may follow
*
* $HEADER$
*/
#ifndef _MCA_SCHIZO_MOAB_H_
#define _MCA_SCHIZO_MOAB_H_
#include "orte_config.h"
#include "orte/types.h"
#include "opal/mca/base/base.h"
#include "orte/mca/schizo/schizo.h"
BEGIN_C_DECLS
ORTE_MODULE_DECLSPEC extern orte_schizo_base_component_t mca_schizo_moab_component;
extern orte_schizo_base_module_t orte_schizo_moab_module;
END_C_DECLS
#endif /* MCA_SCHIZO_MOAB_H_ */

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

@ -0,0 +1,51 @@
/* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil -*- */
/*
* Copyright (c) 2016-2017 Intel, Inc. All rights reserved.
* $COPYRIGHT$
*
* Additional copyrights may follow
*
* $HEADER$
*/
#include "orte_config.h"
#include "orte/types.h"
#include "opal/types.h"
#include "opal/util/show_help.h"
#include "orte/mca/schizo/schizo.h"
#include "schizo_moab.h"
static int component_query(mca_base_module_t **module, int *priority);
/*
* Struct of function pointers and all that to let us be initialized
*/
orte_schizo_base_component_t mca_schizo_moab_component = {
.base_version = {
MCA_SCHIZO_BASE_VERSION_1_0_0,
.mca_component_name = "moab",
MCA_BASE_MAKE_VERSION(component, ORTE_MAJOR_VERSION, ORTE_MINOR_VERSION,
ORTE_RELEASE_VERSION),
.mca_query_component = component_query,
},
.base_data = {
/* The component is checkpoint ready */
MCA_BASE_METADATA_PARAM_CHECKPOINT
},
};
static int component_query(mca_base_module_t **module, int *priority)
{
/* disqualify ourselves if we are not an app or under moab */
if (!ORTE_PROC_IS_APP || NULL == getenv("PBS_JOBID")) {
*priority = 0;
*module = NULL;
return OPAL_ERROR;
}
*module = (mca_base_module_t*)&orte_schizo_moab_module;
*priority = 50;
return ORTE_SUCCESS;
}

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

@ -1,6 +1,6 @@
/* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil -*- */
/*
* Copyright (c) 2015-2016 Intel, Inc. All rights reserved
* Copyright (c) 2015-2017 Intel, Inc. All rights reserved.
* Copyright (c) 2015 Los Alamos National Security, LLC. All rights
* reserved.
* $COPYRIGHT$
@ -110,6 +110,15 @@ typedef orte_schizo_launch_environ_t (*orte_schizo_base_module_ck_launch_environ
/* give the component a chance to cleanup */
typedef void (*orte_schizo_base_module_finalize_fn_t)(void);
/* request time remaining in this allocation - only one module
* capable of supporting this operation should be available
* in a given environment. However, if a module is available
* and decides it cannot provide the info in the current situation,
* then it can return ORTE_ERR_TAKE_NEXT_OPTION to indicate that
* another module should be tried */
typedef long (*orte_schizo_base_module_get_rem_time_fn_t)(void);
/*
* schizo module version 1.3.0
*/
@ -122,6 +131,7 @@ typedef struct {
orte_schizo_base_module_setup_fork_fn_t setup_fork;
orte_schizo_base_module_setup_child_fn_t setup_child;
orte_schizo_base_module_ck_launch_environ_fn_t check_launch_environment;
orte_schizo_base_module_get_rem_time_fn_t get_remaining_time;
orte_schizo_base_module_finalize_fn_t finalize;
} orte_schizo_base_module_t;

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

@ -299,8 +299,9 @@ void pmix_server_notify(int status, orte_process_name_t* sender,
orte_process_name_t source;
opal_output_verbose(2, orte_pmix_server_globals.output,
"%s Notification received",
ORTE_NAME_PRINT(ORTE_PROC_MY_NAME));
"%s Notification received from %s",
ORTE_NAME_PRINT(ORTE_PROC_MY_NAME),
ORTE_NAME_PRINT(sender));
/* unpack the status */
cnt = 1;

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

@ -12,7 +12,7 @@
* 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) 2015-2016 Intel, Inc. All rights reserved.
* Copyright (c) 2015-2017 Intel, Inc. All rights reserved.
* $COPYRIGHT$
*
* Additional copyrights may follow
@ -131,7 +131,7 @@ exit:
return rc;
}
static int _setup_top_session_dir(void)
int orte_setup_top_session_dir(void)
{
int rc = ORTE_SUCCESS;
/* get the effective uid */
@ -170,20 +170,26 @@ static int _setup_jobfam_session_dir(orte_process_name_t *proc)
/* construct the top_session_dir if we need */
if (NULL == orte_process_info.jobfam_session_dir) {
if (ORTE_SUCCESS != (rc = _setup_top_session_dir())) {
if (ORTE_SUCCESS != (rc = orte_setup_top_session_dir())) {
return rc;
}
if (ORTE_PROC_IS_HNP) {
if (ORTE_PROC_IS_MASTER) {
if (0 > asprintf(&orte_process_info.jobfam_session_dir,
"%s/dvm", orte_process_info.top_session_dir)) {
rc = ORTE_ERR_OUT_OF_RESOURCE;
goto exit;
}
} else if (ORTE_PROC_IS_HNP) {
if (0 > asprintf(&orte_process_info.jobfam_session_dir,
"%s/pid.%lu", orte_process_info.top_session_dir,
(unsigned long)orte_process_info.pid) ) {
(unsigned long)orte_process_info.pid)) {
rc = ORTE_ERR_OUT_OF_RESOURCE;
goto exit;
}
} else {
/* we were not given one, so define it */
if (NULL == proc || (ORTE_JOBID_INVALID == proc->jobid) ) {
if (NULL == proc || (ORTE_JOBID_INVALID == proc->jobid)) {
if (0 > asprintf(&orte_process_info.jobfam_session_dir,
"%s/jobfam", orte_process_info.top_session_dir) ) {
rc = ORTE_ERR_OUT_OF_RESOURCE;
@ -524,7 +530,23 @@ orte_session_dir_finalize(orte_process_name_t *proc)
}
}
if(NULL != orte_process_info.top_session_dir) {
if (opal_os_dirpath_is_empty(orte_process_info.jobfam_session_dir)) {
if (orte_debug_flag) {
opal_output(0, "sess_dir_finalize: found jobfam session dir empty - deleting");
}
rmdir(orte_process_info.jobfam_session_dir);
} else {
if (orte_debug_flag) {
if (OPAL_ERR_NOT_FOUND ==
opal_os_dirpath_access(orte_process_info.jobfam_session_dir, 0)) {
opal_output(0, "sess_dir_finalize: jobfam session dir does not exist");
} else {
opal_output(0, "sess_dir_finalize: jobfam session dir not empty - leaving");
}
}
}
if (NULL != orte_process_info.top_session_dir) {
if (opal_os_dirpath_is_empty(orte_process_info.top_session_dir)) {
if (orte_debug_flag) {
opal_output(0, "sess_dir_finalize: found top session dir empty - deleting");

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

@ -9,6 +9,7 @@
* University of Stuttgart. All rights reserved.
* Copyright (c) 2004-2005 The Regents of the University of California.
* All rights reserved.
* Copyright (c) 2016-2017 Intel, Inc. All rights reserved.
* $COPYRIGHT$
*
* Additional copyrights may follow
@ -114,6 +115,7 @@ ORTE_DECLSPEC int orte_session_dir(bool create, orte_process_name_t *proc);
*/
ORTE_DECLSPEC int orte_session_setup_base(orte_process_name_t *proc);
ORTE_DECLSPEC int orte_setup_top_session_dir(void);
/** The orte_session_dir_finalize() function performs a cleanup of the
* session directory tree. It first removes the session directory for