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-2005 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-2010 Cisco Systems, Inc. All rights reserved.
|
2014-04-24 17:36:03 +00:00
|
|
|
* Copyright (c) 2010-2014 Los Alamos National Security, LLC.
|
2011-10-20 21:39:44 +00:00
|
|
|
* All rights reserved.
|
|
|
|
* Copyright (c) 2011 NVIDIA Corporation. All rights reserved.
|
|
|
|
* $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 "opal/util/output.h"
|
George did the work and deserves all the credit for it. Ralph did the merge, and deserves whatever blame results from errors in it :-)
WHAT: Open our low-level communication infrastructure by moving all necessary components (btl/rcache/allocator/mpool) down in OPAL
All the components required for inter-process communications are currently deeply integrated in the OMPI layer. Several groups/institutions have express interest in having a more generic communication infrastructure, without all the OMPI layer dependencies. This communication layer should be made available at a different software level, available to all layers in the Open MPI software stack. As an example, our ORTE layer could replace the current OOB and instead use the BTL directly, gaining access to more reactive network interfaces than TCP. Similarly, external software libraries could take advantage of our highly optimized AM (active message) communication layer for their own purpose. UTK with support from Sandia, developped a version of Open MPI where the entire communication infrastucture has been moved down to OPAL (btl/rcache/allocator/mpool). Most of the moved components have been updated to match the new schema, with few exceptions (mainly BTLs where I have no way of compiling/testing them). Thus, the completion of this RFC is tied to being able to completing this move for all BTLs. For this we need help from the rest of the Open MPI community, especially those supporting some of the BTLs. A non-exhaustive list of BTLs that qualify here is: mx, portals4, scif, udapl, ugni, usnic.
This commit was SVN r32317.
2014-07-26 00:47:28 +00:00
|
|
|
#include "opal/mca/btl/base/btl_base_error.h"
|
2011-10-20 21:39:44 +00:00
|
|
|
|
|
|
|
#include "btl_vader.h"
|
|
|
|
#include "btl_vader_frag.h"
|
|
|
|
#include "btl_vader_fifo.h"
|
2011-10-27 20:22:46 +00:00
|
|
|
#include "btl_vader_fbox.h"
|
2011-10-20 21:39:44 +00:00
|
|
|
|
2013-03-27 22:10:02 +00:00
|
|
|
#include <sys/mman.h>
|
|
|
|
|
2011-10-20 21:39:44 +00:00
|
|
|
static int mca_btl_vader_component_progress (void);
|
|
|
|
static int mca_btl_vader_component_open(void);
|
|
|
|
static int mca_btl_vader_component_close(void);
|
|
|
|
static int mca_btl_vader_component_register(void);
|
|
|
|
static mca_btl_base_module_t** mca_btl_vader_component_init(int *num_btls,
|
2011-11-02 15:07:57 +00:00
|
|
|
bool enable_progress_threads,
|
|
|
|
bool enable_mpi_threads);
|
2011-10-20 21:39:44 +00:00
|
|
|
|
|
|
|
/*
|
|
|
|
* Shared Memory (VADER) component instance.
|
|
|
|
*/
|
|
|
|
mca_btl_vader_component_t mca_btl_vader_component = {
|
2013-03-27 22:10:02 +00:00
|
|
|
.super = {
|
2011-10-20 21:39:44 +00:00
|
|
|
/* First, the mca_base_component_t struct containing meta information
|
2011-11-02 15:07:57 +00:00
|
|
|
about the component itself */
|
2013-03-27 22:10:02 +00:00
|
|
|
.btl_version = {
|
2014-07-10 16:31:15 +00:00
|
|
|
MCA_BTL_DEFAULT_VERSION("vader"),
|
2013-03-27 22:10:02 +00:00
|
|
|
.mca_open_component = mca_btl_vader_component_open,
|
|
|
|
.mca_close_component = mca_btl_vader_component_close,
|
|
|
|
.mca_register_component_params = mca_btl_vader_component_register,
|
2011-10-20 21:39:44 +00:00
|
|
|
},
|
2013-03-27 22:10:02 +00:00
|
|
|
.btl_data = {
|
2011-10-20 21:39:44 +00:00
|
|
|
/* The component is checkpoint ready */
|
2013-03-27 22:10:02 +00:00
|
|
|
.param_field = MCA_BASE_METADATA_PARAM_CHECKPOINT
|
2011-10-20 21:39:44 +00:00
|
|
|
},
|
|
|
|
|
2013-03-27 22:10:02 +00:00
|
|
|
.btl_init = mca_btl_vader_component_init,
|
|
|
|
.btl_progress = mca_btl_vader_component_progress,
|
2011-10-20 21:39:44 +00:00
|
|
|
} /* end super */
|
|
|
|
};
|
|
|
|
|
|
|
|
static int mca_btl_vader_component_register (void)
|
|
|
|
{
|
2013-03-27 21:09:41 +00:00
|
|
|
(void) mca_base_var_group_component_register(&mca_btl_vader_component.super.btl_version,
|
|
|
|
"XPMEM shared memory byte transport later");
|
|
|
|
|
|
|
|
/* register VADER component variables */
|
|
|
|
mca_btl_vader_component.vader_free_list_num = 8;
|
|
|
|
(void) mca_base_component_var_register(&mca_btl_vader_component.super.btl_version,
|
2013-03-27 22:10:02 +00:00
|
|
|
"free_list_num", "Initial number of fragments "
|
|
|
|
"to allocate for shared memory communication.",
|
|
|
|
MCA_BASE_VAR_TYPE_INT, NULL, 0,
|
|
|
|
MCA_BASE_VAR_FLAG_SETTABLE, OPAL_INFO_LVL_9,
|
2013-03-27 21:09:41 +00:00
|
|
|
MCA_BASE_VAR_SCOPE_LOCAL,
|
|
|
|
&mca_btl_vader_component.vader_free_list_num);
|
2013-07-11 23:30:20 +00:00
|
|
|
mca_btl_vader_component.vader_free_list_max = 16384;
|
2013-03-27 21:09:41 +00:00
|
|
|
(void) mca_base_component_var_register(&mca_btl_vader_component.super.btl_version,
|
2013-03-27 22:10:02 +00:00
|
|
|
"free_list_max", "Maximum number of fragments "
|
|
|
|
"to allocate for shared memory communication.",
|
|
|
|
MCA_BASE_VAR_TYPE_INT, NULL, 0,
|
|
|
|
MCA_BASE_VAR_FLAG_SETTABLE, OPAL_INFO_LVL_9,
|
2013-03-27 21:09:41 +00:00
|
|
|
MCA_BASE_VAR_SCOPE_LOCAL,
|
|
|
|
&mca_btl_vader_component.vader_free_list_max);
|
|
|
|
mca_btl_vader_component.vader_free_list_inc = 64;
|
|
|
|
(void) mca_base_component_var_register(&mca_btl_vader_component.super.btl_version,
|
2013-03-27 22:10:02 +00:00
|
|
|
"free_list_inc", "Number of fragments to create "
|
|
|
|
"on each allocation.", MCA_BASE_VAR_TYPE_INT, NULL, 0,
|
|
|
|
MCA_BASE_VAR_FLAG_SETTABLE, OPAL_INFO_LVL_9,
|
2013-03-27 21:09:41 +00:00
|
|
|
MCA_BASE_VAR_SCOPE_LOCAL,
|
|
|
|
&mca_btl_vader_component.vader_free_list_inc);
|
|
|
|
|
2013-03-27 22:10:02 +00:00
|
|
|
mca_btl_vader_component.memcpy_limit = 524288;
|
2013-03-27 21:09:41 +00:00
|
|
|
(void) mca_base_component_var_register(&mca_btl_vader_component.super.btl_version,
|
2013-03-27 22:10:02 +00:00
|
|
|
"memcpy_limit", "Message size to switch from using "
|
|
|
|
"memove to memcpy. The relative speed of these two "
|
|
|
|
"routines can vary by size.", MCA_BASE_VAR_TYPE_INT,
|
|
|
|
NULL, 0, MCA_BASE_VAR_FLAG_SETTABLE, OPAL_INFO_LVL_5,
|
2013-03-27 21:09:41 +00:00
|
|
|
MCA_BASE_VAR_SCOPE_LOCAL,
|
2013-03-27 22:10:02 +00:00
|
|
|
&mca_btl_vader_component.memcpy_limit);
|
|
|
|
mca_btl_vader_component.log_attach_align = 21;
|
|
|
|
(void) mca_base_component_var_register(&mca_btl_vader_component.super.btl_version,
|
|
|
|
"log_align", "Log base 2 of the alignment to use for xpmem "
|
|
|
|
"segments (default: 21, minimum: 12, maximum: 25)",
|
|
|
|
MCA_BASE_VAR_TYPE_INT, NULL, 0,
|
|
|
|
MCA_BASE_VAR_FLAG_SETTABLE, OPAL_INFO_LVL_5,
|
|
|
|
MCA_BASE_VAR_SCOPE_LOCAL,
|
|
|
|
&mca_btl_vader_component.log_attach_align);
|
|
|
|
|
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 && 64 == MCA_BTL_VADER_BITNESS
|
2013-03-27 22:10:02 +00:00
|
|
|
mca_btl_vader_component.segment_size = 1 << 24;
|
2014-01-06 19:51:44 +00:00
|
|
|
#else
|
|
|
|
mca_btl_vader_component.segment_size = 1 << 22;
|
|
|
|
#endif
|
2013-03-27 21:09:41 +00:00
|
|
|
(void) mca_base_component_var_register(&mca_btl_vader_component.super.btl_version,
|
2013-03-27 22:10:02 +00:00
|
|
|
"segment_size", "Maximum size of all shared "
|
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 && 64 == MCA_BTL_VADER_BITNESS
|
2013-03-27 22:10:02 +00:00
|
|
|
"memory buffers (default: 16M)",
|
2014-01-06 19:51:44 +00:00
|
|
|
#else
|
|
|
|
"memory buffers (default: 4M)",
|
|
|
|
#endif
|
2013-03-27 22:10:02 +00:00
|
|
|
MCA_BASE_VAR_TYPE_INT, NULL, 0,
|
|
|
|
MCA_BASE_VAR_FLAG_SETTABLE, OPAL_INFO_LVL_5,
|
2013-03-27 21:09:41 +00:00
|
|
|
MCA_BASE_VAR_SCOPE_LOCAL,
|
2013-03-27 22:10:02 +00:00
|
|
|
&mca_btl_vader_component.segment_size);
|
2013-03-27 21:09:41 +00:00
|
|
|
|
2013-03-27 22:10:02 +00:00
|
|
|
mca_btl_vader_component.max_inline_send = 256;
|
2013-03-27 21:09:41 +00:00
|
|
|
(void) mca_base_component_var_register(&mca_btl_vader_component.super.btl_version,
|
2013-03-27 22:10:02 +00:00
|
|
|
"max_inline_send", "Maximum size to transfer "
|
|
|
|
"using copy-in copy-out semantics",
|
2014-01-06 19:51:44 +00:00
|
|
|
MCA_BASE_VAR_TYPE_UNSIGNED_INT, NULL, 0,
|
2013-03-27 22:10:02 +00:00
|
|
|
MCA_BASE_VAR_FLAG_SETTABLE, OPAL_INFO_LVL_5,
|
|
|
|
MCA_BASE_VAR_SCOPE_LOCAL,
|
|
|
|
&mca_btl_vader_component.max_inline_send);
|
|
|
|
|
|
|
|
mca_btl_vader.super.btl_exclusivity = MCA_BTL_EXCLUSIVITY_HIGH;
|
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
|
2013-07-11 23:30:20 +00:00
|
|
|
mca_btl_vader.super.btl_eager_limit = 32 * 1024;
|
2013-03-27 22:10:02 +00:00
|
|
|
mca_btl_vader.super.btl_rndv_eager_limit = mca_btl_vader.super.btl_eager_limit;
|
|
|
|
mca_btl_vader.super.btl_max_send_size = mca_btl_vader.super.btl_eager_limit;
|
2014-01-06 19:51:44 +00:00
|
|
|
mca_btl_vader.super.btl_min_rdma_pipeline_size = mca_btl_vader.super.btl_eager_limit;
|
|
|
|
#else
|
|
|
|
mca_btl_vader.super.btl_eager_limit = 4 * 1024;
|
|
|
|
mca_btl_vader.super.btl_rndv_eager_limit = 32 * 1024;
|
|
|
|
mca_btl_vader.super.btl_max_send_size = 32 * 1024;
|
|
|
|
mca_btl_vader.super.btl_min_rdma_pipeline_size = 32 * 1024;
|
|
|
|
#endif
|
|
|
|
|
2011-10-25 18:38:42 +00:00
|
|
|
mca_btl_vader.super.btl_rdma_pipeline_send_length = mca_btl_vader.super.btl_eager_limit;
|
2013-03-27 22:10:02 +00:00
|
|
|
mca_btl_vader.super.btl_rdma_pipeline_frag_size = mca_btl_vader.super.btl_eager_limit;
|
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
|
|
|
#if OPAL_BTL_VADER_HAVE_XPMEM || OPAL_BTL_VADER_HAVE_CMA
|
2013-03-27 22:10:02 +00:00
|
|
|
mca_btl_vader.super.btl_flags = MCA_BTL_FLAGS_RDMA | MCA_BTL_FLAGS_SEND_INPLACE;
|
2014-01-06 19:51:44 +00:00
|
|
|
#else
|
|
|
|
mca_btl_vader.super.btl_flags = MCA_BTL_FLAGS_SEND_INPLACE;
|
|
|
|
#endif
|
|
|
|
|
2013-03-27 22:10:02 +00:00
|
|
|
mca_btl_vader.super.btl_seg_size = sizeof (mca_btl_base_segment_t);
|
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 || OPAL_BTL_VADER_HAVE_CMA
|
2011-10-20 21:39:44 +00:00
|
|
|
mca_btl_vader.super.btl_bandwidth = 40000; /* Mbs */
|
2014-01-06 19:51:44 +00:00
|
|
|
#else
|
|
|
|
mca_btl_vader.super.btl_bandwidth = 10000; /* Mbs */
|
|
|
|
#endif
|
2011-10-20 21:39:44 +00:00
|
|
|
mca_btl_vader.super.btl_latency = 1; /* Microsecs */
|
|
|
|
|
|
|
|
/* Call the BTL based to register its MCA params */
|
|
|
|
mca_btl_base_param_register(&mca_btl_vader_component.super.btl_version,
|
|
|
|
&mca_btl_vader.super);
|
|
|
|
|
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
|
|
|
}
|
|
|
|
|
|
|
|
/*
|
|
|
|
* Called by MCA framework to open the component, registers
|
|
|
|
* component parameters.
|
|
|
|
*/
|
|
|
|
|
|
|
|
static int mca_btl_vader_component_open(void)
|
|
|
|
{
|
|
|
|
/* initialize objects */
|
|
|
|
OBJ_CONSTRUCT(&mca_btl_vader_component.vader_frags_eager, ompi_free_list_t);
|
|
|
|
OBJ_CONSTRUCT(&mca_btl_vader_component.vader_frags_user, ompi_free_list_t);
|
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
|
|
|
OBJ_CONSTRUCT(&mca_btl_vader_component.vader_frags_max_send, ompi_free_list_t);
|
|
|
|
#endif
|
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;
|
2011-10-20 21:39:44 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/*
|
|
|
|
* component cleanup - sanity checking of queue lengths
|
|
|
|
*/
|
|
|
|
|
|
|
|
static int mca_btl_vader_component_close(void)
|
|
|
|
{
|
2013-03-27 22:10:02 +00:00
|
|
|
OBJ_DESTRUCT(&mca_btl_vader_component.vader_frags_eager);
|
|
|
|
OBJ_DESTRUCT(&mca_btl_vader_component.vader_frags_user);
|
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
|
|
|
OBJ_DESTRUCT(&mca_btl_vader_component.vader_frags_max_send);
|
|
|
|
#endif
|
2011-10-20 21:39:44 +00:00
|
|
|
|
2013-03-27 22:10:02 +00:00
|
|
|
if (NULL != mca_btl_vader_component.my_segment) {
|
|
|
|
munmap (mca_btl_vader_component.my_segment, mca_btl_vader_component.segment_size);
|
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
|
|
|
|
2013-03-27 22:10:02 +00:00
|
|
|
static int mca_btl_base_vader_modex_send (void)
|
|
|
|
{
|
|
|
|
struct vader_modex_t modex;
|
2014-01-06 19:51:44 +00:00
|
|
|
int modex_size;
|
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
|
|
|
#if OPAL_BTL_VADER_HAVE_XPMEM
|
2013-03-27 22:10:02 +00:00
|
|
|
modex.seg_id = mca_btl_vader_component.my_seg_id;
|
|
|
|
modex.segment_base = mca_btl_vader_component.my_segment;
|
|
|
|
|
2014-01-06 19:51:44 +00:00
|
|
|
modex_size = sizeof (modex);
|
|
|
|
#else
|
|
|
|
modex_size = opal_shmem_sizeof_shmem_ds (&mca_btl_vader_component.seg_ds);
|
|
|
|
memmove (&modex.seg_ds, &mca_btl_vader_component.seg_ds, modex_size);
|
|
|
|
#endif
|
|
|
|
|
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_modex_send(&mca_btl_vader_component.super.btl_version, &modex, modex_size);
|
2011-10-20 21:39:44 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
/*
|
|
|
|
* VADER component initialization
|
|
|
|
*/
|
|
|
|
static mca_btl_base_module_t **mca_btl_vader_component_init (int *num_btls,
|
2011-11-02 15:07:57 +00:00
|
|
|
bool enable_progress_threads,
|
|
|
|
bool enable_mpi_threads)
|
2011-10-20 21:39:44 +00:00
|
|
|
{
|
|
|
|
mca_btl_vader_component_t *component = &mca_btl_vader_component;
|
|
|
|
mca_btl_base_module_t **btls = NULL;
|
2013-03-27 22:10:02 +00:00
|
|
|
int rc;
|
2011-10-20 21:39:44 +00:00
|
|
|
|
|
|
|
*num_btls = 0;
|
|
|
|
|
2013-07-11 20:54:12 +00:00
|
|
|
/* disable if there are no local peers */
|
|
|
|
if (0 == MCA_BTL_VADER_NUM_LOCAL_PEERS) {
|
2014-02-03 17:42:40 +00:00
|
|
|
BTL_VERBOSE(("No peers to communicate with. Disabling vader."));
|
2013-07-11 20:54:12 +00:00
|
|
|
return NULL;
|
|
|
|
}
|
|
|
|
|
2013-03-27 22:10:02 +00:00
|
|
|
/* limit segment alignment to be between 4k and 16M */
|
2011-10-20 21:39:44 +00:00
|
|
|
|
2013-07-11 23:30:20 +00:00
|
|
|
if (mca_btl_vader_component.log_attach_align < 12) {
|
|
|
|
mca_btl_vader_component.log_attach_align = 12;
|
|
|
|
} else if (mca_btl_vader_component.log_attach_align > 25) {
|
|
|
|
mca_btl_vader_component.log_attach_align = 25;
|
2013-03-27 22:10:02 +00:00
|
|
|
}
|
2011-10-20 21:39:44 +00:00
|
|
|
|
|
|
|
btls = (mca_btl_base_module_t **) calloc (1, sizeof (mca_btl_base_module_t *));
|
|
|
|
if (NULL == btls) {
|
|
|
|
return NULL;
|
|
|
|
}
|
|
|
|
|
2014-01-06 19:51:44 +00:00
|
|
|
/* ensure a sane segment size */
|
|
|
|
if (mca_btl_vader_component.segment_size < (2 << 20)) {
|
|
|
|
mca_btl_vader_component.segment_size = (2 << 20);
|
|
|
|
}
|
|
|
|
|
2014-02-10 16:15:43 +00:00
|
|
|
if (mca_btl_vader_component.segment_size > (1ul << MCA_BTL_VADER_OFFSET_BITS)) {
|
|
|
|
mca_btl_vader_component.segment_size = 2ul << MCA_BTL_VADER_OFFSET_BITS;
|
2014-02-07 23:57:36 +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
|
|
|
#if OPAL_BTL_VADER_HAVE_XPMEM
|
2012-02-22 18:32:40 +00:00
|
|
|
/* create an xpmem segment for the entire memory space */
|
2014-02-11 16:28:25 +00:00
|
|
|
component->my_seg_id = xpmem_make (0, VADER_MAX_ADDRESS, XPMEM_PERMIT_MODE, (void *)0666);
|
2012-02-22 18:32:40 +00:00
|
|
|
if (-1 == component->my_seg_id) {
|
2014-02-03 17:42:40 +00:00
|
|
|
BTL_VERBOSE(("Could not create xpmem segment"));
|
2012-02-22 18:32:40 +00:00
|
|
|
free (btls);
|
|
|
|
return NULL;
|
|
|
|
}
|
|
|
|
|
2013-03-27 22:10:02 +00:00
|
|
|
component->my_segment = mmap (NULL, mca_btl_vader_component.segment_size, PROT_READ |
|
2013-07-11 20:54:12 +00:00
|
|
|
PROT_WRITE, MAP_ANONYMOUS | MAP_SHARED, -1, 0);
|
2013-03-27 22:10:02 +00:00
|
|
|
if ((void *)-1 == component->my_segment) {
|
2014-02-03 17:42:40 +00:00
|
|
|
BTL_VERBOSE(("Could not create anonymous memory segment"));
|
2013-03-27 22:10:02 +00:00
|
|
|
free (btls);
|
|
|
|
return NULL;
|
|
|
|
}
|
2014-01-06 19:51:44 +00:00
|
|
|
#else
|
|
|
|
{
|
|
|
|
char *sm_file;
|
|
|
|
|
2014-07-26 21:48:23 +00:00
|
|
|
rc = asprintf(&sm_file, "%s" OPAL_PATH_SEP "vader_segment.%s.%d", opal_process_info.proc_session_dir,
|
|
|
|
opal_process_info.nodename, MCA_BTL_VADER_LOCAL_RANK);
|
2014-01-06 19:51:44 +00:00
|
|
|
if (0 > rc) {
|
|
|
|
free (btls);
|
|
|
|
return NULL;
|
|
|
|
}
|
|
|
|
|
|
|
|
rc = opal_shmem_segment_create (&mca_btl_vader_component.seg_ds, sm_file, mca_btl_vader_component.segment_size);
|
|
|
|
free (sm_file);
|
|
|
|
if (OPAL_SUCCESS != rc) {
|
2014-02-03 17:42:40 +00:00
|
|
|
BTL_VERBOSE(("Could not create shared memory segment"));
|
2014-01-06 19:51:44 +00:00
|
|
|
free (btls);
|
|
|
|
return NULL;
|
|
|
|
}
|
|
|
|
|
|
|
|
component->my_segment = opal_shmem_segment_attach (&mca_btl_vader_component.seg_ds);
|
|
|
|
if (NULL == component->my_segment) {
|
2014-02-03 17:42:40 +00:00
|
|
|
BTL_VERBOSE(("Could not attach to just created shared memory segment"));
|
2014-01-06 19:51:44 +00:00
|
|
|
goto failed;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
#endif
|
2013-03-27 22:10:02 +00:00
|
|
|
|
|
|
|
component->segment_offset = 0;
|
|
|
|
|
2014-01-06 19:51:44 +00:00
|
|
|
memset (component->my_segment + MCA_BTL_VADER_FIFO_SIZE, 0, MCA_BTL_VADER_NUM_LOCAL_PEERS *
|
2013-07-11 20:54:12 +00:00
|
|
|
MCA_BTL_VADER_FBOX_PEER_SIZE);
|
|
|
|
|
2013-03-27 22:10:02 +00:00
|
|
|
/* initialize my fifo */
|
|
|
|
rc = vader_fifo_init ((struct vader_fifo_t *) component->my_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_SUCCESS != rc) {
|
2014-02-03 17:42:40 +00:00
|
|
|
BTL_VERBOSE(("Error initializing FIFO"));
|
2014-01-06 19:51:44 +00:00
|
|
|
goto failed;
|
2013-03-27 22:10:02 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
rc = mca_btl_base_vader_modex_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) {
|
2014-02-03 17:42:40 +00:00
|
|
|
BTL_VERBOSE(("Error sending modex"));
|
2014-01-06 19:51:44 +00:00
|
|
|
goto failed;
|
2013-03-27 22:10:02 +00:00
|
|
|
}
|
|
|
|
|
2011-10-20 21:39:44 +00:00
|
|
|
*num_btls = 1;
|
|
|
|
|
|
|
|
/* get pointer to the btls */
|
|
|
|
btls[0] = (mca_btl_base_module_t *) &mca_btl_vader;
|
|
|
|
|
|
|
|
/* set flag indicating btl not inited */
|
|
|
|
mca_btl_vader.btl_inited = false;
|
|
|
|
|
|
|
|
return btls;
|
2014-01-06 19:51:44 +00:00
|
|
|
failed:
|
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
|
|
|
munmap (component->my_segment, mca_btl_vader_component.segment_size);
|
|
|
|
#else
|
|
|
|
opal_shmem_unlink (&mca_btl_vader_component.seg_ds);
|
|
|
|
#endif
|
|
|
|
|
|
|
|
if (btls) {
|
|
|
|
free (btls);
|
|
|
|
}
|
|
|
|
|
|
|
|
return NULL;
|
2011-10-20 21:39:44 +00:00
|
|
|
}
|
|
|
|
|
2014-04-24 17:36:03 +00:00
|
|
|
static inline int mca_btl_vader_poll_fifo (void)
|
2011-10-20 21:39:44 +00:00
|
|
|
{
|
2013-07-11 20:54:12 +00:00
|
|
|
const mca_btl_active_message_callback_t *reg;
|
2013-03-27 22:10:02 +00:00
|
|
|
struct mca_btl_base_endpoint_t *endpoint;
|
2014-01-06 19:51:44 +00:00
|
|
|
mca_btl_vader_hdr_t *hdr;
|
2012-12-13 23:18:53 +00:00
|
|
|
|
2013-07-11 20:54:12 +00:00
|
|
|
/* poll the fifo until it is empty or a limit has been hit (8 is arbitrary) */
|
2014-04-24 17:36:03 +00:00
|
|
|
for (int fifo_count = 0 ; fifo_count < 16 ; ++fifo_count) {
|
2014-07-10 16:31:15 +00:00
|
|
|
mca_btl_vader_frag_t frag = {.base = {.des_local = frag.segments, .des_local_count = 1}};
|
2014-01-06 19:51:44 +00:00
|
|
|
|
2014-04-24 17:36:03 +00:00
|
|
|
hdr = vader_fifo_read (mca_btl_vader_component.my_fifo, &endpoint);
|
2013-07-11 20:54:12 +00:00
|
|
|
if (NULL == hdr) {
|
|
|
|
return fifo_count;
|
|
|
|
}
|
2011-10-20 21:39:44 +00:00
|
|
|
|
2013-07-11 20:54:12 +00:00
|
|
|
if (hdr->flags & MCA_BTL_VADER_FLAG_COMPLETE) {
|
|
|
|
mca_btl_vader_frag_complete (hdr->frag);
|
|
|
|
continue;
|
|
|
|
}
|
|
|
|
|
|
|
|
reg = mca_btl_base_active_message_trigger + hdr->tag;
|
|
|
|
frag.segments[0].seg_addr.pval = (void *) (hdr + 1);
|
|
|
|
frag.segments[0].seg_len = hdr->len;
|
|
|
|
|
|
|
|
if (hdr->flags & MCA_BTL_VADER_FLAG_SINGLE_COPY) {
|
2014-01-06 19:51:44 +00:00
|
|
|
mca_mpool_base_registration_t *xpmem_reg;
|
|
|
|
|
2013-07-11 20:54:12 +00:00
|
|
|
xpmem_reg = vader_get_registation (endpoint, hdr->sc_iov.iov_base,
|
|
|
|
hdr->sc_iov.iov_len, 0,
|
|
|
|
&frag.segments[1].seg_addr.pval);
|
|
|
|
|
|
|
|
frag.segments[1].seg_len = hdr->sc_iov.iov_len;
|
|
|
|
|
|
|
|
/* recv upcall */
|
2014-07-10 16:31:15 +00:00
|
|
|
frag.base.des_local_count = 2;
|
2013-07-11 20:54:12 +00:00
|
|
|
reg->cbfunc(&mca_btl_vader.super, hdr->tag, &(frag.base), reg->cbdata);
|
|
|
|
vader_return_registration (xpmem_reg, endpoint);
|
|
|
|
} else {
|
|
|
|
reg->cbfunc(&mca_btl_vader.super, hdr->tag, &(frag.base), reg->cbdata);
|
|
|
|
}
|
2011-10-20 21:39:44 +00:00
|
|
|
|
2013-07-11 20:54:12 +00:00
|
|
|
/* return the fragment */
|
|
|
|
hdr->flags = MCA_BTL_VADER_FLAG_COMPLETE;
|
|
|
|
vader_fifo_write_back (hdr, endpoint);
|
|
|
|
}
|
2011-10-20 21:39:44 +00:00
|
|
|
|
2014-01-06 19:51:44 +00:00
|
|
|
return 1;
|
|
|
|
}
|
|
|
|
|
|
|
|
static int mca_btl_vader_component_progress (void)
|
|
|
|
{
|
|
|
|
bool fboxed;
|
|
|
|
|
|
|
|
/* check for messages in fast boxes */
|
|
|
|
for (int spin_count = 5 ; spin_count ; --spin_count) {
|
|
|
|
fboxed = (int) mca_btl_vader_check_fboxes ();
|
|
|
|
if (fboxed) {
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
if (VADER_FIFO_FREE == mca_btl_vader_component.my_fifo->fifo_head) {
|
|
|
|
return (int) fboxed;
|
|
|
|
}
|
|
|
|
|
|
|
|
return mca_btl_vader_poll_fifo () + (int) fboxed;
|
2011-10-20 21:39:44 +00:00
|
|
|
}
|