Skip to content

Commit

Permalink
Merge pull request #4469 from rhc54/topic/pmup
Browse files Browse the repository at this point in the history
Sync with PMIx master
  • Loading branch information
Ralph Castain authored Nov 8, 2017
2 parents 0c3aa44 + d4b83cc commit 4b5be96
Show file tree
Hide file tree
Showing 22 changed files with 420 additions and 122 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -319,6 +319,7 @@ opal/mca/pmix/pmix*/pmix/src/mca/pinstalldirs/config/pinstall_dirs.h
opal/mca/pmix/pmix*/pmix/config/autogen_found_items.m4
opal/mca/pmix/pmix*/pmix/src/include/pmix_config.h
opal/mca/pmix/pmix*/pmix/src/include/pmix_config.h.in
opal/mca/pmix/pmix*/pmix/include/pmix_common.h
opal/mca/pmix/pmix*/pmix/include/pmix_rename.h
opal/mca/pmix/pmix*/pmix/include/pmix_version.h
opal/mca/pmix/pmix*/pmix/src/util/keyval/keyval_lex.c
Expand Down
4 changes: 2 additions & 2 deletions opal/mca/pmix/pmix3x/pmix/VERSION
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ greek=
# command, or with the date (if "git describe" fails) in the form of
# "date<date>".

repo_rev=git877b4d8
repo_rev=git9137d98

# If tarball_version is not empty, it is used as the version string in
# the tarball filename, regardless of all other versions listed in
Expand All @@ -44,7 +44,7 @@ tarball_version=

# The date when this release was created

date="Oct 30, 2017"
date="Nov 07, 2017"

