2014-04-14 19:29:26 +00:00
|
|
|
/* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil -*- */
|
2005-06-15 19:10:26 +00:00
|
|
|
/*
|
2007-03-16 23:11:45 +00:00
|
|
|
* Copyright (c) 2004-2007 The Trustees of Indiana University and Indiana
|
2005-11-05 19:57:48 +00:00
|
|
|
* University Research and Technology
|
|
|
|
* Corporation. All rights reserved.
|
2013-07-04 08:34:37 +00:00
|
|
|
* Copyright (c) 2004-2013 The University of Tennessee and The University
|
2005-11-05 19:57:48 +00:00
|
|
|
* of Tennessee Research Foundation. All rights
|
|
|
|
* reserved.
|
2015-06-23 20:59:57 -07:00
|
|
|
* Copyright (c) 2004-2005 High Performance Computing Center Stuttgart,
|
2005-06-15 19:10:26 +00:00
|
|
|
* University of Stuttgart. All rights reserved.
|
|
|
|
* Copyright (c) 2004-2005 The Regents of the University of California.
|
|
|
|
* All rights reserved.
|
2014-05-16 22:23:52 +00:00
|
|
|
* Copyright (c) 2012-2013 Inria. All rights reserved.
|
2016-10-27 10:34:54 -06:00
|
|
|
* Copyright (c) 2014-2016 Los Alamos National Security, LLC. All rights
|
2014-04-14 19:29:26 +00:00
|
|
|
* reserved.
|
2016-11-24 10:43:10 +09:00
|
|
|
* Copyright (c) 2016 Research Organization for Information Science
|
|
|
|
* and Technology (RIST). All rights reserved.
|
2005-06-15 19:10:26 +00:00
|
|
|
* $COPYRIGHT$
|
2015-06-23 20:59:57 -07:00
|
|
|
*
|
2005-06-15 19:10:26 +00:00
|
|
|
* Additional copyrights may follow
|
2015-06-23 20:59:57 -07:00
|
|
|
*
|
2005-06-15 19:10:26 +00:00
|
|
|
* $HEADER$
|
|
|
|
*/
|
|
|
|
|
George did the work and deserves all the credit for it. Ralph did the merge, and deserves whatever blame results from errors in it :-)
WHAT: Open our low-level communication infrastructure by moving all necessary components (btl/rcache/allocator/mpool) down in OPAL
All the components required for inter-process communications are currently deeply integrated in the OMPI layer. Several groups/institutions have express interest in having a more generic communication infrastructure, without all the OMPI layer dependencies. This communication layer should be made available at a different software level, available to all layers in the Open MPI software stack. As an example, our ORTE layer could replace the current OOB and instead use the BTL directly, gaining access to more reactive network interfaces than TCP. Similarly, external software libraries could take advantage of our highly optimized AM (active message) communication layer for their own purpose. UTK with support from Sandia, developped a version of Open MPI where the entire communication infrastucture has been moved down to OPAL (btl/rcache/allocator/mpool). Most of the moved components have been updated to match the new schema, with few exceptions (mainly BTLs where I have no way of compiling/testing them). Thus, the completion of this RFC is tied to being able to completing this move for all BTLs. For this we need help from the rest of the Open MPI community, especially those supporting some of the BTLs. A non-exhaustive list of BTLs that qualify here is: mx, portals4, scif, udapl, ugni, usnic.
This commit was SVN r32317.
2014-07-26 00:47:28 +00:00
|
|
|
#include "opal_config.h"
|
2005-06-15 19:10:26 +00:00
|
|
|
|
|
|
|
#include <string.h>
|
|
|
|
#include <stdlib.h>
|
|
|
|
|
2009-03-03 22:25:13 +00:00
|
|
|
#include "opal/class/opal_bitmap.h"
|
- Split the datatype engine into two parts: an MPI specific part in
OMPI
and a language agnostic part in OPAL. The convertor is completely
moved into OPAL. This offers several benefits as described in RFC
http://www.open-mpi.org/community/lists/devel/2009/07/6387.php
namely:
- Fewer basic types (int* and float* types, boolean and wchar
- Fixing naming scheme to ompi-nomenclature.
- Usability outside of the ompi-layer.
- Due to the fixed nature of simple opal types, their information is
completely
known at compile time and therefore constified
- With fewer datatypes (22), the actual sizes of bit-field types may be
reduced
from 64 to 32 bits, allowing reorganizing the opal_datatype
structure, eliminating holes and keeping data required in convertor
(upon send/recv) in one cacheline...
This has implications to the convertor-datastructure and other parts
of the code.
- Several performance tests have been run, the netpipe latency does not
change with
this patch on Linux/x86-64 on the smoky cluster.
- Extensive tests have been done to verify correctness (no new
regressions) using:
1. mpi_test_suite on linux/x86-64 using clean ompi-trunk and
ompi-ddt:
a. running both trunk and ompi-ddt resulted in no differences
(except for MPI_SHORT_INT and MPI_TYPE_MIX_LB_UB do now run
correctly).
b. with --enable-memchecker and running under valgrind (one buglet
when run with static found in test-suite, commited)
2. ibm testsuite on linux/x86-64 using clean ompi-trunk and ompi-ddt:
all passed (except for the dynamic/ tests failed!! as trunk/MTT)
3. compilation and usage of HDF5 tests on Jaguar using PGI and
PathScale compilers.
4. compilation and usage on Scicortex.
- Please note, that for the heterogeneous case, (-m32 compiled
binaries/ompi), neither
ompi-trunk, nor ompi-ddt branch would successfully launch.
This commit was SVN r21641.
2009-07-13 04:56:31 +00:00
|
|
|
#include "opal/datatype/opal_convertor.h"
|
2005-06-30 05:50:55 +00:00
|
|
|
#include "btl_self.h"
|
|
|
|
#include "btl_self_frag.h"
|
George did the work and deserves all the credit for it. Ralph did the merge, and deserves whatever blame results from errors in it :-)
WHAT: Open our low-level communication infrastructure by moving all necessary components (btl/rcache/allocator/mpool) down in OPAL
All the components required for inter-process communications are currently deeply integrated in the OMPI layer. Several groups/institutions have express interest in having a more generic communication infrastructure, without all the OMPI layer dependencies. This communication layer should be made available at a different software level, available to all layers in the Open MPI software stack. As an example, our ORTE layer could replace the current OOB and instead use the BTL directly, gaining access to more reactive network interfaces than TCP. Similarly, external software libraries could take advantage of our highly optimized AM (active message) communication layer for their own purpose. UTK with support from Sandia, developped a version of Open MPI where the entire communication infrastucture has been moved down to OPAL (btl/rcache/allocator/mpool). Most of the moved components have been updated to match the new schema, with few exceptions (mainly BTLs where I have no way of compiling/testing them). Thus, the completion of this RFC is tied to being able to completing this move for all BTLs. For this we need help from the rest of the Open MPI community, especially those supporting some of the BTLs. A non-exhaustive list of BTLs that qualify here is: mx, portals4, scif, udapl, ugni, usnic.
This commit was SVN r32317.
2014-07-26 00:47:28 +00:00
|
|
|
#include "opal/util/proc.h"
|
2005-06-30 05:50:55 +00:00
|
|
|
|
2016-10-27 10:34:54 -06:00
|
|
|
/**
|
|
|
|
* PML->BTL notification of change in the process list.
|
|
|
|
* PML->BTL Notification that a receive fragment has been matched.
|
|
|
|
* Called for message that is send from process with the virtual
|
|
|
|
* address of the shared memory segment being different than that of
|
|
|
|
* the receiver.
|
|
|
|
*
|
|
|
|
* @param btl (IN)
|
|
|
|
* @param proc (IN)
|
|
|
|
* @param peer (OUT)
|
|
|
|
* @return OPAL_SUCCESS or error status on failure.
|
|
|
|
*
|
|
|
|
*/
|
|
|
|
static int mca_btl_self_add_procs (struct mca_btl_base_module_t *btl, size_t nprocs,
|
|
|
|
struct opal_proc_t **procs,
|
|
|
|
struct mca_btl_base_endpoint_t **peers,
|
|
|
|
opal_bitmap_t* reachability)
|
2005-06-15 19:10:26 +00:00
|
|
|
{
|
2016-10-27 10:34:54 -06:00
|
|
|
for (int i = 0; i < (int)nprocs; i++ ) {
|
George did the work and deserves all the credit for it. Ralph did the merge, and deserves whatever blame results from errors in it :-)
WHAT: Open our low-level communication infrastructure by moving all necessary components (btl/rcache/allocator/mpool) down in OPAL
All the components required for inter-process communications are currently deeply integrated in the OMPI layer. Several groups/institutions have express interest in having a more generic communication infrastructure, without all the OMPI layer dependencies. This communication layer should be made available at a different software level, available to all layers in the Open MPI software stack. As an example, our ORTE layer could replace the current OOB and instead use the BTL directly, gaining access to more reactive network interfaces than TCP. Similarly, external software libraries could take advantage of our highly optimized AM (active message) communication layer for their own purpose. UTK with support from Sandia, developped a version of Open MPI where the entire communication infrastucture has been moved down to OPAL (btl/rcache/allocator/mpool). Most of the moved components have been updated to match the new schema, with few exceptions (mainly BTLs where I have no way of compiling/testing them). Thus, the completion of this RFC is tied to being able to completing this move for all BTLs. For this we need help from the rest of the Open MPI community, especially those supporting some of the BTLs. A non-exhaustive list of BTLs that qualify here is: mx, portals4, scif, udapl, ugni, usnic.
This commit was SVN r32317.
2014-07-26 00:47:28 +00:00
|
|
|
if( 0 == opal_compare_proc(procs[i]->proc_name, OPAL_PROC_MY_NAME) ) {
|
2009-03-03 22:25:13 +00:00
|
|
|
opal_bitmap_set_bit( reachability, i );
|
2016-10-27 10:34:54 -06:00
|
|
|
/* need to return something to keep the bml from ignoring us */
|
|
|
|
peers[i] = (struct mca_btl_base_endpoint_t *) 1;
|
2006-10-26 23:11:26 +00:00
|
|
|
break; /* there will always be only one ... */
|
2005-06-20 16:38:19 +00:00
|
|
|
}
|
2005-06-15 19:10:26 +00:00
|
|
|
}
|
2016-10-27 10:34:54 -06:00
|
|
|
|
George did the work and deserves all the credit for it. Ralph did the merge, and deserves whatever blame results from errors in it :-)
WHAT: Open our low-level communication infrastructure by moving all necessary components (btl/rcache/allocator/mpool) down in OPAL
All the components required for inter-process communications are currently deeply integrated in the OMPI layer. Several groups/institutions have express interest in having a more generic communication infrastructure, without all the OMPI layer dependencies. This communication layer should be made available at a different software level, available to all layers in the Open MPI software stack. As an example, our ORTE layer could replace the current OOB and instead use the BTL directly, gaining access to more reactive network interfaces than TCP. Similarly, external software libraries could take advantage of our highly optimized AM (active message) communication layer for their own purpose. UTK with support from Sandia, developped a version of Open MPI where the entire communication infrastucture has been moved down to OPAL (btl/rcache/allocator/mpool). Most of the moved components have been updated to match the new schema, with few exceptions (mainly BTLs where I have no way of compiling/testing them). Thus, the completion of this RFC is tied to being able to completing this move for all BTLs. For this we need help from the rest of the Open MPI community, especially those supporting some of the BTLs. A non-exhaustive list of BTLs that qualify here is: mx, portals4, scif, udapl, ugni, usnic.
This commit was SVN r32317.
2014-07-26 00:47:28 +00:00
|
|
|
return OPAL_SUCCESS;
|
2005-06-15 19:10:26 +00:00
|
|
|
}
|
|
|
|
|
2016-10-27 10:34:54 -06:00
|
|
|
/**
|
|
|
|
* PML->BTL notification of change in the process list.
|
|
|
|
*
|
|
|
|
* @param btl (IN) BTL instance
|
|
|
|
* @param proc (IN) Peer process
|
|
|
|
* @param peer (IN) Peer addressing information.
|
|
|
|
* @return Status indicating if cleanup was successful
|
|
|
|
*
|
|
|
|
*/
|
|
|
|
static int mca_btl_self_del_procs (struct mca_btl_base_module_t *btl, size_t nprocs,
|
|
|
|
struct opal_proc_t **procs,
|
|
|
|
struct mca_btl_base_endpoint_t **peers)
|
2005-06-15 19:10:26 +00:00
|
|
|
{
|
George did the work and deserves all the credit for it. Ralph did the merge, and deserves whatever blame results from errors in it :-)
WHAT: Open our low-level communication infrastructure by moving all necessary components (btl/rcache/allocator/mpool) down in OPAL
All the components required for inter-process communications are currently deeply integrated in the OMPI layer. Several groups/institutions have express interest in having a more generic communication infrastructure, without all the OMPI layer dependencies. This communication layer should be made available at a different software level, available to all layers in the Open MPI software stack. As an example, our ORTE layer could replace the current OOB and instead use the BTL directly, gaining access to more reactive network interfaces than TCP. Similarly, external software libraries could take advantage of our highly optimized AM (active message) communication layer for their own purpose. UTK with support from Sandia, developped a version of Open MPI where the entire communication infrastucture has been moved down to OPAL (btl/rcache/allocator/mpool). Most of the moved components have been updated to match the new schema, with few exceptions (mainly BTLs where I have no way of compiling/testing them). Thus, the completion of this RFC is tied to being able to completing this move for all BTLs. For this we need help from the rest of the Open MPI community, especially those supporting some of the BTLs. A non-exhaustive list of BTLs that qualify here is: mx, portals4, scif, udapl, ugni, usnic.
This commit was SVN r32317.
2014-07-26 00:47:28 +00:00
|
|
|
return OPAL_SUCCESS;
|
2005-06-15 19:10:26 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
2005-06-30 05:50:55 +00:00
|
|
|
* MCA->BTL Clean up any resources held by BTL module
|
2005-06-15 19:10:26 +00:00
|
|
|
* before the module is unloaded.
|
|
|
|
*
|
2005-06-30 05:50:55 +00:00
|
|
|
* @param btl (IN) BTL module.
|
2005-06-15 19:10:26 +00:00
|
|
|
*
|
2005-06-30 05:50:55 +00:00
|
|
|
* Prior to unloading a BTL module, the MCA framework will call
|
|
|
|
* the BTL finalize method of the module. Any resources held by
|
|
|
|
* the BTL should be released and if required the memory corresponding
|
|
|
|
* to the BTL module freed.
|
2005-06-15 19:10:26 +00:00
|
|
|
*
|
|
|
|
*/
|
|
|
|
|
2016-10-27 10:34:54 -06:00
|
|
|
static int mca_btl_self_finalize(struct mca_btl_base_module_t* btl)
|
2005-06-15 19:10:26 +00:00
|
|
|
{
|
George did the work and deserves all the credit for it. Ralph did the merge, and deserves whatever blame results from errors in it :-)
WHAT: Open our low-level communication infrastructure by moving all necessary components (btl/rcache/allocator/mpool) down in OPAL
All the components required for inter-process communications are currently deeply integrated in the OMPI layer. Several groups/institutions have express interest in having a more generic communication infrastructure, without all the OMPI layer dependencies. This communication layer should be made available at a different software level, available to all layers in the Open MPI software stack. As an example, our ORTE layer could replace the current OOB and instead use the BTL directly, gaining access to more reactive network interfaces than TCP. Similarly, external software libraries could take advantage of our highly optimized AM (active message) communication layer for their own purpose. UTK with support from Sandia, developped a version of Open MPI where the entire communication infrastucture has been moved down to OPAL (btl/rcache/allocator/mpool). Most of the moved components have been updated to match the new schema, with few exceptions (mainly BTLs where I have no way of compiling/testing them). Thus, the completion of this RFC is tied to being able to completing this move for all BTLs. For this we need help from the rest of the Open MPI community, especially those supporting some of the BTLs. A non-exhaustive list of BTLs that qualify here is: mx, portals4, scif, udapl, ugni, usnic.
This commit was SVN r32317.
2014-07-26 00:47:28 +00:00
|
|
|
return OPAL_SUCCESS;
|
2005-06-15 19:10:26 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Allocate a segment.
|
|
|
|
*
|
2005-06-30 05:50:55 +00:00
|
|
|
* @param btl (IN) BTL module
|
2005-06-15 19:10:26 +00:00
|
|
|
* @param size (IN) Request segment size.
|
|
|
|
*/
|
2016-10-27 10:34:54 -06:00
|
|
|
static mca_btl_base_descriptor_t *mca_btl_self_alloc (struct mca_btl_base_module_t *btl,
|
|
|
|
struct mca_btl_base_endpoint_t *endpoint,
|
|
|
|
uint8_t order, size_t size, uint32_t flags)
|
2005-06-15 19:10:26 +00:00
|
|
|
{
|
2016-10-27 10:34:54 -06:00
|
|
|
mca_btl_self_frag_t *frag = NULL;
|
2013-07-01 11:40:42 +00:00
|
|
|
|
2016-10-27 10:34:54 -06:00
|
|
|
if (size <= MCA_BTL_SELF_MAX_INLINE_SIZE) {
|
|
|
|
MCA_BTL_SELF_FRAG_ALLOC_RDMA(frag);
|
|
|
|
} else if (size <= mca_btl_self.btl_eager_limit) {
|
2013-07-04 08:34:37 +00:00
|
|
|
MCA_BTL_SELF_FRAG_ALLOC_EAGER(frag);
|
2006-02-22 17:37:59 +00:00
|
|
|
} else if (size <= btl->btl_max_send_size) {
|
2013-07-04 08:34:37 +00:00
|
|
|
MCA_BTL_SELF_FRAG_ALLOC_SEND(frag);
|
2008-12-17 22:15:27 +00:00
|
|
|
}
|
2016-10-27 10:34:54 -06:00
|
|
|
|
2008-12-17 22:15:27 +00:00
|
|
|
if( OPAL_UNLIKELY(NULL == frag) ) {
|
2015-06-23 20:59:57 -07:00
|
|
|
return NULL;
|
2005-06-15 19:10:26 +00:00
|
|
|
}
|
2015-06-23 20:59:57 -07:00
|
|
|
|
2016-10-27 10:34:54 -06:00
|
|
|
frag->segments[0].seg_len = size;
|
2015-01-05 15:07:24 -07:00
|
|
|
frag->base.des_segment_count = 1;
|
2016-10-27 10:34:54 -06:00
|
|
|
frag->base.des_flags = flags;
|
|
|
|
|
|
|
|
return &frag->base;
|
2005-06-15 19:10:26 +00:00
|
|
|
}
|
2015-06-23 20:59:57 -07:00
|
|
|
|
2005-06-15 19:10:26 +00:00
|
|
|
/**
|
2005-06-30 05:50:55 +00:00
|
|
|
* Return a segment allocated by this BTL.
|
2005-06-15 19:10:26 +00:00
|
|
|
*
|
2005-06-30 05:50:55 +00:00
|
|
|
* @param btl (IN) BTL module
|
2005-06-15 19:10:26 +00:00
|
|
|
* @param segment (IN) Allocated segment.
|
|
|
|
*/
|
2016-10-27 10:34:54 -06:00
|
|
|
static int mca_btl_self_free (struct mca_btl_base_module_t *btl, mca_btl_base_descriptor_t *des)
|
2005-06-15 19:10:26 +00:00
|
|
|
{
|
2016-10-27 10:34:54 -06:00
|
|
|
MCA_BTL_SELF_FRAG_RETURN((mca_btl_self_frag_t *) des);
|
2006-10-26 23:11:26 +00:00
|
|
|
|
George did the work and deserves all the credit for it. Ralph did the merge, and deserves whatever blame results from errors in it :-)
WHAT: Open our low-level communication infrastructure by moving all necessary components (btl/rcache/allocator/mpool) down in OPAL
All the components required for inter-process communications are currently deeply integrated in the OMPI layer. Several groups/institutions have express interest in having a more generic communication infrastructure, without all the OMPI layer dependencies. This communication layer should be made available at a different software level, available to all layers in the Open MPI software stack. As an example, our ORTE layer could replace the current OOB and instead use the BTL directly, gaining access to more reactive network interfaces than TCP. Similarly, external software libraries could take advantage of our highly optimized AM (active message) communication layer for their own purpose. UTK with support from Sandia, developped a version of Open MPI where the entire communication infrastucture has been moved down to OPAL (btl/rcache/allocator/mpool). Most of the moved components have been updated to match the new schema, with few exceptions (mainly BTLs where I have no way of compiling/testing them). Thus, the completion of this RFC is tied to being able to completing this move for all BTLs. For this we need help from the rest of the Open MPI community, especially those supporting some of the BTLs. A non-exhaustive list of BTLs that qualify here is: mx, portals4, scif, udapl, ugni, usnic.
This commit was SVN r32317.
2014-07-26 00:47:28 +00:00
|
|
|
return OPAL_SUCCESS;
|
2005-06-15 19:10:26 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
2016-10-27 10:34:54 -06:00
|
|
|
* Prepare data for send
|
2005-06-15 19:10:26 +00:00
|
|
|
*
|
2005-06-30 05:50:55 +00:00
|
|
|
* @param btl (IN) BTL module
|
2005-06-15 19:10:26 +00:00
|
|
|
*/
|
2016-10-27 10:34:54 -06:00
|
|
|
static struct mca_btl_base_descriptor_t *mca_btl_self_prepare_src (struct mca_btl_base_module_t* btl,
|
|
|
|
struct mca_btl_base_endpoint_t *endpoint,
|
|
|
|
struct opal_convertor_t *convertor,
|
|
|
|
uint8_t order, size_t reserve,
|
|
|
|
size_t *size, uint32_t flags)
|
2005-06-15 19:10:26 +00:00
|
|
|
{
|
2016-10-27 10:34:54 -06:00
|
|
|
bool inline_send = !opal_convertor_need_buffers(convertor);
|
|
|
|
size_t buffer_len = reserve + (inline_send ? 0 : *size);
|
|
|
|
mca_btl_self_frag_t *frag;
|
2006-10-26 23:11:26 +00:00
|
|
|
|
2016-10-27 10:34:54 -06:00
|
|
|
frag = (mca_btl_self_frag_t *) mca_btl_self_alloc (btl, endpoint, order, buffer_len, flags);
|
|
|
|
if (OPAL_UNLIKELY(NULL == frag)) {
|
|
|
|
return NULL;
|
|
|
|
}
|
2005-06-15 19:10:26 +00:00
|
|
|
|
2016-10-27 10:34:54 -06:00
|
|
|
/* non-contigous data */
|
|
|
|
if (OPAL_UNLIKELY(!inline_send)) {
|
|
|
|
struct iovec iov = {.iov_len = *size, .iov_base = (IOVBASE_TYPE *) ((uintptr_t) frag->data + reserve)};
|
|
|
|
size_t max_data = *size;
|
|
|
|
uint32_t iov_count = 1;
|
|
|
|
int rc;
|
2005-06-15 19:10:26 +00:00
|
|
|
|
2016-10-27 10:34:54 -06:00
|
|
|
rc = opal_convertor_pack (convertor, &iov, &iov_count, &max_data);
|
2005-06-15 19:10:26 +00:00
|
|
|
if(rc < 0) {
|
2016-10-27 10:34:54 -06:00
|
|
|
mca_btl_self_free (btl, &frag->base);
|
2005-06-15 19:10:26 +00:00
|
|
|
return NULL;
|
|
|
|
}
|
2016-10-27 10:34:54 -06:00
|
|
|
|
2005-06-15 19:10:26 +00:00
|
|
|
*size = max_data;
|
2016-11-24 10:43:10 +09:00
|
|
|
frag->segments[0].seg_len = reserve + max_data;
|
2005-06-15 19:10:26 +00:00
|
|
|
} else {
|
2016-10-27 10:34:54 -06:00
|
|
|
void *data_ptr;
|
2005-06-15 19:10:26 +00:00
|
|
|
|
2016-10-27 10:34:54 -06:00
|
|
|
opal_convertor_get_current_pointer (convertor, &data_ptr);
|
|
|
|
|
|
|
|
frag->segments[1].seg_addr.pval = data_ptr;
|
|
|
|
frag->segments[1].seg_len = *size;
|
|
|
|
frag->base.des_segment_count = 2;
|
2005-06-15 19:10:26 +00:00
|
|
|
}
|
2012-06-21 17:09:12 +00:00
|
|
|
|
2005-06-15 19:10:26 +00:00
|
|
|
return &frag->base;
|
|
|
|
}
|
2015-06-23 20:59:57 -07:00
|
|
|
|
2005-06-15 19:10:26 +00:00
|
|
|
/**
|
|
|
|
* Initiate a send to the peer.
|
|
|
|
*
|
2005-06-30 05:50:55 +00:00
|
|
|
* @param btl (IN) BTL module
|
|
|
|
* @param peer (IN) BTL peer addressing
|
2005-06-15 19:10:26 +00:00
|
|
|
*/
|
|
|
|
|
2016-10-27 10:34:54 -06:00
|
|
|
static int mca_btl_self_send (struct mca_btl_base_module_t *btl,
|
|
|
|
struct mca_btl_base_endpoint_t *endpoint,
|
|
|
|
struct mca_btl_base_descriptor_t *des,
|
|
|
|
mca_btl_base_tag_t tag)
|
2005-06-15 19:10:26 +00:00
|
|
|
{
|
2008-01-15 05:32:53 +00:00
|
|
|
mca_btl_active_message_callback_t* reg;
|
2008-02-18 17:39:30 +00:00
|
|
|
int btl_ownership = (des->des_flags & MCA_BTL_DES_FLAGS_BTL_OWNERSHIP);
|
2008-01-15 05:32:53 +00:00
|
|
|
|
2005-06-20 16:38:19 +00:00
|
|
|
/* upcall */
|
2008-01-15 05:32:53 +00:00
|
|
|
reg = mca_btl_base_active_message_trigger + tag;
|
|
|
|
reg->cbfunc( btl, tag, des, reg->cbdata );
|
2014-07-10 16:31:15 +00:00
|
|
|
|
2005-06-20 16:38:19 +00:00
|
|
|
/* send completion */
|
2008-05-30 03:58:39 +00:00
|
|
|
if( des->des_flags & MCA_BTL_DES_SEND_ALWAYS_CALLBACK ) {
|
George did the work and deserves all the credit for it. Ralph did the merge, and deserves whatever blame results from errors in it :-)
WHAT: Open our low-level communication infrastructure by moving all necessary components (btl/rcache/allocator/mpool) down in OPAL
All the components required for inter-process communications are currently deeply integrated in the OMPI layer. Several groups/institutions have express interest in having a more generic communication infrastructure, without all the OMPI layer dependencies. This communication layer should be made available at a different software level, available to all layers in the Open MPI software stack. As an example, our ORTE layer could replace the current OOB and instead use the BTL directly, gaining access to more reactive network interfaces than TCP. Similarly, external software libraries could take advantage of our highly optimized AM (active message) communication layer for their own purpose. UTK with support from Sandia, developped a version of Open MPI where the entire communication infrastucture has been moved down to OPAL (btl/rcache/allocator/mpool). Most of the moved components have been updated to match the new schema, with few exceptions (mainly BTLs where I have no way of compiling/testing them). Thus, the completion of this RFC is tied to being able to completing this move for all BTLs. For this we need help from the rest of the Open MPI community, especially those supporting some of the BTLs. A non-exhaustive list of BTLs that qualify here is: mx, portals4, scif, udapl, ugni, usnic.
This commit was SVN r32317.
2014-07-26 00:47:28 +00:00
|
|
|
des->des_cbfunc( btl, endpoint, des, OPAL_SUCCESS );
|
2008-05-30 03:58:39 +00:00
|
|
|
}
|
2008-02-18 17:39:30 +00:00
|
|
|
if( btl_ownership ) {
|
|
|
|
mca_btl_self_free( btl, des );
|
|
|
|
}
|
2008-05-30 03:58:39 +00:00
|
|
|
return 1;
|
2005-06-20 16:38:19 +00:00
|
|
|
}
|
|
|
|
|
2016-10-27 10:34:54 -06:00
|
|
|
static int mca_btl_self_sendi (struct mca_btl_base_module_t *btl, struct mca_btl_base_endpoint_t *endpoint,
|
|
|
|
struct opal_convertor_t *convertor, void *header, size_t header_size,
|
|
|
|
size_t payload_size, uint8_t order, uint32_t flags, mca_btl_base_tag_t tag,
|
|
|
|
mca_btl_base_descriptor_t **descriptor)
|
|
|
|
{
|
|
|
|
mca_btl_base_descriptor_t *frag;
|
|
|
|
|
|
|
|
if (!payload_size || !opal_convertor_need_buffers(convertor)) {
|
|
|
|
void *data_ptr = NULL;
|
|
|
|
if (payload_size) {
|
|
|
|
opal_convertor_get_current_pointer (convertor, &data_ptr);
|
|
|
|
}
|
|
|
|
|
|
|
|
mca_btl_base_segment_t segments[2] = {{.seg_addr.pval = header, .seg_len = header_size},
|
|
|
|
{.seg_addr.pval = data_ptr, .seg_len = payload_size}};
|
|
|
|
mca_btl_base_descriptor_t des = {.des_segments = segments, .des_segment_count = payload_size ? 2 : 1,
|
|
|
|
.des_flags = 0};
|
|
|
|
|
|
|
|
(void) mca_btl_self_send (btl, endpoint, &des, tag);
|
|
|
|
return OPAL_SUCCESS;
|
|
|
|
}
|
|
|
|
|
|
|
|
frag = mca_btl_self_prepare_src (btl, endpoint, convertor, order, header_size, &payload_size,
|
|
|
|
flags | MCA_BTL_DES_FLAGS_BTL_OWNERSHIP);
|
|
|
|
if (NULL == frag) {
|
|
|
|
*descriptor = NULL;
|
|
|
|
return OPAL_ERR_OUT_OF_RESOURCE;
|
|
|
|
}
|
|
|
|
|
|
|
|
memcpy (frag->des_segments[0].seg_addr.pval, header, header_size);
|
|
|
|
(void) mca_btl_self_send (btl, endpoint, frag, tag);
|
|
|
|
return OPAL_SUCCESS;
|
|
|
|
}
|
2014-07-10 16:31:15 +00:00
|
|
|
|
2015-01-05 15:07:24 -07:00
|
|
|
static int mca_btl_self_put (mca_btl_base_module_t *btl, struct mca_btl_base_endpoint_t *endpoint, void *local_address,
|
|
|
|
uint64_t remote_address, mca_btl_base_registration_handle_t *local_handle,
|
|
|
|
mca_btl_base_registration_handle_t *remote_handle, size_t size, int flags,
|
|
|
|
int order, mca_btl_base_rdma_completion_fn_t cbfunc, void *cbcontext, void *cbdata)
|
2005-06-20 16:38:19 +00:00
|
|
|
{
|
2015-01-05 15:07:24 -07:00
|
|
|
memcpy ((void *)(intptr_t) remote_address, local_address, size);
|
2005-06-20 16:38:19 +00:00
|
|
|
|
2015-01-05 15:07:24 -07:00
|
|
|
cbfunc (btl, endpoint, local_address, NULL, cbcontext, cbdata, OPAL_SUCCESS);
|
2005-06-20 16:38:19 +00:00
|
|
|
|
George did the work and deserves all the credit for it. Ralph did the merge, and deserves whatever blame results from errors in it :-)
WHAT: Open our low-level communication infrastructure by moving all necessary components (btl/rcache/allocator/mpool) down in OPAL
All the components required for inter-process communications are currently deeply integrated in the OMPI layer. Several groups/institutions have express interest in having a more generic communication infrastructure, without all the OMPI layer dependencies. This communication layer should be made available at a different software level, available to all layers in the Open MPI software stack. As an example, our ORTE layer could replace the current OOB and instead use the BTL directly, gaining access to more reactive network interfaces than TCP. Similarly, external software libraries could take advantage of our highly optimized AM (active message) communication layer for their own purpose. UTK with support from Sandia, developped a version of Open MPI where the entire communication infrastucture has been moved down to OPAL (btl/rcache/allocator/mpool). Most of the moved components have been updated to match the new schema, with few exceptions (mainly BTLs where I have no way of compiling/testing them). Thus, the completion of this RFC is tied to being able to completing this move for all BTLs. For this we need help from the rest of the Open MPI community, especially those supporting some of the BTLs. A non-exhaustive list of BTLs that qualify here is: mx, portals4, scif, udapl, ugni, usnic.
This commit was SVN r32317.
2014-07-26 00:47:28 +00:00
|
|
|
return OPAL_SUCCESS;
|
2005-06-15 19:10:26 +00:00
|
|
|
}
|
2007-03-16 23:11:45 +00:00
|
|
|
|
2015-01-05 15:07:24 -07:00
|
|
|
static int mca_btl_self_get (mca_btl_base_module_t *btl, struct mca_btl_base_endpoint_t *endpoint, void *local_address,
|
|
|
|
uint64_t remote_address, mca_btl_base_registration_handle_t *local_handle,
|
|
|
|
mca_btl_base_registration_handle_t *remote_handle, size_t size, int flags,
|
|
|
|
int order, mca_btl_base_rdma_completion_fn_t cbfunc, void *cbcontext, void *cbdata)
|
2014-07-10 16:31:15 +00:00
|
|
|
{
|
2015-01-05 15:07:24 -07:00
|
|
|
memcpy (local_address, (void *)(intptr_t) remote_address, size);
|
2014-10-07 09:25:56 -06:00
|
|
|
|
2015-01-05 15:07:24 -07:00
|
|
|
cbfunc (btl, endpoint, local_address, NULL, cbcontext, cbdata, OPAL_SUCCESS);
|
|
|
|
|
|
|
|
return OPAL_SUCCESS;
|
2014-07-10 16:31:15 +00:00
|
|
|
}
|
|
|
|
|
2016-10-27 10:34:54 -06:00
|
|
|
static int mca_btl_self_ft_event(int state) {
|
George did the work and deserves all the credit for it. Ralph did the merge, and deserves whatever blame results from errors in it :-)
WHAT: Open our low-level communication infrastructure by moving all necessary components (btl/rcache/allocator/mpool) down in OPAL
All the components required for inter-process communications are currently deeply integrated in the OMPI layer. Several groups/institutions have express interest in having a more generic communication infrastructure, without all the OMPI layer dependencies. This communication layer should be made available at a different software level, available to all layers in the Open MPI software stack. As an example, our ORTE layer could replace the current OOB and instead use the BTL directly, gaining access to more reactive network interfaces than TCP. Similarly, external software libraries could take advantage of our highly optimized AM (active message) communication layer for their own purpose. UTK with support from Sandia, developped a version of Open MPI where the entire communication infrastucture has been moved down to OPAL (btl/rcache/allocator/mpool). Most of the moved components have been updated to match the new schema, with few exceptions (mainly BTLs where I have no way of compiling/testing them). Thus, the completion of this RFC is tied to being able to completing this move for all BTLs. For this we need help from the rest of the Open MPI community, especially those supporting some of the BTLs. A non-exhaustive list of BTLs that qualify here is: mx, portals4, scif, udapl, ugni, usnic.
This commit was SVN r32317.
2014-07-26 00:47:28 +00:00
|
|
|
return OPAL_SUCCESS;
|
2007-03-16 23:11:45 +00:00
|
|
|
}
|
2016-10-27 10:34:54 -06:00
|
|
|
|
|
|
|
/* btl self module */
|
|
|
|
mca_btl_base_module_t mca_btl_self = {
|
|
|
|
.btl_component = &mca_btl_self_component.super,
|
|
|
|
.btl_add_procs = mca_btl_self_add_procs,
|
|
|
|
.btl_del_procs = mca_btl_self_del_procs,
|
|
|
|
.btl_finalize = mca_btl_self_finalize,
|
|
|
|
.btl_alloc = mca_btl_self_alloc,
|
|
|
|
.btl_free = mca_btl_self_free,
|
|
|
|
.btl_prepare_src = mca_btl_self_prepare_src,
|
|
|
|
.btl_send = mca_btl_self_send,
|
|
|
|
.btl_sendi = mca_btl_self_sendi,
|
|
|
|
.btl_put = mca_btl_self_put,
|
|
|
|
.btl_get = mca_btl_self_get,
|
|
|
|
.btl_dump = mca_btl_base_dump,
|
|
|
|
.btl_ft_event = mca_btl_self_ft_event,
|
|
|
|
};
|