Skip to content

Commit 2dc5e51

Browse files
committed
pml/ucx: ignore request leak by default, override by mca param
Signed-off-by: Yossi Itigin <yosefe@mellanox.com> (cherry picked from commit 6672d07)
1 parent 803bdd6 commit 2dc5e51

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
@@ -135,7 +135,8 @@ AC_DEFUN([OMPI_CHECK_UCX],[
135135
UCP_ATOMIC_FETCH_OP_FAND,
136136
UCP_ATOMIC_FETCH_OP_FOR,
137137
UCP_ATOMIC_FETCH_OP_FXOR,
138-
UCP_PARAM_FIELD_ESTIMATED_NUM_PPN],
138+
UCP_PARAM_FIELD_ESTIMATED_NUM_PPN,
139+
UCP_WORKER_FLAG_IGNORE_REQUEST_LEAK],
139140
[], [],
140141
[#include <ucp/api/ucp.h>])
141142
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
@@ -296,6 +296,13 @@ int mca_pml_ucx_init(int enable_mpi_threads)
296296
params.thread_mode = UCS_THREAD_MODE_SINGLE;
297297
}
298298

299+
#if HAVE_DECL_UCP_WORKER_FLAG_IGNORE_REQUEST_LEAK
300+
if (!ompi_pml_ucx.request_leak_check) {
301+
params.field_mask |= UCP_WORKER_PARAM_FIELD_FLAGS;
302+
params.flags |= UCP_WORKER_FLAG_IGNORE_REQUEST_LEAK;
303+
}
304+
#endif
305+
299306
status = ucp_worker_create(ompi_pml_ucx.ucp_context, &params,
300307
&ompi_pml_ucx.ucp_worker);
301308
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_0_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)