1
1
Signed-off-by: Ralph Castain <rhc@open-mpi.org>
Этот коммит содержится в:
Ralph Castain 2018-06-16 17:44:14 -07:00
родитель ea21f7175a
Коммит fa18ba395d
23 изменённых файлов: 475 добавлений и 204 удалений

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

@ -23,7 +23,7 @@
# via AC_CONFIG_MACRO_DIR in configure.ac.
ACLOCAL_AMFLAGS = -I ./config
SUBDIRS = config contrib include src etc bindings
SUBDIRS = config contrib include src etc
headers =

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

@ -30,7 +30,7 @@ greek=
# command, or with the date (if "git describe" fails) in the form of
# "date<date>".
repo_rev=gita493add
repo_rev=git32969ba
# 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="Jun 10, 2018"
date="Jun 16, 2018"
# The shared library version of each of PMIx's public libraries.
# These versions are maintained in accordance with the "Library

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

@ -1,22 +0,0 @@
#
# 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-2009 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-2010 Cisco Systems, Inc. All rights reserved.
# Copyright (c) 2012-2013 Los Alamos National Security, Inc. All rights reserved.
# Copyright (c) 2013-2018 Intel, Inc. All rights reserved.
# $COPYRIGHT$
#
# Additional copyrights may follow
#
# $HEADER$
#
SUBDIRS = python

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

@ -1,19 +0,0 @@
Copyright (c) 2016-2018 Intel, Inc. All rights reserved.
$COPYRIGHT$
Additional copyrights may follow
$HEADER$
===========================================================================
This is where bindings of PMIx functions to alternative programming languages
such as Python reside. All functions defined in the public headers have been
provided with a wrapper. Note that there is no restriction on the number of
wrappers that can exist, nor on what type of function is wrapped.
There is only one rule to observe: you can wrap a framework, but you cannot wrap a
specific plugin within that framework. This constraint flows from the fact that
plugins are only accessed via the framework interface - thus, there is no way to
guarantee that a particular plugin will be the active selection.

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

@ -1,39 +0,0 @@
#
# 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-2009 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-2010 Cisco Systems, Inc. All rights reserved.
# Copyright (c) 2012-2013 Los Alamos National Security, Inc. All rights reserved.
# Copyright (c) 2013-2018 Intel, Inc. All rights reserved.
# $COPYRIGHT$
#
# Additional copyrights may follow
#
# $HEADER$
#
helpers = setup.py client.py server.py cpmix.pxd pmix.pyx
if WANT_PYTHON_BINDINGS
install-exec-local: $(helpers)
$(PYTHON) setup.py build_ext --include-dirs="$(top_builddir)/include" --library-dirs="$(DESTDIR)$(libdir)" --user
$(PYTHON) setup.py install --prefix="$(DESTDIR)$(prefix)"
uninstall-hook:
rm -f $(pythondir)/pmix*.so
rm -f $(pythondir)/pypmix-*.egg-info
CLEANFILES += pmix.c
clean-local:
rm -rf build
endif

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

@ -1,49 +0,0 @@
===========================================================================
Cython-based Python wrapper for PMIx
===========================================================================
Example
-------
This example starts up a persistent DVM and then spawns some tasks using
Python.
$ virtualenv ve
$ source ve/bin/activate
$ pip install orte-cffi
$ orte-dvm --report-uri dvm_uri
$ python examples/submit.py
Create a distfile
----------------------------------------
If you want to create a sdist file:
$ virtualenv ve
$ source ve/bin/activate
$ python setup.py sdist
Uploading sdist to pypi
-----------------------
Assuming you have admin privileges to the pypi package repository for this
package, a new version can be uploaded using twine:
$ virtualenv ve
$ source ve/bin/activate
$ pip install twine
$ twine upload dist/orte-cffi-`python setup.py --version`.tar.gz
Building (for development purposes only)
----------------------------------------
If you want to create a non-pip build:
$ virtualenv ve
$ source ve/bin/activate
$ pip install cffi
$ python src/orte-cffi/build.py

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

