2011-12-10 01:24:07 +04:00
|
|
|
/* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil -*- */
|
|
|
|
/*
|
2015-01-06 02:03:15 +03:00
|
|
|
* Copyright (c) 2011-2015 Los Alamos National Security, LLC. All rights
|
2011-12-10 01:24:07 +04:00
|
|
|
* reserved.
|
|
|
|
* Copyright (c) 2011 UT-Battelle, LLC. All rights reserved.
|
2014-11-12 04:00:42 +03:00
|
|
|
* Copyright (c) 2014 Research Organization for Information Science
|
|
|
|
* and Technology (RIST). All rights reserved.
|
2011-12-10 01:24:07 +04:00
|
|
|
* $COPYRIGHT$
|
|
|
|
*
|
|
|
|
* Additional copyrights may follow
|
|
|
|
*
|
|
|
|
* $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"
|
2011-12-10 01:24:07 +04:00
|
|
|
|
|
|
|
#include "btl_ugni.h"
|
|
|
|
#include "btl_ugni_frag.h"
|
|
|
|
#include "btl_ugni_endpoint.h"
|
2012-04-24 01:11:57 +04:00
|
|
|
#include "btl_ugni_prepare.h"
|
2013-11-18 08:58:37 +04:00
|
|
|
#include "btl_ugni_smsg.h"
|
2011-12-10 01:24:07 +04:00
|
|
|
|
|
|
|
static int
|
|
|
|
mca_btl_ugni_free (struct mca_btl_base_module_t *btl,
|
|
|
|
mca_btl_base_descriptor_t *des);
|
|
|
|
|
|
|
|
static int
|
|
|
|
mca_btl_ugni_module_finalize (struct mca_btl_base_module_t* btl);
|
|
|
|
|
|
|
|
static struct mca_btl_base_descriptor_t *
|
|
|
|
mca_btl_ugni_prepare_src (struct mca_btl_base_module_t *btl,
|
|
|
|
struct mca_btl_base_endpoint_t *endpoint,
|
|
|
|
struct opal_convertor_t *convertor,
|
|
|
|
uint8_t order, size_t reserve, size_t *size,
|
|
|
|
uint32_t flags);
|
|
|
|
|
2015-01-06 02:03:15 +03:00
|
|
|
static mca_btl_base_registration_handle_t *
|
|
|
|
mca_btl_ugni_register_mem (mca_btl_base_module_t *btl, mca_btl_base_endpoint_t *endpoint, void *base,
|
|
|
|
size_t size, uint32_t flags);
|
|
|
|
|
|
|
|
static int mca_btl_ugni_deregister_mem (mca_btl_base_module_t *btl, mca_btl_base_registration_handle_t *handle);
|
|
|
|
|
2011-12-10 01:24:07 +04:00
|
|
|
mca_btl_ugni_module_t mca_btl_ugni_module = {
|
2013-11-18 08:58:37 +04:00
|
|
|
.super = {
|
2015-01-06 02:03:15 +03:00
|
|
|
.btl_component = &mca_btl_ugni_component.super,
|
|
|
|
.btl_add_procs = mca_btl_ugni_add_procs,
|
|
|
|
.btl_del_procs = mca_btl_ugni_del_procs,
|
|
|
|
.btl_finalize = mca_btl_ugni_module_finalize,
|
|
|
|
.btl_alloc = mca_btl_ugni_alloc,
|
|
|
|
.btl_free = mca_btl_ugni_free,
|
|
|
|
.btl_prepare_src = mca_btl_ugni_prepare_src,
|
|
|
|
.btl_send = mca_btl_ugni_send,
|
|
|
|
.btl_sendi = mca_btl_ugni_sendi,
|
|
|
|
.btl_put = mca_btl_ugni_put,
|
|
|
|
.btl_get = mca_btl_ugni_get,
|
|
|
|
.btl_register_mem = mca_btl_ugni_register_mem,
|
|
|
|
.btl_deregister_mem = mca_btl_ugni_deregister_mem,
|
2015-01-06 00:35:00 +03:00
|
|
|
.btl_atomic_op = mca_btl_ugni_aop,
|
|
|
|
.btl_atomic_fop = mca_btl_ugni_afop,
|
|
|
|
.btl_atomic_cswap = mca_btl_ugni_acswap,
|
2011-12-10 01:24:07 +04:00
|
|
|
}
|
|
|
|
};
|
|
|
|
|
|
|
|
int
|
|
|
|
mca_btl_ugni_module_init (mca_btl_ugni_module_t *ugni_module,
|
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
|
|
|
opal_common_ugni_device_t *dev)
|
2011-12-10 01:24:07 +04:00
|
|
|
{
|
|
|
|
int rc;
|
|
|
|
|
|
|
|
BTL_VERBOSE(("binding module %p to device %p", (void *) ugni_module,
|
|
|
|
(void *) dev));
|
|
|
|
|
|
|
|
/* copy module defaults (and function pointers) */
|
|
|
|
memmove (ugni_module, &mca_btl_ugni_module, sizeof (mca_btl_ugni_module));
|
|
|
|
|
2013-11-18 08:58:37 +04:00
|
|
|
ugni_module->initialized = false;
|
|
|
|
ugni_module->nlocal_procs = 0;
|
|
|
|
ugni_module->active_send_count = 0;
|
|
|
|
|
2011-12-10 01:24:07 +04:00
|
|
|
OBJ_CONSTRUCT(&ugni_module->failed_frags, opal_list_t);
|
2014-10-09 00:58:09 +04:00
|
|
|
OBJ_CONSTRUCT(&ugni_module->failed_frags_lock, opal_mutex_t);
|
|
|
|
|
|
|
|
OBJ_CONSTRUCT(&ugni_module->eager_get_pending, opal_list_t);
|
|
|
|
OBJ_CONSTRUCT(&ugni_module->eager_get_pending_lock,opal_mutex_t);
|
|
|
|
|
2015-02-19 23:41:41 +03:00
|
|
|
OBJ_CONSTRUCT(&ugni_module->eager_frags_send, opal_free_list_t);
|
|
|
|
OBJ_CONSTRUCT(&ugni_module->eager_frags_recv, opal_free_list_t);
|
|
|
|
OBJ_CONSTRUCT(&ugni_module->smsg_frags, opal_free_list_t);
|
|
|
|
OBJ_CONSTRUCT(&ugni_module->rdma_frags, opal_free_list_t);
|
|
|
|
OBJ_CONSTRUCT(&ugni_module->rdma_int_frags, opal_free_list_t);
|
2012-04-20 01:51:55 +04:00
|
|
|
OBJ_CONSTRUCT(&ugni_module->pending_smsg_frags_bb, opal_pointer_array_t);
|
2014-10-08 20:10:19 +04:00
|
|
|
OBJ_CONSTRUCT(&ugni_module->ep_wait_list_lock,opal_mutex_t);
|
2012-06-01 00:02:41 +04:00
|
|
|
OBJ_CONSTRUCT(&ugni_module->ep_wait_list, opal_list_t);
|
2013-11-18 08:58:37 +04:00
|
|
|
OBJ_CONSTRUCT(&ugni_module->endpoints, opal_pointer_array_t);
|
|
|
|
OBJ_CONSTRUCT(&ugni_module->id_to_endpoint, opal_hash_table_t);
|
2015-02-19 23:41:41 +03:00
|
|
|
OBJ_CONSTRUCT(&ugni_module->smsg_mboxes, opal_free_list_t);
|
2015-01-06 02:03:15 +03:00
|
|
|
OBJ_CONSTRUCT(&ugni_module->pending_descriptors, opal_list_t);
|
|
|
|
OBJ_CONSTRUCT(&ugni_module->eager_get_pending, opal_list_t);
|
2015-02-19 23:41:41 +03:00
|
|
|
OBJ_CONSTRUCT(&ugni_module->post_descriptors, opal_free_list_t);
|
2011-12-10 01:24:07 +04:00
|
|
|
|
|
|
|
ugni_module->device = dev;
|
2012-03-16 00:13:32 +04:00
|
|
|
dev->btl_ctx = (void *) ugni_module;
|
2011-12-10 01:24:07 +04:00
|
|
|
|
|
|
|
/* create wildcard endpoint to listen for connections.
|
|
|
|
* there is no need to bind this endpoint. */
|
2014-10-08 20:10:19 +04:00
|
|
|
OPAL_THREAD_LOCK(&dev->dev_lock);
|
2011-12-10 01:24:07 +04:00
|
|
|
rc = GNI_EpCreate (ugni_module->device->dev_handle, NULL,
|
|
|
|
&ugni_module->wildcard_ep);
|
2014-10-08 20:10:19 +04:00
|
|
|
OPAL_THREAD_UNLOCK(&dev->dev_lock);
|
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
|
|
|
if (OPAL_UNLIKELY(OPAL_SUCCESS != rc)) {
|
2011-12-10 01:24:07 +04:00
|
|
|
BTL_ERROR(("error creating wildcard ugni endpoint"));
|
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
|
|
|
return opal_common_rc_ugni_to_opal (rc);
|
2011-12-10 01:24:07 +04:00
|
|
|
}
|
|
|
|
|
|
|
|
/* post wildcard datagram */
|
|
|
|
rc = mca_btl_ugni_wildcard_ep_post (ugni_module);
|
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
|
|
|
if (OPAL_UNLIKELY(OPAL_SUCCESS != rc)) {
|
2011-12-10 01:24:07 +04:00
|
|
|
BTL_ERROR(("error posting wildcard datagram"));
|
|
|
|
return rc;
|
|
|
|
}
|
|
|
|
|
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
|
|
|
return OPAL_SUCCESS;
|
2011-12-10 01:24:07 +04:00
|
|
|
}
|
|
|
|
|
|
|
|
static int
|
|
|
|
mca_btl_ugni_module_finalize (struct mca_btl_base_module_t *btl)
|
|
|
|
{
|
|
|
|
mca_btl_ugni_module_t *ugni_module = (mca_btl_ugni_module_t *)btl;
|
2013-11-18 08:58:37 +04:00
|
|
|
mca_btl_base_endpoint_t *ep;
|
|
|
|
uint64_t key;
|
|
|
|
void *node;
|
2012-04-25 01:16:51 +04:00
|
|
|
int rc;
|
2011-12-10 01:24:07 +04:00
|
|
|
|
2013-11-18 08:58:37 +04:00
|
|
|
while (ugni_module->active_send_count) {
|
|
|
|
/* ensure all sends are complete before closing the module */
|
|
|
|
rc = mca_btl_ugni_progress_local_smsg (ugni_module);
|
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
|
|
|
if (OPAL_SUCCESS != rc) {
|
2013-11-18 08:58:37 +04:00
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2011-12-10 01:24:07 +04:00
|
|
|
/* close all open connections and release endpoints */
|
2013-11-18 08:58:37 +04:00
|
|
|
if (ugni_module->initialized) {
|
|
|
|
rc = opal_hash_table_get_first_key_uint64 (&ugni_module->id_to_endpoint, &key, (void **) &ep, &node);
|
|
|
|
while (OPAL_SUCCESS == rc) {
|
|
|
|
if (NULL != ep) {
|
|
|
|
mca_btl_ugni_release_ep (ep);
|
2011-12-10 01:24:07 +04:00
|
|
|
}
|
|
|
|
|
2013-11-18 08:58:37 +04:00
|
|
|
rc = opal_hash_table_get_next_key_uint64 (&ugni_module->id_to_endpoint, &key, (void **) &ep, node, &node);
|
2011-12-10 01:24:07 +04:00
|
|
|
}
|
|
|
|
|
2014-12-24 20:41:58 +03:00
|
|
|
if (mca_btl_ugni_component.progress_thread_enabled) {
|
2014-12-05 02:18:16 +03:00
|
|
|
mca_btl_ugni_kill_progress_thread();
|
|
|
|
}
|
|
|
|
|
2013-11-18 08:58:37 +04:00
|
|
|
/* destroy all cqs */
|
2014-10-08 20:10:19 +04:00
|
|
|
OPAL_THREAD_LOCK(&ugni_module->device->dev_lock);
|
2013-11-18 08:58:37 +04:00
|
|
|
rc = GNI_CqDestroy (ugni_module->rdma_local_cq);
|
|
|
|
if (GNI_RC_SUCCESS != rc) {
|
2014-12-05 02:18:16 +03:00
|
|
|
BTL_ERROR(("error tearing down local BTE/FMA CQ - %s",gni_err_str[rc]));
|
2013-11-18 08:58:37 +04:00
|
|
|
}
|
2012-04-20 01:51:55 +04:00
|
|
|
|
2013-11-18 08:58:37 +04:00
|
|
|
rc = GNI_CqDestroy (ugni_module->smsg_local_cq);
|
|
|
|
if (GNI_RC_SUCCESS != rc) {
|
2014-12-05 02:18:16 +03:00
|
|
|
BTL_ERROR(("error tearing down TX SMSG CQ - %s",gni_err_str[rc]));
|
2013-11-18 08:58:37 +04:00
|
|
|
}
|
2011-12-10 01:24:07 +04:00
|
|
|
|
2013-11-18 08:58:37 +04:00
|
|
|
rc = GNI_CqDestroy (ugni_module->smsg_remote_cq);
|
|
|
|
if (GNI_RC_SUCCESS != rc) {
|
2014-12-05 02:18:16 +03:00
|
|
|
BTL_ERROR(("error tearing down RX SMSG CQ - %s",gni_err_str[rc]));
|
|
|
|
}
|
|
|
|
|
2015-01-07 23:48:17 +03:00
|
|
|
if (mca_btl_ugni_component.progress_thread_enabled) {
|
|
|
|
rc = GNI_CqDestroy (ugni_module->rdma_local_irq_cq);
|
|
|
|
if (GNI_RC_SUCCESS != rc) {
|
|
|
|
BTL_ERROR(("error tearing down local BTE/FMA CQ - %s",gni_err_str[rc]));
|
|
|
|
}
|
2014-12-05 02:18:16 +03:00
|
|
|
|
2015-01-07 23:48:17 +03:00
|
|
|
rc = GNI_CqDestroy (ugni_module->smsg_remote_irq_cq);
|
|
|
|
if (GNI_RC_SUCCESS != rc) {
|
|
|
|
BTL_ERROR(("error tearing down remote SMSG CQ - %s",gni_err_str[rc]));
|
|
|
|
}
|
2013-11-18 08:58:37 +04:00
|
|
|
}
|
2012-04-20 01:51:55 +04:00
|
|
|
|
2013-11-18 08:58:37 +04:00
|
|
|
/* cancel wildcard post */
|
|
|
|
rc = GNI_EpPostDataCancelById (ugni_module->wildcard_ep,
|
|
|
|
MCA_BTL_UGNI_CONNECT_WILDCARD_ID |
|
2014-11-12 04:00:42 +03:00
|
|
|
OPAL_PROC_MY_NAME.vpid);
|
2013-11-18 08:58:37 +04:00
|
|
|
if (GNI_RC_SUCCESS != rc) {
|
|
|
|
BTL_VERBOSE(("btl/ugni error cancelling wildcard post"));
|
|
|
|
}
|
2011-12-10 01:24:07 +04:00
|
|
|
|
2013-11-18 08:58:37 +04:00
|
|
|
/* tear down wildcard endpoint */
|
|
|
|
rc = GNI_EpDestroy (ugni_module->wildcard_ep);
|
|
|
|
if (GNI_RC_SUCCESS != rc) {
|
2014-12-05 02:18:16 +03:00
|
|
|
BTL_VERBOSE(("btl/ugni error destroying endpoint - %s",gni_err_str[rc]));
|
2013-11-18 08:58:37 +04:00
|
|
|
}
|
2014-10-08 20:10:19 +04:00
|
|
|
OPAL_THREAD_UNLOCK(&ugni_module->device->dev_lock);
|
2011-12-10 01:24:07 +04:00
|
|
|
}
|
|
|
|
|
2014-05-14 01:22:33 +04:00
|
|
|
OBJ_DESTRUCT(&ugni_module->eager_frags_send);
|
|
|
|
OBJ_DESTRUCT(&ugni_module->eager_frags_recv);
|
|
|
|
OBJ_DESTRUCT(&ugni_module->smsg_frags);
|
|
|
|
OBJ_DESTRUCT(&ugni_module->rdma_frags);
|
|
|
|
OBJ_DESTRUCT(&ugni_module->rdma_int_frags);
|
|
|
|
OBJ_DESTRUCT(&ugni_module->ep_wait_list);
|
|
|
|
OBJ_DESTRUCT(&ugni_module->smsg_mboxes);
|
2012-04-20 01:51:55 +04:00
|
|
|
OBJ_DESTRUCT(&ugni_module->pending_smsg_frags_bb);
|
2013-11-18 08:58:37 +04:00
|
|
|
OBJ_DESTRUCT(&ugni_module->id_to_endpoint);
|
|
|
|
OBJ_DESTRUCT(&ugni_module->endpoints);
|
2011-12-10 01:24:07 +04:00
|
|
|
|
2014-10-09 00:58:09 +04:00
|
|
|
OBJ_DESTRUCT(&ugni_module->eager_get_pending);
|
|
|
|
OBJ_DESTRUCT(&ugni_module->eager_get_pending_lock);
|
|
|
|
|
2014-05-15 20:58:28 +04:00
|
|
|
if (ugni_module->initialized) {
|
|
|
|
/* need to tear down the mpools *after* the free lists */
|
|
|
|
if (NULL != ugni_module->smsg_mpool) {
|
|
|
|
(void) mca_mpool_base_module_destroy (ugni_module->smsg_mpool);
|
|
|
|
ugni_module->smsg_mpool = NULL;
|
|
|
|
}
|
|
|
|
|
|
|
|
if (NULL != ugni_module->super.btl_mpool) {
|
|
|
|
(void) mca_mpool_base_module_destroy (ugni_module->super.btl_mpool);
|
|
|
|
ugni_module->super.btl_mpool = NULL;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2013-11-18 08:58:37 +04:00
|
|
|
ugni_module->initialized = false;
|
|
|
|
|
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
|
|
|
return OPAL_SUCCESS;
|
2011-12-10 01:24:07 +04:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
mca_btl_base_descriptor_t *
|
|
|
|
mca_btl_ugni_alloc(struct mca_btl_base_module_t *btl,
|
|
|
|
struct mca_btl_base_endpoint_t *endpoint,
|
|
|
|
uint8_t order, size_t size, uint32_t flags)
|
|
|
|
{
|
|
|
|
mca_btl_ugni_base_frag_t *frag = NULL;
|
|
|
|
|
2012-02-10 04:47:29 +04:00
|
|
|
if (size <= mca_btl_ugni_component.smsg_max_data) {
|
|
|
|
(void) MCA_BTL_UGNI_FRAG_ALLOC_SMSG(endpoint, frag);
|
|
|
|
} else if (size <= btl->btl_eager_limit) {
|
|
|
|
(void) MCA_BTL_UGNI_FRAG_ALLOC_EAGER_SEND(endpoint, frag);
|
2011-12-10 01:24:07 +04:00
|
|
|
}
|
|
|
|
|
2012-04-20 01:51:55 +04:00
|
|
|
if (OPAL_UNLIKELY(NULL == frag)) {
|
|
|
|
return NULL;
|
|
|
|
}
|
|
|
|
|
2011-12-10 01:24:07 +04:00
|
|
|
BTL_VERBOSE(("btl/ugni_module allocated frag of size: %u, flags: %x. frag = %p",
|
|
|
|
(unsigned int)size, flags, (void *) frag));
|
|
|
|
|
2012-04-20 01:51:55 +04:00
|
|
|
frag->base.des_flags = flags;
|
|
|
|
frag->base.order = order;
|
2015-01-06 02:03:15 +03:00
|
|
|
frag->base.des_segments = &frag->segments[1];
|
|
|
|
frag->base.des_segment_count = 1;
|
2011-12-10 01:24:07 +04:00
|
|
|
|
2015-01-06 02:03:15 +03:00
|
|
|
frag->segments[0].seg_addr.pval = NULL;
|
|
|
|
frag->segments[0].seg_len = 0;
|
|
|
|
frag->segments[1].seg_addr.pval = frag->base.super.ptr;
|
|
|
|
frag->segments[1].seg_len = size;
|
2012-04-20 01:51:55 +04:00
|
|
|
|
2012-05-07 21:23:06 +04:00
|
|
|
frag->flags = MCA_BTL_UGNI_FRAG_BUFFERED;
|
|
|
|
if (size > mca_btl_ugni_component.smsg_max_data) {
|
|
|
|
mca_btl_ugni_reg_t *registration;
|
|
|
|
|
|
|
|
frag->hdr_size = sizeof (frag->hdr.eager);
|
2012-06-01 00:02:41 +04:00
|
|
|
frag->flags |= MCA_BTL_UGNI_FRAG_EAGER | MCA_BTL_UGNI_FRAG_IGNORE;
|
2012-05-07 21:23:06 +04:00
|
|
|
|
|
|
|
registration = (mca_btl_ugni_reg_t *) frag->base.super.registration;
|
|
|
|
|
2015-01-06 02:03:15 +03:00
|
|
|
frag->hdr.eager.memory_handle = registration->handle;
|
2012-05-07 21:23:06 +04:00
|
|
|
} else {
|
|
|
|
frag->hdr_size = sizeof (frag->hdr.send);
|
|
|
|
}
|
|
|
|
|
2012-04-20 01:51:55 +04:00
|
|
|
return &frag->base;
|
2011-12-10 01:24:07 +04:00
|
|
|
}
|
|
|
|
|
|
|
|
static int
|
|
|
|
mca_btl_ugni_free (struct mca_btl_base_module_t *btl,
|
|
|
|
mca_btl_base_descriptor_t *des)
|
|
|
|
{
|
2012-04-20 01:51:55 +04:00
|
|
|
return mca_btl_ugni_frag_return ((mca_btl_ugni_base_frag_t *) des);
|
2011-12-10 01:24:07 +04:00
|
|
|
}
|
|
|
|
|
2012-04-20 01:51:55 +04:00
|
|
|
static struct mca_btl_base_descriptor_t *
|
|
|
|
mca_btl_ugni_prepare_src (struct mca_btl_base_module_t *btl,
|
|
|
|
mca_btl_base_endpoint_t *endpoint,
|
|
|
|
struct opal_convertor_t *convertor,
|
|
|
|
uint8_t order, size_t reserve, size_t *size,
|
|
|
|
uint32_t flags)
|
|
|
|
{
|
2015-01-06 02:03:15 +03:00
|
|
|
return mca_btl_ugni_prepare_src_send (btl, endpoint, convertor,
|
|
|
|
order, reserve, size, flags);
|
2011-12-10 01:24:07 +04:00
|
|
|
}
|
|
|
|
|
2015-01-06 02:03:15 +03:00
|
|
|
static mca_btl_base_registration_handle_t *
|
|
|
|
mca_btl_ugni_register_mem (mca_btl_base_module_t *btl, mca_btl_base_endpoint_t *endpoint, void *base,
|
|
|
|
size_t size, uint32_t flags)
|
2011-12-10 01:24:07 +04:00
|
|
|
{
|
2015-01-06 02:03:15 +03:00
|
|
|
mca_btl_ugni_reg_t *reg;
|
2011-12-10 01:24:07 +04:00
|
|
|
int rc;
|
|
|
|
|
2015-01-06 02:03:15 +03:00
|
|
|
rc = btl->btl_mpool->mpool_register(btl->btl_mpool, base, size, 0,
|
|
|
|
(mca_mpool_base_registration_t **) ®);
|
|
|
|
if (OPAL_UNLIKELY(OPAL_SUCCESS != rc)) {
|
2011-12-10 01:24:07 +04:00
|
|
|
return NULL;
|
|
|
|
}
|
|
|
|
|
2015-01-06 02:03:15 +03:00
|
|
|
return ®->handle;
|
|
|
|
}
|
2011-12-10 01:24:07 +04:00
|
|
|
|
2015-01-06 02:03:15 +03:00
|
|
|
static int mca_btl_ugni_deregister_mem (mca_btl_base_module_t *btl, mca_btl_base_registration_handle_t *handle)
|
|
|
|
{
|
|
|
|
mca_btl_ugni_reg_t *reg =
|
|
|
|
(mca_btl_ugni_reg_t *)((intptr_t) handle - offsetof (mca_btl_ugni_reg_t, handle));
|
2011-12-10 01:24:07 +04:00
|
|
|
|
2015-01-06 02:03:15 +03:00
|
|
|
(void) btl->btl_mpool->mpool_deregister (btl->btl_mpool, ®->base);
|
2014-11-20 09:22:43 +03:00
|
|
|
|
2015-01-06 02:03:15 +03:00
|
|
|
return OPAL_SUCCESS;
|
2011-12-10 01:24:07 +04:00
|
|
|
}
|