# The shared library version of each of PMIx's public libraries.
# These versions are maintained in accordance with the "Library
Expand Down
2 changes: 2 additions & 0 deletions opal/mca/pmix/pmix3x/pmix/config/pmix.m4
Original file line number Diff line number Diff line change
Expand Up @@ -819,6 +819,8 @@ AC_DEFUN([PMIX_SETUP_CORE],[

pmix_show_subtitle "Final output"

AC_CONFIG_HEADERS(pmix_config_prefix[include/pmix_common.h])

AC_CONFIG_FILES(
pmix_config_prefix[Makefile]
pmix_config_prefix[config/Makefile]
Expand Down
3 changes: 1 addition & 2 deletions opal/mca/pmix/pmix3x/pmix/examples/debugger.c
Original file line number Diff line number Diff line change
Expand Up @@ -232,7 +232,7 @@ int main(int argc, char **argv)
pmix_info_t *info;
pmix_app_t *app;
size_t ninfo, napps;
char *tdir, *filename, *sdir, *str, *nspace = NULL;
char *nspace = NULL;
char appspace[PMIX_MAX_NSLEN+1];
int i;
pmix_query_t *query;
Expand All @@ -241,7 +241,6 @@ int main(int argc, char **argv)
bool cospawn = false, stop_on_exec = false;
char cwd[1024];
pmix_status_t code = PMIX_ERR_JOB_TERMINATED;
char hostname[1024];
mylock_t mylock;

/* Process any arguments we were given */
Expand Down
2 changes: 1 addition & 1 deletion opal/mca/pmix/pmix3x/pmix/include/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@
if WANT_PRIMARY_HEADERS
include_HEADERS = \
pmix.h \
pmix_common.h \
pmix_server.h \
pmix_tool.h

Expand All @@ -24,6 +23,7 @@ include_HEADERS += \
endif

nodist_include_HEADERS = \
pmix_common.h \
pmix_version.h \
pmix_rename.h

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,12 +61,16 @@
#include <unistd.h> /* for uid_t and gid_t */
#include <sys/types.h> /* for uid_t and gid_t */

#ifdef PMIX_HAVE_VISIBILITY
/* Whether C compiler supports -fvisibility */
#undef PMIX_HAVE_VISIBILITY

#if PMIX_HAVE_VISIBILITY == 1
#define PMIX_EXPORT __attribute__((__visibility__("default")))
#else
#define PMIX_EXPORT
#endif


#include <pmix_rename.h>
#include <pmix_version.h>

Expand Down
31 changes: 19 additions & 12 deletions opal/mca/pmix/pmix3x/pmix/src/client/pmix_client.c
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ static void pmix_client_notify_recv(struct pmix_peer_t *peer,
pmix_event_chain_t *chain;
size_t ninfo;

pmix_output_verbose(2, pmix_globals.debug_output,
pmix_output_verbose(2, pmix_client_globals.base_output,
"pmix:client_notify_recv - processing event");

/* a zero-byte buffer indicates that this recv is being
Expand Down Expand Up @@ -182,7 +182,7 @@ static void pmix_client_notify_recv(struct pmix_peer_t *peer,
/* now put the callback object tag in the last element */
PMIX_INFO_LOAD(&chain->info[ninfo], PMIX_EVENT_RETURN_OBJECT, NULL, PMIX_POINTER);

pmix_output_verbose(2, pmix_globals.debug_output,
pmix_output_verbose(2, pmix_client_globals.base_output,
"[%s:%d] pmix:client_notify_recv - processing event %d, calling errhandler",
pmix_globals.myid.nspace, pmix_globals.myid.rank, chain->status);

Expand All @@ -191,7 +191,7 @@ static void pmix_client_notify_recv(struct pmix_peer_t *peer,

error:
/* we always need to return */
pmix_output_verbose(2, pmix_globals.debug_output,
pmix_output_verbose(2, pmix_client_globals.base_output,
"pmix:client_notify_recv - unpack error status =%d, calling def errhandler", rc);
chain = PMIX_NEW(pmix_event_chain_t);
if (NULL == chain) {
Expand All @@ -212,7 +212,7 @@ static void wait_cbfunc(struct pmix_peer_t *pr,
{
pmix_lock_t *lock = (pmix_lock_t*)cbdata;

pmix_output_verbose(2, pmix_globals.debug_output,
pmix_output_verbose(2, pmix_client_globals.base_output,
"pmix:client wait_cbfunc received");
PMIX_WAKEUP_THREAD(lock);
}
Expand Down Expand Up @@ -418,8 +418,15 @@ PMIX_EXPORT pmix_status_t PMIx_Init(pmix_proc_t *proc,
PMIX_CONSTRUCT(&pmix_globals.notifications, pmix_ring_buffer_t);
pmix_ring_buffer_init(&pmix_globals.notifications, 256);

pmix_output_verbose(2, pmix_globals.debug_output,
pmix_output_verbose(2, pmix_client_globals.base_output,
"pmix: init called");
/* setup the base verbosity */
if (0 < pmix_client_globals.base_verbose) {
/* set default output */
pmix_client_globals.base_output = pmix_output_open(NULL);
pmix_output_set_verbosity(pmix_client_globals.base_output,
pmix_client_globals.base_verbose);
}

/* we require our nspace */
if (NULL == (evar = getenv("PMIX_NAMESPACE"))) {
Expand Down Expand Up @@ -618,7 +625,7 @@ static void fin_timeout(int sd, short args, void *cbdata)
pmix_client_timeout_t *tev;
tev = (pmix_client_timeout_t*)cbdata;

pmix_output_verbose(2, pmix_globals.debug_output,
pmix_output_verbose(2, pmix_client_globals.base_output,
"pmix:client finwait timeout fired");
if (tev->active) {
tev->active = false;
Expand All @@ -633,7 +640,7 @@ static void finwait_cbfunc(struct pmix_peer_t *pr,
pmix_client_timeout_t *tev;
tev = (pmix_client_timeout_t*)cbdata;

pmix_output_verbose(2, pmix_globals.debug_output,
pmix_output_verbose(2, pmix_client_globals.base_output,
"pmix:client finwait_cbfunc received");
if (tev->active) {
tev->active = false;
Expand All @@ -658,7 +665,7 @@ PMIX_EXPORT pmix_status_t PMIx_Finalize(const pmix_info_t info[], size_t ninfo)
}
pmix_globals.init_cntr = 0;

pmix_output_verbose(2, pmix_globals.debug_output,
pmix_output_verbose(2, pmix_client_globals.base_output,
"%s:%d pmix:client finalize called",
pmix_globals.myid.nspace, pmix_globals.myid.rank);

Expand Down Expand Up @@ -696,7 +703,7 @@ PMIX_EXPORT pmix_status_t PMIx_Finalize(const pmix_info_t info[], size_t ninfo)
}


pmix_output_verbose(2, pmix_globals.debug_output,
pmix_output_verbose(2, pmix_client_globals.base_output,
"%s:%d pmix:client sending finalize sync to server",
pmix_globals.myid.nspace, pmix_globals.myid.rank);

Expand All @@ -723,7 +730,7 @@ PMIX_EXPORT pmix_status_t PMIx_Finalize(const pmix_info_t info[], size_t ninfo)
pmix_event_del(&tev.ev);
}

pmix_output_verbose(2, pmix_globals.debug_output,
pmix_output_verbose(2, pmix_client_globals.base_output,
"%s:%d pmix:client finalize sync received",
pmix_globals.myid.nspace, pmix_globals.myid.rank);
}
Expand Down Expand Up @@ -760,7 +767,7 @@ PMIX_EXPORT pmix_status_t PMIx_Abort(int flag, const char msg[],
pmix_status_t rc;
pmix_lock_t reglock;

pmix_output_verbose(2, pmix_globals.debug_output,
pmix_output_verbose(2, pmix_client_globals.base_output,
"pmix:client abort called");

PMIX_ACQUIRE_THREAD(&pmix_global_lock);
Expand Down Expand Up @@ -911,7 +918,7 @@ PMIX_EXPORT pmix_status_t PMIx_Put(pmix_scope_t scope, const char key[], pmix_va
pmix_cb_t *cb;
pmix_status_t rc;

pmix_output_verbose(2, pmix_globals.debug_output,
pmix_output_verbose(2, pmix_client_globals.base_output,
"pmix: executing put for key %s type %d",
key, val->type);

Expand Down
36 changes: 30 additions & 6 deletions opal/mca/pmix/pmix3x/pmix/src/client/pmix_client_get.c
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,12 @@ PMIX_EXPORT pmix_status_t PMIx_Get(const pmix_proc_t *proc, const char key[],
}
PMIX_RELEASE_THREAD(&pmix_global_lock);

pmix_output_verbose(2, pmix_client_globals.get_verbose,
"pmix:client get for %s:%d key %s",
(NULL == proc) ? "NULL" : proc->nspace,
(NULL == proc) ? PMIX_RANK_UNDEF : proc->rank,
(NULL == key) ? "NULL" : key);

/* 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 */
Expand All @@ -108,7 +114,7 @@ PMIX_EXPORT pmix_status_t PMIx_Get(const pmix_proc_t *proc, const char key[],
}
PMIX_RELEASE(cb);

pmix_output_verbose(2, pmix_globals.debug_output,
pmix_output_verbose(2, pmix_client_globals.get_verbose,
"pmix:client get completed");

return rc;
Expand Down Expand Up @@ -142,12 +148,16 @@ PMIX_EXPORT pmix_status_t PMIx_Get_nb(const pmix_proc_t *proc, const char *key,
* Either case is supported. However, we don't currently
* support the case where -both- values are NULL */
if (NULL == proc && NULL == key) {
pmix_output_verbose(2, pmix_client_globals.get_verbose,
"pmix: get_nb value error - both proc and key are NULL");
return PMIX_ERR_BAD_PARAM;
}

/* if the key is NULL, the rank cannot be WILDCARD as
* we cannot return all info from every rank */
if (NULL != proc && PMIX_RANK_WILDCARD == proc->rank && NULL == key) {
pmix_output_verbose(2, pmix_client_globals.get_verbose,
"pmix: get_nb value error - WILDCARD rank and key is NULL");
return PMIX_ERR_BAD_PARAM;
}

Expand All @@ -168,7 +178,7 @@ PMIX_EXPORT pmix_status_t PMIx_Get_nb(const pmix_proc_t *proc, const char *key,
rank = proc->rank;
}

pmix_output_verbose(2, pmix_globals.debug_output,
pmix_output_verbose(2, pmix_client_globals.get_verbose,
"pmix: get_nb value for proc %s:%u key %s",
nm, rank, (NULL == key) ? "NULL" : key);

Expand Down Expand Up @@ -273,7 +283,7 @@ static void _getnb_cbfunc(struct pmix_peer_t *pr,
pmix_proc_t proc;
pmix_kval_t *kv;

pmix_output_verbose(2, pmix_globals.debug_output,
pmix_output_verbose(2, pmix_client_globals.get_verbose,
"pmix: get_nb callback recvd");

if (NULL == cb) {
Expand Down Expand Up @@ -479,7 +489,7 @@ static void _getnbfn(int fd, short flags, void *cbdata)
/* cb was passed to us from another thread - acquire it */
PMIX_ACQUIRE_OBJECT(cb);

pmix_output_verbose(2, pmix_globals.debug_output,
pmix_output_verbose(2, pmix_client_globals.get_verbose,
"pmix: getnbfn value for proc %s:%u key %s",
cb->pname.nspace, cb->pname.rank,
(NULL == cb->key) ? "NULL" : cb->key);
Expand Down Expand Up @@ -517,9 +527,13 @@ static void _getnbfn(int fd, short flags, void *cbdata)
cb->copy = true;
PMIX_GDS_FETCH_KV(rc, pmix_globals.mypeer, cb);
if (PMIX_SUCCESS == rc) {
pmix_output_verbose(5, pmix_client_globals.get_verbose,
"pmix:client data found in internal storage");
rc = process_values(&val, cb);
goto respond;
}
pmix_output_verbose(5, pmix_client_globals.get_verbose,
"pmix:client data NOT found in internal storage");

/* if the key is NULL or starts with "pmix", then they are looking
* for data that was provided by the server at startup */
Expand All @@ -530,6 +544,8 @@ static void _getnbfn(int fd, short flags, void *cbdata)
cb->copy = true;
PMIX_GDS_FETCH_KV(rc, pmix_client_globals.myserver, cb);
if (PMIX_SUCCESS != rc) {
pmix_output_verbose(5, pmix_client_globals.get_verbose,
"pmix:client job-level data NOT found");
if (0 != strncmp(cb->pname.nspace, pmix_globals.myid.nspace, PMIX_MAX_NSLEN)) {
/* we are asking about the job-level info from another
* namespace. It seems that we don't have it - go and
Expand All @@ -542,6 +558,8 @@ static void _getnbfn(int fd, short flags, void *cbdata)
* job-level info. In some cases, a server may elect not
* to provide info at init to save memory */
if (immediate) {
pmix_output_verbose(5, pmix_client_globals.get_verbose,
"pmix:client IMMEDIATE given - querying data");
/* the direct modex request doesn't pass a key as it
* was intended to support non-job-level information.
* So instead, we will use the PMIx_Query function
Expand All @@ -560,11 +578,17 @@ static void _getnbfn(int fd, short flags, void *cbdata)
return;
}
/* we should have had this info, so respond with the error */
pmix_output_verbose(5, pmix_client_globals.get_verbose,
"pmix:client returning NOT FOUND error");
goto respond;
} else {
pmix_output_verbose(5, pmix_client_globals.get_verbose,
"pmix:client NULL KEY - returning error");
goto respond;
}
}
pmix_output_verbose(5, pmix_client_globals.get_verbose,
"pmix:client job-level data NOT found");
rc = process_values(&val, cb);
goto respond;
} else {
Expand Down Expand Up @@ -619,7 +643,7 @@ static void _getnbfn(int fd, short flags, void *cbdata)
* us to attempt to retrieve it from the server */
if (optional) {
/* they don't want us to try and retrieve it */
pmix_output_verbose(2, pmix_globals.debug_output,
pmix_output_verbose(2, pmix_client_globals.get_verbose,
"PMIx_Get key=%s for rank = %u, namespace = %s was not found - request was optional",
cb->key, cb->pname.rank, cb->pname.nspace);
rc = PMIX_ERR_NOT_FOUND;
Expand Down Expand Up @@ -647,7 +671,7 @@ static void _getnbfn(int fd, short flags, void *cbdata)
goto respond;
}

pmix_output_verbose(2, pmix_globals.debug_output,
pmix_output_verbose(2, pmix_client_globals.get_verbose,
"%s:%d REQUESTING DATA FROM SERVER FOR %s:%d KEY %s",
pmix_globals.myid.nspace, pmix_globals.myid.rank,
cb->pname.nspace, cb->pname.rank, cb->key);
Expand Down
21 changes: 21 additions & 0 deletions opal/mca/pmix/pmix3x/pmix/src/client/pmix_client_ops.h
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,27 @@ BEGIN_C_DECLS
typedef struct {
pmix_peer_t *myserver; // messaging support to/from my server
pmix_list_t pending_requests; // list of pmix_cb_t pending data requests
// verbosity for client get operations
int get_output;
int get_verbose;
// verbosity for client connect operations
int connect_output;
int connect_verbose;
// verbosity for client fence operations
int fence_output;
int fence_verbose;
// verbosity for client pub operations
int pub_output;
int pub_verbose;
// verbosity for client spawn operations
int spawn_output;
int spawn_verbose;
// verbosity for client event operations
int event_output;
int event_verbose;
// verbosity for basic client functions
int base_output;
int base_verbose;
} pmix_client_globals_t;

PMIX_EXPORT extern pmix_client_globals_t pmix_client_globals;
Expand Down
Loading

0 comments on commit 4b5be96

Please sign in to comment.