@ -833,8 +833,6 @@ AC_DEFUN([PMIX_SETUP_CORE],[
AC_CONFIG_FILES(
pmix_config_prefix[Makefile]
pmix_config_prefix[bindings/Makefile]
pmix_config_prefix[bindings/python/Makefile]
pmix_config_prefix[config/Makefile]
pmix_config_prefix[etc/Makefile]
pmix_config_prefix[include/Makefile]
@ -1128,45 +1126,6 @@ fi
AM_CONDITIONAL([PMIX_INSTALL_BINARIES], [test $WANT_PMIX_BINARIES -eq 1])
#
# Install Python bindings?
#
AC_MSG_CHECKING([if want install Python bindings])
AC_ARG_ENABLE(python-bindings,
AC_HELP_STRING([--enable-python-bindings],
[enable Python bindings (default: disabled)]))
if test "$enable_python_bindings" != "yes"; then
AC_MSG_RESULT([no])
WANT_PYTHON_BINDINGS=0
else
AC_MSG_RESULT([yes])
WANT_PYTHON_BINDINGS=1
fi
AM_CONDITIONAL([WANT_PYTHON_BINDINGS], [test $WANT_PYTHON_BINDINGS -eq 1])
if test "$WANT_PYTHON_BINDINGS" = "1"; then
AM_PATH_PYTHON([2.7], [python_happy=1], [python_happy=0])
if test "$python_happy" = "0"; then
AC_MSG_WARN([Python bindings were enabled, but no suitable])
AC_MSG_WARN([interpreter was found. PMIx requires at least])
AC_MSG_WARN([Python v2.7 to provide Python bindings])
AC_MSG_ERROR([Cannot continue])
fi
AC_MSG_CHECKING([if Cython package installed])
have_cython=esyscmd(config/pmix_check_cython.py)
if test "$have_cython" = "0"; then
AC_MSG_RESULT([yes])
else
AC_MSG_RESULT([no])
AC_MSG_WARN([Python bindings were enabled, but the Cython])
AC_MSG_WARN([package was not found. PMIx Python bindings])
AC_MSG_WARN([require that the Cython package be installed])
AC_MSG_ERROR([Cannot continue])
fi
fi
])dnl
# This must be a standalone routine so that it can be called both by

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

@ -502,7 +502,7 @@ static void progress_local_event_hdlr(pmix_status_t status,
* and code, then invoke it now */
if (NULL != pmix_globals.events.last &&
pmix_notify_check_range(&pmix_globals.events.last->rng, &chain->source) &&
pmix_notify_check_affected(nxt->affected, nxt->naffected,
pmix_notify_check_affected(pmix_globals.events.last->affected, pmix_globals.events.last->naffected,
chain->affected, chain->naffected)) {
chain->endchain = true; // ensure we don't do this again
if (1 == pmix_globals.events.last->ncodes &&

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

@ -103,8 +103,21 @@ pmix_status_t pmix_hwloc_get_topology(pmix_info_t *info, size_t ninfo)
pmix_hwloc_vm_hole_kind_t hole = VM_HOLE_BIGGEST;
#endif
/* we only do something if specifically requested */
if (NULL == info) {
if (NULL == info || 0 == ninfo) {
if (0 != hwloc_topology_init(&pmix_hwloc_topology)) {
return PMIX_ERR_INIT;
}
if (0 != set_flags(pmix_hwloc_topology, 0)) {
hwloc_topology_destroy(pmix_hwloc_topology);
return PMIX_ERR_INIT;
}
if (0 != hwloc_topology_load(pmix_hwloc_topology)) {
PMIX_ERROR_LOG(PMIX_ERR_NOT_SUPPORTED);
hwloc_topology_destroy(pmix_hwloc_topology);
return PMIX_ERR_NOT_SUPPORTED;
}
return PMIX_SUCCESS;
}

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

@ -60,7 +60,6 @@ static void localcbfunc(pmix_status_t status, void *cbdata)
mycount->cbfunc(mycount->status, mycount->cbdata);
}
PMIX_RELEASE(mycount);
return;
}
PMIX_RELEASE_THREAD(&mycount->lock);
}

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

@ -86,6 +86,7 @@ static pmix_status_t pmix_pnet_open(pmix_mca_base_open_flag_t flags)
/* initialize globals */
pmix_pnet_globals.initialized = true;
PMIX_CONSTRUCT_LOCK(&pmix_pnet_globals.lock);
pmix_pnet_globals.lock.active = false;
PMIX_CONSTRUCT(&pmix_pnet_globals.actives, pmix_list_t);
PMIX_CONSTRUCT(&pmix_pnet_globals.jobs, pmix_list_t);
PMIX_CONSTRUCT(&pmix_pnet_globals.nodes, pmix_list_t);

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

@ -76,7 +76,7 @@ AC_DEFUN([MCA_pmix_pnet_opa_CONFIG],[
[pmix_check_opamgt_happy="no"])],
[pmix_check_opamgt_happy="no"])
pnet_opa_CLFAGS="$pnet_opa_CFLAGS $pnet_opamgt_CFLAGS"
pnet_opa_CFLAGS="$pnet_opa_CFLAGS $pnet_opamgt_CFLAGS"
pnet_opa_CPPFLAGS="$pnet_opa_CPPFLAGS $pnet_opamgt_CPPFLAGS"
pnet_opa_LDFLAGS="$pnet_opa_LDFLAGS $pnet_opamgt_LDFLAGS"
pnet_opa_LIBS="$pnet_opa_LIBS $pnet_opamgt_LIBS"

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

@ -26,15 +26,15 @@
#endif
#include <time.h>
#if 0
#if PMIX_WANT_OPAMGT
#include "opamgt.h"
#endif
#include <opamgt/opamgt.h>
#include <opamgt/opamgt_sa.h>
#endif
#include <pmix_common.h>
#include "src/mca/base/pmix_mca_base_var.h"
#include "src/class/pmix_list.h"
#include "src/include/pmix_socket_errno.h"
#include "src/include/pmix_globals.h"
#include "src/class/pmix_list.h"
@ -84,6 +84,52 @@ pmix_pnet_module_t pmix_opa_module = {
.deliver_inventory = deliver_inventory
};
/* local object definitions */
typedef struct {
pmix_list_item_t super;
char *name;
char *value;
} opa_attr_t;
static void atcon(opa_attr_t *p)
{
p->name = NULL;
p->value = NULL;
}
static void atdes(opa_attr_t *p)
{
if (NULL != p->name) {
free(p->name);
}
if (NULL != p->value) {
free(p->value);
}
}
static PMIX_CLASS_INSTANCE(opa_attr_t,
pmix_list_item_t,
atcon, atdes);
typedef struct {
pmix_list_item_t super;
char *device;
pmix_list_t attributes;
} opa_resource_t;
static void rcon(opa_resource_t *p)
{
p->device = NULL;
PMIX_CONSTRUCT(&p->attributes, pmix_list_t);
}
static void rdes(opa_resource_t *p)
{
if (NULL != p->device) {
free(p->device);
}
PMIX_LIST_DESTRUCT(&p->attributes);
}
static PMIX_CLASS_INSTANCE(opa_resource_t,
pmix_list_item_t,
rcon, rdes);
static pmix_status_t opa_init(void)
{
pmix_output_verbose(2, pmix_pnet_base_framework.framework_output,
@ -197,6 +243,10 @@ static pmix_status_t allocate(pmix_nspace_t *nptr,
envars = false;
seckeys = false;
pmix_output_verbose(2, pmix_pnet_base_framework.framework_output,
"pnet:opa:allocate for nspace %s", nptr->nspace);
if (NULL == info) {
return PMIX_ERR_TAKE_NEXT_OPTION;
}
@ -354,9 +404,10 @@ static void deregister_nspace(pmix_nspace_t *nptr)
static pmix_status_t collect_inventory(pmix_info_t directives[], size_t ndirs,
pmix_inventory_cbfunc_t cbfunc, void *cbdata)
{
#if PMIX_HAVE_HWLOC
pmix_inventory_rollup_t *cd = (pmix_inventory_rollup_t*)cbdata;
#if PMIX_HAVE_HWLOC
hwloc_obj_t obj;
#endif
unsigned n;
pmix_status_t rc;
pmix_kval_t *kv;
@ -368,10 +419,6 @@ static pmix_status_t collect_inventory(pmix_info_t directives[], size_t ndirs,
pmix_output_verbose(2, pmix_pnet_base_framework.framework_output,
"pnet:opa collect inventory");
if (NULL == pmix_hwloc_topology) {
return PMIX_ERR_NOT_SUPPORTED;
}
/* setup the bucket - we will pass the results as a blob */
PMIX_CONSTRUCT(&bucket, pmix_buffer_t);
/* pack our node name */
@ -384,6 +431,11 @@ static pmix_status_t collect_inventory(pmix_info_t directives[], size_t ndirs,
return rc;
}
#if PMIX_HAVE_HWLOC
if (NULL == pmix_hwloc_topology) {
goto query;
}
/* search the topology for OPA devices */
obj = hwloc_get_next_osdev(pmix_hwloc_topology, NULL);
while (NULL != obj) {
@ -393,6 +445,14 @@ static pmix_status_t collect_inventory(pmix_info_t directives[], size_t ndirs,
continue;
}
found = true;
if (9 < pmix_output_get_verbosity(pmix_pnet_base_framework.framework_output)) {
/* dump the discovered node resources */
pmix_output(0, "OPA resource discovered on node: %s", nodename);
pmix_output(0, "\tDevice name: %s", obj->name);
for (n=0; n < obj->infos_count; n++) {
pmix_output(0, "\t\t%s: %s", obj->infos[n].name, obj->infos[n].value);
}
}
/* pack the name of the device */
PMIX_CONSTRUCT(&pbkt, pmix_buffer_t);
PMIX_BFROPS_PACK(rc, pmix_globals.mypeer, &pbkt, &obj->name, 1, PMIX_STRING);
@ -402,6 +462,14 @@ static pmix_status_t collect_inventory(pmix_info_t directives[], size_t ndirs,
PMIX_DESTRUCT(&bucket);
return rc;
}
/* pack the number of attributes */
PMIX_BFROPS_PACK(rc, pmix_globals.mypeer, &pbkt, &obj->infos_count, 1, PMIX_UINT);
if (PMIX_SUCCESS != rc) {
PMIX_ERROR_LOG(rc);
PMIX_DESTRUCT(&pbkt);
PMIX_DESTRUCT(&bucket);
return rc;
}
/* pack each descriptive object */
for (n=0; n < obj->infos_count; n++) {
PMIX_BFROPS_PACK(rc, pmix_globals.mypeer, &pbkt, &obj->infos[n].name, 1, PMIX_STRING);
@ -432,6 +500,29 @@ static pmix_status_t collect_inventory(pmix_info_t directives[], size_t ndirs,
obj = hwloc_get_next_osdev(pmix_hwloc_topology, obj);
}
query:
#if 0
#if PMIX_WANT_OPAMGT
if (PMIX_PROC_IS_GATEWAY(pmix_globals.mypeer)) {
/* collect the switch information from the FM */
OMGT_STATUS_T status = OMGT_STATUS_SUCCESS;
struct omgt_port * port = NULL;
omgt_sa_selector_t selector;
/* create a session */
status = omgt_open_port_by_num(&port, 1 /* hfi */, 1 /* port */, NULL);
if (OMGT_STATUS_SUCCESS != status) {
pmix_output_verbose(1, pmix_pnet_base_framework.framework_output,
"Unable to open port to FM");
goto complete;
}
/* specify how and what we want to query by */
selector.InputType = InputTypeLid;
selector.InputValue.PortInfoRecord.Lid = 1;
}
#endif
#endif
/* if we found any devices, then return the blob */
if (!found) {
PMIX_DESTRUCT(&bucket);
@ -441,14 +532,39 @@ static pmix_status_t collect_inventory(pmix_info_t directives[], size_t ndirs,
/* extract the resulting blob */
PMIX_UNLOAD_BUFFER(&bucket, pbo.bytes, pbo.size);
kv = PMIX_NEW(pmix_kval_t);
kv->key = strdup(PMIX_PNET_OPA_BLOB);
kv->key = strdup(PMIX_OPA_INVENTORY_KEY);
PMIX_VALUE_CREATE(kv->value, 1);
pmix_value_load(kv->value, &pbo, PMIX_BYTE_OBJECT);
PMIX_BYTE_OBJECT_DESTRUCT(&pbo);
pmix_list_append(&cd->payload, &kv->super);
#else
#else // have_hwloc
#if 0
#if PMIX_WANT_OPAMGT
if (PMIX_PROC_IS_GATEWAY(pmix_globals.mypeer)) {
/* query the FM for the inventory */
}
complete:
/* if we found any devices, then return the blob */
if (!found) {
PMIX_DESTRUCT(&bucket);
return PMIX_ERR_TAKE_NEXT_OPTION;
}
/* extract the resulting blob */
PMIX_UNLOAD_BUFFER(&bucket, pbo.bytes, pbo.size);
kv = PMIX_NEW(pmix_kval_t);
kv->key = strdup(PMIX_OPA_INVENTORY_KEY);
PMIX_VALUE_CREATE(kv->value, 1);
pmix_value_load(kv->value, &pbo, PMIX_BYTE_OBJECT);
PMIX_BYTE_OBJECT_DESTRUCT(&pbo);
pmix_list_append(&cd->payload, &kv->super);
#endif
#endif
return PMIX_ERR_TAKE_NEXT_OPTION;
#endif // have_hwloc
return PMIX_SUCCESS;
}
@ -457,8 +573,145 @@ static pmix_status_t deliver_inventory(pmix_info_t info[], size_t ninfo,
pmix_info_t directives[], size_t ndirs,
pmix_op_cbfunc_t cbfunc, void *cbdata)
{
pmix_buffer_t bkt, pbkt;
size_t n;
int32_t cnt;
unsigned m, nattrs;
char *hostname;
pmix_byte_object_t pbo;
pmix_pnet_node_t *nd, *ndptr;
pmix_pnet_resource_t *lt, *lst;
opa_attr_t *attr;
opa_resource_t *res;
pmix_status_t rc;
pmix_output_verbose(2, pmix_pnet_base_framework.framework_output,
"pnet:opa deliver inventory");
return PMIX_ERR_NOT_SUPPORTED;
for (n=0; n < ninfo; n++) {
if (0 == strncmp(info[n].key, PMIX_OPA_INVENTORY_KEY, PMIX_MAX_KEYLEN)) {
/* this is our inventory in the form of a blob */
PMIX_CONSTRUCT(&bkt,pmix_buffer_t);
PMIX_LOAD_BUFFER(pmix_globals.mypeer, &bkt,
info[n].value.data.bo.bytes,
info[n].value.data.bo.size);
/* first is the host this came from */
cnt = 1;
PMIX_BFROPS_UNPACK(rc, pmix_globals.mypeer,
&bkt, &hostname, &cnt, PMIX_STRING);
if (PMIX_SUCCESS != rc) {
PMIX_ERROR_LOG(rc);
/* must _not_ destruct bkt as we don't
* own the bytes! */
return rc;
}
/* do we already have this node? */
nd = NULL;
PMIX_LIST_FOREACH(ndptr, &pmix_pnet_globals.nodes, pmix_pnet_node_t) {
if (0 == strcmp(hostname, ndptr->name)) {
nd = ndptr;
break;
}
}
if (NULL == nd) {
nd = PMIX_NEW(pmix_pnet_node_t);
nd->name = strdup(hostname);
pmix_list_append(&pmix_pnet_globals.nodes, &nd->super);
}
/* does this node already have an OPA entry? */
lst = NULL;
PMIX_LIST_FOREACH(lt, &nd->resources, pmix_pnet_resource_t) {
if (0 == strcmp(lt->name, "opa")) {
lst = lt;
break;
}
}
if (NULL == lst) {
lst = PMIX_NEW(pmix_pnet_resource_t);
lst->name = strdup("opa");
pmix_list_append(&nd->resources, &lst->super);
}
/* each device was packed as a "blob" */
cnt = 1;
PMIX_BFROPS_UNPACK(rc, pmix_globals.mypeer,
&bkt, &pbo, &cnt, PMIX_BYTE_OBJECT);
while (PMIX_SUCCESS == rc) {
/* load the blob for unpacking */
PMIX_CONSTRUCT(&pbkt, pmix_buffer_t);
PMIX_LOAD_BUFFER(pmix_globals.mypeer, &pbkt,
pbo.bytes, pbo.size);
res = PMIX_NEW(opa_resource_t);
/* starts with the name of the device */
cnt = 1;
PMIX_BFROPS_UNPACK(rc, pmix_globals.mypeer,
&pbkt, &res->device, &cnt, PMIX_STRING);
if (PMIX_SUCCESS != rc) {
PMIX_ERROR_LOG(rc);
PMIX_DESTRUCT(&pbkt);
PMIX_RELEASE(res);
return rc;
}
/* next comes the numbers of attributes for that device */
cnt = 1;
PMIX_BFROPS_UNPACK(rc, pmix_globals.mypeer,
&pbkt, &nattrs, &cnt, PMIX_UINT);
if (PMIX_SUCCESS != rc) {
PMIX_ERROR_LOG(rc);
PMIX_DESTRUCT(&pbkt);
PMIX_RELEASE(res);
return rc;
}
for (m=0; m < nattrs; m++) {
attr = PMIX_NEW(opa_attr_t);
/* unpack the name of the attribute */
cnt = 1;
PMIX_BFROPS_UNPACK(rc, pmix_globals.mypeer,
&pbkt, &attr->name, &cnt, PMIX_STRING);
if (PMIX_SUCCESS != rc) {
PMIX_ERROR_LOG(rc);
PMIX_DESTRUCT(&pbkt);
PMIX_RELEASE(attr);
PMIX_RELEASE(res);
return rc;
}
/* unpack the attribute value */
cnt = 1;
PMIX_BFROPS_UNPACK(rc, pmix_globals.mypeer,
&pbkt, &attr->value, &cnt, PMIX_STRING);
if (PMIX_SUCCESS != rc) {
PMIX_ERROR_LOG(rc);
PMIX_DESTRUCT(&pbkt);
PMIX_RELEASE(attr);
PMIX_RELEASE(res);
return rc;
}
pmix_list_append(&res->attributes, &attr->super);
}
pmix_list_append(&lst->resources, &res->super);
PMIX_DESTRUCT(&pbkt);
/* get the next device unit */
cnt = 1;
PMIX_BFROPS_UNPACK(rc, pmix_globals.mypeer,
&bkt, &pbo, &cnt, PMIX_BYTE_OBJECT);
}
if (5 < pmix_output_get_verbosity(pmix_pnet_base_framework.framework_output)) {
/* dump the resulting node resources */
pmix_output(0, "OPA resources for node: %s", nd->name);
PMIX_LIST_FOREACH(lt, &nd->resources, pmix_pnet_resource_t) {
if (0 == strcmp(lt->name, "opa")) {
PMIX_LIST_FOREACH(res, &lt->resources, opa_resource_t) {
pmix_output(0, "\tDevice: %s", res->device);
PMIX_LIST_FOREACH(attr, &res->attributes, opa_attr_t) {
pmix_output(0, "\t\t%s: %s", attr->name, attr->value);
}
}
}
}
}
}
}
return PMIX_SUCCESS;
}

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

@ -31,6 +31,9 @@ extern pmix_pnet_module_t pmix_opa_module;
/* define a key for any blob we need to send in a launch msg */
#define PMIX_PNET_OPA_BLOB "pmix.pnet.opa.blob"
/* define an inventory key */
#define PMIX_OPA_INVENTORY_KEY "pmix.opa.inventory"
END_C_DECLS
#endif

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

@ -599,6 +599,13 @@ static pmix_status_t allocate(pmix_nspace_t *nptr,
allocated = true;
}
} else {
pmix_output_verbose(2, pmix_pnet_base_framework.framework_output,
"pnet:tcp:allocate allocating %d ports/node for nspace %s",
ports_per_node, nptr->nspace);
if (0 == ports_per_node) {
/* nothing to allocate */
return PMIX_ERR_TAKE_NEXT_OPTION;
}
avail = (tcp_available_ports_t*)pmix_list_get_first(&available);
if (NULL != avail) {
/* setup to track the assignment */
@ -888,6 +895,8 @@ static pmix_status_t collect_inventory(pmix_info_t directives[], size_t ndirs,
prefix = "tcp6://";
inet_ntop(AF_INET6, &((struct sockaddr_in6*) &my_ss)->sin6_addr,
myconnhost, PMIX_MAXHOSTNAMELEN);
} else {
continue;
}
(void)snprintf(uri, 2048, "%s%s", prefix, myconnhost);
pmix_output_verbose(2, pmix_pnet_base_framework. framework_output,
@ -1130,6 +1139,28 @@ static pmix_status_t deliver_inventory(pmix_info_t info[], size_t ninfo,
&bkt, &pbo, &cnt, PMIX_BYTE_OBJECT);
}
PMIX_DATA_BUFFER_DESTRUCT(&bkt);
if (5 < pmix_output_get_verbosity(pmix_pnet_base_framework.framework_output)) {
/* dump the resulting node resources */
pmix_output(0, "TCP resources for node: %s", nd->name);
PMIX_LIST_FOREACH(lt, &nd->resources, pmix_pnet_resource_t) {
if (0 == strcmp(lt->name, "tcp")) {
PMIX_LIST_FOREACH(prts, &lt->resources, tcp_available_ports_t) {
device = NULL;
if (NULL != prts->ports) {
device = pmix_argv_join(prts->ports, ',');
}
pmix_output(0, "\tPorts: %s", (NULL == device) ? "UNSPECIFIED" : device);
if (NULL != device) {
free(device);
}
PMIX_LIST_FOREACH(res, &prts->devices, tcp_device_t) {
pmix_output(0, "\tDevice: %s", res->device);
pmix_output(0, "\tAddress: %s", res->address);
}
}
}
}
}
}
}

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

@ -158,8 +158,8 @@ static pmix_status_t validate_cred(struct pmix_peer_t *peer,
#endif
socklen_t crlen = sizeof (ucred);
#endif
uid_t euid;
gid_t egid;
uid_t euid = -1;
gid_t egid = -1;
char *ptr;
size_t ln;
bool takeus;

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

@ -415,6 +415,9 @@ static pmix_status_t connect_to_peer(struct pmix_peer_t *peer,
if (system_level_only) {
pmix_output_verbose(2, pmix_ptl_base_framework.framework_output,
"ptl:tcp: connecting to system failed");
if (NULL != suri) {
free(suri);
}
return PMIX_ERR_UNREACH;
}
@ -424,6 +427,9 @@ static pmix_status_t connect_to_peer(struct pmix_peer_t *peer,
* one session per user on a node */
if (0 > asprintf(&filename, "pmix.%s.tool", myhost)) {
if (NULL != suri) {
free(suri);
}
return PMIX_ERR_NOMEM;
}
pmix_output_verbose(2, pmix_ptl_base_framework.framework_output,
@ -437,6 +443,9 @@ static pmix_status_t connect_to_peer(struct pmix_peer_t *peer,
if (NULL != nspace){
free(nspace);
}
if (NULL != suri) {
free(suri);
}
return PMIX_ERR_UNREACH;
}
@ -449,6 +458,9 @@ static pmix_status_t connect_to_peer(struct pmix_peer_t *peer,
if (NULL != nspace) {
free(nspace);
}
if (NULL != suri) {
free(suri);
}
CLOSE_THE_SOCKET(sd);
return PMIX_ERR_UNREACH;
}
@ -469,7 +481,7 @@ static pmix_status_t connect_to_peer(struct pmix_peer_t *peer,
if (NULL != pmix_client_globals.myserver->nptr->nspace) {
free(pmix_client_globals.myserver->nptr->nspace);
}
pmix_client_globals.myserver->nptr->nspace = nspace;
pmix_client_globals.myserver->nptr->nspace = strdup(nspace);
if (NULL != pmix_client_globals.myserver->info->pname.nspace) {
free(pmix_client_globals.myserver->info->pname.nspace);
@ -498,6 +510,7 @@ static pmix_status_t connect_to_peer(struct pmix_peer_t *peer,
pmix_ptl_base_send_handler, pmix_client_globals.myserver);
pmix_client_globals.myserver->send_ev_active = false;
free(nspace);
if (NULL != suri) {
free(suri);
}
@ -1169,9 +1182,11 @@ static pmix_status_t df_search(char *dirname, char *prefix,
(*nspace) = nsp;
*rank = rk;
closedir(cur_dirp);
free(suri);
free(newdir);
return PMIX_SUCCESS;
}
free(suri);
free(nsp);
}
}

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

@ -1821,7 +1821,17 @@ static void clct_complete(pmix_status_t status,
static void clct(int sd, short args, void *cbdata)
{
pmix_inventory_rollup_t *cd = (pmix_inventory_rollup_t*)cbdata;
pmix_status_t rc;
#if PMIX_HAVE_HWLOC
/* if we don't know our topology, we better get it now */
if (NULL == pmix_hwloc_topology) {
if (PMIX_SUCCESS != (rc = pmix_hwloc_get_topology(NULL, 0))) {
PMIX_ERROR_LOG(rc);
return;
}
}
#endif
/* we only have one source at this time */
cd->requests = 1;

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

@ -568,7 +568,7 @@ static pmix_status_t _satisfy_request(pmix_nspace_t *nptr, pmix_rank_t rank,
pmix_rank_info_t *iptr;
pmix_proc_t proc;
pmix_cb_t cb;
pmix_peer_t *peer;
pmix_peer_t *peer = NULL;
pmix_byte_object_t bo;
char *data = NULL;
size_t sz = 0;

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

@ -289,8 +289,8 @@ PMIX_EXPORT int PMIx_tool_init(pmix_proc_t *proc,
pmix_kval_t *kptr;
pmix_status_t rc;
char hostname[PMIX_MAX_NSLEN];
char *evar, *nspace;
pmix_rank_t rank;
char *evar, *nspace = NULL;
pmix_rank_t rank = PMIX_RANK_UNDEF;
bool gdsfound, do_not_connect = false;
bool nspace_given = false;
bool nspace_in_enviro = false;
@ -336,6 +336,15 @@ PMIX_EXPORT int PMIx_tool_init(pmix_proc_t *proc,
} else if (0 == strncmp(info[n].key, PMIX_TOOL_DO_NOT_CONNECT, PMIX_MAX_KEYLEN)) {
do_not_connect = PMIX_INFO_TRUE(&info[n]);
} else if (0 == strncmp(info[n].key, PMIX_TOOL_NSPACE, PMIX_MAX_KEYLEN)) {
if (NULL != nspace) {
/* cannot define it twice */
free(nspace);
if (gdsfound) {
PMIX_INFO_DESTRUCT(&ginfo);
}
PMIX_RELEASE_THREAD(&pmix_global_lock);
return PMIX_ERR_BAD_PARAM;
}
nspace = strdup(info[n].value.data.string);
nspace_given = true;
} else if (0 == strncmp(info[n].key, PMIX_TOOL_RANK, PMIX_MAX_KEYLEN)) {
@ -353,6 +362,12 @@ PMIX_EXPORT int PMIx_tool_init(pmix_proc_t *proc,
(!nspace_given && rank_given)) {
/* can't have one and not the other */
PMIX_ERROR_LOG(PMIX_ERR_BAD_PARAM);
if (NULL != nspace) {
free(nspace);
}
if (gdsfound) {
PMIX_INFO_DESTRUCT(&ginfo);
}
PMIX_RELEASE_THREAD(&pmix_global_lock);
return PMIX_ERR_BAD_PARAM;
}
@ -386,6 +401,12 @@ PMIX_EXPORT int PMIx_tool_init(pmix_proc_t *proc,
/* this is an error - we can't have one and not
* the other */
PMIX_ERROR_LOG(PMIX_ERR_BAD_PARAM);
if (NULL != nspace) {
free(nspace);
}
if (gdsfound) {
PMIX_INFO_DESTRUCT(&ginfo);
}
PMIX_RELEASE_THREAD(&pmix_global_lock);
return PMIX_ERR_BAD_PARAM;
}
@ -396,6 +417,12 @@ PMIX_EXPORT int PMIx_tool_init(pmix_proc_t *proc,
if (PMIX_PROC_LAUNCHER == ptype) {
if (PMIX_SUCCESS != (rc = pmix_server_initialize())) {
PMIX_ERROR_LOG(rc);
if (NULL != nspace) {
free(nspace);
}
if (gdsfound) {
PMIX_INFO_DESTRUCT(&ginfo);
}
PMIX_RELEASE_THREAD(&pmix_global_lock);
return rc;
}
@ -416,6 +443,12 @@ PMIX_EXPORT int PMIx_tool_init(pmix_proc_t *proc,
if (PMIX_SUCCESS != (rc = pmix_rte_init(ptype, info, ninfo,
pmix_tool_notify_recv))) {
PMIX_ERROR_LOG(rc);
if (NULL != nspace) {
free(nspace);
}
if (gdsfound) {
PMIX_INFO_DESTRUCT(&ginfo);
}
PMIX_RELEASE_THREAD(&pmix_global_lock);
return rc;
}
@ -440,18 +473,27 @@ PMIX_EXPORT int PMIx_tool_init(pmix_proc_t *proc,
pmix_pointer_array_init(&pmix_client_globals.peers, 1, INT_MAX, 1);
pmix_client_globals.myserver = PMIX_NEW(pmix_peer_t);
if (NULL == pmix_client_globals.myserver) {
if (gdsfound) {
PMIX_INFO_DESTRUCT(&ginfo);
}
PMIX_RELEASE_THREAD(&pmix_global_lock);
return PMIX_ERR_NOMEM;
}
pmix_client_globals.myserver->nptr = PMIX_NEW(pmix_nspace_t);
if (NULL == pmix_client_globals.myserver->nptr) {
PMIX_RELEASE(pmix_client_globals.myserver);
if (gdsfound) {
PMIX_INFO_DESTRUCT(&ginfo);
}
PMIX_RELEASE_THREAD(&pmix_global_lock);
return PMIX_ERR_NOMEM;
}
pmix_client_globals.myserver->info = PMIX_NEW(pmix_rank_info_t);
if (NULL == pmix_client_globals.myserver->info) {
PMIX_RELEASE(pmix_client_globals.myserver);
if (gdsfound) {
PMIX_INFO_DESTRUCT(&ginfo);
}
PMIX_RELEASE_THREAD(&pmix_global_lock);
return PMIX_ERR_NOMEM;
}
@ -466,6 +508,9 @@ PMIX_EXPORT int PMIx_tool_init(pmix_proc_t *proc,
/* setup a rank_info object for us */
pmix_globals.mypeer->info = PMIX_NEW(pmix_rank_info_t);
if (NULL == pmix_globals.mypeer->info) {
if (gdsfound) {
PMIX_INFO_DESTRUCT(&ginfo);
}
PMIX_RELEASE_THREAD(&pmix_global_lock);
return PMIX_ERR_NOMEM;
}
@ -476,6 +521,9 @@ PMIX_EXPORT int PMIx_tool_init(pmix_proc_t *proc,
/* select our bfrops compat module */
pmix_globals.mypeer->nptr->compat.bfrops = pmix_bfrops_base_assign_module(NULL);
if (NULL == pmix_globals.mypeer->nptr->compat.bfrops) {
if (gdsfound) {
PMIX_INFO_DESTRUCT(&ginfo);
}
PMIX_RELEASE_THREAD(&pmix_global_lock);
return PMIX_ERR_INIT;
}
@ -489,6 +537,9 @@ PMIX_EXPORT int PMIx_tool_init(pmix_proc_t *proc,
evar = getenv("PMIX_SECURITY_MODE");
pmix_globals.mypeer->nptr->compat.psec = pmix_psec_base_assign_module(evar);
if (NULL == pmix_globals.mypeer->nptr->compat.psec) {
if (gdsfound) {
PMIX_INFO_DESTRUCT(&ginfo);
}
PMIX_RELEASE_THREAD(&pmix_global_lock);
return PMIX_ERR_INIT;
}

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

@ -171,6 +171,7 @@ PMIX_CLASS_INSTANCE(pmix_locdat_t,
typedef struct {
pmix_object_t super;
mylock_t lock;
pmix_status_t status;
pmix_proc_t caller;
pmix_info_t *info;
size_t ninfo;
@ -232,6 +233,7 @@ static void opcbfunc(pmix_status_t status, void *cbdata)
{
myxfer_t *x = (myxfer_t*)cbdata;
x->status = status;
/* release the caller, if necessary */
if (NULL != x->cbfunc) {
x->cbfunc(PMIX_SUCCESS, x->cbdata);
@ -247,6 +249,7 @@ static void sacbfunc(pmix_status_t status,
myxfer_t *x = (myxfer_t*)provided_cbdata;
size_t n;
x->status = status;
if (NULL != info) {
x->ninfo = ninfo;
PMIX_INFO_CREATE(x->info, x->ninfo);
@ -261,6 +264,30 @@ static void sacbfunc(pmix_status_t status,
DEBUG_WAKEUP_THREAD(&x->lock);
}
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)
{
myxfer_t *x = (myxfer_t*)cbdata;
size_t n;
x->status = status;
if (NULL != info) {
x->ninfo = ninfo;
PMIX_INFO_CREATE(x->info, x->ninfo);
for (n=0; n < ninfo; n++) {
/* copy the data across */
PMIX_INFO_XFER(&x->info[n], &info[n]);
}
}
if (NULL != release_fn) {
release_fn(release_cbdata);
}
DEBUG_WAKEUP_THREAD(&x->lock);
}
int main(int argc, char **argv)
{
char **client_env=NULL;
@ -332,6 +359,37 @@ int main(int argc, char **argv)
/* setup the pub data, in case it is used */
PMIX_CONSTRUCT(&pubdata, pmix_list_t);
/* collect the inventory */
x = PMIX_NEW(myxfer_t);
rc = PMIx_server_collect_inventory(NULL, 0, infocbfunc, (void*)x);
if (PMIX_SUCCESS != rc) {
fprintf(stderr, "Collect inventory failed: %s\n", PMIx_Error_string(rc));
PMIX_RELEASE(x);
exit(1);
}
DEBUG_WAIT_THREAD(&x->lock);
if (PMIX_SUCCESS != x->status) {
fprintf(stderr, "Collect inventory failed: %s\n", PMIx_Error_string(x->status));
PMIX_RELEASE(x);
exit(1);
}
DEBUG_DESTRUCT_LOCK(&x->lock);
/* pass the info down */
DEBUG_CONSTRUCT_LOCK(&x->lock);
rc = PMIx_server_deliver_inventory(x->info, x->ninfo, NULL, 0, opcbfunc, x);
if (PMIX_SUCCESS != rc) {
fprintf(stderr, "Deliver inventory failed: %s\n", PMIx_Error_string(rc));
PMIX_RELEASE(x);
exit(1);
}
DEBUG_WAIT_THREAD(&x->lock);
if (PMIX_SUCCESS != x->status) {
fprintf(stderr, "Deliver inventory failed: %s\n", PMIx_Error_string(x->status));
PMIX_RELEASE(x);
exit(1);
}
PMIX_RELEASE(x);
/* setup to see sigchld on the forked tests */
PMIX_CONSTRUCT(&children, pmix_list_t);
event_assign(&handler, pmix_globals.evbase, SIGCHLD,

18
orte/mca/odls/base/odls_base_default_fns.c Обычный файл → Исполняемый файл
Просмотреть файл

@ -100,6 +100,7 @@
#include "orte/mca/odls/base/base.h"
#include "orte/mca/odls/base/odls_private.h"
#if 0
static void setup_cbfunc(int status,
opal_list_t *info,
void *provided_cbdata,
@ -131,8 +132,9 @@ static void setup_cbfunc(int status,
/* move to next stage */
ORTE_ACTIVATE_JOB_STATE(jdata, ORTE_JOB_STATE_SEND_LAUNCH_MSG);
}
#endif
/* IT IS CRITICAL THAT ANY CHANGE IN THE ORDER OF THE INFO PACKED IN
* THIS FUNCTION BE REFLECTED IN THE CONSTRUCT_CHILD_LIST PARSER BELOW
*/
@ -431,6 +433,7 @@ int orte_odls_base_default_get_add_procs_data(opal_buffer_t *buffer,
}
/* get any application prep info */
#if 0
if (NULL != opal_pmix.server_setup_application) {
/* we don't want to block here because it could
* take some indeterminate time to get the info */
@ -439,6 +442,7 @@ int orte_odls_base_default_get_add_procs_data(opal_buffer_t *buffer,
}
return rc;
}
#endif
/* move to next stage */
ORTE_ACTIVATE_JOB_STATE(jdata, ORTE_JOB_STATE_SEND_LAUNCH_MSG);
@ -453,11 +457,13 @@ static void fm_release(void *cbdata)
OBJ_RELEASE(bptr);
}
#if 0
static void ls_cbunc(int status, void *cbdata)
{
opal_pmix_lock_t *lock = (opal_pmix_lock_t*)cbdata;
OPAL_PMIX_WAKEUP_THREAD(lock);
}
#endif
int orte_odls_base_default_construct_child_list(opal_buffer_t *buffer,
orte_jobid_t *job)
@ -795,6 +801,7 @@ int orte_odls_base_default_construct_child_list(opal_buffer_t *buffer,
goto REPORT_ERROR;
}
#if 0
/* if we have local support setup info, then execute it here - we
* have to do so AFTER we register the nspace so the PMIx server
* has the nspace info it needs */
@ -808,6 +815,8 @@ int orte_odls_base_default_construct_child_list(opal_buffer_t *buffer,
} else {
lock.active = false; // we won't get a callback
}
#endif
lock.active = false; // we won't get a callback
/* if we have a file map, then we need to load it */
if (orte_get_attribute(&jdata->attributes, ORTE_JOB_FILE_MAPS, (void**)&bptr, OPAL_BUFFER)) {
@ -1058,10 +1067,11 @@ void orte_odls_base_spawn_proc(int fd, short sd, void *cbdata)
ORTE_NAME_PRINT(ORTE_PROC_MY_NAME),
ORTE_NAME_PRINT(&child->name));
if (15 < opal_output_get_verbosity(orte_odls_base_framework.framework_output)) {
// if (15 < opal_output_get_verbosity(orte_odls_base_framework.framework_output)) {
/* dump what is going to be exec'd */
opal_dss.dump(orte_odls_base_framework.framework_output, app, ORTE_APP_CONTEXT);
}
opal_dss.dump(0, app, ORTE_APP_CONTEXT);
// }
exit(1);
if (ORTE_SUCCESS != (rc = cd->fork_local(cd))) {
/* error message already output */

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

@ -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-2017 Intel, Inc. All rights reserved.
* Copyright (c) 2013-2018 Intel, Inc. All rights reserved.
* Copyright (c) 2014-2017 Mellanox Technologies, Inc.
* All rights reserved.
* Copyright (c) 2014-2015 Research Organization for Information Science
@ -248,9 +248,6 @@ int pmix_server_init(void)
OBJ_CONSTRUCT(&orte_pmix_server_globals.notifications, opal_list_t);
orte_pmix_server_globals.server = *ORTE_NAME_INVALID;
/* ensure the PMIx server uses the proper rendezvous directory */
opal_setenv("PMIX_SERVER_TMPDIR", orte_process_info.proc_session_dir, true, &environ);
OBJ_CONSTRUCT(&info, opal_list_t);
/* tell the server our temp directory */
kv = OBJ_NEW(opal_value_t);