Skip to content

Commit 3f746fe

Browse files
authored
Merge pull request #8661 from yosefe/topic/pml-ucx-ignore-request-leak-by-default
pml/ucx: ignore request leak by default, override by mca param
2 parents 46bb184 + 6672d07 commit 3f746fe

File tree

4 files changed

+25
-1
lines changed

4 files changed

+25
-1
lines changed

config/ompi_check_ucx.m4

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -136,7 +136,8 @@ AC_DEFUN([OMPI_CHECK_UCX],[
136136
UCP_ATOMIC_FETCH_OP_FAND,
137137
UCP_ATOMIC_FETCH_OP_FOR,
138138
UCP_ATOMIC_FETCH_OP_FXOR,
139-
UCP_PARAM_FIELD_ESTIMATED_NUM_PPN],
139+
UCP_PARAM_FIELD_ESTIMATED_NUM_PPN,
140+
UCP_WORKER_FLAG_IGNORE_REQUEST_LEAK],
140141
[], [],
141142
[#include <ucp/api/ucp.h>])
142143
AC_CHECK_DECLS([UCP_WORKER_ATTR_FIELD_ADDRESS_FLAGS],

ompi/mca/pml/ucx/pml_ucx.c

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -299,6 +299,13 @@ int mca_pml_ucx_init(int enable_mpi_threads)
299299
params.thread_mode = UCS_THREAD_MODE_SINGLE;
300300
}
301301

302+
#if HAVE_DECL_UCP_WORKER_FLAG_IGNORE_REQUEST_LEAK
303+
if (!ompi_pml_ucx.request_leak_check) {
304+
params.field_mask |= UCP_WORKER_PARAM_FIELD_FLAGS;
305+
params.flags |= UCP_WORKER_FLAG_IGNORE_REQUEST_LEAK;
306+
}
307+
#endif
308+
302309
status = ucp_worker_create(ompi_pml_ucx.ucp_context, &params,
303310
&ompi_pml_ucx.ucp_worker);
304311
if (UCS_OK != status) {

ompi/mca/pml/ucx/pml_ucx.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,7 @@ struct mca_pml_ucx_module {
5858

5959
int priority;
6060
bool cuda_initialized;
61+
bool request_leak_check;
6162
};
6263

6364
extern mca_pml_base_component_2_1_0_t mca_pml_ucx_component;

ompi/mca/pml/ucx/pml_ucx_component.c

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,21 @@ static int mca_pml_ucx_component_register(void)
6464
OPAL_INFO_LVL_3,
6565
MCA_BASE_VAR_SCOPE_LOCAL,
6666
&ompi_pml_ucx.num_disconnect);
67+
68+
#if HAVE_DECL_UCP_WORKER_FLAG_IGNORE_REQUEST_LEAK
69+
ompi_pml_ucx.request_leak_check = false;
70+
(void) mca_base_component_var_register(&mca_pml_ucx_component.pmlm_version, "request_leak_check",
71+
"Enable showing a warning during MPI_Finalize if some "
72+
"non-blocking MPI requests have not been released",
73+
MCA_BASE_VAR_TYPE_BOOL, NULL, 0, 0,
74+
OPAL_INFO_LVL_3,
75+
MCA_BASE_VAR_SCOPE_LOCAL,
76+
&ompi_pml_ucx.request_leak_check);
77+
#else
78+
/* If UCX does not support ignoring leak check, then it's always enabled */
79+
ompi_pml_ucx.request_leak_check = true;
80+
#endif
81+
6782
opal_common_ucx_mca_var_register(&mca_pml_ucx_component.pmlm_version);
6883
return 0;
6984
}

0 commit comments

Comments
 (0)