1
1

Merge pull request #2223 from rhc54/topic/pmixfix

Repair event notification support and resync to PMIx master
Этот коммит содержится в:
rhc54 2016-10-13 19:26:44 -05:00 коммит произвёл GitHub
родитель 952ea06f15 6f65d0a173
Коммит ef0610dd56
25 изменённых файлов: 274 добавлений и 205 удалений

1
.gitignore поставляемый
Просмотреть файл

@ -371,6 +371,7 @@ orte/test/mpi/parallel_r8
orte/test/mpi/parallel_r64
orte/test/mpi/parallel_w8
orte/test/mpi/parallel_w64
orte/test/mpi/pmix
orte/test/mpi/pubsub
orte/test/mpi/read_write
orte/test/mpi/reduce-hang

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

@ -49,7 +49,7 @@ AC_DEFUN([MCA_opal_pmix_pmix3x_CONFIG],[
opal_pmix_pmix3x_sm_flag=--disable-dstore
fi
opal_pmix_pmix3x_args="$opal_pmix_pmix3x_sm_flag --without-tests-examples --disable-visibility --enable-embedded-libevent --with-libevent-header=\\\"opal/mca/event/$opal_event_base_include\\\" --enable-embedded-hwloc --with-hwloc-header=\\\"$opal_hwloc_base_include\\\""
opal_pmix_pmix3x_args="--with-pmix-symbol-rename=OPAL_MCA_PMIX3X_ $opal_pmix_pmix3x_sm_flag --without-tests-examples --disable-visibility --enable-embedded-libevent --with-libevent-header=\\\"opal/mca/event/$opal_event_base_include\\\" --enable-embedded-hwloc --with-hwloc-header=\\\"$opal_hwloc_base_include\\\""
AS_IF([test "$enable_debug" = "yes"],
[opal_pmix_pmix3x_args="--enable-debug $opal_pmix_pmix3x_args"
CFLAGS="$OPAL_CFLAGS_BEFORE_PICKY $OPAL_VISIBILITY_CFLAGS -g"],

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

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

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

@ -17,7 +17,7 @@ dnl Copyright (c) 2009 Los Alamos National Security, LLC. All rights
dnl reserved.
dnl Copyright (c) 2009-2011 Oak Ridge National Labs. All rights reserved.
dnl Copyright (c) 2011-2013 NVIDIA Corporation. All rights reserved.
dnl Copyright (c) 2013-2016 Intel, Inc. All rights reserved
dnl Copyright (c) 2013-2016 Intel, Inc. All rights reserved.
dnl Copyright (c) 2015-2016 Research Organization for Information Science
dnl and Technology (RIST). All rights reserved.
dnl Copyright (c) 2016 Mellanox Technologies, Inc.

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

@ -1,5 +1,7 @@
/*
* Copyright (c) 2013-2016 Intel, Inc. All rights reserved
* Copyright (c) 2016 Research Organization for Information Science
* and Technology (RIST). All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are
@ -48,7 +50,6 @@
/* Structure and constant definitions */
#include <pmix_common.h>
#include <pmix_rename.h>
#if defined(c_plusplus) || defined(__cplusplus)
extern "C" {

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

@ -59,6 +59,7 @@
#include <sys/time.h> /* for struct timeval */
#include <unistd.h> /* for uid_t and gid_t */
#include <sys/types.h> /* for uid_t and gid_t */
#include <pmix_rename.h>
#include <pmix_version.h>
#if defined(c_plusplus) || defined(__cplusplus)

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

@ -1,5 +1,7 @@
/*
* Copyright (c) 2016 Intel, Inc. All rights reserved
* Copyright (c) 2016 Research Organization for Information Science
* and Technology (RIST). All rights reserved.
* $COPYRIGHT$
*
* Additional copyrights may follow
@ -10,62 +12,63 @@
#ifndef PMIX_RENAME_H
#define PMIX_RENAME_H
#define @PMIX_RENAME@PMIx_Init PMIx_Init
#define @PMIX_RENAME@PMIx_Finalize PMIx_Finalize
#define @PMIX_RENAME@PMIx_Abort PMIx_Abort
#define @PMIX_RENAME@PMIx_Put PMIx_Put
#define @PMIX_RENAME@PMIx_Commit PMIx_Commit
#define @PMIX_RENAME@PMIx_Fence PMIx_Fence
#define @PMIX_RENAME@PMIx_Fence_nb PMIx_Fence_nb
#define @PMIX_RENAME@PMIx_Get PMIx_Get
#define @PMIX_RENAME@PMIx_Get_nb PMIx_Get_nb
#define @PMIX_RENAME@PMIx_Publish PMIx_Publish
#define @PMIX_RENAME@PMIx_Publish_nb PMIx_Publish_nb
#define @PMIX_RENAME@PMIx_Lookup PMIx_Lookup
#define @PMIX_RENAME@PMIx_Lookup_nb PMIx_Lookup_nb
#define @PMIX_RENAME@PMIx_Unpublish PMIx_Unpublish
#define @PMIX_RENAME@PMIx_Unpublish_nb PMIx_Unpublish_nb
#define @PMIX_RENAME@PMIx_Spawn PMIx_Spawn
#define @PMIX_RENAME@PMIx_Spawn_nb PMIx_Spawn_nb
#define @PMIX_RENAME@PMIx_Connect PMIx_Connect
#define @PMIX_RENAME@PMIx_Connect_nb PMIx_Connect_nb
#define @PMIX_RENAME@PMIx_Disconnect PMIx_Disconnect
#define @PMIX_RENAME@PMIx_Disconnect_nb PMIx_Disconnect_nb
#define @PMIX_RENAME@PMIx_Resolve_peers PMIx_Resolve_peers
#define @PMIX_RENAME@PMIx_Resolve_nodes PMIx_Resolve_nodes
#define @PMIX_RENAME@PMIx_Query_info_nb PMIx_Query_info_nb
#define @PMIX_RENAME@PMIx_Log_nb PMIx_Log_nb
#define PMIx_Init @PMIX_RENAME@PMIx_Init
#define PMIx_Initialized @PMIX_RENAME@PMIx_Initialized
#define PMIx_Finalize @PMIX_RENAME@PMIx_Finalize
#define PMIx_Abort @PMIX_RENAME@PMIx_Abort
#define PMIx_Put @PMIX_RENAME@PMIx_Put
#define PMIx_Commit @PMIX_RENAME@PMIx_Commit
#define PMIx_Fence @PMIX_RENAME@PMIx_Fence
#define PMIx_Fence_nb @PMIX_RENAME@PMIx_Fence_nb
#define PMIx_Get @PMIX_RENAME@PMIx_Get
#define PMIx_Get_nb @PMIX_RENAME@PMIx_Get_nb
#define PMIx_Publish @PMIX_RENAME@PMIx_Publish
#define PMIx_Publish_nb @PMIX_RENAME@PMIx_Publish_nb
#define PMIx_Lookup @PMIX_RENAME@PMIx_Lookup
#define PMIx_Lookup_nb @PMIX_RENAME@PMIx_Lookup_nb
#define PMIx_Unpublish @PMIX_RENAME@PMIx_Unpublish
#define PMIx_Unpublish_nb @PMIX_RENAME@PMIx_Unpublish_nb
#define PMIx_Spawn @PMIX_RENAME@PMIx_Spawn
#define PMIx_Spawn_nb @PMIX_RENAME@PMIx_Spawn_nb
#define PMIx_Connect @PMIX_RENAME@PMIx_Connect
#define PMIx_Connect_nb @PMIX_RENAME@PMIx_Connect_nb
#define PMIx_Disconnect @PMIX_RENAME@PMIx_Disconnect
#define PMIx_Disconnect_nb @PMIX_RENAME@PMIx_Disconnect_nb
#define PMIx_Resolve_peers @PMIX_RENAME@PMIx_Resolve_peers
#define PMIx_Resolve_nodes @PMIX_RENAME@PMIx_Resolve_nodes
#define PMIx_Query_info_nb @PMIX_RENAME@PMIx_Query_info_nb
#define PMIx_Log_nb @PMIX_RENAME@PMIx_Log_nb
#define @PMIX_RENAME@PMIx_server_init PMIx_server_init
#define @PMIX_RENAME@PMIx_server_finalize PMIx_server_finalize
#define @PMIX_RENAME@PMIx_generate_regex PMIx_generate_regex
#define @PMIX_RENAME@PMIx_generate_ppn PMIx_generate_ppn
#define @PMIX_RENAME@PMIx_server_register_nspace PMIx_server_register_nspace
#define @PMIX_RENAME@PMIx_server_deregister_nspace PMIx_server_deregister_nspace
#define @PMIX_RENAME@PMIx_server_register_client PMIx_server_register_client
#define @PMIX_RENAME@PMIx_server_deregister_client PMIx_server_deregister_client
#define @PMIX_RENAME@PMIx_server_setup_fork PMIx_server_setup_fork
#define @PMIX_RENAME@PMIx_server_dmodex_request PMIx_server_dmodex_request
#define PMIx_server_init @PMIX_RENAME@PMIx_server_init
#define PMIx_server_finalize @PMIX_RENAME@PMIx_server_finalize
#define PMIx_generate_regex @PMIX_RENAME@PMIx_generate_regex
#define PMIx_generate_ppn @PMIX_RENAME@PMIx_generate_ppn
#define PMIx_server_register_nspace @PMIX_RENAME@PMIx_server_register_nspace
#define PMIx_server_deregister_nspace @PMIX_RENAME@PMIx_server_deregister_nspace
#define PMIx_server_register_client @PMIX_RENAME@PMIx_server_register_client
#define PMIx_server_deregister_client @PMIX_RENAME@PMIx_server_deregister_client
#define PMIx_server_setup_fork @PMIX_RENAME@PMIx_server_setup_fork
#define PMIx_server_dmodex_request @PMIX_RENAME@PMIx_server_dmodex_request
#define @PMIX_RENAME@PMIx_tool_init PMIx_tool_init
#define @PMIX_RENAME@PMIx_tool_finalize PMIx_tool_finalize
#define PMIx_tool_init @PMIX_RENAME@PMIx_tool_init
#define PMIx_tool_finalize @PMIX_RENAME@PMIx_tool_finalize
#define @PMIX_RENAME@PMIx_Register_event_handler PMIx_Register_event_handler
#define @PMIX_RENAME@PMIx_Deregister_event_handler PMIx_Deregister_event_handler
#define @PMIX_RENAME@PMIx_Notify_event PMIx_Notify_event
#define @PMIX_RENAME@PMIx_Error_string PMIx_Error_string
#define @PMIX_RENAME@PMIx_Proc_state_string PMIx_Proc_state_string
#define @PMIX_RENAME@PMIx_Persistence_string PMIx_Persistence_string
#define @PMIX_RENAME@PMIx_Data_range_string PMIx_Data_range_string
#define @PMIX_RENAME@PMIx_Info_directives_string PMIx_Info_directives_string
#define @PMIX_RENAME@PMIx_Data_type_string PMIx_Data_type_string
#define @PMIX_RENAME@PMIx_Get_version PMIx_Get_version
#define @PMIX_RENAME@PMIx_Store_internal PMIx_Store_internal
#define PMIx_Register_event_handler @PMIX_RENAME@PMIx_Register_event_handler
#define PMIx_Deregister_event_handler @PMIX_RENAME@PMIx_Deregister_event_handler
#define PMIx_Notify_event @PMIX_RENAME@PMIx_Notify_event
#define PMIx_Error_string @PMIX_RENAME@PMIx_Error_string
#define PMIx_Proc_state_string @PMIX_RENAME@PMIx_Proc_state_string
#define PMIx_Persistence_string @PMIX_RENAME@PMIx_Persistence_string
#define PMIx_Data_range_string @PMIX_RENAME@PMIx_Data_range_string
#define PMIx_Info_directives_string @PMIX_RENAME@PMIx_Info_directives_string
#define PMIx_Data_type_string @PMIX_RENAME@PMIx_Data_type_string
#define PMIx_Get_version @PMIX_RENAME@PMIx_Get_version
#define PMIx_Store_internal @PMIX_RENAME@PMIx_Store_internal
#define @PMIX_RENAME@pmix_value_load pmix_value_load
#define @PMIX_RENAME@pmix_value_xfer pmix_value_xfer
#define @PMIX_RENAME@pmix_globals pmix_globals
#define @PMIX_RENAME@pmix_output pmix_output
#define @PMIX_RENAME@pmix_output_verbose pmix_output_verbose
#define pmix_value_load @PMIX_RENAME@pmix_value_load
#define pmix_value_xfer @PMIX_RENAME@pmix_value_xfer
#define pmix_globals @PMIX_RENAME@pmix_globals
#define pmix_output @PMIX_RENAME@pmix_output
#define pmix_output_verbose @PMIX_RENAME@pmix_output_verbose
#endif

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

@ -351,17 +351,6 @@ PMIX_EXPORT pmix_status_t PMIx_Init(pmix_proc_t *proc,
}
#endif /* PMIX_ENABLE_DSTORE */
if (!pmix_globals.external_evbase) {
/* tell the event library we need thread support */
pmix_event_use_threads();
/* create an event base and progress thread for us */
if (NULL == (pmix_globals.evbase = pmix_progress_thread_init(NULL))) {
return -1;
}
}
/* setup an object to track server connection */
PMIX_CONSTRUCT(&cb, pmix_cb_t);
cb.active = true;
@ -882,7 +871,6 @@ static pmix_status_t send_connect_ack(int sd)
pmix_usock_hdr_t hdr;
size_t sdsize=0, csize=0;
char *cred = NULL;
char *bfrop;
char *sec;
pmix_output_verbose(2, pmix_globals.debug_output,

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

@ -1,7 +1,7 @@
/*
* Copyright (c) 2016 Mellanox Technologies, Inc.
* All rights reserved.
* Copyright (c) 2016 Intel, Inc. All rights reserved
* Copyright (c) 2016 Intel, Inc. All rights reserved.
* $COPYRIGHT$
*
* Additional copyrights may follow

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

@ -617,7 +617,10 @@ int _esh_init(pmix_info_t info[], size_t ninfo)
*
* PMIX_DSTPATH has higher priority than PMIX_SERVER_TMPDIR
*/
dstor_tmpdir = (char*)info[n].value.data.ptr;
if (NULL != dstor_tmpdir) {
free(dstor_tmpdir);
}
dstor_tmpdir = strdup((char*)info[n].value.data.string);
continue;
}
if (0 == strcmp(PMIX_SERVER_TMPDIR, info[n].key)) {
@ -1002,7 +1005,7 @@ int _esh_fetch(const char *nspace, pmix_rank_t rank, const char *key, pmix_value
goto done;
} else {
char ckey[PMIX_MAX_KEYLEN+1] = {0};
strncpy(ckey, (const char *)addr, PMIX_MAX_KEYLEN+1);
strncpy(ckey, (const char *)addr, PMIX_MAX_KEYLEN);
size_t size;
memcpy(&size, addr + PMIX_MAX_KEYLEN + 1, sizeof(size_t));
PMIX_OUTPUT_VERBOSE((10, pmix_globals.debug_output,

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

@ -2,7 +2,6 @@
* Copyright (c) 2015-2016 Mellanox Technologies, Inc.
* All rights reserved.
* Copyright (c) 2016 Intel, Inc. All rights reserved.
*
* $COPYRIGHT$
*
* Additional copyrights may follow

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

@ -117,13 +117,19 @@ PMIX_CLASS_DECLARATION(pmix_event_chain_t);
* affected, plus any additional info provided by the server */
void pmix_invoke_local_event_hdlr(pmix_event_chain_t *chain);
#define PMIX_REPORT_EVENT(e) \
#define PMIX_REPORT_EVENT(e, f) \
do { \
pmix_event_chain_t *_ch; \
_ch = PMIX_NEW(pmix_event_chain_t); \
_ch->status = (e); \
_ch->ninfo = 1; \
_ch->final_cbfunc = (f); \
_ch->final_cbdata = _ch; \
PMIX_INFO_CREATE(_ch->info, _ch->ninfo); \
PMIX_INFO_LOAD(&_ch->info[0], \
PMIX_EVENT_RETURN_OBJECT, \
NULL, PMIX_POINTER); \
pmix_invoke_local_event_hdlr(_ch); \
PMIX_RELEASE(_ch); \
} while(0)

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

@ -93,6 +93,7 @@ static pmix_status_t notify_server_of_event(pmix_status_t status,
pmix_cmd_t cmd = PMIX_NOTIFY_CMD;
pmix_cb_t *cb;
pmix_event_chain_t *chain;
size_t n;
if (!pmix_globals.connected) {
return PMIX_ERR_UNREACH;
@ -135,9 +136,18 @@ static pmix_status_t notify_server_of_event(pmix_status_t status,
chain->status = status;
(void)strncpy(chain->source.nspace, pmix_globals.myid.nspace, PMIX_MAX_NSLEN);
chain->source.rank = pmix_globals.myid.rank;
if (0 < ninfo) {
/* we always leave space for a callback object */
chain->ninfo = ninfo + 1;
PMIX_INFO_CREATE(chain->info, chain->ninfo);
if (0 < ninfo) {
/* need to copy the info */
for (n=0; n < ninfo; n++) {
PMIX_INFO_XFER(&chain->info[n], &info[n]);
}
}
/* now put the callback object tag in the last element */
PMIX_INFO_LOAD(&chain->info[ninfo], PMIX_EVENT_RETURN_OBJECT, NULL, PMIX_POINTER);
/* create a callback object as we need to pass it to the
* recv routine so we know which callback to use when
@ -295,6 +305,7 @@ static void progress_local_event_hdlr(pmix_status_t status,
/* we still have to call their final callback */
if (NULL != chain->final_cbfunc) {
chain->final_cbfunc(PMIX_SUCCESS, chain->final_cbdata);
return;
}
/* maintain acctng */
PMIX_RELEASE(chain);
@ -395,8 +406,7 @@ void pmix_invoke_local_event_hdlr(pmix_event_chain_t *chain)
/* add any cbobject - the info struct for it is at the end */
chain->info[chain->ninfo-1].value.data.ptr = def->cbobject;
pmix_output_verbose(2, pmix_globals.debug_output,
"[%s:%d] CALLING DEFAULT EVHDLR",
pmix_globals.myid.nspace, pmix_globals.myid.rank);
"[%s:%d] CALLING DEFAULT EVHDLR", __FILE__, __LINE__);
def->evhdlr(def->index,
chain->status, &chain->source,
chain->info, chain->ninfo,

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

@ -3,8 +3,8 @@
# Copyright (c) 2009-2015 Cisco Systems, Inc. All rights reserved.
# Copyright (c) 2016 Research Organization for Information Science
# and Technology (RIST). All rights reserved.
# Copyright (c) 2016 Intel, Inc. All rights reserved.
#
# Copyright (c) 2016 Intel, Inc. All rights reserved.
# $COPYRIGHT$
#
# Additional copyrights may follow

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

@ -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-2016 Intel, Inc. All rights reserved.
* Copyright (c) 2016 Mellanox Technologies, Inc.
* All rights reserved.
*

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

@ -1,7 +1,7 @@
/* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil -*- */
/*
* Copyright (c) 2007-2008 Cisco Systems, Inc. All rights reserved.
* Copyright (c) 2015-2016 Intel, Inc. All rights reserved.
* Copyright (c) 2015-2016 Intel, Inc. All rights reserved.
*
* Copyright (c) 2015 Research Organization for Information Science
* and Technology (RIST). All rights reserved.

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

@ -1188,8 +1188,8 @@ void pmix_server_deregister_events(pmix_peer_t *peer,
/* unpack the number of codes */
cnt=1;
if (PMIX_SUCCESS != (rc = pmix_bfrop.unpack(buf, &ncodes, &cnt, PMIX_SIZE))) {
PMIX_ERROR_LOG(rc);
return;
/* it is okay if there aren't any - equivalent to a wildcard */
ncodes = 0;
}
/* unpack the array of codes */
if (0 < ncodes) {

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

@ -1,5 +1,5 @@
/*
* Copyright (c) 2014-2016 Intel, Inc. All rights reserved.
* Copyright (c) 2014-2016 Intel, Inc. All rights reserved.
* Copyright (c) 2014 Artem Y. Polyakov <artpol84@gmail.com>.
* All rights reserved.
* Copyright (c) 2015 Research Organization for Information Science

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

@ -48,11 +48,19 @@
static uint32_t current_tag = 1; // 0 is reserved for system purposes
static void _notify_complete(pmix_status_t status, void *cbdata)
{
pmix_event_chain_t *chain = (pmix_event_chain_t*)cbdata;
PMIX_RELEASE(chain);
}
static void lost_connection(pmix_peer_t *peer, pmix_status_t err)
{
pmix_server_trkr_t *trk;
pmix_rank_info_t *rinfo, *rnext;
pmix_trkr_caddy_t *tcd;
pmix_regevents_info_t *reginfoptr, *regnext;
pmix_peer_events_info_t *pr, *pnext;
/* stop all events */
if (peer->recv_ev_active) {
@ -100,15 +108,29 @@ static void lost_connection(pmix_peer_t *peer, pmix_status_t err)
}
}
}
/* remove this proc from the list of ranks for this nspace */
pmix_list_remove_item(&(peer->info->nptr->server->ranks), &(peer->info->super));
/* reduce the number of local procs */
--peer->info->nptr->server->nlocalprocs;
/* now decrease the refcount - might actually free the object */
PMIX_RELEASE(peer->info);
/* do some cleanup as the client has left us */
pmix_pointer_array_set_item(&pmix_server_globals.clients,
peer->index, NULL);
/* remove this proc from the list of ranks for this nspace */
pmix_list_remove_item(&(peer->info->nptr->server->ranks), &(peer->info->super));
/* reduce the number of local procs */
--peer->info->nptr->server->nlocalprocs;
/* now decrease the refcount - might actually free the object */
PMIX_RELEASE(peer->info);
/* remove this client from our array */
pmix_pointer_array_set_item(&pmix_server_globals.clients,
peer->index, NULL);
/* cleanup any remaining events they have registered for */
PMIX_LIST_FOREACH_SAFE(reginfoptr, regnext, &pmix_server_globals.events, pmix_regevents_info_t) {
PMIX_LIST_FOREACH_SAFE(pr, pnext, &reginfoptr->peers, pmix_peer_events_info_t) {
if (peer == pr->peer) {
pmix_list_remove_item(&reginfoptr->peers, &pr->super);
PMIX_RELEASE(pr);
if (0 == pmix_list_get_size(&reginfoptr->peers)) {
pmix_list_remove_item(&pmix_server_globals.events, &reginfoptr->super);
PMIX_RELEASE(reginfoptr);
break;
}
}
}
}
PMIX_RELEASE(peer);
} else {
/* if I am a client, there is only
@ -117,7 +139,7 @@ static void lost_connection(pmix_peer_t *peer, pmix_status_t err)
/* set the public error status */
err = PMIX_ERR_LOST_CONNECTION_TO_SERVER;
}
PMIX_REPORT_EVENT(err);
PMIX_REPORT_EVENT(err, _notify_complete);
}
static pmix_status_t send_bytes(int sd, char **buf, size_t *remain)
@ -535,5 +557,5 @@ void pmix_usock_process_msg(int fd, short flags, void *cbdata)
/* we get here if no matching recv was found - this is an error */
pmix_output(0, "UNEXPECTED MESSAGE tag =%d", msg->hdr.tag);
PMIX_RELEASE(msg);
PMIX_REPORT_EVENT(PMIX_ERROR);
PMIX_REPORT_EVENT(PMIX_ERROR, _notify_complete);
}

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

@ -611,6 +611,7 @@ char *pmix_util_keyval_yytext;
* All rights reserved.
* Copyright (c) 2012 Los Alamos National Security, LLC. All rights
* reserved.
* Copyright (c) 2016 Intel, Inc. All rights reserved.
* $COPYRIGHT$
*
* Additional copyrights may follow

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

@ -11,7 +11,9 @@
* All rights reserved.
* Copyright (c) 2007-2011 Cisco Systems, Inc. All rights reserved.
* Copyright (c) 2010 Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2015 Intel, Inc. All rights reserved.
* Copyright (c) 2015-2016 Intel, Inc. All rights reserved.
* Copyright (c) 2016 Research Organization for Information Science
* and Technology (RIST). All rights reserved.
* $COPYRIGHT$
*
* Additional copyrights may follow
@ -71,6 +73,7 @@
#include <stdarg.h>
#endif
#include "pmix_rename.h"
#include "src/class/pmix_object.h"
BEGIN_C_DECLS

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

@ -391,6 +391,7 @@ void pmix3x_event_hdlr(size_t evhdlr_registration_id,
opal_output_verbose(2, opal_pmix_base_framework.framework_output,
"%s CONVERTED STATUS %d TO STATUS %d",
OPAL_NAME_PRINT(OPAL_PROC_MY_NAME), status, cd->status);
/* convert the nspace/rank to an opal_process_name_t */
if (NULL == source) {
cd->pname.jobid = OPAL_NAME_INVALID->jobid;
@ -427,9 +428,10 @@ void pmix3x_event_hdlr(size_t evhdlr_registration_id,
event_active(&cd->ev, EV_WRITE, 1);
/* we don't need any of the data they provided,
* so let them go */
* so let them go - also tell them that we will handle
* everything from this point forward */
if (NULL != cbfunc) {
cbfunc(PMIX_SUCCESS, NULL, 0, NULL, NULL, cbdata);
cbfunc(PMIX_EVENT_ACTION_COMPLETE, NULL, 0, NULL, NULL, cbdata);
}
}
@ -1045,7 +1047,7 @@ static void _reg_hdlr(int sd, short args, void *cbdata)
def->handler = cd->evhandler;
def->index = mca_pmix_pmix3x_component.evindex;
if (prepend) {
opal_output_verbose(2, opal_pmix_base_framework.framework_output,
opal_output_verbose(2, opal_pmix_base_framework.framework_output,
"%s PREPENDING TO DEFAULT EVENTS",
OPAL_NAME_PRINT(OPAL_PROC_MY_NAME));
opal_list_prepend(&mca_pmix_pmix3x_component.default_events, &def->super);

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

@ -1,6 +1,7 @@
/*
* Copyright (c) 2015 Mellanox Technologies, Inc.
* All rights reserved.
* Copyright (c) 2016 Intel, Inc. All rights reserved.
* $COPYRIGHT$
*
* Additional copyrights may follow
@ -17,8 +18,10 @@
#include <stdio.h>
#include <unistd.h>
#include <mpi.h>
#include <time.h>
#include <sys/time.h>
#include "opal/class/opal_list.h"
#include "opal/mca/pmix/pmix.h"
#include "ompi/proc/proc.h"
@ -27,55 +30,72 @@
if (flag) { \
fprintf(stderr, format, args); \
} \
if (opal_pmix.initialized) { \
opal_pmix.finalize(); \
} \
MPI_Finalize(); \
return rc; \
} while(0);
inline double get_timestamp(void)
static int my_rank;
static volatile bool waiting = true;
static double get_timestamp(void)
{
struct timeval tv;
gettimeofday(&tv, NULL);
return ((tv.tv_sec) + (tv.tv_usec) * 1.0e-6);
}
static void evhandler(int status,
const opal_process_name_t *source,
opal_list_t *info, opal_list_t *results,
opal_pmix_notification_complete_fn_t cbfunc,
void *cbdata)
{
fprintf(stderr, "%d: received notification status %d\n", my_rank, status);
if (NULL != cbfunc) {
cbfunc(OPAL_ERR_HANDLERS_COMPLETE, NULL, NULL, NULL, cbdata);
}
waiting = false;
}
int main(int argc, char* argv[])
{
int rc, my_rank;
int rc;
int recv_data;
size_t i, numprocs;
ompi_proc_t **procs, *thisproc;
double t0, t1, t2, t3, t4, t5, t6;
int *ptr;
struct timespec tp;
opal_list_t info;
opal_value_t *kv;
MPI_Init(&argc, &argv);
MPI_Comm_rank(MPI_COMM_WORLD, &my_rank);
if (NULL != opal_pmix.init) {
rc = opal_pmix.init();
if (OPAL_SUCCESS != rc) {
DO_FINALIZE(rc, 1, "[%d] pmix_init failed.\n", my_rank);
}
}
/* register an event */
OBJ_CONSTRUCT(&info, opal_list_t);
kv = OBJ_NEW(opal_value_t);
kv->key = strdup(OPAL_PMIX_EVENT_ORDER_PREPEND);
opal_list_append(&info, &kv->super);
opal_pmix.register_evhandler(NULL, &info, evhandler, NULL, NULL);
int data = my_rank;
t0 = get_timestamp();
OPAL_MODEX_SEND_VALUE(rc, PMIX_SYNC_REQD, PMIX_GLOBAL,
"MY_RANK", &data, OPAL_INT);
OPAL_MODEX_SEND_VALUE(rc, OPAL_PMIX_GLOBAL, "MY_RANK", &data, OPAL_INT);
t1 = get_timestamp();
if (OPAL_SUCCESS != rc) {
DO_FINALIZE(rc, 1, "[%d] OPAL_MODEX_SEND_STRING failed.\n", my_rank);
}
t2 = get_timestamp();
OPAL_FENCE(NULL, 0, NULL, NULL);
opal_pmix.commit();
opal_pmix.fence(NULL, 1);
t3 = get_timestamp();
procs = ompi_proc_world ( &numprocs );
ptr = &recv_data;
t4 = get_timestamp();
for ( i = 0; i < numprocs; i++ ) {
thisproc = procs[i];
OPAL_MODEX_RECV_VALUE(rc, "MY_RANK", &thisproc->super, (void**)&ptr, OPAL_INT);
OPAL_MODEX_RECV_VALUE(rc, "MY_RANK", &thisproc->super.proc_name, (void**)&ptr, OPAL_INT);
/* check return status and received data */
if (OPAL_SUCCESS != rc || i != recv_data) {
rc = OPAL_ERROR;
@ -88,8 +108,6 @@ int main(int argc, char* argv[])
opal_pmix.fence(NULL, 0);
t6 = get_timestamp();
free(procs);
fprintf(stderr, "[%d] Test passed.\n", my_rank);
fprintf(stderr, "[%d] \"MODEX_SEND\" %f\n", my_rank, t1-t0);
fprintf(stderr, "[%d] \"FENCE\" %f\n", my_rank, t3-t2);
@ -97,5 +115,16 @@ int main(int argc, char* argv[])
fprintf(stderr, "[%d] \"BARRIER\" %f\n", my_rank, t6-t5);
fprintf(stderr, "[%d] \"TOTAL\" %f\n", my_rank, t6-t0);
fprintf(stderr, "[%d] Pid %d waiting for notification\n", my_rank, (int)getpid());
/* now wait for notification of someone failing */
tp.tv_sec = 0;
tp.tv_nsec = 100000;
waiting = true;
while (waiting) {
nanosleep(&tp, NULL);
}
free(procs);
DO_FINALIZE(0, 0, 0, 0);
}