1
1

Merge pull request #6679 from hoopoepg/topic/ucx-common-init-patcher-on-hooks-used-only-v4.0

COMMON/UCX: init memhooks infra on external hooks only - v4.0
Этот коммит содержится в:
Howard Pritchard 2019-05-17 12:40:52 -06:00 коммит произвёл GitHub
родитель 8c9a3d1d1f 1944295da3
Коммит 81aa9d1413
Не найден ключ, соответствующий данной подписи
Идентификатор ключа GPG: 4AEE18F83AFDEB23

Просмотреть файл

@ -91,23 +91,23 @@ OPAL_DECLSPEC void opal_common_ucx_mca_register(void)
opal_common_ucx.output = opal_output_open(NULL);
opal_output_set_verbosity(opal_common_ucx.output, opal_common_ucx.verbose);
ret = mca_base_framework_open(&opal_memory_base_framework, 0);
if (OPAL_SUCCESS != ret) {
/* failed to initialize memory framework - just exit */
MCA_COMMON_UCX_VERBOSE(1, "failed to initialize memory base framework: %d, "
"memory hooks will not be used", ret);
return;
}
/* Set memory hooks */
if (opal_common_ucx.opal_mem_hooks &&
(OPAL_MEMORY_FREE_SUPPORT | OPAL_MEMORY_MUNMAP_SUPPORT) ==
((OPAL_MEMORY_FREE_SUPPORT | OPAL_MEMORY_MUNMAP_SUPPORT) &
opal_mem_hooks_support_level()))
{
MCA_COMMON_UCX_VERBOSE(1, "%s", "using OPAL memory hooks as external events");
ucm_set_external_event(UCM_EVENT_VM_UNMAPPED);
opal_mem_hooks_register_release(opal_common_ucx_mem_release_cb, NULL);
if (opal_common_ucx.opal_mem_hooks) {
ret = mca_base_framework_open(&opal_memory_base_framework, 0);
if (OPAL_SUCCESS != ret) {
/* failed to initialize memory framework - just exit */
MCA_COMMON_UCX_VERBOSE(1, "failed to initialize memory base framework: %d, "
"memory hooks will not be used", ret);
return;
}
if ((OPAL_MEMORY_FREE_SUPPORT | OPAL_MEMORY_MUNMAP_SUPPORT) ==
((OPAL_MEMORY_FREE_SUPPORT | OPAL_MEMORY_MUNMAP_SUPPORT) &
opal_mem_hooks_support_level())) {
MCA_COMMON_UCX_VERBOSE(1, "%s", "using OPAL memory hooks as external events");
ucm_set_external_event(UCM_EVENT_VM_UNMAPPED);
opal_mem_hooks_register_release(opal_common_ucx_mem_release_cb, NULL);
}
}
}