2013-10-23 19:59:14 +04:00
|
|
|
/* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil -*- */
|
|
|
|
/*
|
2014-11-20 09:22:43 +03:00
|
|
|
* Copyright (c) 2013 Los Alamos National Security, LLC. All rights
|
2013-10-23 19:59:14 +04:00
|
|
|
* reserved.
|
2014-07-30 08:26:50 +04:00
|
|
|
* Copyright (c) 2014 Research Organization for Information Science
|
|
|
|
* and Technology (RIST). 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.
|
2013-10-23 19:59:14 +04:00
|
|
|
* $COPYRIGHT$
|
|
|
|
*
|
|
|
|
* Additional copyrights may follow
|
|
|
|
*
|
|
|
|
* $HEADER$
|
|
|
|
*/
|
|
|
|
|
|
|
|
#include "btl_scif.h"
|
|
|
|
#include "btl_scif_frag.h"
|
|
|
|
|
2014-07-30 08:26:50 +04:00
|
|
|
#include "opal/runtime/opal_params.h"
|
2013-10-23 19:59:14 +04:00
|
|
|
#include "opal/include/opal/align.h"
|
|
|
|
#include "opal/memoryhooks/memory.h"
|
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
|
|
|
#include "opal/mca/pmix/pmix.h"
|
2013-10-23 19:59:14 +04:00
|
|
|
|
|
|
|
#include "opal/mca/base/mca_base_pvar.h"
|
|
|
|
|
|
|
|
#include <scif.h>
|
|
|
|
|
|
|
|
static int btl_scif_component_register(void);
|
|
|
|
static int btl_scif_component_open(void);
|
|
|
|
static int btl_scif_component_close(void);
|
|
|
|
static mca_btl_base_module_t **mca_btl_scif_component_init(int *, bool, bool);
|
|
|
|
static int mca_btl_scif_component_progress(void);
|
|
|
|
|
|
|
|
mca_btl_scif_component_t mca_btl_scif_component = {
|
|
|
|
{
|
|
|
|
/* First, the mca_base_component_t struct containing meta information
|
|
|
|
about the component itself */
|
|
|
|
|
|
|
|
.btl_version = {
|
2014-07-10 20:31:15 +04:00
|
|
|
MCA_BTL_DEFAULT_VERSION("scif"),
|
2013-10-23 19:59:14 +04:00
|
|
|
.mca_open_component = btl_scif_component_open,
|
|
|
|
.mca_close_component = btl_scif_component_close,
|
|
|
|
.mca_register_component_params = btl_scif_component_register,
|
|
|
|
},
|
|
|
|
.btl_data = {
|
|
|
|
.param_field = MCA_BASE_METADATA_PARAM_CHECKPOINT
|
|
|
|
},
|
|
|
|
.btl_init = mca_btl_scif_component_init,
|
|
|
|
.btl_progress = mca_btl_scif_component_progress,
|
|
|
|
}
|
|
|
|
};
|
|
|
|
|
|
|
|
static int btl_scif_component_register(void)
|
|
|
|
{
|
|
|
|
(void) mca_base_var_group_component_register(&mca_btl_scif_component.super.btl_version,
|
|
|
|
"SCIF byte transport layer");
|
|
|
|
|
|
|
|
mca_btl_scif_component.scif_free_list_num = 8;
|
|
|
|
(void) mca_base_component_var_register(&mca_btl_scif_component.super.btl_version,
|
|
|
|
"free_list_num", "Initial fragment free list size",
|
|
|
|
MCA_BASE_VAR_TYPE_INT, NULL, 0, MCA_BASE_VAR_FLAG_SETTABLE,
|
|
|
|
OPAL_INFO_LVL_9, MCA_BASE_VAR_SCOPE_LOCAL,
|
|
|
|
&mca_btl_scif_component.scif_free_list_num);
|
|
|
|
mca_btl_scif_component.scif_free_list_max = 16384;
|
|
|
|
(void) mca_base_component_var_register(&mca_btl_scif_component.super.btl_version,
|
|
|
|
"free_list_max", "Maximum fragment free list size",
|
|
|
|
MCA_BASE_VAR_TYPE_INT, NULL, 0, MCA_BASE_VAR_FLAG_SETTABLE,
|
|
|
|
OPAL_INFO_LVL_9, MCA_BASE_VAR_SCOPE_LOCAL,
|
|
|
|
&mca_btl_scif_component.scif_free_list_max);
|
|
|
|
mca_btl_scif_component.scif_free_list_inc = 64;
|
|
|
|
(void) mca_base_component_var_register(&mca_btl_scif_component.super.btl_version,
|
|
|
|
"free_list_inc", "Fragment free list size increment",
|
|
|
|
MCA_BASE_VAR_TYPE_INT, NULL, 0, MCA_BASE_VAR_FLAG_SETTABLE,
|
|
|
|
OPAL_INFO_LVL_9, MCA_BASE_VAR_SCOPE_LOCAL,
|
|
|
|
&mca_btl_scif_component.scif_free_list_inc);
|
|
|
|
|
|
|
|
mca_btl_scif_component.segment_size = 8 * 1024;
|
|
|
|
(void) mca_base_component_var_register(&mca_btl_scif_component.super.btl_version,
|
|
|
|
"segment_size", "Size of memory segment to "
|
|
|
|
"allocate for each remote process (default: "
|
|
|
|
"8k)", MCA_BASE_VAR_TYPE_UNSIGNED_INT, NULL, 0,
|
|
|
|
MCA_BASE_VAR_FLAG_SETTABLE, OPAL_INFO_LVL_9,
|
|
|
|
MCA_BASE_VAR_SCOPE_LOCAL,
|
|
|
|
&mca_btl_scif_component.segment_size);
|
|
|
|
|
|
|
|
mca_btl_scif_component.rma_use_cpu = false;
|
|
|
|
(void) mca_base_component_var_register(&mca_btl_scif_component.super.btl_version,
|
|
|
|
"rma_use_cpu", "Use CPU instead of DMA "
|
|
|
|
"for RMA copies (default: false)", MCA_BASE_VAR_TYPE_BOOL,
|
|
|
|
NULL, 0, MCA_BASE_VAR_FLAG_SETTABLE,
|
|
|
|
OPAL_INFO_LVL_9, MCA_BASE_VAR_SCOPE_LOCAL,
|
|
|
|
&mca_btl_scif_component.rma_use_cpu);
|
|
|
|
|
|
|
|
|
|
|
|
mca_btl_scif_component.rma_sync = true;
|
|
|
|
(void) mca_base_component_var_register(&mca_btl_scif_component.super.btl_version,
|
|
|
|
"rma_sync", "Use synchronous RMA instead of "
|
|
|
|
"an RMA fence (default: true)", MCA_BASE_VAR_TYPE_BOOL,
|
|
|
|
NULL, 0, MCA_BASE_VAR_FLAG_SETTABLE,
|
|
|
|
OPAL_INFO_LVL_9, MCA_BASE_VAR_SCOPE_LOCAL,
|
|
|
|
&mca_btl_scif_component.rma_sync);
|
|
|
|
|
|
|
|
#if defined(SCIF_TIMING)
|
|
|
|
mca_btl_scif_component.aquire_buffer_time = 0.0;
|
|
|
|
(void) mca_base_component_pvar_register(&mca_btl_scif_component.super.btl_version,
|
|
|
|
"aquire_buffer_time", "Aggregate time spent "
|
|
|
|
"aquiring send buffers", OPAL_INFO_LVL_9,
|
|
|
|
MCA_BASE_PVAR_CLASS_AGGREGATE, MCA_BASE_VAR_TYPE_DOUBLE,
|
|
|
|
NULL, MCA_BASE_VAR_BIND_NO_OBJECT, MCA_BASE_PVAR_FLAG_READONLY |
|
|
|
|
MCA_BASE_PVAR_FLAG_CONTINUOUS, NULL, NULL, NULL,
|
|
|
|
&mca_btl_scif_component.aquire_buffer_time);
|
|
|
|
|
|
|
|
mca_btl_scif_component.send_time = 0.0;
|
|
|
|
(void) mca_base_component_pvar_register(&mca_btl_scif_component.super.btl_version,
|
|
|
|
"send_time", "Aggregate time spent writing to "
|
|
|
|
"send buffers", OPAL_INFO_LVL_9, MCA_BASE_PVAR_CLASS_AGGREGATE,
|
|
|
|
MCA_BASE_VAR_TYPE_DOUBLE, NULL, MCA_BASE_VAR_BIND_NO_OBJECT,
|
|
|
|
MCA_BASE_PVAR_FLAG_READONLY | MCA_BASE_PVAR_FLAG_CONTINUOUS,
|
|
|
|
NULL, NULL, NULL, &mca_btl_scif_component.send_time);
|
|
|
|
|
|
|
|
mca_btl_scif_component.sendi_time = 0.0;
|
|
|
|
(void) mca_base_component_pvar_register(&mca_btl_scif_component.super.btl_version,
|
|
|
|
"sendi_time", "Aggregate time spent writing to "
|
|
|
|
"send buffers in sendi", OPAL_INFO_LVL_9, MCA_BASE_PVAR_CLASS_AGGREGATE,
|
|
|
|
MCA_BASE_VAR_TYPE_DOUBLE, NULL, MCA_BASE_VAR_BIND_NO_OBJECT,
|
|
|
|
MCA_BASE_PVAR_FLAG_READONLY | MCA_BASE_PVAR_FLAG_CONTINUOUS,
|
|
|
|
NULL, NULL, NULL, &mca_btl_scif_component.sendi_time);
|
|
|
|
|
|
|
|
mca_btl_scif_component.get_time = 0.0;
|
|
|
|
(void) mca_base_component_pvar_register(&mca_btl_scif_component.super.btl_version,
|
|
|
|
"get_time", "Aggregate time spent in DMA read (scif_readfrom)",
|
|
|
|
OPAL_INFO_LVL_9, MCA_BASE_PVAR_CLASS_AGGREGATE,
|
|
|
|
MCA_BASE_VAR_TYPE_DOUBLE, NULL, MCA_BASE_VAR_BIND_NO_OBJECT,
|
|
|
|
MCA_BASE_PVAR_FLAG_READONLY | MCA_BASE_PVAR_FLAG_CONTINUOUS,
|
|
|
|
NULL, NULL, NULL, &mca_btl_scif_component.get_time);
|
|
|
|
|
|
|
|
mca_btl_scif_component.get_count = 0;
|
|
|
|
(void) mca_base_component_pvar_register(&mca_btl_scif_component.super.btl_version,
|
|
|
|
"get_count", "Number of times btl_scif_get was called",
|
|
|
|
OPAL_INFO_LVL_9, MCA_BASE_PVAR_CLASS_COUNTER,
|
|
|
|
MCA_BASE_VAR_TYPE_UNSIGNED_LONG, NULL, MCA_BASE_VAR_BIND_NO_OBJECT,
|
|
|
|
MCA_BASE_PVAR_FLAG_READONLY | MCA_BASE_PVAR_FLAG_CONTINUOUS,
|
|
|
|
NULL, NULL, NULL, &mca_btl_scif_component.get_count);
|
|
|
|
|
|
|
|
mca_btl_scif_component.put_time = 0.0;
|
|
|
|
(void) mca_base_component_pvar_register(&mca_btl_scif_component.super.btl_version,
|
|
|
|
"put_time", "Aggregate time spent in DMA write (scif_writeto)",
|
|
|
|
OPAL_INFO_LVL_9, MCA_BASE_PVAR_CLASS_AGGREGATE,
|
|
|
|
MCA_BASE_VAR_TYPE_DOUBLE, NULL, MCA_BASE_VAR_BIND_NO_OBJECT,
|
|
|
|
MCA_BASE_PVAR_FLAG_READONLY | MCA_BASE_PVAR_FLAG_CONTINUOUS,
|
|
|
|
NULL, NULL, NULL, &mca_btl_scif_component.put_time);
|
|
|
|
|
|
|
|
mca_btl_scif_component.put_count = 0;
|
|
|
|
(void) mca_base_component_pvar_register(&mca_btl_scif_component.super.btl_version,
|
|
|
|
"put_count", "Number of times btl_scif_put was called",
|
|
|
|
OPAL_INFO_LVL_9, MCA_BASE_PVAR_CLASS_COUNTER,
|
|
|
|
MCA_BASE_VAR_TYPE_UNSIGNED_LONG, NULL, MCA_BASE_VAR_BIND_NO_OBJECT,
|
|
|
|
MCA_BASE_PVAR_FLAG_READONLY | MCA_BASE_PVAR_FLAG_CONTINUOUS,
|
|
|
|
NULL, NULL, NULL, &mca_btl_scif_component.put_count);
|
|
|
|
#endif
|
|
|
|
|
|
|
|
mca_btl_scif_module.super.btl_exclusivity = MCA_BTL_EXCLUSIVITY_HIGH;
|
|
|
|
mca_btl_scif_module.super.btl_eager_limit = 1 * 1024;
|
|
|
|
mca_btl_scif_module.super.btl_rndv_eager_limit = 1 * 1024;
|
|
|
|
mca_btl_scif_module.super.btl_rdma_pipeline_frag_size = 4 * 1024 * 1024;
|
|
|
|
mca_btl_scif_module.super.btl_max_send_size = 1 * 1024;
|
|
|
|
mca_btl_scif_module.super.btl_rdma_pipeline_send_length = 1 * 1024;
|
|
|
|
|
|
|
|
/* threshold for put */
|
|
|
|
mca_btl_scif_module.super.btl_min_rdma_pipeline_size = 1 * 1024;
|
|
|
|
|
|
|
|
mca_btl_scif_module.super.btl_flags = MCA_BTL_FLAGS_SEND |
|
|
|
|
MCA_BTL_FLAGS_RDMA | MCA_BTL_FLAGS_SEND_INPLACE;
|
|
|
|
|
2014-11-20 09:22:43 +03:00
|
|
|
mca_btl_scif_module.super.btl_seg_size = sizeof (mca_btl_scif_segment_t);
|
2013-10-23 19:59:14 +04:00
|
|
|
|
|
|
|
mca_btl_scif_module.super.btl_bandwidth = 50000; /* Mbs */
|
|
|
|
mca_btl_scif_module.super.btl_latency = 2; /* Microsecs */
|
|
|
|
|
|
|
|
/* Call the BTL based to register its MCA params */
|
|
|
|
mca_btl_base_param_register(&mca_btl_scif_component.super.btl_version,
|
|
|
|
&mca_btl_scif_module.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;
|
2013-10-23 19:59:14 +04:00
|
|
|
}
|
|
|
|
|
|
|
|
static int btl_scif_component_open(void)
|
|
|
|
{
|
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-10-23 19:59:14 +04:00
|
|
|
}
|
|
|
|
|
|
|
|
static int btl_scif_component_close(void)
|
|
|
|
{
|
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-10-23 19:59:14 +04:00
|
|
|
}
|
|
|
|
|
|
|
|
static void mca_btl_scif_autoset_leave_pinned (void) {
|
|
|
|
int value = opal_mem_hooks_support_level();
|
|
|
|
|
|
|
|
if ((OPAL_MEMORY_FREE_SUPPORT | OPAL_MEMORY_MUNMAP_SUPPORT) ==
|
|
|
|
((OPAL_MEMORY_FREE_SUPPORT | OPAL_MEMORY_MUNMAP_SUPPORT) & value)) {
|
|
|
|
/* Set leave pinned to 1 if leave pinned pipeline is not set */
|
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 (-1 == opal_leave_pinned) {
|
|
|
|
opal_leave_pinned = !opal_leave_pinned_pipeline;
|
2013-10-23 19:59:14 +04:00
|
|
|
}
|
|
|
|
} else {
|
George did the work and deserves all the credit for it. Ralph did the merge, and deserves whatever blame results from errors in it :-)
WHAT: Open our low-level communication infrastructure by moving all necessary components (btl/rcache/allocator/mpool) down in OPAL
All the components required for inter-process communications are currently deeply integrated in the OMPI layer. Several groups/institutions have express interest in having a more generic communication infrastructure, without all the OMPI layer dependencies. This communication layer should be made available at a different software level, available to all layers in the Open MPI software stack. As an example, our ORTE layer could replace the current OOB and instead use the BTL directly, gaining access to more reactive network interfaces than TCP. Similarly, external software libraries could take advantage of our highly optimized AM (active message) communication layer for their own purpose. UTK with support from Sandia, developped a version of Open MPI where the entire communication infrastucture has been moved down to OPAL (btl/rcache/allocator/mpool). Most of the moved components have been updated to match the new schema, with few exceptions (mainly BTLs where I have no way of compiling/testing them). Thus, the completion of this RFC is tied to being able to completing this move for all BTLs. For this we need help from the rest of the Open MPI community, especially those supporting some of the BTLs. A non-exhaustive list of BTLs that qualify here is: mx, portals4, scif, udapl, ugni, usnic.
This commit was SVN r32317.
2014-07-26 04:47:28 +04:00
|
|
|
opal_leave_pinned = 0;
|
|
|
|
opal_leave_pinned_pipeline = 0;
|
2013-10-23 19:59:14 +04:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
static int mca_btl_scif_modex_send (void)
|
|
|
|
{
|
2014-08-20 06:48:47 +04:00
|
|
|
mca_btl_scif_modex_t modex;
|
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
|
|
|
int rc;
|
|
|
|
|
2014-08-21 14:32:05 +04:00
|
|
|
memset(&modex, 0, sizeof(mca_btl_scif_modex_t));
|
2014-08-20 06:48:47 +04:00
|
|
|
modex.port_id = mca_btl_scif_module.port_id;
|
2013-10-23 19:59:14 +04:00
|
|
|
|
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
|
|
|
OPAL_MODEX_SEND(rc, PMIX_SYNC_REQD, PMIX_LOCAL,
|
|
|
|
&mca_btl_scif_component.super.btl_version,
|
|
|
|
&modex, sizeof (modex));
|
|
|
|
return rc;
|
2013-10-23 19:59:14 +04:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
static mca_btl_base_module_t **mca_btl_scif_component_init (int *num_btl_modules,
|
|
|
|
bool enable_progress_threads,
|
|
|
|
bool enable_mpi_threads)
|
|
|
|
{
|
|
|
|
struct mca_btl_base_module_t **base_modules;
|
|
|
|
int rc;
|
|
|
|
|
|
|
|
BTL_VERBOSE(("btl/scif initializing"));
|
|
|
|
|
|
|
|
signal (SIGSEGV, SIG_DFL);
|
|
|
|
|
|
|
|
/* we currently need the memory hooks to determine when
|
|
|
|
* registrations are no longer valid. */
|
|
|
|
mca_btl_scif_autoset_leave_pinned ();
|
|
|
|
|
|
|
|
if (32768 < mca_btl_scif_module.super.btl_eager_limit) {
|
|
|
|
mca_btl_scif_module.super.btl_eager_limit = 32768;
|
|
|
|
}
|
|
|
|
|
|
|
|
/* the segment should be large enough to hold at least one eager packet */
|
|
|
|
if (4 * mca_btl_scif_module.super.btl_eager_limit > mca_btl_scif_component.segment_size) {
|
|
|
|
mca_btl_scif_component.segment_size = 4 * mca_btl_scif_module.super.btl_eager_limit;
|
|
|
|
}
|
|
|
|
|
|
|
|
/* round up to a multiple of 4096 */
|
|
|
|
mca_btl_scif_component.segment_size = (mca_btl_scif_component.segment_size + 0xfff) & ~0xfff;
|
|
|
|
|
|
|
|
base_modules = (struct mca_btl_base_module_t **)
|
|
|
|
calloc (1, sizeof (struct mca_btl_base_module_t *));
|
|
|
|
if (OPAL_UNLIKELY(NULL == base_modules)) {
|
|
|
|
BTL_ERROR(("Malloc failed : %s:%d", __FILE__, __LINE__));
|
|
|
|
return NULL;
|
|
|
|
}
|
|
|
|
|
|
|
|
/* initialize the module */
|
|
|
|
rc = mca_btl_scif_module_init ();
|
George did the work and deserves all the credit for it. Ralph did the merge, and deserves whatever blame results from errors in it :-)
WHAT: Open our low-level communication infrastructure by moving all necessary components (btl/rcache/allocator/mpool) down in OPAL
All the components required for inter-process communications are currently deeply integrated in the OMPI layer. Several groups/institutions have express interest in having a more generic communication infrastructure, without all the OMPI layer dependencies. This communication layer should be made available at a different software level, available to all layers in the Open MPI software stack. As an example, our ORTE layer could replace the current OOB and instead use the BTL directly, gaining access to more reactive network interfaces than TCP. Similarly, external software libraries could take advantage of our highly optimized AM (active message) communication layer for their own purpose. UTK with support from Sandia, developped a version of Open MPI where the entire communication infrastucture has been moved down to OPAL (btl/rcache/allocator/mpool). Most of the moved components have been updated to match the new schema, with few exceptions (mainly BTLs where I have no way of compiling/testing them). Thus, the completion of this RFC is tied to being able to completing this move for all BTLs. For this we need help from the rest of the Open MPI community, especially those supporting some of the BTLs. A non-exhaustive list of BTLs that qualify here is: mx, portals4, scif, udapl, ugni, usnic.
This commit was SVN r32317.
2014-07-26 04:47:28 +04:00
|
|
|
if (OPAL_SUCCESS != rc) {
|
2013-10-23 19:59:14 +04:00
|
|
|
BTL_VERBOSE(("btl/scif error initializing module"));
|
|
|
|
free (base_modules);
|
|
|
|
return NULL;
|
|
|
|
}
|
|
|
|
|
|
|
|
base_modules[0] = &mca_btl_scif_module.super;
|
2014-05-14 20:14:00 +04:00
|
|
|
mca_btl_scif_module.exiting = false;
|
2014-10-31 10:34:02 +03:00
|
|
|
mca_btl_scif_module.listening = false;
|
2013-10-23 19:59:14 +04:00
|
|
|
|
|
|
|
rc = mca_btl_scif_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) {
|
2013-10-23 19:59:14 +04:00
|
|
|
BTL_VERBOSE(("btl/scif error sending modex"));
|
|
|
|
free (base_modules);
|
|
|
|
return NULL;
|
|
|
|
}
|
|
|
|
|
|
|
|
*num_btl_modules = 1;
|
|
|
|
|
|
|
|
BTL_VERBOSE(("btl/scif done initializing modules"));
|
|
|
|
|
|
|
|
return base_modules;
|
|
|
|
}
|
|
|
|
|
|
|
|
static int mca_btl_scif_progress_recvs (mca_btl_base_endpoint_t *ep)
|
|
|
|
{
|
|
|
|
const mca_btl_active_message_callback_t *reg;
|
|
|
|
unsigned int start = ep->recv_buffer.start;
|
|
|
|
unsigned int end = ep->recv_buffer.endp[0];
|
|
|
|
mca_btl_scif_base_frag_t frag;
|
|
|
|
mca_btl_scif_frag_hdr_t *hdr;
|
|
|
|
/* changing this value does not appear to have a signifigant impact
|
|
|
|
* on performance */
|
|
|
|
int frags_per_loop = 5;
|
|
|
|
|
|
|
|
if (end == start) {
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
end &= ~ (1 << 31);
|
|
|
|
start &= ~ (1 << 31);
|
|
|
|
|
|
|
|
/* force all prior reads to complete before continuing */
|
|
|
|
opal_atomic_rmb ();
|
|
|
|
|
|
|
|
do {
|
|
|
|
hdr = (mca_btl_scif_frag_hdr_t *) (ep->recv_buffer.buffer + start);
|
|
|
|
|
|
|
|
/* force all prior reads to complete before continuing */
|
|
|
|
MB();
|
|
|
|
|
|
|
|
BTL_VERBOSE(("got frag with header {.tag = %d, .size = %d} from offset %u",
|
|
|
|
hdr->tag, hdr->size, start));
|
|
|
|
#if defined(SCIF_USE_SEQ)
|
|
|
|
if (hdr->seq != ep->seq_expected) {
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
|
|
|
|
ep->seq_expected++;
|
|
|
|
#endif
|
|
|
|
|
|
|
|
/* message to skip the rest of the buffer */
|
|
|
|
if (0xff != hdr->tag) {
|
|
|
|
reg = mca_btl_base_active_message_trigger + hdr->tag;
|
|
|
|
|
|
|
|
/* fragment fits entirely in the remaining buffer space. some
|
|
|
|
* btl users do not handle fragmented data so we can't split
|
|
|
|
* the fragment without introducing another copy here. this
|
|
|
|
* limitation has not appeared to cause any performance
|
|
|
|
* problems. */
|
2014-11-20 09:22:43 +03:00
|
|
|
frag.base.des_local_count = 1;
|
|
|
|
frag.segments[0].base.seg_len = hdr->size;
|
|
|
|
frag.segments[0].base.seg_addr.pval = (void *) (hdr + 1);
|
2013-10-23 19:59:14 +04:00
|
|
|
|
2014-11-20 09:22:43 +03:00
|
|
|
frag.base.des_local = &frag.segments[0].base;
|
2013-10-23 19:59:14 +04:00
|
|
|
|
|
|
|
/* call the registered callback function */
|
|
|
|
reg->cbfunc(&mca_btl_scif_module.super, hdr->tag, &frag.base, reg->cbdata);
|
|
|
|
}
|
|
|
|
|
|
|
|
start = (start + hdr->size + sizeof (*hdr) + 63) & ~63;
|
|
|
|
|
|
|
|
/* skip unusable space at the end of the buffer */
|
|
|
|
if (mca_btl_scif_component.segment_size == start) {
|
|
|
|
start = 64;
|
|
|
|
ep->recv_buffer.start = ((ep->recv_buffer.start & (1 << 31)) ^ (1 << 31)) | 64;
|
|
|
|
} else {
|
|
|
|
ep->recv_buffer.start = (ep->recv_buffer.start & (1 << 31)) | start;
|
|
|
|
}
|
|
|
|
} while (start != end && --frags_per_loop);
|
|
|
|
|
|
|
|
/* let the sender know where we stopped */
|
|
|
|
ep->recv_buffer.startp[0] = ep->recv_buffer.start;
|
|
|
|
|
|
|
|
/* return the number of fragments processed */
|
|
|
|
return 5 - frags_per_loop;
|
|
|
|
}
|
|
|
|
|
|
|
|
static int mca_btl_scif_progress_sends (mca_btl_base_endpoint_t *ep)
|
|
|
|
{
|
|
|
|
/* try sending any wait listed fragments */
|
|
|
|
if (OPAL_UNLIKELY(0 != opal_list_get_size (&ep->frag_wait_list))) {
|
2014-07-09 23:33:58 +04:00
|
|
|
return mca_btl_scif_progress_send_wait_list (ep);
|
2013-10-23 19:59:14 +04:00
|
|
|
}
|
|
|
|
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
static int mca_btl_scif_component_progress (void)
|
|
|
|
{
|
|
|
|
unsigned int i;
|
|
|
|
int count = 0;
|
|
|
|
|
|
|
|
/* progress all connected endpoints */
|
|
|
|
for (i = 0, count = 0 ; i < mca_btl_scif_module.endpoint_count ; ++i) {
|
|
|
|
if (MCA_BTL_SCIF_EP_STATE_CONNECTED == mca_btl_scif_module.endpoints[i].state) {
|
|
|
|
/* poll all connected endpoints */
|
|
|
|
count += mca_btl_scif_progress_recvs (mca_btl_scif_module.endpoints + i);
|
|
|
|
/* if any fragments are waiting try to send them now */
|
|
|
|
count += mca_btl_scif_progress_sends (mca_btl_scif_module.endpoints + i);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
return count;
|
|
|
|
}
|