2011-11-02 15:07:57 +00:00
|
|
|
/* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil -*- */
|
2011-10-20 21:39:44 +00:00
|
|
|
/*
|
|
|
|
* Copyright (c) 2004-2011 The Trustees of Indiana University and Indiana
|
|
|
|
* University Research and Technology
|
|
|
|
* Corporation. All rights reserved.
|
|
|
|
* Copyright (c) 2004-2009 The University of Tennessee and The University
|
|
|
|
* of Tennessee Research Foundation. All rights
|
|
|
|
* reserved.
|
|
|
|
* Copyright (c) 2004-2007 High Performance Computing Center Stuttgart,
|
|
|
|
* University of Stuttgart. All rights reserved.
|
|
|
|
* Copyright (c) 2004-2005 The Regents of the University of California.
|
|
|
|
* All rights reserved.
|
|
|
|
* Copyright (c) 2006-2007 Voltaire. All rights reserved.
|
|
|
|
* Copyright (c) 2009 Cisco Systems, Inc. All rights reserved.
|
2014-05-15 19:26:49 +00:00
|
|
|
* Copyright (c) 2010-2014 Los Alamos National Security, LLC. All rights
|
|
|
|
* reserved.
|
Per the PMIx RFC:
WHAT: Merge the PMIx branch into the devel repo, creating a new
OPAL “lmix” framework to abstract PMI support for all RTEs.
Replace the ORTE daemon-level collectives with a new PMIx
server and update the ORTE grpcomm framework to support
server-to-server collectives
WHY: We’ve had problems dealing with variations in PMI implementations,
and need to extend the existing PMI definitions to meet exascale
requirements.
WHEN: Mon, Aug 25
WHERE: https://github.com/rhc54/ompi-svn-mirror.git
Several community members have been working on a refactoring of the current PMI support within OMPI. Although the APIs are common, Slurm and Cray implement a different range of capabilities, and package them differently. For example, Cray provides an integrated PMI-1/2 library, while Slurm separates the two and requires the user to specify the one to be used at runtime. In addition, several bugs in the Slurm implementations have caused problems requiring extra coding.
All this has led to a slew of #if’s in the PMI code and bugs when the corner-case logic for one implementation accidentally traps the other. Extending this support to other implementations would have increased this complexity to an unacceptable level.
Accordingly, we have:
* created a new OPAL “pmix” framework to abstract the PMI support, with separate components for Cray, Slurm PMI-1, and Slurm PMI-2 implementations.
* Replaced the current ORTE grpcomm daemon-based collective operation with an integrated PMIx server, and updated the grpcomm APIs to provide more flexible, multi-algorithm support for collective operations. At this time, only the xcast and allgather operations are supported.
* Replaced the current global collective id with a signature based on the names of the participating procs. The allows an unlimited number of collectives to be executed by any group of processes, subject to the requirement that only one collective can be active at a time for a unique combination of procs. Note that a proc can be involved in any number of simultaneous collectives - it is the specific combination of procs that is subject to the constraint
* removed the prior OMPI/OPAL modex code
* added new macros for executing modex send/recv to simplify use of the new APIs. The send macros allow the caller to specify whether or not the BTL supports async modex operations - if so, then the non-blocking “fence” operation is used, if the active PMIx component supports it. Otherwise, the default is a full blocking modex exchange as we currently perform.
* retained the current flag that directs us to use a blocking fence operation, but only to retrieve data upon demand
This commit was SVN r32570.
2014-08-21 18:56:47 +00:00
|
|
|
* Copyright (c) 2014 Intel, Inc. All rights reserved.
|
2014-10-21 10:42:22 +09:00
|
|
|
* Copyright (c) 2014 Research Organization for Information Science
|
|
|
|
* and Technology (RIST). All rights reserved.
|
2011-10-20 21:39:44 +00: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 00:47:28 +00:00
|
|
|
#include "opal_config.h"
|
2011-10-20 21:39:44 +00:00
|
|
|
|
|
|
|
#include "btl_vader.h"
|
|
|
|
#include "btl_vader_endpoint.h"
|
|
|
|
#include "btl_vader_fifo.h"
|
2011-10-27 20:22:46 +00:00
|
|
|
#include "btl_vader_fbox.h"
|
2014-10-08 15:42:57 -06:00
|
|
|
#include "btl_vader_xpmem.h"
|
2011-10-20 21:39:44 +00:00
|
|
|
|
2014-01-06 19:51:44 +00:00
|
|
|
#include <string.h>
|
|
|
|
|
2011-10-20 21:39:44 +00:00
|
|
|
static int vader_del_procs (struct mca_btl_base_module_t *btl,
|
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 00:47:28 +00:00
|
|
|
size_t nprocs, struct opal_proc_t **procs,
|
2011-11-02 15:07:57 +00:00
|
|
|
struct mca_btl_base_endpoint_t **peers);
|
2011-10-20 21:39:44 +00:00
|
|
|
|
|
|
|
static int vader_register_error_cb (struct mca_btl_base_module_t* btl,
|
2011-11-02 15:07:57 +00:00
|
|
|
mca_btl_base_module_error_cb_fn_t cbfunc);
|
2011-10-20 21:39:44 +00:00
|
|
|
|
|
|
|
static int vader_finalize (struct mca_btl_base_module_t* btl);
|
|
|
|
|
|
|
|
static int vader_free (struct mca_btl_base_module_t* btl, mca_btl_base_descriptor_t* des);
|
|
|
|
|
|
|
|
static struct mca_btl_base_descriptor_t *vader_prepare_src (
|
2011-11-02 15:07:57 +00:00
|
|
|
struct mca_btl_base_module_t *btl,
|
|
|
|
struct mca_btl_base_endpoint_t *endpoint,
|
|
|
|
mca_mpool_base_registration_t *registration,
|
|
|
|
struct opal_convertor_t *convertor,
|
|
|
|
uint8_t order,
|
|
|
|
size_t reserve,
|
|
|
|
size_t *size,
|
|
|
|
uint32_t flags
|
|
|
|
);
|
2011-10-20 21:39:44 +00:00
|
|
|
|
|
|
|
static struct mca_btl_base_descriptor_t *vader_prepare_dst (
|
2011-11-02 15:07:57 +00:00
|
|
|
struct mca_btl_base_module_t *btl,
|
|
|
|
struct mca_btl_base_endpoint_t *endpoint,
|
|
|
|
struct mca_mpool_base_registration_t *registration,
|
|
|
|
struct opal_convertor_t *convertor,
|
|
|
|
uint8_t order,
|
|
|
|
size_t reserve,
|
|
|
|
size_t *size,
|
|
|
|
uint32_t flags);
|
2011-10-20 21:39:44 +00:00
|
|
|
|
|
|
|
static int vader_add_procs(struct mca_btl_base_module_t* btl,
|
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 00:47:28 +00:00
|
|
|
size_t nprocs, struct opal_proc_t **procs,
|
2011-11-02 15:07:57 +00:00
|
|
|
struct mca_btl_base_endpoint_t** peers,
|
|
|
|
struct opal_bitmap_t* reachability);
|
2011-10-20 21:39:44 +00:00
|
|
|
|
|
|
|
static int vader_ft_event (int state);
|
|
|
|
|
|
|
|
mca_btl_vader_t mca_btl_vader = {
|
|
|
|
{
|
|
|
|
&mca_btl_vader_component.super,
|
2013-03-27 22:10:02 +00:00
|
|
|
.btl_add_procs = vader_add_procs,
|
|
|
|
.btl_del_procs = vader_del_procs,
|
|
|
|
.btl_finalize = vader_finalize,
|
|
|
|
.btl_alloc = mca_btl_vader_alloc,
|
|
|
|
.btl_free = vader_free,
|
|
|
|
.btl_prepare_src = vader_prepare_src,
|
|
|
|
.btl_prepare_dst = vader_prepare_dst,
|
|
|
|
.btl_send = mca_btl_vader_send,
|
|
|
|
.btl_sendi = mca_btl_vader_sendi,
|
|
|
|
.btl_dump = mca_btl_base_dump,
|
|
|
|
.btl_register_error = vader_register_error_cb,
|
|
|
|
.btl_ft_event = vader_ft_event
|
2011-10-20 21:39:44 +00:00
|
|
|
}
|
|
|
|
};
|
|
|
|
|
2013-03-27 22:10:02 +00:00
|
|
|
static int vader_btl_first_time_init(mca_btl_vader_t *vader_btl, int n)
|
2011-10-20 21:39:44 +00:00
|
|
|
{
|
|
|
|
mca_btl_vader_component_t *component = &mca_btl_vader_component;
|
2013-03-27 22:10:02 +00:00
|
|
|
int rc;
|
2011-10-20 21:39:44 +00:00
|
|
|
|
2013-03-27 22:10:02 +00:00
|
|
|
/* generate the endpoints */
|
2014-01-06 19:51:44 +00:00
|
|
|
component->endpoints = (struct mca_btl_base_endpoint_t *) calloc (n + 1, sizeof (struct mca_btl_base_endpoint_t));
|
|
|
|
component->endpoints[n].peer_smp_rank = -1;
|
2014-09-23 18:11:22 +00:00
|
|
|
component->fbox_in_endpoints = calloc (n + 1, sizeof (void *));
|
|
|
|
|
|
|
|
if (NULL == component->endpoints || NULL == component->fbox_in_endpoints) {
|
|
|
|
return OPAL_ERR_OUT_OF_RESOURCE;
|
|
|
|
}
|
2011-10-20 21:39:44 +00:00
|
|
|
|
2014-09-23 18:11:22 +00:00
|
|
|
component->segment_offset = MCA_BTL_VADER_FIFO_SIZE;
|
2011-10-20 21:39:44 +00:00
|
|
|
|
2013-03-27 22:10:02 +00:00
|
|
|
/* initialize fragment descriptor free lists */
|
2014-10-17 17:06:33 -06:00
|
|
|
/* initialize free list for single copy (get, put) */
|
|
|
|
if (MCA_BTL_VADER_NONE != mca_btl_vader_component.single_copy_mechanism) {
|
|
|
|
rc = ompi_free_list_init_ex_new (&component->vader_frags_rdma,
|
|
|
|
sizeof(mca_btl_vader_frag_t), 8,
|
|
|
|
OBJ_CLASS(mca_btl_vader_frag_t),
|
|
|
|
0, opal_cache_line_size,
|
|
|
|
component->vader_free_list_num,
|
|
|
|
component->vader_free_list_max,
|
|
|
|
component->vader_free_list_inc,
|
|
|
|
NULL, mca_btl_vader_frag_init, (void *) 0);
|
|
|
|
if (OPAL_SUCCESS != rc) {
|
|
|
|
return rc;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
/* initialize free list for small send and inline fragments */
|
2013-07-11 20:54:12 +00:00
|
|
|
rc = ompi_free_list_init_ex_new(&component->vader_frags_user,
|
|
|
|
sizeof(mca_btl_vader_frag_t),
|
2013-03-27 22:10:02 +00:00
|
|
|
opal_cache_line_size, OBJ_CLASS(mca_btl_vader_frag_t),
|
|
|
|
0, opal_cache_line_size,
|
|
|
|
component->vader_free_list_num,
|
|
|
|
component->vader_free_list_max,
|
|
|
|
component->vader_free_list_inc,
|
|
|
|
NULL, mca_btl_vader_frag_init,
|
2014-09-23 18:11:22 +00:00
|
|
|
(void *)(intptr_t) mca_btl_vader_component.max_inline_send);
|
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 00:47:28 +00:00
|
|
|
if (OPAL_SUCCESS != rc) {
|
2011-11-02 15:07:57 +00:00
|
|
|
return rc;
|
2011-10-20 21:39:44 +00:00
|
|
|
}
|
|
|
|
|
2013-07-11 20:54:12 +00:00
|
|
|
/* initialize free list for buffered send fragments */
|
|
|
|
rc = ompi_free_list_init_ex_new(&component->vader_frags_eager,
|
|
|
|
sizeof (mca_btl_vader_frag_t),
|
2013-03-27 22:10:02 +00:00
|
|
|
opal_cache_line_size, OBJ_CLASS(mca_btl_vader_frag_t),
|
|
|
|
0, opal_cache_line_size,
|
|
|
|
component->vader_free_list_num,
|
|
|
|
component->vader_free_list_max,
|
|
|
|
component->vader_free_list_inc,
|
|
|
|
NULL, mca_btl_vader_frag_init,
|
2014-09-23 18:11:22 +00:00
|
|
|
(void *)(intptr_t) mca_btl_vader.super.btl_eager_limit);
|
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 00:47:28 +00:00
|
|
|
if (OPAL_SUCCESS != rc) {
|
2013-03-27 22:10:02 +00:00
|
|
|
return rc;
|
2011-10-20 21:39:44 +00:00
|
|
|
}
|
|
|
|
|
2014-10-17 17:06:33 -06:00
|
|
|
if (MCA_BTL_VADER_XPMEM != mca_btl_vader_component.single_copy_mechanism) {
|
|
|
|
/* initialize free list for buffered send fragments */
|
|
|
|
rc = ompi_free_list_init_ex_new(&component->vader_frags_max_send,
|
|
|
|
sizeof (mca_btl_vader_frag_t),
|
|
|
|
opal_cache_line_size, OBJ_CLASS(mca_btl_vader_frag_t),
|
|
|
|
0, opal_cache_line_size,
|
|
|
|
component->vader_free_list_num,
|
|
|
|
component->vader_free_list_max,
|
|
|
|
component->vader_free_list_inc,
|
|
|
|
NULL, mca_btl_vader_frag_init,
|
|
|
|
(void *)(intptr_t) mca_btl_vader.super.btl_max_send_size);
|
|
|
|
if (OPAL_SUCCESS != rc) {
|
|
|
|
return rc;
|
|
|
|
}
|
2014-01-06 19:51:44 +00:00
|
|
|
}
|
|
|
|
|
2013-03-27 22:10:02 +00:00
|
|
|
/* set flag indicating btl has been inited */
|
|
|
|
vader_btl->btl_inited = true;
|
2011-10-20 21:39:44 +00:00
|
|
|
|
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 00:47:28 +00:00
|
|
|
return OPAL_SUCCESS;
|
2013-03-27 22:10:02 +00:00
|
|
|
}
|
2011-10-20 21:39:44 +00:00
|
|
|
|
|
|
|
|
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 00:47:28 +00:00
|
|
|
static int init_vader_endpoint (struct mca_btl_base_endpoint_t *ep, struct opal_proc_t *proc, int remote_rank) {
|
2013-03-27 22:10:02 +00:00
|
|
|
mca_btl_vader_component_t *component = &mca_btl_vader_component;
|
2014-10-17 17:06:33 -06:00
|
|
|
union vader_modex_t *modex;
|
2013-03-27 22:10:02 +00:00
|
|
|
size_t msg_size;
|
|
|
|
int rc;
|
2011-10-27 20:22:46 +00:00
|
|
|
|
2014-09-23 18:11:22 +00:00
|
|
|
OBJ_CONSTRUCT(ep, mca_btl_vader_endpoint_t);
|
|
|
|
|
2013-07-11 20:54:12 +00:00
|
|
|
ep->peer_smp_rank = remote_rank;
|
2011-10-27 20:22:46 +00:00
|
|
|
|
2013-07-11 20:54:12 +00:00
|
|
|
if (remote_rank != MCA_BTL_VADER_LOCAL_RANK) {
|
2014-09-23 18:11:22 +00:00
|
|
|
OPAL_MODEX_RECV(rc, &component->super.btl_version, proc, (void **) &modex, &msg_size);
|
Per the PMIx RFC:
WHAT: Merge the PMIx branch into the devel repo, creating a new
OPAL “lmix” framework to abstract PMI support for all RTEs.
Replace the ORTE daemon-level collectives with a new PMIx
server and update the ORTE grpcomm framework to support
server-to-server collectives
WHY: We’ve had problems dealing with variations in PMI implementations,
and need to extend the existing PMI definitions to meet exascale
requirements.
WHEN: Mon, Aug 25
WHERE: https://github.com/rhc54/ompi-svn-mirror.git
Several community members have been working on a refactoring of the current PMI support within OMPI. Although the APIs are common, Slurm and Cray implement a different range of capabilities, and package them differently. For example, Cray provides an integrated PMI-1/2 library, while Slurm separates the two and requires the user to specify the one to be used at runtime. In addition, several bugs in the Slurm implementations have caused problems requiring extra coding.
All this has led to a slew of #if’s in the PMI code and bugs when the corner-case logic for one implementation accidentally traps the other. Extending this support to other implementations would have increased this complexity to an unacceptable level.
Accordingly, we have:
* created a new OPAL “pmix” framework to abstract the PMI support, with separate components for Cray, Slurm PMI-1, and Slurm PMI-2 implementations.
* Replaced the current ORTE grpcomm daemon-based collective operation with an integrated PMIx server, and updated the grpcomm APIs to provide more flexible, multi-algorithm support for collective operations. At this time, only the xcast and allgather operations are supported.
* Replaced the current global collective id with a signature based on the names of the participating procs. The allows an unlimited number of collectives to be executed by any group of processes, subject to the requirement that only one collective can be active at a time for a unique combination of procs. Note that a proc can be involved in any number of simultaneous collectives - it is the specific combination of procs that is subject to the constraint
* removed the prior OMPI/OPAL modex code
* added new macros for executing modex send/recv to simplify use of the new APIs. The send macros allow the caller to specify whether or not the BTL supports async modex operations - if so, then the non-blocking “fence” operation is used, if the active PMIx component supports it. Otherwise, the default is a full blocking modex exchange as we currently perform.
* retained the current flag that directs us to use a blocking fence operation, but only to retrieve data upon demand
This commit was SVN r32570.
2014-08-21 18:56:47 +00:00
|
|
|
if (OPAL_SUCCESS != rc) {
|
2013-07-11 20:54:12 +00:00
|
|
|
return rc;
|
|
|
|
}
|
2011-10-27 20:22:46 +00:00
|
|
|
|
2014-01-06 19:51:44 +00:00
|
|
|
/* attatch to the remote segment */
|
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 00:47:28 +00:00
|
|
|
#if OPAL_BTL_VADER_HAVE_XPMEM
|
2014-10-17 17:06:33 -06:00
|
|
|
if (MCA_BTL_VADER_XPMEM == mca_btl_vader_component.single_copy_mechanism) {
|
|
|
|
/* always use xpmem if it is available */
|
|
|
|
ep->segment_data.xpmem.apid = xpmem_get (modex->xpmem.seg_id, XPMEM_RDWR, XPMEM_PERMIT_MODE, (void *) 0666);
|
|
|
|
ep->segment_data.xpmem.rcache = mca_rcache_base_module_create("vma");
|
|
|
|
(void) vader_get_registation (ep, modex->xpmem.segment_base, mca_btl_vader_component.segment_size,
|
|
|
|
MCA_MPOOL_FLAGS_PERSIST, (void **) &ep->segment_base);
|
|
|
|
} else {
|
|
|
|
#endif
|
|
|
|
/* store a copy of the segment information for detach */
|
|
|
|
ep->segment_data.other.seg_ds = malloc (msg_size);
|
|
|
|
if (NULL == ep->segment_data.other.seg_ds) {
|
|
|
|
return OPAL_ERR_OUT_OF_RESOURCE;
|
|
|
|
}
|
2014-09-23 18:11:22 +00:00
|
|
|
|
2014-10-17 17:06:33 -06:00
|
|
|
memcpy (ep->segment_data.other.seg_ds, &modex->seg_ds, msg_size);
|
2014-09-23 18:11:22 +00:00
|
|
|
|
2014-10-17 17:06:33 -06:00
|
|
|
ep->segment_base = opal_shmem_segment_attach (ep->segment_data.other.seg_ds);
|
|
|
|
if (NULL == ep->segment_base) {
|
2014-10-21 10:42:22 +09:00
|
|
|
return OPAL_ERROR;
|
2014-10-17 17:06:33 -06:00
|
|
|
}
|
|
|
|
#if OPAL_BTL_VADER_HAVE_XPMEM
|
2014-01-06 19:51:44 +00:00
|
|
|
}
|
|
|
|
#endif
|
2014-09-23 18:11:22 +00:00
|
|
|
OBJ_CONSTRUCT(&ep->lock, opal_mutex_t);
|
2014-01-06 19:51:44 +00:00
|
|
|
|
2014-05-15 15:59:51 +00:00
|
|
|
free (modex);
|
2013-07-11 20:54:12 +00:00
|
|
|
} else {
|
|
|
|
/* set up the segment base so we can calculate a virtual to real for local pointers */
|
|
|
|
ep->segment_base = component->my_segment;
|
|
|
|
}
|
2011-10-20 21:39:44 +00:00
|
|
|
|
2014-01-06 19:51:44 +00:00
|
|
|
ep->fifo = (struct vader_fifo_t *) ep->segment_base;
|
|
|
|
|
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 00:47:28 +00:00
|
|
|
return OPAL_SUCCESS;
|
2014-01-06 19:51:44 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
static int fini_vader_endpoint (struct mca_btl_base_endpoint_t *ep)
|
|
|
|
{
|
2014-09-23 21:51:15 +00:00
|
|
|
/* check if the endpoint is initialized. avoids a double-destruct */
|
|
|
|
if (ep->fifo) {
|
|
|
|
OBJ_DESTRUCT(ep);
|
2014-01-06 19:51:44 +00:00
|
|
|
}
|
2014-09-23 18:11:22 +00:00
|
|
|
|
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 00:47:28 +00:00
|
|
|
return OPAL_SUCCESS;
|
2011-10-20 21:39:44 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* PML->BTL notification of change in the process list.
|
|
|
|
* PML->BTL Notification that a receive fragment has been matched.
|
|
|
|
* Called for message that is send from process with the virtual
|
|
|
|
* address of the shared memory segment being different than that of
|
|
|
|
* the receiver.
|
|
|
|
*
|
|
|
|
* @param btl (IN)
|
|
|
|
* @param proc (IN)
|
|
|
|
* @param peer (OUT)
|
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 00:47:28 +00:00
|
|
|
* @return OPAL_SUCCESS or error status on failure.
|
2011-10-20 21:39:44 +00:00
|
|
|
*
|
|
|
|
*/
|
|
|
|
|
|
|
|
static int vader_add_procs (struct mca_btl_base_module_t* btl,
|
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 00:47:28 +00:00
|
|
|
size_t nprocs, struct opal_proc_t **procs,
|
2011-11-02 15:07:57 +00:00
|
|
|
struct mca_btl_base_endpoint_t **peers,
|
|
|
|
opal_bitmap_t *reachability)
|
2011-10-20 21:39:44 +00:00
|
|
|
{
|
|
|
|
mca_btl_vader_component_t *component = &mca_btl_vader_component;
|
|
|
|
mca_btl_vader_t *vader_btl = (mca_btl_vader_t *) btl;
|
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 00:47:28 +00:00
|
|
|
const opal_proc_t *my_proc;
|
|
|
|
int rc = OPAL_SUCCESS;
|
2011-10-20 21:39:44 +00:00
|
|
|
|
|
|
|
/* initializion */
|
|
|
|
|
|
|
|
/* get pointer to my proc structure */
|
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 00:47:28 +00:00
|
|
|
if (NULL == (my_proc = opal_proc_local_get())) {
|
|
|
|
return OPAL_ERR_OUT_OF_RESOURCE;
|
2011-10-20 21:39:44 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
/* jump out if there's not someone we can talk to */
|
2013-07-11 20:54:12 +00:00
|
|
|
if (1 > MCA_BTL_VADER_NUM_LOCAL_PEERS) {
|
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 00:47:28 +00:00
|
|
|
return OPAL_SUCCESS;
|
2011-10-20 21:39:44 +00:00
|
|
|
}
|
|
|
|
|
2013-07-11 20:54:12 +00:00
|
|
|
/* make sure that my local rank has been defined */
|
2014-07-29 16:07:59 +00:00
|
|
|
if (0 > MCA_BTL_VADER_LOCAL_RANK) {
|
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 00:47:28 +00:00
|
|
|
return OPAL_ERROR;
|
2011-10-20 21:39:44 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
if (!vader_btl->btl_inited) {
|
2013-07-11 20:54:12 +00:00
|
|
|
rc = vader_btl_first_time_init (vader_btl, 1 + MCA_BTL_VADER_NUM_LOCAL_PEERS);
|
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 00:47:28 +00:00
|
|
|
if (rc != OPAL_SUCCESS) {
|
2013-03-27 22:10:02 +00:00
|
|
|
return rc;
|
2011-11-02 15:07:57 +00:00
|
|
|
}
|
2011-10-20 21:39:44 +00:00
|
|
|
}
|
|
|
|
|
2014-01-06 19:51:44 +00:00
|
|
|
for (int32_t proc = 0, local_rank = 0 ; proc < (int32_t) nprocs ; ++proc) {
|
2013-03-27 22:10:02 +00:00
|
|
|
/* check to see if this proc can be reached via shmem (i.e.,
|
|
|
|
if they're on my local host and in my job) */
|
2014-11-11 17:00:42 -08:00
|
|
|
if (procs[proc]->proc_name.jobid != my_proc->proc_name.jobid ||
|
2013-03-27 22:10:02 +00:00
|
|
|
!OPAL_PROC_ON_LOCAL_NODE(procs[proc]->proc_flags)) {
|
|
|
|
peers[proc] = NULL;
|
2011-10-20 21:39:44 +00:00
|
|
|
continue;
|
|
|
|
}
|
|
|
|
|
2013-07-11 20:54:12 +00:00
|
|
|
if (my_proc != procs[proc]) {
|
|
|
|
/* add this proc to shared memory accessibility list */
|
|
|
|
rc = opal_bitmap_set_bit (reachability, proc);
|
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 00:47:28 +00:00
|
|
|
if(OPAL_SUCCESS != rc) {
|
2013-07-11 20:54:12 +00:00
|
|
|
return rc;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2013-03-27 22:10:02 +00:00
|
|
|
/* setup endpoint */
|
|
|
|
peers[proc] = component->endpoints + local_rank;
|
2014-10-22 19:11:54 +09:00
|
|
|
rc = init_vader_endpoint (peers[proc], procs[proc], local_rank++);
|
|
|
|
if (OPAL_SUCCESS != rc) {
|
|
|
|
break;
|
|
|
|
}
|
2011-10-20 21:39:44 +00:00
|
|
|
}
|
|
|
|
|
2014-10-22 19:11:54 +09:00
|
|
|
return rc;
|
2011-10-20 21:39:44 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* PML->BTL notification of change in the process list.
|
|
|
|
*
|
|
|
|
* @param btl (IN) BTL instance
|
|
|
|
* @param proc (IN) Peer process
|
|
|
|
* @param peer (IN) Peer addressing information.
|
|
|
|
* @return Status indicating if cleanup was successful
|
|
|
|
*
|
|
|
|
*/
|
|
|
|
|
|
|
|
static int vader_del_procs(struct mca_btl_base_module_t *btl,
|
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 00:47:28 +00:00
|
|
|
size_t nprocs, struct opal_proc_t **procs,
|
2011-11-02 15:07:57 +00:00
|
|
|
struct mca_btl_base_endpoint_t **peers)
|
2011-10-20 21:39:44 +00:00
|
|
|
{
|
2014-01-07 23:18:55 +00:00
|
|
|
for (size_t i = 0 ; i < nprocs ; ++i) {
|
2014-05-15 19:26:49 +00:00
|
|
|
if (peers[i]) {
|
|
|
|
fini_vader_endpoint (peers[i]);
|
|
|
|
peers[i] = NULL;
|
|
|
|
}
|
2014-01-06 19:51:44 +00:00
|
|
|
}
|
|
|
|
|
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 00:47:28 +00:00
|
|
|
return OPAL_SUCCESS;
|
2011-10-20 21:39:44 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
* MCA->BTL Clean up any resources held by BTL module
|
|
|
|
* before the module is unloaded.
|
|
|
|
*
|
|
|
|
* @param btl (IN) BTL module.
|
|
|
|
*
|
|
|
|
* Prior to unloading a BTL module, the MCA framework will call
|
|
|
|
* the BTL finalize method of the module. Any resources held by
|
|
|
|
* the BTL should be released and if required the memory corresponding
|
|
|
|
* to the BTL module freed.
|
|
|
|
*
|
|
|
|
*/
|
|
|
|
|
|
|
|
static int vader_finalize(struct mca_btl_base_module_t *btl)
|
|
|
|
{
|
2014-01-06 19:51:44 +00:00
|
|
|
mca_btl_vader_component_t *component = &mca_btl_vader_component;
|
|
|
|
mca_btl_vader_t *vader_btl = (mca_btl_vader_t *) btl;
|
|
|
|
|
|
|
|
if (!vader_btl->btl_inited) {
|
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 00:47:28 +00:00
|
|
|
return OPAL_SUCCESS;
|
2014-01-06 19:51:44 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
for (int i = 0 ; i < 1 + MCA_BTL_VADER_NUM_LOCAL_PEERS ; ++i) {
|
|
|
|
fini_vader_endpoint (component->endpoints + i);
|
|
|
|
}
|
|
|
|
|
|
|
|
free (component->endpoints);
|
2014-09-23 18:11:22 +00:00
|
|
|
component->endpoints = NULL;
|
|
|
|
|
2014-01-06 19:51:44 +00:00
|
|
|
vader_btl->btl_inited = false;
|
|
|
|
|
2014-09-23 18:11:22 +00:00
|
|
|
free (component->fbox_in_endpoints);
|
|
|
|
component->fbox_in_endpoints = NULL;
|
|
|
|
|
2014-10-17 17:06:33 -06:00
|
|
|
if (MCA_BTL_VADER_XPMEM != mca_btl_vader_component.single_copy_mechanism) {
|
|
|
|
opal_shmem_unlink (&mca_btl_vader_component.seg_ds);
|
|
|
|
opal_shmem_segment_detach (&mca_btl_vader_component.seg_ds);
|
|
|
|
}
|
2014-01-06 19:51:44 +00:00
|
|
|
|
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 00:47:28 +00:00
|
|
|
return OPAL_SUCCESS;
|
2011-10-20 21:39:44 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Register a callback function that is called on error..
|
|
|
|
*
|
|
|
|
* @param btl (IN) BTL module
|
|
|
|
* @param cbfunc (IN) function to call on error
|
|
|
|
* @return Status indicating if cleanup was successful
|
|
|
|
*/
|
|
|
|
static int vader_register_error_cb(struct mca_btl_base_module_t* btl,
|
2011-11-02 15:07:57 +00:00
|
|
|
mca_btl_base_module_error_cb_fn_t cbfunc)
|
2011-10-20 21:39:44 +00:00
|
|
|
{
|
|
|
|
((mca_btl_vader_t *)btl)->error_cb = cbfunc;
|
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 00:47:28 +00:00
|
|
|
return OPAL_SUCCESS;
|
2011-10-20 21:39:44 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Allocate a segment.
|
|
|
|
*
|
|
|
|
* @param btl (IN) BTL module
|
|
|
|
* @param size (IN) Request segment size.
|
|
|
|
*/
|
2011-10-26 22:15:42 +00:00
|
|
|
mca_btl_base_descriptor_t *mca_btl_vader_alloc(struct mca_btl_base_module_t *btl,
|
2011-11-02 15:07:57 +00:00
|
|
|
struct mca_btl_base_endpoint_t *endpoint,
|
|
|
|
uint8_t order, size_t size, uint32_t flags)
|
2011-10-20 21:39:44 +00:00
|
|
|
{
|
|
|
|
mca_btl_vader_frag_t *frag = NULL;
|
|
|
|
|
2013-03-27 22:10:02 +00:00
|
|
|
if (size <= (size_t) mca_btl_vader_component.max_inline_send) {
|
2014-01-06 19:51:44 +00:00
|
|
|
(void) MCA_BTL_VADER_FRAG_ALLOC_USER(frag, endpoint);
|
2013-03-27 22:10:02 +00:00
|
|
|
} else if (size <= mca_btl_vader.super.btl_eager_limit) {
|
2014-01-06 19:51:44 +00:00
|
|
|
(void) MCA_BTL_VADER_FRAG_ALLOC_EAGER(frag, endpoint);
|
2014-10-17 17:06:33 -06:00
|
|
|
} else if (MCA_BTL_VADER_XPMEM != mca_btl_vader_component.single_copy_mechanism &&
|
|
|
|
size <= mca_btl_vader.super.btl_max_send_size) {
|
2014-01-06 19:51:44 +00:00
|
|
|
(void) MCA_BTL_VADER_FRAG_ALLOC_MAX(frag, endpoint);
|
2011-10-20 21:39:44 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
if (OPAL_LIKELY(frag != NULL)) {
|
2014-10-17 17:06:33 -06:00
|
|
|
frag->segments[0].base.seg_len = size;
|
2011-10-26 19:29:37 +00:00
|
|
|
|
2011-10-26 22:15:42 +00:00
|
|
|
frag->base.des_flags = flags;
|
2011-11-02 15:07:57 +00:00
|
|
|
frag->base.order = order;
|
2011-10-20 21:39:44 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
return (mca_btl_base_descriptor_t *) frag;
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Return a segment allocated by this BTL.
|
|
|
|
*
|
|
|
|
* @param btl (IN) BTL module
|
|
|
|
* @param segment (IN) Allocated segment.
|
|
|
|
*/
|
|
|
|
static int vader_free (struct mca_btl_base_module_t *btl, mca_btl_base_descriptor_t *des)
|
|
|
|
{
|
|
|
|
MCA_BTL_VADER_FRAG_RETURN((mca_btl_vader_frag_t *) des);
|
|
|
|
|
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 00:47:28 +00:00
|
|
|
return OPAL_SUCCESS;
|
2011-10-20 21:39:44 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
struct mca_btl_base_descriptor_t *vader_prepare_dst(struct mca_btl_base_module_t *btl,
|
2011-11-02 15:07:57 +00:00
|
|
|
struct mca_btl_base_endpoint_t *endpoint,
|
|
|
|
struct mca_mpool_base_registration_t *registration,
|
|
|
|
struct opal_convertor_t *convertor,
|
|
|
|
uint8_t order, size_t reserve, size_t *size,
|
|
|
|
uint32_t flags)
|
2011-10-20 21:39:44 +00:00
|
|
|
{
|
|
|
|
mca_btl_vader_frag_t *frag;
|
2011-10-26 19:29:37 +00:00
|
|
|
void *data_ptr;
|
2011-10-20 21:39:44 +00:00
|
|
|
|
2014-11-10 17:02:45 +09:00
|
|
|
if (MCA_BTL_VADER_NONE != mca_btl_vader_component.single_copy_mechanism) {
|
|
|
|
(void) MCA_BTL_VADER_FRAG_ALLOC_RDMA(frag, endpoint);
|
|
|
|
} else {
|
|
|
|
(void) MCA_BTL_VADER_FRAG_ALLOC_USER(frag, endpoint);
|
|
|
|
}
|
2011-10-20 21:39:44 +00:00
|
|
|
if (OPAL_UNLIKELY(NULL == frag)) {
|
|
|
|
return NULL;
|
|
|
|
}
|
2014-10-17 17:06:33 -06:00
|
|
|
|
2013-07-11 20:54:12 +00:00
|
|
|
opal_convertor_get_current_pointer (convertor, &data_ptr);
|
2011-10-26 19:29:37 +00:00
|
|
|
|
2014-10-17 17:06:33 -06:00
|
|
|
frag->segments[0].base.seg_addr.lval = (uint64_t)(uintptr_t) data_ptr;
|
|
|
|
frag->segments[0].base.seg_len = *size;
|
|
|
|
|
|
|
|
#if OPAL_BTL_VADER_HAVE_KNEM
|
|
|
|
if (MCA_BTL_VADER_KNEM == mca_btl_vader_component.single_copy_mechanism) {
|
|
|
|
struct knem_cmd_create_region knem_cr;
|
|
|
|
struct knem_cmd_param_iovec knem_iov;
|
|
|
|
|
|
|
|
knem_iov.base = (uintptr_t) data_ptr;
|
|
|
|
knem_iov.len = *size;
|
|
|
|
|
|
|
|
knem_cr.iovec_array = (uintptr_t) &knem_iov;
|
|
|
|
knem_cr.iovec_nr = 1;
|
|
|
|
knem_cr.protection = PROT_WRITE;
|
|
|
|
/* Vader will explicitly destroy this cookie */
|
|
|
|
knem_cr.flags = 0;
|
|
|
|
if (OPAL_UNLIKELY(ioctl(mca_btl_vader.knem_fd, KNEM_CMD_CREATE_REGION, &knem_cr) < 0)) {
|
|
|
|
MCA_BTL_VADER_FRAG_RETURN(frag);
|
|
|
|
return NULL;
|
|
|
|
}
|
|
|
|
|
|
|
|
frag->segments[0].cookie = knem_cr.cookie;
|
2014-11-12 10:12:52 -07:00
|
|
|
frag->segments[0].registered_base = (intptr_t) data_ptr;
|
2014-10-17 17:06:33 -06:00
|
|
|
frag->cookie = knem_cr.cookie;
|
|
|
|
}
|
|
|
|
#endif /* OPAL_BTL_SM_HAVE_KNEM */
|
2011-10-20 21:39:44 +00:00
|
|
|
|
2011-10-26 19:29:37 +00:00
|
|
|
frag->base.order = order;
|
|
|
|
frag->base.des_flags = flags;
|
|
|
|
|
2011-10-20 21:39:44 +00:00
|
|
|
return &frag->base;
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Pack data
|
|
|
|
*
|
|
|
|
* @param btl (IN) BTL module
|
|
|
|
*/
|
|
|
|
static struct mca_btl_base_descriptor_t *vader_prepare_src (struct mca_btl_base_module_t *btl,
|
2011-11-02 15:07:57 +00:00
|
|
|
struct mca_btl_base_endpoint_t *endpoint,
|
|
|
|
mca_mpool_base_registration_t *registration,
|
|
|
|
struct opal_convertor_t *convertor,
|
|
|
|
uint8_t order, size_t reserve, size_t *size,
|
|
|
|
uint32_t flags)
|
2011-10-20 21:39:44 +00:00
|
|
|
{
|
2013-07-11 20:54:12 +00:00
|
|
|
const size_t total_size = reserve + *size;
|
2011-10-20 21:39:44 +00:00
|
|
|
mca_btl_vader_frag_t *frag;
|
2014-09-23 18:11:22 +00:00
|
|
|
unsigned char *fbox;
|
2014-01-06 19:51:44 +00:00
|
|
|
void *data_ptr;
|
2011-10-20 21:39:44 +00:00
|
|
|
int rc;
|
|
|
|
|
2011-10-26 19:29:37 +00:00
|
|
|
opal_convertor_get_current_pointer (convertor, &data_ptr);
|
|
|
|
|
2011-10-20 21:39:44 +00:00
|
|
|
if (OPAL_LIKELY(reserve)) {
|
2011-11-02 15:07:57 +00:00
|
|
|
/* in place send fragment */
|
|
|
|
if (OPAL_UNLIKELY(opal_convertor_need_buffers(convertor))) {
|
2014-01-06 19:51:44 +00:00
|
|
|
uint32_t iov_count = 1;
|
|
|
|
struct iovec iov;
|
|
|
|
|
2011-11-02 15:07:57 +00:00
|
|
|
/* non-contiguous data requires the convertor */
|
2014-10-17 17:06:33 -06:00
|
|
|
if (MCA_BTL_VADER_XPMEM != mca_btl_vader_component.single_copy_mechanism &&
|
|
|
|
total_size > mca_btl_vader.super.btl_eager_limit) {
|
2014-01-06 19:51:44 +00:00
|
|
|
(void) MCA_BTL_VADER_FRAG_ALLOC_MAX(frag, endpoint);
|
|
|
|
} else
|
2014-10-17 17:06:33 -06:00
|
|
|
(void) MCA_BTL_VADER_FRAG_ALLOC_EAGER(frag, endpoint);
|
2014-01-06 19:51:44 +00:00
|
|
|
|
2011-11-02 15:07:57 +00:00
|
|
|
if (OPAL_UNLIKELY(NULL == frag)) {
|
|
|
|
return NULL;
|
|
|
|
}
|
|
|
|
|
2012-01-26 20:07:33 +00:00
|
|
|
iov.iov_len = *size;
|
2011-11-02 15:07:57 +00:00
|
|
|
iov.iov_base =
|
2014-10-17 17:06:33 -06:00
|
|
|
(IOVBASE_TYPE *)(((uintptr_t)(frag->segments[0].base.seg_addr.pval)) +
|
2011-11-02 15:07:57 +00:00
|
|
|
reserve);
|
|
|
|
|
|
|
|
rc = opal_convertor_pack (convertor, &iov, &iov_count, size);
|
|
|
|
if (OPAL_UNLIKELY(rc < 0)) {
|
|
|
|
MCA_BTL_VADER_FRAG_RETURN(frag);
|
|
|
|
return NULL;
|
|
|
|
}
|
|
|
|
|
2014-10-17 17:06:33 -06:00
|
|
|
frag->segments[0].base.seg_len = *size + reserve;
|
2011-11-02 15:07:57 +00:00
|
|
|
} else {
|
2014-10-17 17:06:33 -06:00
|
|
|
if (MCA_BTL_VADER_XPMEM != mca_btl_vader_component.single_copy_mechanism) {
|
|
|
|
if (OPAL_LIKELY(total_size <= mca_btl_vader.super.btl_eager_limit)) {
|
|
|
|
(void) MCA_BTL_VADER_FRAG_ALLOC_EAGER(frag, endpoint);
|
|
|
|
} else {
|
|
|
|
(void) MCA_BTL_VADER_FRAG_ALLOC_MAX(frag, endpoint);
|
|
|
|
}
|
|
|
|
} else
|
|
|
|
(void) MCA_BTL_VADER_FRAG_ALLOC_USER(frag, endpoint);
|
|
|
|
|
2011-11-02 15:07:57 +00:00
|
|
|
if (OPAL_UNLIKELY(NULL == frag)) {
|
|
|
|
return NULL;
|
|
|
|
}
|
|
|
|
|
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 00:47:28 +00:00
|
|
|
#if OPAL_BTL_VADER_HAVE_XPMEM
|
2014-01-06 19:51:44 +00:00
|
|
|
/* use xpmem to send this segment if it is above the max inline send size */
|
2014-10-17 17:06:33 -06:00
|
|
|
if (OPAL_UNLIKELY(MCA_BTL_VADER_XPMEM == mca_btl_vader_component.single_copy_mechanism &&
|
|
|
|
total_size > (size_t) mca_btl_vader_component.max_inline_send)) {
|
2011-11-02 15:07:57 +00:00
|
|
|
/* single copy send */
|
|
|
|
frag->hdr->flags = MCA_BTL_VADER_FLAG_SINGLE_COPY;
|
|
|
|
|
2012-12-13 23:18:53 +00:00
|
|
|
/* set up single copy io vector */
|
|
|
|
frag->hdr->sc_iov.iov_base = data_ptr;
|
|
|
|
frag->hdr->sc_iov.iov_len = *size;
|
2011-11-02 15:07:57 +00:00
|
|
|
|
2014-10-17 17:06:33 -06:00
|
|
|
frag->segments[0].base.seg_len = reserve;
|
|
|
|
frag->segments[1].base.seg_len = *size;
|
|
|
|
frag->segments[1].base.seg_addr.pval = data_ptr;
|
2014-07-10 16:31:15 +00:00
|
|
|
frag->base.des_local_count = 2;
|
2011-11-02 15:07:57 +00:00
|
|
|
} else {
|
2014-01-06 19:51:44 +00:00
|
|
|
#endif
|
2014-04-24 17:36:03 +00:00
|
|
|
|
2011-11-02 15:07:57 +00:00
|
|
|
/* inline send */
|
2014-01-06 19:51:44 +00:00
|
|
|
if (OPAL_LIKELY(MCA_BTL_DES_FLAGS_BTL_OWNERSHIP & flags)) {
|
|
|
|
/* try to reserve a fast box for this transfer only if the
|
|
|
|
* fragment does not belong to the caller */
|
|
|
|
fbox = mca_btl_vader_reserve_fbox (endpoint, total_size);
|
|
|
|
if (OPAL_LIKELY(fbox)) {
|
2014-10-17 17:06:33 -06:00
|
|
|
frag->segments[0].base.seg_addr.pval = fbox;
|
2014-01-06 19:51:44 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
frag->fbox = fbox;
|
2011-11-02 15:07:57 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
/* NTH: the covertor adds some latency so we bypass it here */
|
2014-10-17 17:06:33 -06:00
|
|
|
memcpy ((void *)((uintptr_t)frag->segments[0].base.seg_addr.pval + reserve), data_ptr, *size);
|
|
|
|
frag->segments[0].base.seg_len = total_size;
|
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 00:47:28 +00:00
|
|
|
#if OPAL_BTL_VADER_HAVE_XPMEM
|
2011-11-02 15:07:57 +00:00
|
|
|
}
|
2014-01-06 19:51:44 +00:00
|
|
|
#endif
|
2011-11-02 15:07:57 +00:00
|
|
|
}
|
2011-10-20 21:39:44 +00:00
|
|
|
} else {
|
2011-11-02 15:07:57 +00:00
|
|
|
/* put/get fragment */
|
2014-11-10 17:02:45 +09:00
|
|
|
if (MCA_BTL_VADER_NONE != mca_btl_vader_component.single_copy_mechanism) {
|
|
|
|
(void) MCA_BTL_VADER_FRAG_ALLOC_RDMA(frag, endpoint);
|
|
|
|
} else {
|
|
|
|
(void) MCA_BTL_VADER_FRAG_ALLOC_USER(frag, endpoint);
|
|
|
|
}
|
2011-11-02 15:07:57 +00:00
|
|
|
if (OPAL_UNLIKELY(NULL == frag)) {
|
|
|
|
return NULL;
|
|
|
|
}
|
|
|
|
|
2014-10-17 17:06:33 -06:00
|
|
|
frag->segments[0].base.seg_addr.lval = (uint64_t)(uintptr_t) data_ptr;
|
|
|
|
frag->segments[0].base.seg_len = total_size;
|
|
|
|
#if OPAL_BTL_VADER_HAVE_KNEM
|
|
|
|
if (MCA_BTL_VADER_KNEM == mca_btl_vader_component.single_copy_mechanism) {
|
|
|
|
struct knem_cmd_create_region knem_cr;
|
|
|
|
struct knem_cmd_param_iovec knem_iov;
|
|
|
|
|
|
|
|
knem_iov.base = (uintptr_t) data_ptr;
|
|
|
|
knem_iov.len = total_size;
|
|
|
|
|
|
|
|
knem_cr.iovec_array = (uintptr_t) &knem_iov;
|
|
|
|
knem_cr.iovec_nr = 1;
|
|
|
|
knem_cr.protection = PROT_READ;
|
|
|
|
/* Vader will explicitly destroy this cookie */
|
|
|
|
knem_cr.flags = 0;
|
|
|
|
if (OPAL_UNLIKELY(ioctl(mca_btl_vader.knem_fd, KNEM_CMD_CREATE_REGION, &knem_cr) < 0)) {
|
|
|
|
MCA_BTL_VADER_FRAG_RETURN(frag);
|
|
|
|
return NULL;
|
|
|
|
}
|
|
|
|
|
|
|
|
frag->segments[0].cookie = knem_cr.cookie;
|
2014-11-12 10:12:52 -07:00
|
|
|
frag->segments[0].registered_base = (intptr_t) data_ptr;
|
2014-10-17 17:06:33 -06:00
|
|
|
frag->cookie = knem_cr.cookie;
|
|
|
|
}
|
|
|
|
#endif /* OPAL_BTL_SM_HAVE_KNEM */
|
2011-10-20 21:39:44 +00:00
|
|
|
}
|
|
|
|
|
2011-10-26 19:29:37 +00:00
|
|
|
frag->base.order = order;
|
|
|
|
frag->base.des_flags = flags;
|
|
|
|
|
2011-10-20 21:39:44 +00:00
|
|
|
return &frag->base;
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Fault Tolerance Event Notification Function
|
|
|
|
* @param state Checkpoint Stae
|
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 00:47:28 +00:00
|
|
|
* @return OPAL_SUCCESS or failure status
|
2011-10-20 21:39:44 +00:00
|
|
|
*/
|
|
|
|
static int vader_ft_event (int state)
|
|
|
|
{
|
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 00:47:28 +00:00
|
|
|
return OPAL_SUCCESS;
|
2011-10-20 21:39:44 +00:00
|
|
|
}
|
2014-09-23 18:11:22 +00:00
|
|
|
|
|
|
|
static void mca_btl_vader_endpoint_constructor (mca_btl_vader_endpoint_t *ep)
|
|
|
|
{
|
|
|
|
OBJ_CONSTRUCT(&ep->pending_frags, opal_list_t);
|
2014-09-23 21:51:15 +00:00
|
|
|
ep->fifo = NULL;
|
2014-09-23 18:11:22 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
static void mca_btl_vader_endpoint_destructor (mca_btl_vader_endpoint_t *ep)
|
|
|
|
{
|
|
|
|
OBJ_DESTRUCT(&ep->pending_frags);
|
2014-09-23 21:51:15 +00:00
|
|
|
|
|
|
|
#if OPAL_BTL_VADER_HAVE_XPMEM
|
2014-10-17 17:06:33 -06:00
|
|
|
if (MCA_BTL_VADER_XPMEM == mca_btl_vader_component.single_copy_mechanism) {
|
|
|
|
if (ep->segment_data.xpmem.rcache) {
|
|
|
|
/* clean out the registration cache */
|
|
|
|
const int nregs = 100;
|
|
|
|
mca_mpool_base_registration_t *regs[nregs];
|
|
|
|
int reg_cnt;
|
|
|
|
|
|
|
|
do {
|
|
|
|
reg_cnt = ep->segment_data.xpmem.rcache->rcache_find_all(ep->segment_data.xpmem.rcache, 0, (size_t)-1,
|
|
|
|
regs, nregs);
|
|
|
|
|
|
|
|
for (int i = 0 ; i < reg_cnt ; ++i) {
|
|
|
|
/* otherwise dereg will fail on assert */
|
|
|
|
regs[i]->ref_count = 0;
|
|
|
|
OBJ_RELEASE(regs[i]);
|
|
|
|
}
|
|
|
|
} while (reg_cnt == nregs);
|
2014-09-23 21:51:15 +00:00
|
|
|
|
2014-10-17 17:06:33 -06:00
|
|
|
ep->segment_data.xpmem.rcache = NULL;
|
|
|
|
}
|
2014-09-23 21:51:15 +00:00
|
|
|
|
2014-10-17 17:06:33 -06:00
|
|
|
if (ep->segment_base) {
|
|
|
|
xpmem_release (ep->segment_data.xpmem.apid);
|
|
|
|
ep->segment_data.xpmem.apid = 0;
|
|
|
|
}
|
|
|
|
} else
|
|
|
|
#endif
|
|
|
|
if (ep->segment_data.other.seg_ds) {
|
2014-09-23 21:51:15 +00:00
|
|
|
opal_shmem_ds_t seg_ds;
|
|
|
|
|
|
|
|
/* opal_shmem_segment_detach expects a opal_shmem_ds_t and will
|
|
|
|
* stomp past the end of the seg_ds if it is too small (which
|
|
|
|
* ep->seg_ds probably is) */
|
2014-10-17 17:06:33 -06:00
|
|
|
memcpy (&seg_ds, ep->segment_data.other.seg_ds, opal_shmem_sizeof_shmem_ds (ep->segment_data.other.seg_ds));
|
|
|
|
free (ep->segment_data.other.seg_ds);
|
|
|
|
ep->segment_data.other.seg_ds = NULL;
|
2014-09-23 21:51:15 +00:00
|
|
|
|
|
|
|
/* disconnect from the peer's segment */
|
|
|
|
opal_shmem_segment_detach (&seg_ds);
|
|
|
|
}
|
|
|
|
|
|
|
|
ep->fbox_in.buffer = ep->fbox_out.buffer = NULL;
|
|
|
|
ep->segment_base = NULL;
|
|
|
|
ep->fifo = NULL;
|
2014-09-23 18:11:22 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
OBJ_CLASS_INSTANCE(mca_btl_vader_endpoint_t, opal_list_item_t, mca_btl_vader_endpoint_constructor, mca_btl_vader_endpoint_destructor);
|