Skip to content

Commit abc56ce

Browse files
authored
Merge pull request #3071 from yosefe/topic/fix-memhooks-mxm-hcoll
yalla/mtl_mxm/hcoll: open memory component to activate memory hooks.
2 parents 880f2d5 + 33471c4 commit abc56ce

File tree

4 files changed

+13
-0
lines changed

4 files changed

+13
-0
lines changed

ompi/mca/coll/hcoll/coll_hcoll.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
#include "mpi.h"
1818
#include "ompi/mca/mca.h"
1919
#include "opal/memoryhooks/memory.h"
20+
#include "opal/mca/memory/base/base.h"
2021
#include "ompi/mca/coll/coll.h"
2122
#include "ompi/request/request.h"
2223
#include "ompi/mca/pml/pml.h"

ompi/mca/coll/hcoll/coll_hcoll_component.c

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -217,6 +217,8 @@ static int hcoll_open(void)
217217

218218
cm->libhcoll_initialized = false;
219219

220+
(void)mca_base_framework_open(&opal_memory_base_framework, 0);
221+
220222
/* Register memory hooks */
221223
if ((OPAL_MEMORY_FREE_SUPPORT | OPAL_MEMORY_MUNMAP_SUPPORT) ==
222224
((OPAL_MEMORY_FREE_SUPPORT | OPAL_MEMORY_MUNMAP_SUPPORT) &
@@ -259,5 +261,8 @@ static int hcoll_close(void)
259261
HCOL_VERBOSE(1,"Hcol library finalize failed");
260262
return OMPI_ERROR;
261263
}
264+
265+
mca_base_framework_close(&opal_memory_base_framework);
266+
262267
return OMPI_SUCCESS;
263268
}

ompi/mca/mtl/mxm/mtl_mxm_component.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
#include "opal/util/show_help.h"
1818
#include "ompi/proc/proc.h"
1919
#include "opal/memoryhooks/memory.h"
20+
#include "opal/mca/memory/base/base.h"
2021
#include "ompi/runtime/mpiruntime.h"
2122

2223
#include "mtl_mxm.h"
@@ -201,6 +202,7 @@ static int ompi_mtl_mxm_component_open(void)
201202
}
202203

203204
#if MXM_API >= MXM_VERSION(2,0)
205+
(void)mca_base_framework_open(&opal_memory_base_framework, 0);
204206
/* Register memory hooks */
205207
if ((OPAL_MEMORY_FREE_SUPPORT | OPAL_MEMORY_MUNMAP_SUPPORT) ==
206208
((OPAL_MEMORY_FREE_SUPPORT | OPAL_MEMORY_MUNMAP_SUPPORT) &
@@ -284,6 +286,7 @@ static int ompi_mtl_mxm_component_close(void)
284286
#if MXM_API >= MXM_VERSION(2,0)
285287
mxm_config_free_ep_opts(ompi_mtl_mxm.mxm_ep_opts);
286288
mxm_config_free_context_opts(ompi_mtl_mxm.mxm_ctx_opts);
289+
mca_base_framework_close(&opal_memory_base_framework);
287290
#else
288291
mxm_config_free(ompi_mtl_mxm.mxm_ep_opts);
289292
mxm_config_free(ompi_mtl_mxm.mxm_ctx_opts);

ompi/mca/pml/yalla/pml_yalla.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818

1919
#include "opal/runtime/opal.h"
2020
#include "opal/memoryhooks/memory.h"
21+
#include "opal/mca/memory/base/base.h"
2122
#include "opal/mca/pmix/pmix.h"
2223
#include "ompi/mca/pml/base/pml_base_bsend.h"
2324
#include "ompi/message/message.h"
@@ -109,6 +110,8 @@ int mca_pml_yalla_open(void)
109110

110111
PML_YALLA_VERBOSE(1, "%s", "mca_pml_yalla_open");
111112

113+
(void)mca_base_framework_open(&opal_memory_base_framework, 0);
114+
112115
/* Set memory hooks */
113116
if ((OPAL_MEMORY_FREE_SUPPORT | OPAL_MEMORY_MUNMAP_SUPPORT) ==
114117
((OPAL_MEMORY_FREE_SUPPORT | OPAL_MEMORY_MUNMAP_SUPPORT) &
@@ -153,6 +156,7 @@ int mca_pml_yalla_close(void)
153156
mxm_cleanup(ompi_pml_yalla.mxm_context);
154157
ompi_pml_yalla.mxm_context = NULL;
155158
}
159+
mca_base_framework_close(&opal_memory_base_framework);
156160
return 0;
157161
}
158162

0 commit comments

Comments
 (0)