Skip to content
This repository was archived by the owner on Sep 30, 2022. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 9 additions & 11 deletions opal/mca/pmix/base/pmix_base_fns.c
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
* Copyright (c) 2012-2015 Los Alamos National Security, LLC. All rights
* reserved.
* Copyright (c) 2014-2016 Intel, Inc. All rights reserved.
* Copyright (c) 2014-2015 Research Organization for Information Science
* Copyright (c) 2014-2016 Research Organization for Information Science
* and Technology (RIST). All rights reserved.
* $COPYRIGHT$
*
Expand Down Expand Up @@ -152,16 +152,14 @@ int opal_pmix_base_exchange(opal_value_t *indat,
info->type = OPAL_BOOL;
info->data.flag = true;
opal_list_append(&mlist, &info->super);
if (0 < timeout) {
/* give it a decent timeout as we don't know when
* the other side will publish - it doesn't
* have to be simultaneous */
info = OBJ_NEW(opal_value_t);
info->key = strdup(OPAL_PMIX_TIMEOUT);
info->type = OPAL_INT;
info->data.integer = timeout;
opal_list_append(&mlist, &info->super);
}
/* give it a decent timeout as we don't know when
* the other side will publish - it doesn't
* have to be simultaneous */
info = OBJ_NEW(opal_value_t);
info->key = strdup(OPAL_PMIX_TIMEOUT);
info->type = OPAL_INT;
info->data.integer = timeout;
opal_list_append(&mlist, &info->super);

/* if a non-blocking version of lookup isn't
* available, then use the blocking version */
Expand Down
6 changes: 4 additions & 2 deletions opal/mca/pmix/pmix112/pmix1_client.c
Original file line number Diff line number Diff line change
Expand Up @@ -469,6 +469,7 @@ int pmix1_get(const opal_process_name_t *proc, const char *key,
OPAL_LIST_FOREACH(ival, info, opal_value_t) {
(void)strncpy(pinfo[n].key, ival->key, PMIX_MAX_KEYLEN);
pmix1_value_load(&pinfo[n].value, ival);
++n;
}
} else {
pinfo = NULL;
Expand Down Expand Up @@ -562,6 +563,7 @@ int pmix1_getnb(const opal_process_name_t *proc, const char *key,
OPAL_LIST_FOREACH(ival, info, opal_value_t) {
(void)strncpy(op->info[n].key, ival->key, PMIX_MAX_KEYLEN);
pmix1_value_load(&op->info[n].value, ival);
++n;
}
}
}
Expand Down Expand Up @@ -673,7 +675,7 @@ int pmix1_lookup(opal_list_t *data, opal_list_t *info)
PMIX_INFO_CREATE(pinfo, ninfo);
n=0;
OPAL_LIST_FOREACH(iptr, info, opal_value_t) {
(void)strncpy(pinfo[n++].key, iptr->key, PMIX_MAX_KEYLEN);
(void)strncpy(pinfo[n].key, iptr->key, PMIX_MAX_KEYLEN);
pmix1_value_load(&pinfo[n].value, iptr);
++n;
}
Expand Down Expand Up @@ -847,7 +849,7 @@ int pmix1_unpublish(char **keys, opal_list_t *info)
PMIX_INFO_CREATE(pinfo, ninfo);
n=0;
OPAL_LIST_FOREACH(iptr, info, opal_value_t) {
(void)strncpy(pinfo[n++].key, iptr->key, PMIX_MAX_KEYLEN);
(void)strncpy(pinfo[n].key, iptr->key, PMIX_MAX_KEYLEN);
pmix1_value_load(&pinfo[n].value, iptr);
++n;
}
Expand Down
12 changes: 9 additions & 3 deletions orte/orted/pmix/pmix_server.c
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
* Copyright (c) 2013-2015 Intel, Inc. All rights reserved.
* Copyright (c) 2014 Mellanox Technologies, Inc.
* All rights reserved.
* Copyright (c) 2014-2015 Research Organization for Information Science
* Copyright (c) 2014-2016 Research Organization for Information Science
* and Technology (RIST). All rights reserved.
* $COPYRIGHT$
*
Expand Down Expand Up @@ -150,11 +150,17 @@ static void eviction_cbfunc(struct opal_hotel_t *hotel,
int room_num, void *occupant)
{
pmix_server_req_t *req = (pmix_server_req_t*)occupant;
bool timeout = false;
int rc;

/* decrement the request timeout */
req->timeout -= orte_pmix_server_globals.timeout;
if (0 < req->timeout) {
if (req->timeout > 0) {
req->timeout -= orte_pmix_server_globals.timeout;
if (0 >= req->timeout) {
timeout = true;
}
}
if (!timeout) {
/* not done yet - check us back in */
if (OPAL_SUCCESS == (rc = opal_hotel_checkin(&orte_pmix_server_globals.reqs, req, &req->room_num))) {
return;
Expand Down
20 changes: 16 additions & 4 deletions orte/orted/pmix/pmix_server_pub.c
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
* Copyright (c) 2013-2015 Intel, Inc. All rights reserved.
* Copyright (c) 2014 Mellanox Technologies, Inc.
* All rights reserved.
* Copyright (c) 2014 Research Organization for Information Science
* Copyright (c) 2014-2016 Research Organization for Information Science
* and Technology (RIST). All rights reserved.
* $COPYRIGHT$
*
Expand Down Expand Up @@ -156,13 +156,17 @@ int pmix_server_publish_fn(opal_process_name_t *proc,
return rc;
}

/* if we have items, pack those too - ignore persistence
/* if we have items, pack those too - ignore persistence, timeout
* and range values */
OPAL_LIST_FOREACH(iptr, info, opal_value_t) {
if (0 == strcmp(iptr->key, OPAL_PMIX_RANGE) ||
0 == strcmp(iptr->key, OPAL_PMIX_PERSISTENCE)) {
continue;
}
if (0 == strcmp(iptr->key, OPAL_PMIX_TIMEOUT)) {
req->timeout = iptr->data.integer;
continue;
}
opal_output_verbose(5, orte_pmix_server_globals.output,
"%s publishing data %s of type %d from source %s",
ORTE_NAME_PRINT(ORTE_PROC_MY_NAME), iptr->key, iptr->type,
Expand Down Expand Up @@ -250,11 +254,15 @@ int pmix_server_lookup_fn(opal_process_name_t *proc, char **keys,
}
}

/* if we have items, pack those too - ignore range value */
/* if we have items, pack those too - ignore range and timeout values */
OPAL_LIST_FOREACH(iptr, info, opal_value_t) {
if (0 == strcmp(iptr->key, OPAL_PMIX_RANGE)) {
continue;
}
if (0 == strcmp(iptr->key, OPAL_PMIX_TIMEOUT)) {
req->timeout = iptr->data.integer;
continue;
}
if (OPAL_SUCCESS != (rc = opal_dss.pack(&req->msg, &iptr, 1, OPAL_VALUE))) {
ORTE_ERROR_LOG(rc);
OBJ_RELEASE(req);
Expand Down Expand Up @@ -340,11 +348,15 @@ int pmix_server_unpublish_fn(opal_process_name_t *proc, char **keys,
}
}

/* if we have items, pack those too - ignore range value */
/* if we have items, pack those too - ignore range and timeout values */
OPAL_LIST_FOREACH(iptr, info, opal_value_t) {
if (0 == strcmp(iptr->key, OPAL_PMIX_RANGE)) {
continue;
}
if (0 == strcmp(iptr->key, OPAL_PMIX_TIMEOUT)) {
req->timeout = iptr->data.integer;
continue;
}
if (OPAL_SUCCESS != (rc = opal_dss.pack(&req->msg, &iptr, 1, OPAL_VALUE))) {
ORTE_ERROR_LOG(rc);
OBJ_RELEASE(req);
Expand Down