Skip to content

Commit 937429f

Browse files
committed
btl/ofi: Export memory monitor
The OFI MTL exports a memory monitor to Libfabric (so that OMPI's patcher wins), but in cases where OB1 is directly selected, that code won't run. So make sure to also configure Libfabric so that it won't try to use a suboptimial memory monitor in the case that only the OFI BTL is used. Signed-off-by: Brian Barrett <bbarrett@amazon.com>
1 parent c3e22c6 commit 937429f

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

opal/mca/btl/ofi/btl_ofi_module.c

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -148,6 +148,20 @@ void mca_btl_ofi_rcache_init(mca_btl_ofi_module_t *module)
148148
if (!module->initialized) {
149149
mca_rcache_base_resources_t rcache_resources;
150150
char *tmp;
151+
int ret;
152+
153+
/* this must be called during single threaded part of the code and
154+
* before Libfabric configures its memory monitors. Easiest to do
155+
* that before domain open. Silently ignore not-supported errors,
156+
* as they are not critical to program correctness, but only
157+
* indicate that LIbfabric will have to pick a different, possibly
158+
* less optimal, monitor. */
159+
ret = opal_common_ofi_export_memory_monitor();
160+
if (0 != ret && -FI_ENOSYS != ret) {
161+
opal_output_verbose(1, opal_common_ofi.output,
162+
"Failed to inject Libfabric memory monitor: %s",
163+
fi_strerror(-ret));
164+
}
151165

152166
(void) opal_asprintf(&tmp, "ofi.%s", module->linux_device_name);
153167

0 commit comments

Comments
 (0)