Skip to content
This repository was archived by the owner on Sep 30, 2022. It is now read-only.

Commit b440a37

Browse files
committed
orted/pmix: do handle OPAL_PMIX_TIMEOUT in pmix_server_lookup_fn()
1 parent 88b176b commit b440a37

File tree

3 files changed

+34
-18
lines changed

3 files changed

+34
-18
lines changed

opal/mca/pmix/base/pmix_base_fns.c

Lines changed: 9 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
* Copyright (c) 2012-2015 Los Alamos National Security, LLC. All rights
44
* reserved.
55
* Copyright (c) 2014-2016 Intel, Inc. All rights reserved.
6-
* Copyright (c) 2014-2015 Research Organization for Information Science
6+
* Copyright (c) 2014-2016 Research Organization for Information Science
77
* and Technology (RIST). All rights reserved.
88
* $COPYRIGHT$
99
*
@@ -152,16 +152,14 @@ int opal_pmix_base_exchange(opal_value_t *indat,
152152
info->type = OPAL_BOOL;
153153
info->data.flag = true;
154154
opal_list_append(&mlist, &info->super);
155-
if (0 < timeout) {
156-
/* give it a decent timeout as we don't know when
157-
* the other side will publish - it doesn't
158-
* have to be simultaneous */
159-
info = OBJ_NEW(opal_value_t);
160-
info->key = strdup(OPAL_PMIX_TIMEOUT);
161-
info->type = OPAL_INT;
162-
info->data.integer = timeout;
163-
opal_list_append(&mlist, &info->super);
164-
}
155+
/* give it a decent timeout as we don't know when
156+
* the other side will publish - it doesn't
157+
* have to be simultaneous */
158+
info = OBJ_NEW(opal_value_t);
159+
info->key = strdup(OPAL_PMIX_TIMEOUT);
160+
info->type = OPAL_INT;
161+
info->data.integer = timeout;
162+
opal_list_append(&mlist, &info->super);
165163

166164
/* if a non-blocking version of lookup isn't
167165
* available, then use the blocking version */

orte/orted/pmix/pmix_server.c

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
* Copyright (c) 2013-2015 Intel, Inc. All rights reserved.
1717
* Copyright (c) 2014 Mellanox Technologies, Inc.
1818
* All rights reserved.
19-
* Copyright (c) 2014-2015 Research Organization for Information Science
19+
* Copyright (c) 2014-2016 Research Organization for Information Science
2020
* and Technology (RIST). All rights reserved.
2121
* $COPYRIGHT$
2222
*
@@ -150,11 +150,17 @@ static void eviction_cbfunc(struct opal_hotel_t *hotel,
150150
int room_num, void *occupant)
151151
{
152152
pmix_server_req_t *req = (pmix_server_req_t*)occupant;
153+
bool timeout = false;
153154
int rc;
154155

155156
/* decrement the request timeout */
156-
req->timeout -= orte_pmix_server_globals.timeout;
157-
if (0 < req->timeout) {
157+
if (req->timeout > 0) {
158+
req->timeout -= orte_pmix_server_globals.timeout;
159+
if (0 >= req->timeout) {
160+
timeout = true;
161+
}
162+
}
163+
if (!timeout) {
158164
/* not done yet - check us back in */
159165
if (OPAL_SUCCESS == (rc = opal_hotel_checkin(&orte_pmix_server_globals.reqs, req, &req->room_num))) {
160166
return;

orte/orted/pmix/pmix_server_pub.c

Lines changed: 16 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
* Copyright (c) 2013-2015 Intel, Inc. All rights reserved.
1717
* Copyright (c) 2014 Mellanox Technologies, Inc.
1818
* All rights reserved.
19-
* Copyright (c) 2014 Research Organization for Information Science
19+
* Copyright (c) 2014-2016 Research Organization for Information Science
2020
* and Technology (RIST). All rights reserved.
2121
* $COPYRIGHT$
2222
*
@@ -156,13 +156,17 @@ int pmix_server_publish_fn(opal_process_name_t *proc,
156156
return rc;
157157
}
158158

159-
/* if we have items, pack those too - ignore persistence
159+
/* if we have items, pack those too - ignore persistence, timeout
160160
* and range values */
161161
OPAL_LIST_FOREACH(iptr, info, opal_value_t) {
162162
if (0 == strcmp(iptr->key, OPAL_PMIX_RANGE) ||
163163
0 == strcmp(iptr->key, OPAL_PMIX_PERSISTENCE)) {
164164
continue;
165165
}
166+
if (0 == strcmp(iptr->key, OPAL_PMIX_TIMEOUT)) {
167+
req->timeout = iptr->data.integer;
168+
continue;
169+
}
166170
opal_output_verbose(5, orte_pmix_server_globals.output,
167171
"%s publishing data %s of type %d from source %s",
168172
ORTE_NAME_PRINT(ORTE_PROC_MY_NAME), iptr->key, iptr->type,
@@ -250,11 +254,15 @@ int pmix_server_lookup_fn(opal_process_name_t *proc, char **keys,
250254
}
251255
}
252256

253-
/* if we have items, pack those too - ignore range value */
257+
/* if we have items, pack those too - ignore range and timeout values */
254258
OPAL_LIST_FOREACH(iptr, info, opal_value_t) {
255259
if (0 == strcmp(iptr->key, OPAL_PMIX_RANGE)) {
256260
continue;
257261
}
262+
if (0 == strcmp(iptr->key, OPAL_PMIX_TIMEOUT)) {
263+
req->timeout = iptr->data.integer;
264+
continue;
265+
}
258266
if (OPAL_SUCCESS != (rc = opal_dss.pack(&req->msg, &iptr, 1, OPAL_VALUE))) {
259267
ORTE_ERROR_LOG(rc);
260268
OBJ_RELEASE(req);
@@ -340,11 +348,15 @@ int pmix_server_unpublish_fn(opal_process_name_t *proc, char **keys,
340348
}
341349
}
342350

343-
/* if we have items, pack those too - ignore range value */
351+
/* if we have items, pack those too - ignore range and timeout values */
344352
OPAL_LIST_FOREACH(iptr, info, opal_value_t) {
345353
if (0 == strcmp(iptr->key, OPAL_PMIX_RANGE)) {
346354
continue;
347355
}
356+
if (0 == strcmp(iptr->key, OPAL_PMIX_TIMEOUT)) {
357+
req->timeout = iptr->data.integer;
358+
continue;
359+
}
348360
if (OPAL_SUCCESS != (rc = opal_dss.pack(&req->msg, &iptr, 1, OPAL_VALUE))) {
349361
ORTE_ERROR_LOG(rc);
350362
OBJ_RELEASE(req);

0 commit comments

Comments
 (0)