Skip to content

Commit d8e3562

Browse files
author
Sergey Oblomov
committed
PML/SPML/UCX: added evaluation of mmap events
- there was a set of UCX related issues reported which caused by mmap API hooks conflicts. We added diagnostic of such problems to simplify bug-resolving pipeline Signed-off-by: Sergey Oblomov <sergeyo@mellanox.com>
1 parent fd9ed9c commit d8e3562

File tree

5 files changed

+34
-0
lines changed

5 files changed

+34
-0
lines changed

config/ompi_check_ucx.m4

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -112,6 +112,9 @@ AC_DEFUN([OMPI_CHECK_UCX],[
112112
ucp_request_check_status, ucp_put_nb, ucp_get_nb],
113113
[], [],
114114
[#include <ucp/api/ucp.h>])
115+
AC_CHECK_DECLS([ucm_test_events],
116+
[], [],
117+
[#include <ucm/api/ucm.h>])
115118
AC_CHECK_DECLS([UCP_ATOMIC_POST_OP_AND,
116119
UCP_ATOMIC_POST_OP_OR,
117120
UCP_ATOMIC_POST_OP_XOR,

ompi/mca/pml/ucx/pml_ucx.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -422,6 +422,7 @@ int mca_pml_ucx_add_procs(struct ompi_proc_t **procs, size_t nprocs)
422422
}
423423
}
424424

425+
opal_common_ucx_mca_proc_added();
425426
return OMPI_SUCCESS;
426427
}
427428

opal/mca/common/ucx/common_ucx.c

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -132,6 +132,28 @@ static void opal_common_ucx_mca_fence_complete_cb(int status, void *fenced)
132132
*(int*)fenced = 1;
133133
}
134134

135+
void opal_common_ucx_mca_proc_added(void)
136+
{
137+
#if HAVE_DECL_UCM_TEST_EVENTS
138+
static int warned = 0;
139+
static char *mem_hooks_suggestion = "Try to add command line agrument "
140+
"'--mca opal_common_ucx_opal_mem_hooks 1' to resolve "
141+
"this issue.";
142+
ucs_status_t status;
143+
144+
if (!warned) {
145+
status = ucm_test_events(UCM_EVENT_VM_UNMAPPED);
146+
if (status != UCS_OK) {
147+
MCA_COMMON_UCX_WARN("UCX is unable to handle VM_UNMAP event. "
148+
"This may cause performance degradation or data "
149+
"corruption. %s",
150+
opal_common_ucx.opal_mem_hooks ? "" : mem_hooks_suggestion);
151+
warned = 1;
152+
}
153+
}
154+
#endif
155+
}
156+
135157
OPAL_DECLSPEC int opal_common_ucx_mca_pmix_fence(ucp_worker_h worker)
136158
{
137159
volatile int fenced = 0;

opal/mca/common/ucx/common_ucx.h

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,11 @@ BEGIN_C_DECLS
4949
__FILE__ ":" MCA_COMMON_UCX_QUOTE(__LINE__) \
5050
" Error: " __VA_ARGS__)
5151

52+
#define MCA_COMMON_UCX_WARN(...) \
53+
opal_output_verbose(0, opal_common_ucx.output, \
54+
__FILE__ ":" MCA_COMMON_UCX_QUOTE(__LINE__) \
55+
" Warning: " __VA_ARGS__)
56+
5257
#define MCA_COMMON_UCX_VERBOSE(_level, ... ) \
5358
if (((_level) <= MCA_COMMON_UCX_MAX_VERBOSE) && \
5459
((_level) <= opal_common_ucx.verbose)) { \
@@ -101,6 +106,7 @@ extern opal_common_ucx_module_t opal_common_ucx;
101106

102107
OPAL_DECLSPEC void opal_common_ucx_mca_register(void);
103108
OPAL_DECLSPEC void opal_common_ucx_mca_deregister(void);
109+
OPAL_DECLSPEC void opal_common_ucx_mca_proc_added(void);
104110
OPAL_DECLSPEC void opal_common_ucx_empty_complete_cb(void *request, ucs_status_t status);
105111
OPAL_DECLSPEC int opal_common_ucx_mca_pmix_fence(ucp_worker_h worker);
106112
OPAL_DECLSPEC int opal_common_ucx_del_procs(opal_common_ucx_del_proc_t *procs, size_t count,

oshmem/mca/spml/ucx/spml_ucx.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -135,6 +135,8 @@ int mca_spml_ucx_del_procs(ompi_proc_t** procs, size_t nprocs)
135135

136136
mca_spml_ucx_ctx_default.ucp_peers = NULL;
137137

138+
opal_common_ucx_mca_proc_added();
139+
138140
return ret;
139141
}
140142

0 commit comments

Comments
 (0)