2011-11-02 19:07:57 +04:00
|
|
|
/* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil -*- */
|
2011-10-21 01:39:44 +04: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.
|
2015-01-06 02:02:41 +03:00
|
|
|
* Copyright (c) 2010-2015 Los Alamos National Security, LLC.
|
2011-10-21 01:39:44 +04:00
|
|
|
* All rights reserved.
|
|
|
|
* Copyright (c) 2011 NVIDIA Corporation. 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 22:56:47 +04:00
|
|
|
* Copyright (c) 2014 Intel, Inc. All rights reserved.
|
2014-10-21 14:51:29 +04:00
|
|
|
* Copyright (c) 2014 Research Organization for Information Science
|
|
|
|
* and Technology (RIST). All rights reserved.
|
2011-10-21 01:39:44 +04:00
|
|
|
* $COPYRIGHT$
|
|
|
|
*
|
|
|
|
* Additional copyrights may follow
|
|
|
|
*
|
|
|
|
* $HEADER$
|
|
|
|
*/
|
George did the work and deserves all the credit for it. Ralph did the merge, and deserves whatever blame results from errors in it :-)
WHAT: Open our low-level communication infrastructure by moving all necessary components (btl/rcache/allocator/mpool) down in OPAL
All the components required for inter-process communications are currently deeply integrated in the OMPI layer. Several groups/institutions have express interest in having a more generic communication infrastructure, without all the OMPI layer dependencies. This communication layer should be made available at a different software level, available to all layers in the Open MPI software stack. As an example, our ORTE layer could replace the current OOB and instead use the BTL directly, gaining access to more reactive network interfaces than TCP. Similarly, external software libraries could take advantage of our highly optimized AM (active message) communication layer for their own purpose. UTK with support from Sandia, developped a version of Open MPI where the entire communication infrastucture has been moved down to OPAL (btl/rcache/allocator/mpool). Most of the moved components have been updated to match the new schema, with few exceptions (mainly BTLs where I have no way of compiling/testing them). Thus, the completion of this RFC is tied to being able to completing this move for all BTLs. For this we need help from the rest of the Open MPI community, especially those supporting some of the BTLs. A non-exhaustive list of BTLs that qualify here is: mx, portals4, scif, udapl, ugni, usnic.
This commit was SVN r32317.
2014-07-26 04:47:28 +04:00
|
|
|
#include "opal_config.h"
|
2011-10-21 01:39:44 +04:00
|
|
|
|
|
|
|
#include "opal/util/output.h"
|
2014-10-18 03:06:33 +04:00
|
|
|
#include "opal/util/show_help.h"
|
2014-09-23 22:11:22 +04:00
|
|
|
#include "opal/threads/mutex.h"
|
George did the work and deserves all the credit for it. Ralph did the merge, and deserves whatever blame results from errors in it :-)
WHAT: Open our low-level communication infrastructure by moving all necessary components (btl/rcache/allocator/mpool) down in OPAL
All the components required for inter-process communications are currently deeply integrated in the OMPI layer. Several groups/institutions have express interest in having a more generic communication infrastructure, without all the OMPI layer dependencies. This communication layer should be made available at a different software level, available to all layers in the Open MPI software stack. As an example, our ORTE layer could replace the current OOB and instead use the BTL directly, gaining access to more reactive network interfaces than TCP. Similarly, external software libraries could take advantage of our highly optimized AM (active message) communication layer for their own purpose. UTK with support from Sandia, developped a version of Open MPI where the entire communication infrastucture has been moved down to OPAL (btl/rcache/allocator/mpool). Most of the moved components have been updated to match the new schema, with few exceptions (mainly BTLs where I have no way of compiling/testing them). Thus, the completion of this RFC is tied to being able to completing this move for all BTLs. For this we need help from the rest of the Open MPI community, especially those supporting some of the BTLs. A non-exhaustive list of BTLs that qualify here is: mx, portals4, scif, udapl, ugni, usnic.
This commit was SVN r32317.
2014-07-26 04:47:28 +04:00
|
|
|
#include "opal/mca/btl/base/btl_base_error.h"
|
2011-10-21 01:39:44 +04:00
|
|
|
|
|
|
|
#include "btl_vader.h"
|
|
|
|
#include "btl_vader_frag.h"
|
|
|
|
#include "btl_vader_fifo.h"
|
2011-10-28 00:22:46 +04:00
|
|
|
#include "btl_vader_fbox.h"
|
2014-09-23 22:11:22 +04:00
|
|
|
#include "btl_vader_xpmem.h"
|
2011-10-21 01:39:44 +04:00
|
|
|
|
2013-03-28 02:10:02 +04:00
|
|
|
#include <sys/mman.h>
|
2014-10-18 03:06:33 +04:00
|
|
|
#include <fcntl.h>
|
|
|
|
|
2014-10-21 14:51:29 +04:00
|
|
|
#ifdef HAVE_SYS_PRCTL_H
|
2014-10-18 03:06:33 +04:00
|
|
|
#include <sys/prctl.h>
|
|
|
|
#endif
|
2013-03-28 02:10:02 +04:00
|
|
|
|
2014-10-21 19:27:36 +04:00
|
|
|
/* NTH: OS X does not define MAP_ANONYMOUS */
|
|
|
|
#if !defined(MAP_ANONYMOUS)
|
|
|
|
#define MAP_ANONYMOUS MAP_ANON
|
|
|
|
#endif
|
|
|
|
|
2011-10-21 01:39:44 +04: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 19:07:57 +04:00
|
|
|
bool enable_progress_threads,
|
|
|
|
bool enable_mpi_threads);
|
2011-10-21 01:39:44 +04:00
|
|
|
|
2014-10-18 03:06:33 +04:00
|
|
|
/* This enumeration is in order of preference */
|
|
|
|
static mca_base_var_enum_value_t single_copy_mechanisms[] = {
|
|
|
|
#if OPAL_BTL_VADER_HAVE_XPMEM
|
|
|
|
{.value = MCA_BTL_VADER_XPMEM, .string = "xpmem"},
|
|
|
|
#endif
|
|
|
|
#if OPAL_BTL_VADER_HAVE_CMA
|
|
|
|
{.value = MCA_BTL_VADER_CMA, .string = "cma"},
|
|
|
|
#endif
|
|
|
|
#if OPAL_BTL_VADER_HAVE_KNEM
|
|
|
|
{.value = MCA_BTL_VADER_KNEM, .string = "knem"},
|
|
|
|
#endif
|
|
|
|
{.value = MCA_BTL_VADER_NONE, .string = "none"},
|
|
|
|
{.value = 0, .string = NULL}
|
|
|
|
};
|
|
|
|
|
2011-10-21 01:39:44 +04:00
|
|
|
/*
|
|
|
|
* Shared Memory (VADER) component instance.
|
|
|
|
*/
|
|
|
|
mca_btl_vader_component_t mca_btl_vader_component = {
|
2013-03-28 02:10:02 +04:00
|
|
|
.super = {
|
2011-10-21 01:39:44 +04:00
|
|
|
/* First, the mca_base_component_t struct containing meta information
|
2011-11-02 19:07:57 +04:00
|
|
|
about the component itself */
|
2013-03-28 02:10:02 +04:00
|
|
|
.btl_version = {
|
2014-07-10 20:31:15 +04:00
|
|
|
MCA_BTL_DEFAULT_VERSION("vader"),
|
2013-03-28 02:10:02 +04: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-21 01:39:44 +04:00
|
|
|
},
|
2013-03-28 02:10:02 +04:00
|
|
|
.btl_data = {
|
2011-10-21 01:39:44 +04:00
|
|
|
/* The component is checkpoint ready */
|
2013-03-28 02:10:02 +04:00
|
|
|
.param_field = MCA_BASE_METADATA_PARAM_CHECKPOINT
|
2011-10-21 01:39:44 +04:00
|
|
|
},
|
|
|
|
|
2013-03-28 02:10:02 +04:00
|
|
|
.btl_init = mca_btl_vader_component_init,
|
|
|
|
.btl_progress = mca_btl_vader_component_progress,
|
2011-10-21 01:39:44 +04:00
|
|
|
} /* end super */
|
|
|
|
};
|
|
|
|
|
2014-10-23 00:57:29 +04:00
|
|
|
static void mca_btl_vader_dummy_rdma (void)
|
|
|
|
{
|
|
|
|
/* If a backtrace ends at this function something has gone wrong with
|
|
|
|
* the btl bootstrapping. Check that the btl_get function was set to
|
|
|
|
* something reasonable. */
|
|
|
|
abort ();
|
|
|
|
}
|
|
|
|
|
2011-10-21 01:39:44 +04:00
|
|
|
static int mca_btl_vader_component_register (void)
|
|
|
|
{
|
2014-10-18 03:06:33 +04:00
|
|
|
mca_base_var_enum_t *new_enum;
|
|
|
|
|
2013-03-28 01:09:41 +04:00
|
|
|
(void) mca_base_var_group_component_register(&mca_btl_vader_component.super.btl_version,
|
2014-10-18 03:06:33 +04:00
|
|
|
"Enhanced shared memory byte transport later");
|
2013-03-28 01:09:41 +04:00
|
|
|
|
|
|
|
/* 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-28 02:10:02 +04: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-28 01:09:41 +04:00
|
|
|
MCA_BASE_VAR_SCOPE_LOCAL,
|
|
|
|
&mca_btl_vader_component.vader_free_list_num);
|
2014-10-18 03:06:33 +04:00
|
|
|
mca_btl_vader_component.vader_free_list_max = 4096;
|
2013-03-28 01:09:41 +04:00
|
|
|
(void) mca_base_component_var_register(&mca_btl_vader_component.super.btl_version,
|
2013-03-28 02:10:02 +04: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-28 01:09:41 +04: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-28 02:10:02 +04: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-28 01:09:41 +04:00
|
|
|
MCA_BASE_VAR_SCOPE_LOCAL,
|
|
|
|
&mca_btl_vader_component.vader_free_list_inc);
|
|
|
|
|
2013-03-28 02:10:02 +04:00
|
|
|
mca_btl_vader_component.memcpy_limit = 524288;
|
2013-03-28 01:09:41 +04:00
|
|
|
(void) mca_base_component_var_register(&mca_btl_vader_component.super.btl_version,
|
2013-03-28 02:10:02 +04: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-28 01:09:41 +04:00
|
|
|
MCA_BASE_VAR_SCOPE_LOCAL,
|
2013-03-28 02:10:02 +04:00
|
|
|
&mca_btl_vader_component.memcpy_limit);
|
2014-09-23 22:11:22 +04:00
|
|
|
#if OPAL_BTL_VADER_HAVE_XPMEM
|
2013-03-28 02:10:02 +04:00
|
|
|
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);
|
2014-09-23 22:11:22 +04:00
|
|
|
#endif
|
2013-03-28 02:10:02 +04: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 04:47:28 +04:00
|
|
|
#if OPAL_BTL_VADER_HAVE_XPMEM && 64 == MCA_BTL_VADER_BITNESS
|
2013-03-28 02:10:02 +04:00
|
|
|
mca_btl_vader_component.segment_size = 1 << 24;
|
2014-01-06 23:51:44 +04:00
|
|
|
#else
|
|
|
|
mca_btl_vader_component.segment_size = 1 << 22;
|
|
|
|
#endif
|
2013-03-28 01:09:41 +04:00
|
|
|
(void) mca_base_component_var_register(&mca_btl_vader_component.super.btl_version,
|
2013-03-28 02:10:02 +04: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 04:47:28 +04:00
|
|
|
#if OPAL_BTL_VADER_HAVE_XPMEM && 64 == MCA_BTL_VADER_BITNESS
|
2013-03-28 02:10:02 +04:00
|
|
|
"memory buffers (default: 16M)",
|
2014-01-06 23:51:44 +04:00
|
|
|
#else
|
|
|
|
"memory buffers (default: 4M)",
|
|
|
|
#endif
|
2013-03-28 02:10:02 +04:00
|
|
|
MCA_BASE_VAR_TYPE_INT, NULL, 0,
|
|
|
|
MCA_BASE_VAR_FLAG_SETTABLE, OPAL_INFO_LVL_5,
|
2013-03-28 01:09:41 +04:00
|
|
|
MCA_BASE_VAR_SCOPE_LOCAL,
|
2013-03-28 02:10:02 +04:00
|
|
|
&mca_btl_vader_component.segment_size);
|
2013-03-28 01:09:41 +04:00
|
|
|
|
2013-03-28 02:10:02 +04:00
|
|
|
mca_btl_vader_component.max_inline_send = 256;
|
2013-03-28 01:09:41 +04:00
|
|
|
(void) mca_base_component_var_register(&mca_btl_vader_component.super.btl_version,
|
2013-03-28 02:10:02 +04:00
|
|
|
"max_inline_send", "Maximum size to transfer "
|
|
|
|
"using copy-in copy-out semantics",
|
2014-01-06 23:51:44 +04:00
|
|
|
MCA_BASE_VAR_TYPE_UNSIGNED_INT, NULL, 0,
|
2013-03-28 02:10:02 +04:00
|
|
|
MCA_BASE_VAR_FLAG_SETTABLE, OPAL_INFO_LVL_5,
|
|
|
|
MCA_BASE_VAR_SCOPE_LOCAL,
|
|
|
|
&mca_btl_vader_component.max_inline_send);
|
|
|
|
|
2014-09-23 22:11:22 +04:00
|
|
|
mca_btl_vader_component.fbox_threshold = 16;
|
|
|
|
(void) mca_base_component_var_register(&mca_btl_vader_component.super.btl_version,
|
|
|
|
"fbox_threshold", "Number of sends required "
|
|
|
|
"before an eager send buffer is setup for a peer "
|
|
|
|
"(default: 16)", MCA_BASE_VAR_TYPE_UNSIGNED_INT, NULL,
|
|
|
|
0, MCA_BASE_VAR_FLAG_SETTABLE, OPAL_INFO_LVL_5,
|
|
|
|
MCA_BASE_VAR_SCOPE_LOCAL, &mca_btl_vader_component.fbox_threshold);
|
|
|
|
|
|
|
|
mca_btl_vader_component.fbox_max = 32;
|
|
|
|
(void) mca_base_component_var_register(&mca_btl_vader_component.super.btl_version,
|
|
|
|
"fbox_max", "Maximum number of eager send buffers "
|
|
|
|
"to allocate (default: 32)", MCA_BASE_VAR_TYPE_UNSIGNED_INT,
|
|
|
|
NULL, 0, MCA_BASE_VAR_FLAG_SETTABLE, OPAL_INFO_LVL_5,
|
|
|
|
MCA_BASE_VAR_SCOPE_LOCAL, &mca_btl_vader_component.fbox_max);
|
|
|
|
|
|
|
|
mca_btl_vader_component.fbox_size = 4096;
|
|
|
|
(void) mca_base_component_var_register(&mca_btl_vader_component.super.btl_version,
|
|
|
|
"fbox_size", "Size of per-peer fast transfer buffers (default: 4k)",
|
|
|
|
MCA_BASE_VAR_TYPE_UNSIGNED_INT, NULL, 0, MCA_BASE_VAR_FLAG_SETTABLE,
|
|
|
|
OPAL_INFO_LVL_5, MCA_BASE_VAR_SCOPE_LOCAL, &mca_btl_vader_component.fbox_size);
|
|
|
|
|
2014-10-18 03:06:33 +04:00
|
|
|
(void) mca_base_var_enum_create ("btl_vader_single_copy_mechanisms", single_copy_mechanisms, &new_enum);
|
|
|
|
|
|
|
|
/* Default to the best available mechanism (see the enumerator for ordering) */
|
|
|
|
mca_btl_vader_component.single_copy_mechanism = single_copy_mechanisms[0].value;
|
|
|
|
(void) mca_base_component_var_register(&mca_btl_vader_component.super.btl_version,
|
|
|
|
"single_copy_mechanism", "Single copy mechanism to use (defaults to best available)",
|
|
|
|
MCA_BASE_VAR_TYPE_INT, new_enum, 0, MCA_BASE_VAR_FLAG_SETTABLE,
|
|
|
|
OPAL_INFO_LVL_3, MCA_BASE_VAR_SCOPE_GROUP, &mca_btl_vader_component.single_copy_mechanism);
|
2015-04-10 00:25:58 +03:00
|
|
|
OBJ_RELEASE(new_enum);
|
2014-10-18 03:06:33 +04:00
|
|
|
|
|
|
|
#if OPAL_BTL_VADER_HAVE_KNEM
|
|
|
|
/* Currently disabling DMA mode by default; it's not clear that this is useful in all applications and architectures. */
|
|
|
|
mca_btl_vader_component.knem_dma_min = 0;
|
|
|
|
(void) mca_base_component_var_register(&mca_btl_vader_component.super.btl_version, "knem_dma_min",
|
|
|
|
"Minimum message size (in bytes) to use the knem DMA mode; "
|
|
|
|
"ignored if knem does not support DMA mode (0 = do not use the "
|
|
|
|
"knem DMA mode, default: 0)", MCA_BASE_VAR_TYPE_UNSIGNED_INT,
|
|
|
|
NULL, 0, 0, OPAL_INFO_LVL_9, MCA_BASE_VAR_SCOPE_READONLY,
|
|
|
|
&mca_btl_vader_component.knem_dma_min);
|
2014-01-06 23:51:44 +04:00
|
|
|
#endif
|
|
|
|
|
2014-10-18 03:06:33 +04:00
|
|
|
mca_btl_vader.super.btl_exclusivity = MCA_BTL_EXCLUSIVITY_HIGH;
|
|
|
|
|
|
|
|
if (MCA_BTL_VADER_XPMEM == mca_btl_vader_component.single_copy_mechanism) {
|
|
|
|
mca_btl_vader.super.btl_eager_limit = 32 * 1024;
|
|
|
|
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;
|
2015-01-06 02:02:41 +03:00
|
|
|
mca_btl_vader.super.btl_min_rdma_pipeline_size = INT_MAX;
|
2014-10-18 03:06:33 +04:00
|
|
|
} 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;
|
2015-01-06 02:02:41 +03:00
|
|
|
mca_btl_vader.super.btl_min_rdma_pipeline_size = INT_MAX;
|
2014-10-18 03:06:33 +04:00
|
|
|
}
|
|
|
|
|
2011-10-25 22:38:42 +04:00
|
|
|
mca_btl_vader.super.btl_rdma_pipeline_send_length = mca_btl_vader.super.btl_eager_limit;
|
2013-03-28 02:10:02 +04:00
|
|
|
mca_btl_vader.super.btl_rdma_pipeline_frag_size = mca_btl_vader.super.btl_eager_limit;
|
2011-10-21 01:39:44 +04:00
|
|
|
|
2014-10-18 03:06:33 +04:00
|
|
|
if (MCA_BTL_VADER_NONE != mca_btl_vader_component.single_copy_mechanism) {
|
|
|
|
mca_btl_vader.super.btl_flags = MCA_BTL_FLAGS_RDMA | MCA_BTL_FLAGS_SEND_INPLACE;
|
|
|
|
/* Single copy mechanisms should provide better bandwidth */
|
|
|
|
mca_btl_vader.super.btl_bandwidth = 40000; /* Mbs */
|
2014-01-06 23:51:44 +04:00
|
|
|
|
2014-10-18 03:06:33 +04:00
|
|
|
/* Set dummy values so the RDMA flag doesn't get unset by mca_btl_base_param_verify() */
|
2014-10-23 00:57:29 +04:00
|
|
|
mca_btl_vader.super.btl_get = (mca_btl_base_module_get_fn_t) mca_btl_vader_dummy_rdma;
|
|
|
|
mca_btl_vader.super.btl_put = (mca_btl_base_module_get_fn_t) mca_btl_vader_dummy_rdma;
|
2014-10-18 03:06:33 +04:00
|
|
|
} else {
|
|
|
|
mca_btl_vader.super.btl_flags = MCA_BTL_FLAGS_SEND_INPLACE;
|
|
|
|
mca_btl_vader.super.btl_bandwidth = 10000; /* Mbs */
|
|
|
|
}
|
|
|
|
|
2011-10-21 01:39:44 +04: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 04:47:28 +04:00
|
|
|
return OPAL_SUCCESS;
|
2011-10-21 01:39:44 +04:00
|
|
|
}
|
|
|
|
|
|
|
|
/*
|
|
|
|
* Called by MCA framework to open the component, registers
|
|
|
|
* component parameters.
|
|
|
|
*/
|
|
|
|
|
|
|
|
static int mca_btl_vader_component_open(void)
|
|
|
|
{
|
|
|
|
/* initialize objects */
|
2015-02-19 23:41:41 +03:00
|
|
|
OBJ_CONSTRUCT(&mca_btl_vader_component.vader_frags_eager, opal_free_list_t);
|
|
|
|
OBJ_CONSTRUCT(&mca_btl_vader_component.vader_frags_user, opal_free_list_t);
|
|
|
|
OBJ_CONSTRUCT(&mca_btl_vader_component.vader_frags_max_send, opal_free_list_t);
|
2014-09-23 22:11:22 +04:00
|
|
|
OBJ_CONSTRUCT(&mca_btl_vader_component.lock, opal_mutex_t);
|
|
|
|
OBJ_CONSTRUCT(&mca_btl_vader_component.pending_endpoints, opal_list_t);
|
2014-10-18 03:06:33 +04:00
|
|
|
OBJ_CONSTRUCT(&mca_btl_vader_component.pending_fragments, opal_list_t);
|
|
|
|
#if OPAL_BTL_VADER_HAVE_KNEM
|
|
|
|
mca_btl_vader.knem_fd = -1;
|
|
|
|
#endif
|
2011-10-21 01:39:44 +04: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 04:47:28 +04:00
|
|
|
return OPAL_SUCCESS;
|
2011-10-21 01:39:44 +04:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/*
|
|
|
|
* component cleanup - sanity checking of queue lengths
|
|
|
|
*/
|
|
|
|
|
|
|
|
static int mca_btl_vader_component_close(void)
|
|
|
|
{
|
2013-03-28 02:10:02 +04:00
|
|
|
OBJ_DESTRUCT(&mca_btl_vader_component.vader_frags_eager);
|
|
|
|
OBJ_DESTRUCT(&mca_btl_vader_component.vader_frags_user);
|
2014-01-06 23:51:44 +04:00
|
|
|
OBJ_DESTRUCT(&mca_btl_vader_component.vader_frags_max_send);
|
2014-09-23 22:11:22 +04:00
|
|
|
OBJ_DESTRUCT(&mca_btl_vader_component.lock);
|
|
|
|
OBJ_DESTRUCT(&mca_btl_vader_component.pending_endpoints);
|
2014-10-18 03:06:33 +04:00
|
|
|
OBJ_DESTRUCT(&mca_btl_vader_component.pending_fragments);
|
2011-10-21 01:39:44 +04:00
|
|
|
|
2013-03-28 02:10:02 +04:00
|
|
|
if (NULL != mca_btl_vader_component.my_segment) {
|
|
|
|
munmap (mca_btl_vader_component.my_segment, mca_btl_vader_component.segment_size);
|
2011-10-21 01:39:44 +04:00
|
|
|
}
|
|
|
|
|
2014-10-18 03:06:33 +04:00
|
|
|
#if OPAL_BTL_VADER_HAVE_KNEM
|
|
|
|
mca_btl_vader_knem_fini ();
|
|
|
|
#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 04:47:28 +04:00
|
|
|
return OPAL_SUCCESS;
|
2013-03-28 02:10:02 +04:00
|
|
|
}
|
2011-10-21 01:39:44 +04:00
|
|
|
|
2013-03-28 02:10:02 +04:00
|
|
|
static int mca_btl_base_vader_modex_send (void)
|
|
|
|
{
|
2014-10-18 03:06:33 +04:00
|
|
|
union vader_modex_t modex;
|
2014-09-23 22:11:22 +04:00
|
|
|
int modex_size, rc;
|
2011-10-21 01:39:44 +04: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 04:47:28 +04:00
|
|
|
#if OPAL_BTL_VADER_HAVE_XPMEM
|
2014-10-18 03:06:33 +04:00
|
|
|
if (MCA_BTL_VADER_XPMEM == mca_btl_vader_component.single_copy_mechanism) {
|
|
|
|
modex.xpmem.seg_id = mca_btl_vader_component.my_seg_id;
|
|
|
|
modex.xpmem.segment_base = mca_btl_vader_component.my_segment;
|
2013-03-28 02:10:02 +04:00
|
|
|
|
2015-02-13 00:06:11 +03:00
|
|
|
modex_size = sizeof (modex.xpmem);
|
2014-10-18 03:06:33 +04:00
|
|
|
} else {
|
|
|
|
#endif
|
|
|
|
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);
|
|
|
|
|
|
|
|
#if OPAL_BTL_VADER_HAVE_XPMEM
|
|
|
|
}
|
2014-01-06 23:51:44 +04:00
|
|
|
#endif
|
|
|
|
|
2014-09-23 22:11:22 +04:00
|
|
|
OPAL_MODEX_SEND(rc, PMIX_SYNC_REQD, PMIX_LOCAL,
|
|
|
|
&mca_btl_vader_component.super.btl_version, &modex, modex_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 22:56:47 +04:00
|
|
|
return rc;
|
2011-10-21 01:39:44 +04:00
|
|
|
}
|
|
|
|
|
2014-10-18 03:06:33 +04:00
|
|
|
#if OPAL_BTL_VADER_HAVE_XPMEM || OPAL_BTL_VADER_HAVE_CMA || OPAL_BTL_VADER_HAVE_KNEM
|
|
|
|
static void mca_btl_vader_select_next_single_copy_mechanism (void)
|
|
|
|
{
|
|
|
|
for (int i = 0 ; single_copy_mechanisms[i].value != MCA_BTL_VADER_NONE ; ++i) {
|
|
|
|
if (single_copy_mechanisms[i].value == mca_btl_vader_component.single_copy_mechanism) {
|
|
|
|
mca_btl_vader_component.single_copy_mechanism = single_copy_mechanisms[i+1].value;
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
static void mca_btl_vader_check_single_copy (void)
|
|
|
|
{
|
|
|
|
int initial_mechanism = mca_btl_vader_component.single_copy_mechanism;
|
|
|
|
|
|
|
|
#if OPAL_BTL_VADER_HAVE_XPMEM
|
|
|
|
if (MCA_BTL_VADER_XPMEM == mca_btl_vader_component.single_copy_mechanism) {
|
|
|
|
/* try to create an xpmem segment for the entire address space */
|
2015-01-06 02:02:41 +03:00
|
|
|
int rc = mca_btl_vader_xpmem_init ();
|
2014-12-12 19:09:01 +03:00
|
|
|
if (OPAL_SUCCESS != rc) {
|
2014-10-18 03:06:33 +04:00
|
|
|
if (MCA_BTL_VADER_XPMEM == initial_mechanism) {
|
|
|
|
opal_show_help("help-btl-vader.txt", "xpmem-make-failed",
|
|
|
|
true, opal_process_info.nodename, errno,
|
|
|
|
strerror(errno));
|
|
|
|
}
|
|
|
|
|
|
|
|
mca_btl_vader_select_next_single_copy_mechanism ();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#if OPAL_BTL_VADER_HAVE_CMA
|
|
|
|
if (MCA_BTL_VADER_CMA == mca_btl_vader_component.single_copy_mechanism) {
|
|
|
|
/* Check if we have the proper permissions for CMA */
|
2014-12-16 22:39:14 +03:00
|
|
|
char buffer = '0';
|
2014-10-18 03:06:33 +04:00
|
|
|
bool cma_happy = false;
|
|
|
|
int fd;
|
|
|
|
|
|
|
|
/* check system setting for current ptrace scope */
|
|
|
|
fd = open ("/proc/sys/kernel/yama/ptrace_scope", O_RDONLY);
|
2015-01-07 01:16:58 +03:00
|
|
|
if (0 < fd) {
|
2014-10-18 03:06:33 +04:00
|
|
|
read (fd, &buffer, 1);
|
|
|
|
close (fd);
|
|
|
|
}
|
|
|
|
|
|
|
|
/* ptrace scope 0 will allow an attach from any of the process owner's
|
|
|
|
* processes. ptrace scope 1 limits attachers to the process tree
|
|
|
|
* starting at the parent of this process. */
|
|
|
|
if ('0' != buffer) {
|
|
|
|
#if defined PR_SET_PTRACER
|
|
|
|
/* try setting the ptrace scope to allow attach */
|
|
|
|
int ret = prctl (PR_SET_PTRACER, PR_SET_PTRACER_ANY, 0, 0, 0);
|
|
|
|
if (0 == ret) {
|
|
|
|
cma_happy = true;
|
|
|
|
}
|
|
|
|
#endif
|
|
|
|
} else {
|
|
|
|
cma_happy = true;
|
|
|
|
}
|
|
|
|
|
|
|
|
if (!cma_happy) {
|
|
|
|
mca_btl_vader_select_next_single_copy_mechanism ();
|
|
|
|
|
|
|
|
if (MCA_BTL_VADER_CMA == initial_mechanism) {
|
2014-12-16 22:22:26 +03:00
|
|
|
opal_show_help("help-btl-vader.txt", "cma-permission-denied",
|
|
|
|
true, opal_process_info.nodename);
|
2014-10-18 03:06:33 +04:00
|
|
|
}
|
|
|
|
} else {
|
|
|
|
/* ptrace_scope will allow CMA */
|
|
|
|
mca_btl_vader.super.btl_get = mca_btl_vader_get_cma;
|
|
|
|
mca_btl_vader.super.btl_put = mca_btl_vader_put_cma;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#if OPAL_BTL_VADER_HAVE_KNEM
|
|
|
|
if (MCA_BTL_VADER_KNEM == mca_btl_vader_component.single_copy_mechanism) {
|
|
|
|
/* mca_btl_vader_knem_init will set the appropriate get/put functions */
|
2015-01-06 02:02:41 +03:00
|
|
|
int rc = mca_btl_vader_knem_init ();
|
2014-10-18 03:06:33 +04:00
|
|
|
if (OPAL_SUCCESS != rc) {
|
|
|
|
if (MCA_BTL_VADER_KNEM == initial_mechanism) {
|
|
|
|
opal_show_help("help-btl-vader.txt", "knem requested but not available",
|
2014-12-16 22:22:26 +03:00
|
|
|
true, opal_process_info.nodename);
|
2014-10-18 03:06:33 +04:00
|
|
|
}
|
|
|
|
|
|
|
|
/* disable single copy */
|
|
|
|
mca_btl_vader_select_next_single_copy_mechanism ();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
#endif
|
|
|
|
|
|
|
|
if (MCA_BTL_VADER_NONE == mca_btl_vader_component.single_copy_mechanism) {
|
|
|
|
mca_btl_vader.super.btl_flags &= ~MCA_BTL_FLAGS_RDMA;
|
|
|
|
mca_btl_vader.super.btl_get = NULL;
|
|
|
|
mca_btl_vader.super.btl_put = NULL;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
#endif
|
|
|
|
|
2011-10-21 01:39:44 +04:00
|
|
|
/*
|
|
|
|
* VADER component initialization
|
|
|
|
*/
|
|
|
|
static mca_btl_base_module_t **mca_btl_vader_component_init (int *num_btls,
|
2011-11-02 19:07:57 +04:00
|
|
|
bool enable_progress_threads,
|
|
|
|
bool enable_mpi_threads)
|
2011-10-21 01:39:44 +04:00
|
|
|
{
|
|
|
|
mca_btl_vader_component_t *component = &mca_btl_vader_component;
|
|
|
|
mca_btl_base_module_t **btls = NULL;
|
2013-03-28 02:10:02 +04:00
|
|
|
int rc;
|
2011-10-21 01:39:44 +04:00
|
|
|
|
|
|
|
*num_btls = 0;
|
|
|
|
|
2013-07-12 00:54:12 +04:00
|
|
|
/* disable if there are no local peers */
|
|
|
|
if (0 == MCA_BTL_VADER_NUM_LOCAL_PEERS) {
|
2014-02-03 21:42:40 +04:00
|
|
|
BTL_VERBOSE(("No peers to communicate with. Disabling vader."));
|
2013-07-12 00:54:12 +04:00
|
|
|
return NULL;
|
|
|
|
}
|
|
|
|
|
2014-09-23 22:11:22 +04:00
|
|
|
#if OPAL_BTL_VADER_HAVE_XPMEM
|
2013-03-28 02:10:02 +04:00
|
|
|
/* limit segment alignment to be between 4k and 16M */
|
2014-09-23 22:11:22 +04:00
|
|
|
if (component->log_attach_align < 12) {
|
|
|
|
component->log_attach_align = 12;
|
|
|
|
} else if (component->log_attach_align > 25) {
|
|
|
|
component->log_attach_align = 25;
|
2013-03-28 02:10:02 +04:00
|
|
|
}
|
2014-09-23 22:11:22 +04:00
|
|
|
#endif
|
2011-10-21 01:39:44 +04:00
|
|
|
|
|
|
|
btls = (mca_btl_base_module_t **) calloc (1, sizeof (mca_btl_base_module_t *));
|
|
|
|
if (NULL == btls) {
|
|
|
|
return NULL;
|
|
|
|
}
|
|
|
|
|
2014-01-06 23:51:44 +04:00
|
|
|
/* ensure a sane segment size */
|
2014-09-23 22:11:22 +04:00
|
|
|
if (component->segment_size < (2 << 20)) {
|
|
|
|
component->segment_size = (2 << 20);
|
2014-01-06 23:51:44 +04:00
|
|
|
}
|
|
|
|
|
2014-09-23 22:11:22 +04:00
|
|
|
component->fbox_size = (component->fbox_size + MCA_BTL_VADER_FBOX_ALIGNMENT_MASK) & ~MCA_BTL_VADER_FBOX_ALIGNMENT_MASK;
|
|
|
|
|
|
|
|
if (component->segment_size > (1ul << MCA_BTL_VADER_OFFSET_BITS)) {
|
|
|
|
component->segment_size = 2ul << MCA_BTL_VADER_OFFSET_BITS;
|
2014-02-08 03:57:36 +04:00
|
|
|
}
|
|
|
|
|
2014-09-23 22:11:22 +04:00
|
|
|
/* no fast boxes allocated initially */
|
|
|
|
component->num_fbox_in_endpoints = 0;
|
|
|
|
component->fbox_count = 0;
|
|
|
|
|
2014-10-18 03:06:33 +04:00
|
|
|
#if OPAL_BTL_VADER_HAVE_XPMEM || OPAL_BTL_VADER_HAVE_CMA || OPAL_BTL_VADER_HAVE_KNEM
|
|
|
|
mca_btl_vader_check_single_copy ();
|
|
|
|
#endif
|
2012-02-22 22:32:40 +04:00
|
|
|
|
2014-10-18 03:06:33 +04:00
|
|
|
if (MCA_BTL_VADER_XPMEM != mca_btl_vader_component.single_copy_mechanism) {
|
2014-01-06 23:51:44 +04:00
|
|
|
char *sm_file;
|
|
|
|
|
2014-07-27 01:48:23 +04: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 23:51:44 +04:00
|
|
|
if (0 > rc) {
|
|
|
|
free (btls);
|
|
|
|
return NULL;
|
|
|
|
}
|
|
|
|
|
2014-09-23 22:11:22 +04:00
|
|
|
rc = opal_shmem_segment_create (&component->seg_ds, sm_file, component->segment_size);
|
2014-01-06 23:51:44 +04:00
|
|
|
free (sm_file);
|
|
|
|
if (OPAL_SUCCESS != rc) {
|
2014-02-03 21:42:40 +04:00
|
|
|
BTL_VERBOSE(("Could not create shared memory segment"));
|
2014-01-06 23:51:44 +04:00
|
|
|
free (btls);
|
|
|
|
return NULL;
|
|
|
|
}
|
|
|
|
|
2014-09-23 22:11:22 +04:00
|
|
|
component->my_segment = opal_shmem_segment_attach (&component->seg_ds);
|
2014-01-06 23:51:44 +04:00
|
|
|
if (NULL == component->my_segment) {
|
2014-02-03 21:42:40 +04:00
|
|
|
BTL_VERBOSE(("Could not attach to just created shared memory segment"));
|
2014-01-06 23:51:44 +04:00
|
|
|
goto failed;
|
|
|
|
}
|
2014-10-18 03:06:33 +04:00
|
|
|
} else {
|
|
|
|
/* when using xpmem it is safe to use an anonymous segment */
|
|
|
|
component->my_segment = mmap (NULL, component->segment_size, PROT_READ |
|
|
|
|
PROT_WRITE, MAP_ANONYMOUS | MAP_SHARED, -1, 0);
|
|
|
|
if ((void *)-1 == component->my_segment) {
|
|
|
|
BTL_VERBOSE(("Could not create anonymous memory segment"));
|
|
|
|
free (btls);
|
|
|
|
return NULL;
|
|
|
|
}
|
2014-01-06 23:51:44 +04:00
|
|
|
}
|
2013-03-28 02:10:02 +04:00
|
|
|
|
|
|
|
component->segment_offset = 0;
|
|
|
|
|
|
|
|
/* initialize my fifo */
|
2014-09-23 22:11:22 +04:00
|
|
|
vader_fifo_init ((struct vader_fifo_t *) component->my_segment);
|
2013-03-28 02:10:02 +04: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 04:47:28 +04:00
|
|
|
if (OPAL_SUCCESS != rc) {
|
2014-02-03 21:42:40 +04:00
|
|
|
BTL_VERBOSE(("Error sending modex"));
|
2014-01-06 23:51:44 +04:00
|
|
|
goto failed;
|
2013-03-28 02:10:02 +04:00
|
|
|
}
|
|
|
|
|
2011-10-21 01:39:44 +04: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 23:51:44 +04: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 04:47:28 +04:00
|
|
|
#if OPAL_BTL_VADER_HAVE_XPMEM
|
2014-10-18 03:06:33 +04:00
|
|
|
if (MCA_BTL_VADER_XPMEM == mca_btl_vader_component.single_copy_mechanism) {
|
|
|
|
munmap (component->my_segment, component->segment_size);
|
|
|
|
} else
|
2014-01-06 23:51:44 +04:00
|
|
|
#endif
|
2014-10-18 03:06:33 +04:00
|
|
|
opal_shmem_unlink (&component->seg_ds);
|
2014-01-06 23:51:44 +04:00
|
|
|
|
|
|
|
if (btls) {
|
|
|
|
free (btls);
|
|
|
|
}
|
|
|
|
|
|
|
|
return NULL;
|
2011-10-21 01:39:44 +04:00
|
|
|
}
|
|
|
|
|
2014-09-23 22:11:22 +04:00
|
|
|
void mca_btl_vader_poll_handle_frag (mca_btl_vader_hdr_t *hdr, struct mca_btl_base_endpoint_t *endpoint)
|
2011-10-21 01:39:44 +04:00
|
|
|
{
|
2014-10-18 03:06:33 +04:00
|
|
|
mca_btl_base_segment_t segments[2];
|
2015-01-06 02:02:41 +03:00
|
|
|
mca_btl_base_descriptor_t frag = {.des_segments = segments, .des_segment_count = 1};
|
2013-07-12 00:54:12 +04:00
|
|
|
const mca_btl_active_message_callback_t *reg;
|
2014-09-23 22:11:22 +04:00
|
|
|
|
|
|
|
if (hdr->flags & MCA_BTL_VADER_FLAG_COMPLETE) {
|
|
|
|
mca_btl_vader_frag_complete (hdr->frag);
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
reg = mca_btl_base_active_message_trigger + hdr->tag;
|
2014-10-18 03:06:33 +04:00
|
|
|
segments[0].seg_addr.pval = (void *) (hdr + 1);
|
|
|
|
segments[0].seg_len = hdr->len;
|
2014-09-23 22:11:22 +04:00
|
|
|
|
|
|
|
if (hdr->flags & MCA_BTL_VADER_FLAG_SINGLE_COPY) {
|
|
|
|
mca_mpool_base_registration_t *xpmem_reg;
|
|
|
|
|
|
|
|
xpmem_reg = vader_get_registation (endpoint, hdr->sc_iov.iov_base,
|
|
|
|
hdr->sc_iov.iov_len, 0,
|
2014-10-18 03:06:33 +04:00
|
|
|
&segments[1].seg_addr.pval);
|
2014-09-23 22:11:22 +04:00
|
|
|
|
2014-10-18 03:06:33 +04:00
|
|
|
segments[1].seg_len = hdr->sc_iov.iov_len;
|
2015-01-06 02:02:41 +03:00
|
|
|
frag.des_segment_count = 2;
|
2014-09-23 22:11:22 +04:00
|
|
|
|
|
|
|
/* recv upcall */
|
2014-10-18 03:06:33 +04:00
|
|
|
reg->cbfunc(&mca_btl_vader.super, hdr->tag, &frag, reg->cbdata);
|
2014-09-23 22:11:22 +04:00
|
|
|
vader_return_registration (xpmem_reg, endpoint);
|
|
|
|
} else {
|
2014-10-18 03:06:33 +04:00
|
|
|
reg->cbfunc(&mca_btl_vader.super, hdr->tag, &frag, reg->cbdata);
|
2014-09-23 22:11:22 +04:00
|
|
|
}
|
|
|
|
|
|
|
|
if (OPAL_UNLIKELY(MCA_BTL_VADER_FLAG_SETUP_FBOX & hdr->flags)) {
|
|
|
|
mca_btl_vader_endpoint_setup_fbox_recv (endpoint, relative2virtual(hdr->fbox_base));
|
|
|
|
mca_btl_vader_component.fbox_in_endpoints[mca_btl_vader_component.num_fbox_in_endpoints++] = endpoint;
|
|
|
|
}
|
|
|
|
|
|
|
|
hdr->flags = MCA_BTL_VADER_FLAG_COMPLETE;
|
|
|
|
vader_fifo_write_back (hdr, endpoint);
|
|
|
|
}
|
|
|
|
|
2014-10-18 03:06:33 +04:00
|
|
|
static int mca_btl_vader_poll_fifo (void)
|
2014-09-23 22:11:22 +04:00
|
|
|
{
|
2013-03-28 02:10:02 +04:00
|
|
|
struct mca_btl_base_endpoint_t *endpoint;
|
2014-01-06 23:51:44 +04:00
|
|
|
mca_btl_vader_hdr_t *hdr;
|
2012-12-14 03:18:53 +04:00
|
|
|
|
2013-07-12 00:54:12 +04:00
|
|
|
/* poll the fifo until it is empty or a limit has been hit (8 is arbitrary) */
|
2014-10-18 03:06:33 +04:00
|
|
|
for (int fifo_count = 0 ; fifo_count < 31 ; ++fifo_count) {
|
2014-04-24 21:36:03 +04:00
|
|
|
hdr = vader_fifo_read (mca_btl_vader_component.my_fifo, &endpoint);
|
2013-07-12 00:54:12 +04:00
|
|
|
if (NULL == hdr) {
|
|
|
|
return fifo_count;
|
|
|
|
}
|
2011-10-21 01:39:44 +04:00
|
|
|
|
2014-09-23 22:11:22 +04:00
|
|
|
mca_btl_vader_poll_handle_frag (hdr, endpoint);
|
2013-07-12 00:54:12 +04:00
|
|
|
}
|
2011-10-21 01:39:44 +04:00
|
|
|
|
2014-01-06 23:51:44 +04:00
|
|
|
return 1;
|
|
|
|
}
|
|
|
|
|
2014-09-23 22:11:22 +04:00
|
|
|
/**
|
|
|
|
* Progress pending messages on an endpoint
|
|
|
|
*
|
|
|
|
* @param ep (IN) Vader BTL endpoint
|
2014-10-18 03:06:33 +04:00
|
|
|
*
|
|
|
|
* This is called with the component lock held so the component lock does
|
|
|
|
* not need to be aquired before modifying the pending_endpoints list.
|
2014-09-23 22:11:22 +04:00
|
|
|
*/
|
|
|
|
static void mca_btl_vader_progress_waiting (mca_btl_base_endpoint_t *ep)
|
|
|
|
{
|
2015-05-21 01:14:58 +03:00
|
|
|
mca_btl_vader_frag_t *frag, *next;
|
|
|
|
int ret = 1;
|
2014-09-23 22:11:22 +04:00
|
|
|
|
2014-10-18 03:06:33 +04:00
|
|
|
if (OPAL_UNLIKELY(NULL == ep)) {
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
2014-09-23 22:11:22 +04:00
|
|
|
OPAL_THREAD_LOCK(&ep->lock);
|
2015-05-21 01:14:58 +03:00
|
|
|
OPAL_LIST_FOREACH_SAFE(frag, next, &ep->pending_frags, mca_btl_vader_frag_t) {
|
2014-09-23 22:11:22 +04:00
|
|
|
OPAL_THREAD_UNLOCK(&ep->lock);
|
2015-05-21 01:14:58 +03:00
|
|
|
ret = vader_fifo_write_ep (frag->hdr, ep);
|
|
|
|
if (!ret) {
|
2015-05-20 23:35:22 +03:00
|
|
|
return;
|
2014-09-23 22:11:22 +04:00
|
|
|
}
|
2015-05-21 01:14:58 +03:00
|
|
|
|
2014-09-23 22:11:22 +04:00
|
|
|
OPAL_THREAD_LOCK(&ep->lock);
|
2015-05-21 01:14:58 +03:00
|
|
|
(void) opal_list_remove_first (&ep->pending_frags);
|
2014-09-23 22:11:22 +04:00
|
|
|
}
|
2015-05-21 01:14:58 +03:00
|
|
|
|
|
|
|
ep->waiting = false;
|
|
|
|
opal_list_remove_item (&mca_btl_vader_component.pending_endpoints, &ep->super);
|
|
|
|
|
2014-09-23 22:11:22 +04:00
|
|
|
OPAL_THREAD_UNLOCK(&ep->lock);
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Progress pending messages on all waiting endpoints
|
|
|
|
*
|
|
|
|
* @param ep (IN) Vader BTL endpoint
|
|
|
|
*/
|
|
|
|
static void mca_btl_vader_progress_endpoints (void)
|
|
|
|
{
|
2015-05-21 01:14:58 +03:00
|
|
|
mca_btl_base_endpoint_t *ep, *next;
|
2014-09-23 22:11:22 +04:00
|
|
|
int count;
|
|
|
|
|
|
|
|
count = opal_list_get_size (&mca_btl_vader_component.pending_endpoints);
|
2014-10-18 03:06:33 +04:00
|
|
|
if (OPAL_LIKELY(0 == count)) {
|
|
|
|
return;
|
|
|
|
}
|
2014-09-23 22:11:22 +04:00
|
|
|
|
2014-10-18 03:06:33 +04:00
|
|
|
OPAL_THREAD_LOCK(&mca_btl_vader_component.lock);
|
2015-05-21 01:14:58 +03:00
|
|
|
OPAL_LIST_FOREACH_SAFE(ep, next, &mca_btl_vader_component.pending_endpoints, mca_btl_base_endpoint_t) {
|
|
|
|
mca_btl_vader_progress_waiting (ep);
|
2014-09-23 22:11:22 +04:00
|
|
|
}
|
2015-04-14 18:33:19 +03:00
|
|
|
OPAL_THREAD_UNLOCK(&mca_btl_vader_component.lock);
|
2014-09-23 22:11:22 +04:00
|
|
|
}
|
|
|
|
|
2014-01-06 23:51:44 +04:00
|
|
|
static int mca_btl_vader_component_progress (void)
|
|
|
|
{
|
2014-09-23 22:11:22 +04:00
|
|
|
static int32_t lock = 0;
|
|
|
|
int count = 0;
|
2014-01-06 23:51:44 +04:00
|
|
|
|
2014-09-23 22:11:22 +04:00
|
|
|
if (opal_using_threads()) {
|
|
|
|
if (opal_atomic_swap_32 (&lock, 1)) {
|
|
|
|
return 0;
|
2014-01-06 23:51:44 +04:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2014-09-23 22:11:22 +04:00
|
|
|
/* check for messages in fast boxes */
|
|
|
|
if (mca_btl_vader_component.num_fbox_in_endpoints) {
|
|
|
|
count = mca_btl_vader_check_fboxes ();
|
|
|
|
}
|
|
|
|
|
|
|
|
mca_btl_vader_progress_endpoints ();
|
|
|
|
|
2014-01-06 23:51:44 +04:00
|
|
|
if (VADER_FIFO_FREE == mca_btl_vader_component.my_fifo->fifo_head) {
|
2014-09-23 22:11:22 +04:00
|
|
|
lock = 0;
|
|
|
|
return count;
|
2014-01-06 23:51:44 +04:00
|
|
|
}
|
|
|
|
|
2014-09-23 22:11:22 +04:00
|
|
|
count += mca_btl_vader_poll_fifo ();
|
|
|
|
opal_atomic_mb ();
|
|
|
|
lock = 0;
|
|
|
|
|
|
|
|
return count;
|
2011-10-21 01:39:44 +04:00
|
|
|
}
|