Skip to content

Commit 9dcde8e

Browse files
authored
Merge pull request #8959 from hppritcha/topic/add_timeout_to_pmix_connect
PMIx_Connect usage: add optional timeout
2 parents 37c2581 + 038291a commit 9dcde8e

File tree

3 files changed

+23
-2
lines changed

3 files changed

+23
-2
lines changed

ompi/dpm/dpm.c

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,8 @@
2121
* and Technology (RIST). All rights reserved.
2222
* Copyright (c) 2018 Amazon.com, Inc. or its affiliates. All Rights reserved.
2323
* Copyright (c) 2021 Nanook Consulting. All rights reserved.
24+
* Copyright (c) 2021 Triad National Security, LLC. All rights
25+
* reserved.
2426
* $COPYRIGHT$
2527
*
2628
* Additional copyrights may follow
@@ -104,7 +106,7 @@ int ompi_dpm_connect_accept(ompi_communicator_t *comm, int root,
104106
bool dense, isnew;
105107
opal_process_name_t pname;
106108
opal_list_t ilist, mlist, rlist;
107-
pmix_info_t info;
109+
pmix_info_t info, tinfo;
108110
pmix_value_t pval;
109111
pmix_pdata_t pdat;
110112
pmix_proc_t *procs, pxproc;
@@ -373,7 +375,10 @@ int ompi_dpm_connect_accept(ompi_communicator_t *comm, int root,
373375
/* tell the host RTE to connect us - this will download
374376
* all known data for the nspace's of participating procs
375377
* so that add_procs will not result in a slew of lookups */
376-
pret = PMIx_Connect(procs, nprocs, NULL, 0);
378+
PMIX_INFO_CONSTRUCT(&tinfo);
379+
PMIX_INFO_LOAD(&tinfo, PMIX_TIMEOUT, &ompi_pmix_connect_timeout, PMIX_UINT32);
380+
pret = PMIx_Connect(procs, nprocs, &tinfo, 1);
381+
PMIX_INFO_DESTRUCT(&tinfo);
377382
PMIX_PROC_FREE(procs, nprocs);
378383
rc = opal_pmix_convert_status(pret);
379384
if (OPAL_SUCCESS != rc) {

ompi/runtime/ompi_mpi_params.c

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,8 @@
2020
* All rights reserved.
2121
* Copyright (c) 2016-2019 Research Organization for Information Science
2222
* and Technology (RIST). All rights reserved.
23+
* Copyright (c) 2021 Triad National Security, LLC. All rights
24+
* reserved.
2325
* $COPYRIGHT$
2426
*
2527
* Additional copyrights may follow
@@ -83,6 +85,7 @@ bool ompi_mpi_compat_mpi3 = false;
8385

8486
char *ompi_mpi_spc_attach_string = NULL;
8587
bool ompi_mpi_spc_dump_enabled = false;
88+
uint32_t ompi_pmix_connect_timeout;
8689

8790
static bool show_default_mca_params = false;
8891
static bool show_file_mca_params = false;
@@ -391,6 +394,13 @@ int ompi_mpi_register_params(void)
391394
&ompi_mpi_spc_dump_enabled);
392395
#endif // SPC_ENABLE
393396

397+
ompi_pmix_connect_timeout = 0; /* infinite timeout - see PMIx standard */
398+
(void) mca_base_var_register ("ompi", "mpi", NULL, "pmix_connect_timeout",
399+
"Timeout(secs) for calls to PMIx_Connect. Default is no timeout.",
400+
MCA_BASE_VAR_TYPE_UNSIGNED_INT, NULL,
401+
0, 0, OPAL_INFO_LVL_3, MCA_BASE_VAR_SCOPE_LOCAL,
402+
&ompi_pmix_connect_timeout);
403+
394404
return OMPI_SUCCESS;
395405
}
396406

ompi/runtime/params.h

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,8 @@
1616
* Copyright (c) 2010-2012 Oak Ridge National Labs. All rights reserved.
1717
* Copyright (c) 2013 NVIDIA Corporation. All rights reserved.
1818
* Copyright (c) 2013 Intel, Inc. All rights reserved
19+
* Copyright (c) 2021 Triad National Security, LLC. All rights
20+
* reserved.
1921
* $COPYRIGHT$
2022
*
2123
* Additional copyrights may follow
@@ -172,6 +174,10 @@ OMPI_DECLSPEC extern char * ompi_mpi_spc_attach_string;
172174
*/
173175
OMPI_DECLSPEC extern bool ompi_mpi_spc_dump_enabled;
174176

177+
/**
178+
* Timeout for calls to PMIx_Connect(defaut 0, no timeout)
179+
*/
180+
OMPI_DECLSPEC extern uint32_t ompi_pmix_connect_timeout;
175181

176182
/**
177183
* Register MCA parameters used by the MPI layer.

0 commit comments

Comments
 (0)