2011-12-10 01:24:07 +04:00
|
|
|
/* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil -*- */
|
|
|
|
/*
|
2018-02-15 22:57:21 +03:00
|
|
|
* Copyright (c) 2011-2018 Los Alamos National Security, LLC. All rights
|
2011-12-10 01:24:07 +04:00
|
|
|
* reserved.
|
|
|
|
* Copyright (c) 2011 UT-Battelle, LLC. All rights reserved.
|
|
|
|
* $COPYRIGHT$
|
|
|
|
*
|
|
|
|
* Additional copyrights may follow
|
|
|
|
*
|
|
|
|
* $HEADER$
|
|
|
|
*/
|
|
|
|
|
2015-06-24 06:59:57 +03:00
|
|
|
#ifndef MCA_BTL_UGNI_ENDPOINT_H
|
2011-12-10 01:24:07 +04:00
|
|
|
#define MCA_BTL_UGNI_ENDPOINT_H
|
|
|
|
|
|
|
|
#include "btl_ugni.h"
|
|
|
|
|
2012-04-20 01:51:55 +04:00
|
|
|
enum mca_btl_ugni_endpoint_state_t {
|
|
|
|
MCA_BTL_UGNI_EP_STATE_INIT = 0,
|
|
|
|
MCA_BTL_UGNI_EP_STATE_CONNECTING,
|
2017-03-13 07:37:35 +03:00
|
|
|
MCA_BTL_UGNI_EP_STATE_CONNECTED,
|
2012-04-20 01:51:55 +04:00
|
|
|
};
|
|
|
|
typedef enum mca_btl_ugni_endpoint_state_t mca_btl_ugni_endpoint_state_t;
|
|
|
|
|
2012-06-01 00:02:41 +04:00
|
|
|
struct mca_btl_ugni_smsg_mbox_t;
|
2012-02-10 05:11:54 +04:00
|
|
|
|
2017-03-13 07:37:35 +03:00
|
|
|
struct mca_btl_ugni_endpoint_handle_t {
|
|
|
|
mca_btl_ugni_device_t *device;
|
|
|
|
gni_ep_handle_t gni_handle;
|
|
|
|
};
|
|
|
|
|
|
|
|
typedef struct mca_btl_ugni_endpoint_handle_t mca_btl_ugni_endpoint_handle_t;
|
|
|
|
|
2012-02-10 04:47:29 +04:00
|
|
|
typedef struct mca_btl_base_endpoint_t {
|
2012-06-01 00:02:41 +04:00
|
|
|
opal_list_item_t super;
|
2011-12-10 01:24:07 +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
|
|
|
opal_proc_t *peer_proc;
|
When we direct launch an application, we rely on PMI for wireup support. In doing so, we lose the de facto data compression we get from the ORTE modex since we no longer get all the wireup info from every proc in a single blob. Instead, we have to iterate over all the procs, calling PMI_KVS_get for every value we require.
This creates a really bad scaling behavior. Users have found a nearly 20% launch time differential between mpirun and PMI, with PMI being the slower method. Some of the problem is attributable to poor exchange algorithms in RM's like Slurm and Alps, but we make things worse by calling "get" so many times.
Nathan (with a tad advice from me) has attempted to alleviate this problem by reducing the number of "get" calls. This required the following changes:
* upon first request for data, have the OPAL db pmi component fetch and decode *all* the info from a given remote proc. It turned out we weren't caching the info, so we would continually request it and only decode the piece we needed for the immediate request. We now decode all the info and push it into the db hash component for local storage - and then all subsequent retrievals are fulfilled locally
* reduced the amount of data by eliminating the exchange of the OMPI_ARCH value if heterogeneity is not enabled. This was used solely as a check so we would error out if the system wasn't actually homogeneous, which was fine when we thought there was no cost in doing the check. Unfortunately, at large scale and with direct launch, there is a non-zero cost of making this test. We are open to finding a compromise (perhaps turning the test off if requested?), if people feel strongly about performing the test
* reduced the amount of RTE data being automatically fetched, and fetched the rest only upon request. In particular, we no longer immediately fetch the hostname (which is only used for error reporting), but instead get it when needed. Likewise for the RML uri as that info is only required for some (not all) environments. In addition, we no longer fetch the locality unless required, relying instead on the PMI clique info to tell us who is on our local node (if additional info is required, the fetch is performed when a modex_recv is issued).
Again, all this only impacts direct launch - all the info is provided when launched via mpirun as there is no added cost to getting it
Barring objections, we may move this (plus any required other pieces) to the 1.7 branch once it soaks for an appropriate time.
This commit was SVN r29040.
2013-08-17 04:49:18 +04:00
|
|
|
|
2016-08-05 01:08:01 +03:00
|
|
|
/** may need to lock recursively as the modex lookup could call opal_progress
|
|
|
|
* and hence our progress function. if this changes modify this mutex to not
|
|
|
|
* be recursive. also need to update the constructor function. */
|
|
|
|
opal_recursive_mutex_t lock;
|
2012-04-20 01:51:55 +04:00
|
|
|
mca_btl_ugni_endpoint_state_t state;
|
|
|
|
|
2017-03-13 07:37:35 +03:00
|
|
|
/** Remote NIC address */
|
|
|
|
uint32_t ep_rem_addr;
|
2011-12-10 01:24:07 +04:00
|
|
|
|
2017-03-13 07:37:35 +03:00
|
|
|
/** Remote CDM identifier (base) */
|
|
|
|
uint32_t ep_rem_id;
|
2011-12-10 01:24:07 +04:00
|
|
|
|
2017-03-13 07:37:35 +03:00
|
|
|
/** endpoint to use for SMSG messages */
|
2018-02-15 22:57:21 +03:00
|
|
|
mca_btl_ugni_endpoint_handle_t smsg_ep_handle;
|
2012-04-20 01:51:55 +04:00
|
|
|
|
2017-03-13 07:37:35 +03:00
|
|
|
/** temporary space to store the remote SMSG attributes */
|
|
|
|
mca_btl_ugni_endpoint_attr_t *remote_attr;
|
2011-12-10 01:24:07 +04:00
|
|
|
|
2017-03-13 07:37:35 +03:00
|
|
|
/** SMSG mailbox assigned to this endpoint */
|
2012-06-01 00:02:41 +04:00
|
|
|
struct mca_btl_ugni_smsg_mbox_t *mailbox;
|
2014-10-08 20:10:19 +04:00
|
|
|
|
2017-03-13 07:37:35 +03:00
|
|
|
/** Remote IRQ handle (for async completion) */
|
|
|
|
gni_mem_handle_t rmt_irq_mem_hndl;
|
2011-12-10 01:24:07 +04:00
|
|
|
|
2017-03-13 07:37:35 +03:00
|
|
|
/** frags waiting for SMSG credits */
|
2012-06-01 00:02:41 +04:00
|
|
|
opal_list_t frag_wait_list;
|
2017-03-13 07:37:35 +03:00
|
|
|
|
|
|
|
/** endpoint is currently wait-listed for SMSG progress */
|
2012-06-21 21:09:12 +04:00
|
|
|
bool wait_listed;
|
2017-03-13 07:37:35 +03:00
|
|
|
|
2016-08-05 01:08:01 +03:00
|
|
|
/** protect against race on connection */
|
|
|
|
bool dg_posted;
|
2012-04-20 01:51:55 +04:00
|
|
|
|
2017-03-13 07:37:35 +03:00
|
|
|
/** protect against re-entry to SMSG */
|
2012-05-07 21:23:06 +04:00
|
|
|
int32_t smsg_progressing;
|
2013-11-18 08:58:37 +04:00
|
|
|
|
|
|
|
int index;
|
2012-02-10 04:47:29 +04:00
|
|
|
} mca_btl_base_endpoint_t;
|
2011-12-10 01:24:07 +04:00
|
|
|
|
2014-07-09 23:33:58 +04:00
|
|
|
typedef mca_btl_base_endpoint_t mca_btl_ugni_endpoint_t;
|
|
|
|
OBJ_CLASS_DECLARATION(mca_btl_ugni_endpoint_t);
|
2011-12-10 01:24:07 +04:00
|
|
|
|
2014-07-09 23:33:58 +04:00
|
|
|
int mca_btl_ugni_ep_connect_progress (mca_btl_ugni_endpoint_t *ep);
|
|
|
|
int mca_btl_ugni_ep_disconnect (mca_btl_ugni_endpoint_t *ep, bool send_disconnect);
|
2017-03-13 07:37:35 +03:00
|
|
|
int mca_btl_ugni_wildcard_ep_post (mca_btl_ugni_module_t *ugni_module);
|
|
|
|
void mca_btl_ugni_release_ep (mca_btl_ugni_endpoint_t *ep);
|
|
|
|
int mca_btl_ugni_init_ep (mca_btl_ugni_module_t *ugni_module, mca_btl_ugni_endpoint_t **ep,
|
|
|
|
mca_btl_ugni_module_t *btl, opal_proc_t *peer_proc);
|
2011-12-10 01:24:07 +04:00
|
|
|
|
2014-07-09 23:33:58 +04:00
|
|
|
static inline int mca_btl_ugni_check_endpoint_state (mca_btl_ugni_endpoint_t *ep) {
|
2011-12-10 01:24:07 +04:00
|
|
|
int rc;
|
|
|
|
|
2012-04-20 01:51:55 +04:00
|
|
|
if (OPAL_LIKELY(MCA_BTL_UGNI_EP_STATE_CONNECTED == ep->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 04:47:28 +04:00
|
|
|
return OPAL_SUCCESS;
|
2011-12-10 01:24:07 +04:00
|
|
|
}
|
|
|
|
|
2013-11-18 08:58:37 +04:00
|
|
|
opal_mutex_lock (&ep->lock);
|
2011-12-10 01:24:07 +04:00
|
|
|
|
2012-04-20 01:51:55 +04:00
|
|
|
switch (ep->state) {
|
|
|
|
case MCA_BTL_UGNI_EP_STATE_INIT:
|
2011-12-10 01:24:07 +04:00
|
|
|
rc = mca_btl_ugni_ep_connect_progress (ep);
|
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) {
|
2011-12-10 01:24:07 +04:00
|
|
|
break;
|
|
|
|
}
|
2012-04-20 01:51:55 +04:00
|
|
|
case MCA_BTL_UGNI_EP_STATE_CONNECTING:
|
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
|
|
|
rc = OPAL_ERR_RESOURCE_BUSY;
|
2011-12-10 01:24:07 +04:00
|
|
|
break;
|
|
|
|
default:
|
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
|
|
|
rc = OPAL_SUCCESS;
|
2011-12-10 01:24:07 +04:00
|
|
|
}
|
|
|
|
|
2013-11-18 08:58:37 +04:00
|
|
|
opal_mutex_unlock (&ep->lock);
|
2011-12-10 01:24:07 +04:00
|
|
|
|
|
|
|
return rc;
|
|
|
|
}
|
|
|
|
|
2017-03-13 07:37:35 +03:00
|
|
|
/**
|
|
|
|
* Accessor function for endpoint btl
|
|
|
|
*
|
|
|
|
* @param[in] ep endpoint to query
|
|
|
|
*
|
|
|
|
* This helper function exists to make it easy to switch between using a single
|
|
|
|
* and multiple ugni modules. Currently there is only one so we just use the
|
|
|
|
* pointer in the component structure. This saves 4-8 bytes in the endpoint
|
|
|
|
* structure.
|
|
|
|
*/
|
|
|
|
static inline mca_btl_ugni_module_t *mca_btl_ugni_ep_btl (mca_btl_ugni_endpoint_t *ep)
|
|
|
|
{
|
|
|
|
/* there is only one ugni module at this time. if that changes add a btl pointer back
|
|
|
|
* to the endpoint structure. */
|
|
|
|
return mca_btl_ugni_component.modules;
|
|
|
|
}
|
2015-01-06 00:35:00 +03:00
|
|
|
|
2017-03-13 07:37:35 +03:00
|
|
|
/**
|
2018-02-15 22:57:21 +03:00
|
|
|
* Initialize and bind an endpoint handle
|
2017-03-13 07:37:35 +03:00
|
|
|
*
|
|
|
|
* @param[in] ep BTL endpoint
|
|
|
|
* @param[in] cq completion queue
|
2018-02-15 22:57:21 +03:00
|
|
|
* @param[in] device device to bind with
|
|
|
|
* @param[in] ep_handle endpoint handle to initialize and bind
|
2017-03-13 07:37:35 +03:00
|
|
|
*/
|
2018-02-15 22:57:21 +03:00
|
|
|
int mca_btl_ugni_ep_handle_init (mca_btl_ugni_endpoint_t *ep, gni_cq_handle_t cq,
|
|
|
|
mca_btl_ugni_device_t *device, mca_btl_ugni_endpoint_handle_t *ep_handle);
|
2016-08-05 01:08:01 +03:00
|
|
|
|
2018-02-15 22:57:21 +03:00
|
|
|
int mca_btl_ugni_ep_handle_cleanup (mca_btl_ugni_endpoint_handle_t *ep_handle);
|
2011-12-10 01:24:07 +04:00
|
|
|
|
|
|
|
#endif /* MCA_BTL_UGNI_ENDPOINT_H */
|