2015-11-02 22:07:08 +03:00
|
|
|
/* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil -*- */
|
2005-09-08 00:21:15 +04:00
|
|
|
/*
|
2005-11-05 22:57:48 +03:00
|
|
|
* Copyright (c) 2004-2005 The Trustees of Indiana University and Indiana
|
|
|
|
* University Research and Technology
|
|
|
|
* Corporation. All rights reserved.
|
|
|
|
* Copyright (c) 2004-2005 The University of Tennessee and The University
|
|
|
|
* of Tennessee Research Foundation. All rights
|
|
|
|
* reserved.
|
2015-06-24 06:59:57 +03:00
|
|
|
* Copyright (c) 2004-2005 High Performance Computing Center Stuttgart,
|
2005-09-08 00:21:15 +04:00
|
|
|
* University of Stuttgart. All rights reserved.
|
|
|
|
* Copyright (c) 2004-2005 The Regents of the University of California.
|
|
|
|
* All rights reserved.
|
2016-04-26 23:39:23 +03:00
|
|
|
* Copyright (c) 2015-2016 Los Alamos National Security, LLC. All rights
|
2015-11-02 22:07:08 +03:00
|
|
|
* reserved.
|
2005-09-08 00:21:15 +04:00
|
|
|
* $COPYRIGHT$
|
2015-06-24 06:59:57 +03:00
|
|
|
*
|
2005-09-08 00:21:15 +04:00
|
|
|
* Additional copyrights may follow
|
2015-06-24 06:59:57 +03:00
|
|
|
*
|
2005-09-08 00:21:15 +04:00
|
|
|
* $HEADER$
|
|
|
|
*/
|
|
|
|
|
George did the work and deserves all the credit for it. Ralph did the merge, and deserves whatever blame results from errors in it :-)
WHAT: Open our low-level communication infrastructure by moving all necessary components (btl/rcache/allocator/mpool) down in OPAL
All the components required for inter-process communications are currently deeply integrated in the OMPI layer. Several groups/institutions have express interest in having a more generic communication infrastructure, without all the OMPI layer dependencies. This communication layer should be made available at a different software level, available to all layers in the Open MPI software stack. As an example, our ORTE layer could replace the current OOB and instead use the BTL directly, gaining access to more reactive network interfaces than TCP. Similarly, external software libraries could take advantage of our highly optimized AM (active message) communication layer for their own purpose. UTK with support from Sandia, developped a version of Open MPI where the entire communication infrastucture has been moved down to OPAL (btl/rcache/allocator/mpool). Most of the moved components have been updated to match the new schema, with few exceptions (mainly BTLs where I have no way of compiling/testing them). Thus, the completion of this RFC is tied to being able to completing this move for all BTLs. For this we need help from the rest of the Open MPI community, especially those supporting some of the BTLs. A non-exhaustive list of BTLs that qualify here is: mx, portals4, scif, udapl, ugni, usnic.
This commit was SVN r32317.
2014-07-26 04:47:28 +04:00
|
|
|
#include "opal_config.h"
|
2005-09-08 00:21:15 +04:00
|
|
|
|
|
|
|
#include <stdio.h>
|
|
|
|
#include <string.h>
|
|
|
|
|
2006-02-12 04:33:29 +03:00
|
|
|
#include "opal/mca/mca.h"
|
|
|
|
#include "opal/mca/base/base.h"
|
George did the work and deserves all the credit for it. Ralph did the merge, and deserves whatever blame results from errors in it :-)
WHAT: Open our low-level communication infrastructure by moving all necessary components (btl/rcache/allocator/mpool) down in OPAL
All the components required for inter-process communications are currently deeply integrated in the OMPI layer. Several groups/institutions have express interest in having a more generic communication infrastructure, without all the OMPI layer dependencies. This communication layer should be made available at a different software level, available to all layers in the Open MPI software stack. As an example, our ORTE layer could replace the current OOB and instead use the BTL directly, gaining access to more reactive network interfaces than TCP. Similarly, external software libraries could take advantage of our highly optimized AM (active message) communication layer for their own purpose. UTK with support from Sandia, developped a version of Open MPI where the entire communication infrastucture has been moved down to OPAL (btl/rcache/allocator/mpool). Most of the moved components have been updated to match the new schema, with few exceptions (mainly BTLs where I have no way of compiling/testing them). Thus, the completion of this RFC is tied to being able to completing this move for all BTLs. For this we need help from the rest of the Open MPI community, especially those supporting some of the BTLs. A non-exhaustive list of BTLs that qualify here is: mx, portals4, scif, udapl, ugni, usnic.
This commit was SVN r32317.
2014-07-26 04:47:28 +04:00
|
|
|
#include "opal/mca/rcache/rcache.h"
|
|
|
|
#include "opal/mca/rcache/base/base.h"
|
2015-11-02 22:07:08 +03:00
|
|
|
#include "opal/mca/rcache/base/rcache_base_mem_cb.h"
|
|
|
|
#include "opal/util/show_help.h"
|
|
|
|
#include "opal/util/proc.h"
|
2005-09-08 00:21:15 +04:00
|
|
|
|
2015-11-02 22:07:08 +03:00
|
|
|
#include "opal/runtime/opal_params.h"
|
|
|
|
#include "opal/memoryhooks/memory.h"
|
2005-09-08 00:21:15 +04:00
|
|
|
|
2015-11-02 22:07:08 +03:00
|
|
|
mca_rcache_base_module_t* mca_rcache_base_module_create (const char* name, void *user_data,
|
|
|
|
struct mca_rcache_base_resources_t* resources)
|
2005-09-08 00:21:15 +04:00
|
|
|
{
|
2013-12-22 03:23:33 +04:00
|
|
|
mca_rcache_base_component_t* component = NULL;
|
|
|
|
mca_rcache_base_module_t* module = NULL;
|
2015-11-02 22:07:08 +03:00
|
|
|
mca_base_component_list_item_t *cli;
|
2005-09-08 00:21:15 +04:00
|
|
|
mca_rcache_base_selected_module_t *sm;
|
|
|
|
|
2015-11-02 22:07:08 +03:00
|
|
|
/* on the very first creation of a module we init the memory
|
|
|
|
callback */
|
|
|
|
if (!mca_rcache_base_used_mem_hooks) {
|
|
|
|
/* Use the memory hooks if leave_pinned or
|
|
|
|
* leave_pinned_pipeline is enabled (note that either of these
|
|
|
|
* leave_pinned variables may have been set by a user MCA
|
|
|
|
* param or elsewhere in the code base). Yes, we could havexc
|
|
|
|
* coded this more succinctly, but this is more clear. Do not
|
|
|
|
* check memory hooks if the rcache does not provide an
|
|
|
|
* range invalidation function.. */
|
2016-04-08 23:38:09 +03:00
|
|
|
if (opal_leave_pinned != 0 || opal_leave_pinned_pipeline) {
|
|
|
|
/* open the memory manager components. Memory hooks may be
|
|
|
|
triggered before this (any time after mem_free_init(),
|
|
|
|
actually). This is a hook available for memory manager hooks
|
|
|
|
without good initialization routine support */
|
|
|
|
(void) mca_base_framework_open (&opal_memory_base_framework, 0);
|
|
|
|
|
2015-11-02 22:07:08 +03:00
|
|
|
if ((OPAL_MEMORY_FREE_SUPPORT | OPAL_MEMORY_MUNMAP_SUPPORT) ==
|
|
|
|
((OPAL_MEMORY_FREE_SUPPORT | OPAL_MEMORY_MUNMAP_SUPPORT) &
|
|
|
|
opal_mem_hooks_support_level())) {
|
2016-04-08 23:38:09 +03:00
|
|
|
if (-1 == opal_leave_pinned) {
|
|
|
|
opal_leave_pinned = !opal_leave_pinned_pipeline;
|
|
|
|
}
|
2015-11-02 22:07:08 +03:00
|
|
|
opal_mem_hooks_register_release(mca_rcache_base_mem_cb, NULL);
|
2016-04-26 23:39:23 +03:00
|
|
|
} else if (1 == opal_leave_pinned || opal_leave_pinned_pipeline) {
|
2015-11-02 22:07:08 +03:00
|
|
|
opal_show_help("help-rcache-base.txt", "leave pinned failed",
|
|
|
|
true, name, OPAL_NAME_PRINT(OPAL_PROC_MY_NAME),
|
|
|
|
opal_proc_local_get()->proc_hostname);
|
|
|
|
return NULL;
|
|
|
|
}
|
|
|
|
|
|
|
|
/* Set this to true so that rcache_base_close knows to
|
|
|
|
cleanup */
|
|
|
|
mca_rcache_base_used_mem_hooks = 1;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2016-04-08 23:38:09 +03:00
|
|
|
OPAL_LIST_FOREACH(cli, &opal_rcache_base_framework.framework_components, mca_base_component_list_item_t) {
|
|
|
|
component = (mca_rcache_base_component_t *) cli->cli_component;
|
|
|
|
if(0 == strcmp(component->rcache_version.mca_component_name, name)) {
|
|
|
|
module = component->rcache_init (resources);
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
if ( NULL == module ) {
|
|
|
|
return NULL;
|
|
|
|
}
|
|
|
|
|
|
|
|
sm = OBJ_NEW(mca_rcache_base_selected_module_t);
|
|
|
|
sm->rcache_component = component;
|
|
|
|
sm->rcache_module = module;
|
|
|
|
sm->user_data = user_data;
|
|
|
|
opal_list_append(&mca_rcache_base_modules, (opal_list_item_t*) sm);
|
|
|
|
|
2013-12-22 03:23:33 +04:00
|
|
|
return module;
|
2005-09-08 00:21:15 +04:00
|
|
|
}
|
|
|
|
|
2015-11-02 22:07:08 +03:00
|
|
|
int mca_rcache_base_module_destroy(mca_rcache_base_module_t *module)
|
|
|
|
{
|
|
|
|
mca_rcache_base_selected_module_t *sm, *next;
|
|
|
|
|
|
|
|
OPAL_LIST_FOREACH_SAFE(sm, next, &mca_rcache_base_modules, mca_rcache_base_selected_module_t) {
|
|
|
|
if (module == sm->rcache_module) {
|
|
|
|
opal_list_remove_item(&mca_rcache_base_modules, (opal_list_item_t*)sm);
|
|
|
|
if (NULL != sm->rcache_module->rcache_finalize) {
|
|
|
|
sm->rcache_module->rcache_finalize(sm->rcache_module);
|
|
|
|
}
|
|
|
|
OBJ_RELEASE(sm);
|
|
|
|
return OPAL_SUCCESS;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
return OPAL_ERR_NOT_FOUND;
|
|
|
|
}
|