Skip to content

Commit 6487348

Browse files
author
Ralph Castain
committed
Remove the max_connections parameter from the radix component as it is confusing. Modify PMIx client init so that it simply returns the nspace/rank if called by a server - this allows the server to retrieve its assigned ID. Register the server's nspace so client-side operations can succeed
Signed-off-by: Ralph Castain <[email protected]>
1 parent 6074c2a commit 6487348

File tree

6 files changed

+30
-36
lines changed

6 files changed

+30
-36
lines changed

opal/mca/pmix/pmix3x/pmix/src/client/pmix_client.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -258,7 +258,7 @@ PMIX_EXPORT pmix_status_t PMIx_Init(pmix_proc_t *proc,
258258
return PMIX_ERR_BAD_PARAM;
259259
}
260260

261-
if (0 < pmix_globals.init_cntr) {
261+
if (0 < pmix_globals.init_cntr || PMIX_PROC_SERVER == pmix_globals.proc_type) {
262262
/* since we have been called before, the nspace and
263263
* rank should be known. So return them here if
264264
* requested */

opal/mca/pmix/pmix3x/pmix3x_server_south.c

Lines changed: 28 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,28 @@ static void errreg_cbfunc (pmix_status_t status,
7171
*active = false;
7272
}
7373

74+
static void opcbfunc(pmix_status_t status, void *cbdata)
75+
{
76+
pmix3x_opcaddy_t *op = (pmix3x_opcaddy_t*)cbdata;
77+
78+
if (NULL != op->opcbfunc) {
79+
op->opcbfunc(pmix3x_convert_rc(status), op->cbdata);
80+
}
81+
if (op->active) {
82+
op->status = status;
83+
op->active = false;
84+
} else {
85+
OBJ_RELEASE(op);
86+
}
87+
}
88+
89+
static void op2cbfunc(pmix_status_t status, void *cbdata)
90+
{
91+
volatile bool *active = (volatile bool*)cbdata;
92+
93+
*active = false;
94+
}
95+
7496
int pmix3x_server_init(opal_pmix_server_module_t *module,
7597
opal_list_t *info)
7698
{
@@ -123,6 +145,12 @@ int pmix3x_server_init(opal_pmix_server_module_t *module,
123145
PMIx_Register_event_handler(NULL, 0, NULL, 0, pmix3x_event_hdlr, errreg_cbfunc, (void*)&active);
124146
PMIX_WAIT_FOR_COMPLETION(active);
125147

148+
/* as we might want to use some client-side functions, be sure
149+
* to register our own nspace */
150+
active = true;
151+
PMIx_server_register_nspace(job->nspace, 1, NULL, 0, op2cbfunc, (void*)&active);
152+
PMIX_WAIT_FOR_COMPLETION(active);
153+
126154
return OPAL_SUCCESS;
127155
}
128156

@@ -163,21 +191,6 @@ int pmix3x_server_gen_ppn(const char *input, char **ppn)
163191
return pmix3x_convert_rc(rc);
164192
}
165193

166-
static void opcbfunc(pmix_status_t status, void *cbdata)
167-
{
168-
pmix3x_opcaddy_t *op = (pmix3x_opcaddy_t*)cbdata;
169-
170-
if (NULL != op->opcbfunc) {
171-
op->opcbfunc(pmix3x_convert_rc(status), op->cbdata);
172-
}
173-
if (op->active) {
174-
op->status = status;
175-
op->active = false;
176-
} else {
177-
OBJ_RELEASE(op);
178-
}
179-
}
180-
181194
static void _reg_nspace(int sd, short args, void *cbdata)
182195
{
183196
pmix3x_threadshift_t *cd = (pmix3x_threadshift_t*)cbdata;

orte/mca/ess/base/ess_base_std_orted.c

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -434,13 +434,6 @@ int orte_ess_base_orted_setup(char **hosts)
434434
orte_rml.set_contact_info(orte_process_info.my_hnp_uri);
435435
}
436436

437-
/* setup the PMIx server */
438-
if (ORTE_SUCCESS != (ret = pmix_server_init())) {
439-
ORTE_ERROR_LOG(ret);
440-
error = "pmix server init";
441-
goto error;
442-
}
443-
444437
/* select the errmgr */
445438
if (ORTE_SUCCESS != (ret = orte_errmgr_base_select())) {
446439
ORTE_ERROR_LOG(ret);

orte/mca/routed/radix/routed_radix.c

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -276,10 +276,6 @@ static orte_process_name_t get_route(orte_process_name_t *target)
276276
if (ORTE_PROC_MY_NAME->vpid == daemon.vpid) {
277277
ret = target;
278278
goto found;
279-
} else if (orte_process_info.num_procs < mca_routed_radix_component.max_connections) {
280-
/* if the job is small enough, send direct to the target's daemon */
281-
ret = &daemon;
282-
goto found;
283279
} else {
284280
/* search routing tree for next step to that daemon */
285281
for (item = opal_list_get_first(&my_children);

orte/mca/routed/radix/routed_radix.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
/*
22
* Copyright (c) 2007 Los Alamos National Security, LLC.
33
* All rights reserved.
4+
* Copyright (c) 2016 Intel, Inc. All rights reserved.
45
* $COPYRIGHT$
56
*
67
* Additional copyrights may follow
@@ -20,7 +21,6 @@ BEGIN_C_DECLS
2021
typedef struct {
2122
orte_routed_component_t super;
2223
int radix;
23-
orte_vpid_t max_connections;
2424
} orte_routed_radix_component_t;
2525
ORTE_MODULE_DECLSPEC extern orte_routed_radix_component_t mca_routed_radix_component;
2626

orte/mca/routed/radix/routed_radix_component.c

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -60,14 +60,6 @@ static int orte_routed_radix_component_register(void)
6060
MCA_BASE_VAR_SCOPE_READONLY,
6161
&mca_routed_radix_component.radix);
6262

63-
mca_routed_radix_component.max_connections = -1;
64-
(void) mca_base_component_var_register(c, "max_connections",
65-
"Send direct between daemons if the number of nodes is less than this number",
66-
MCA_BASE_VAR_TYPE_INT, NULL,0, 0,
67-
OPAL_INFO_LVL_9,
68-
MCA_BASE_VAR_SCOPE_READONLY,
69-
&mca_routed_radix_component.max_connections);
70-
7163
return ORTE_SUCCESS;
7264
}
7365

0 commit comments

Comments
 (0)