Skip to content

Commit f7fe2f7

Browse files
author
Ralph Castain
authored
Merge pull request #2977 from rhc54/topic/spawn
Fix comm_spawn by registering nspace info only when needed
2 parents 6ff74dd + 68b53e2 commit f7fe2f7

File tree

6 files changed

+20
-15
lines changed

6 files changed

+20
-15
lines changed

opal/mca/pmix/pmix2x/pmix/src/server/pmix_server_get.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -612,10 +612,10 @@ static void _process_dmdx_reply(int fd, short args, void *cbdata)
612612
}
613613

614614
if (NULL == nptr) {
615-
/*
616-
* We may not have this namespace because someone asked about this namespace
617-
* but there are not processses from it running on this host
618-
*/
615+
/*
616+
* We may not have this namespace because someone asked about this namespace
617+
* but there are not processses from it running on this host
618+
*/
619619
nptr = PMIX_NEW(pmix_nspace_t);
620620
(void)strncpy(nptr->nspace, caddy->lcd->proc.nspace, PMIX_MAX_NSLEN);
621621
nptr->server = PMIX_NEW(pmix_server_nspace_t);

orte/mca/odls/base/odls_base_default_fns.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -481,16 +481,16 @@ int orte_odls_base_default_construct_child_list(opal_buffer_t *buffer,
481481
}
482482
}
483483

484-
COMPLETE:
484+
COMPLETE:
485485
/* register this job with the PMIx server - need to wait until after we
486486
* have computed the #local_procs before calling the function */
487-
if (ORTE_SUCCESS != (rc = orte_pmix_server_register_nspace(jdata))) {
487+
if (ORTE_SUCCESS != (rc = orte_pmix_server_register_nspace(jdata, false))) {
488488
ORTE_ERROR_LOG(rc);
489489
goto REPORT_ERROR;
490490
}
491491
return ORTE_SUCCESS;
492492

493-
REPORT_ERROR:
493+
REPORT_ERROR:
494494
/* we have to report an error back to the HNP so we don't just
495495
* hang. Although there shouldn't be any errors once this is
496496
* all debugged, it is still good practice to have a way

orte/orted/orted_main.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -573,7 +573,7 @@ int orte_daemon(int argc, char *argv[])
573573
orte_pre_condition_transports(jdata);
574574

575575
/* register the singleton's nspace with our PMIx server */
576-
if (ORTE_SUCCESS != (ret = orte_pmix_server_register_nspace(jdata))) {
576+
if (ORTE_SUCCESS != (ret = orte_pmix_server_register_nspace(jdata, false))) {
577577
ORTE_ERROR_LOG(ret);
578578
goto DONE;
579579
}

orte/orted/pmix/pmix_server.h

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
* Copyright (c) 2006-2013 Los Alamos National Security, LLC.
1313
* All rights reserved.
1414
* Copyright (c) 2010-2011 Cisco Systems, Inc. All rights reserved.
15-
* Copyright (c) 2013-2015 Intel, Inc. All rights reserved.
15+
* Copyright (c) 2013-2017 Intel, Inc. All rights reserved.
1616
* $COPYRIGHT$
1717
*
1818
* Additional copyrights may follow
@@ -34,9 +34,8 @@ ORTE_DECLSPEC void pmix_server_finalize(void);
3434
ORTE_DECLSPEC void pmix_server_register_params(void);
3535

3636

37-
ORTE_DECLSPEC int orte_pmix_server_register_nspace(orte_job_t *jdata);
37+
ORTE_DECLSPEC int orte_pmix_server_register_nspace(orte_job_t *jdata, bool force);
3838

3939
END_C_DECLS
4040

4141
#endif /* PMIX_SERVER_H_ */
42-

orte/orted/pmix/pmix_server_dyn.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
* All rights reserved.
1414
* Copyright (c) 2009 Cisco Systems, Inc. All rights reserved.
1515
* Copyright (c) 2011 Oak Ridge National Labs. All rights reserved.
16-
* Copyright (c) 2013-2016 Intel, Inc. All rights reserved.
16+
* Copyright (c) 2013-2017 Intel, Inc. All rights reserved.
1717
* Copyright (c) 2014 Mellanox Technologies, Inc.
1818
* All rights reserved.
1919
* Copyright (c) 2014-2016 Research Organization for Information Science
@@ -377,7 +377,7 @@ static void _cnlk(int status, opal_list_t *data, void *cbdata)
377377
goto release;
378378
}
379379
OBJ_DESTRUCT(&buf);
380-
if (ORTE_SUCCESS != (rc = orte_pmix_server_register_nspace(jdata))) {
380+
if (ORTE_SUCCESS != (rc = orte_pmix_server_register_nspace(jdata, true))) {
381381
OBJ_RELEASE(jdata);
382382
goto release;
383383
}
@@ -441,7 +441,7 @@ static void _cnct(int sd, short args, void *cbdata)
441441
* registered with the local PMIx server */
442442
if (!orte_get_attribute(&jdata->attributes, ORTE_JOB_NSPACE_REGISTERED, NULL, OPAL_BOOL)) {
443443
/* it hasn't been registered yet, so register it now */
444-
if (ORTE_SUCCESS != (rc = orte_pmix_server_register_nspace(jdata))) {
444+
if (ORTE_SUCCESS != (rc = orte_pmix_server_register_nspace(jdata, true))) {
445445
goto release;
446446
}
447447
}

orte/orted/pmix/pmix_server_register_fns.c

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@
5151
#include "pmix_server.h"
5252

5353
/* stuff proc attributes for sending back to a proc */
54-
int orte_pmix_server_register_nspace(orte_job_t *jdata)
54+
int orte_pmix_server_register_nspace(orte_job_t *jdata, bool force)
5555
{
5656
int rc;
5757
orte_proc_t *pptr;
@@ -74,6 +74,12 @@ int orte_pmix_server_register_nspace(orte_job_t *jdata)
7474
ORTE_NAME_PRINT(ORTE_PROC_MY_NAME),
7575
ORTE_JOBID_PRINT(jdata->jobid));
7676

77+
/* if this job has no local procs, then no need to register
78+
* it unless the job info is needed by connecting jobs */
79+
if (!force && 0 == jdata->num_local_procs) {
80+
return ORTE_SUCCESS;
81+
}
82+
7783
/* setup the info list */
7884
info = OBJ_NEW(opal_list_t);
7985
uid = geteuid();

0 commit comments

Comments
 (0)