2011-12-10 01:24:07 +04:00
|
|
|
/* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil -*- */
|
|
|
|
/*
|
2013-11-18 08:58:37 +04:00
|
|
|
* Copyright (c) 2011-2013 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$
|
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef MCA_BTL_UGNI_ENDPOINT_H
|
|
|
|
#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,
|
|
|
|
MCA_BTL_UGNI_EP_STATE_CONNECTED
|
|
|
|
};
|
|
|
|
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
|
|
|
|
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
|
|
|
|
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
|
|
|
ompi_proc_t *peer_proc;
|
|
|
|
|
2012-04-20 01:51:55 +04:00
|
|
|
opal_mutex_t lock;
|
|
|
|
mca_btl_ugni_endpoint_state_t state;
|
|
|
|
|
2011-12-10 01:24:07 +04:00
|
|
|
ompi_common_ugni_endpoint_t *common;
|
|
|
|
|
|
|
|
mca_btl_ugni_module_t *btl;
|
|
|
|
|
2012-04-20 01:51:55 +04:00
|
|
|
gni_ep_handle_t smsg_ep_handle;
|
|
|
|
gni_ep_handle_t rdma_ep_handle;
|
|
|
|
|
2013-11-18 08:58:37 +04:00
|
|
|
mca_btl_ugni_endpoint_attr_t remote_attr;
|
2011-12-10 01:24:07 +04:00
|
|
|
|
2012-06-01 00:02:41 +04:00
|
|
|
struct mca_btl_ugni_smsg_mbox_t *mailbox;
|
2011-12-10 01:24:07 +04:00
|
|
|
|
2012-06-01 00:02:41 +04:00
|
|
|
opal_list_t frag_wait_list;
|
2012-06-21 21:09:12 +04:00
|
|
|
bool wait_listed;
|
2012-04-20 01:51:55 +04:00
|
|
|
|
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
|
|
|
|
2012-02-10 04:47:29 +04:00
|
|
|
OBJ_CLASS_DECLARATION(mca_btl_base_endpoint_t);
|
2011-12-10 01:24:07 +04:00
|
|
|
|
|
|
|
int mca_btl_ugni_ep_connect_progress (mca_btl_base_endpoint_t *ep);
|
|
|
|
int mca_btl_ugni_ep_disconnect (mca_btl_base_endpoint_t *ep, bool send_disconnect);
|
|
|
|
|
2013-11-18 08:58:37 +04:00
|
|
|
static inline int mca_btl_ugni_init_ep (mca_btl_ugni_module_t *ugni_module,
|
|
|
|
mca_btl_base_endpoint_t **ep,
|
2011-12-10 01:24:07 +04:00
|
|
|
mca_btl_ugni_module_t *btl,
|
|
|
|
ompi_proc_t *peer_proc) {
|
|
|
|
mca_btl_base_endpoint_t *endpoint;
|
|
|
|
|
|
|
|
endpoint = OBJ_NEW(mca_btl_base_endpoint_t);
|
|
|
|
assert (endpoint != NULL);
|
|
|
|
|
2012-04-20 01:51:55 +04:00
|
|
|
endpoint->smsg_progressing = 0;
|
|
|
|
endpoint->state = MCA_BTL_UGNI_EP_STATE_INIT;
|
|
|
|
|
2011-12-10 01:24:07 +04:00
|
|
|
endpoint->btl = btl;
|
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
|
|
|
endpoint->peer_proc = peer_proc;
|
|
|
|
endpoint->common = NULL;
|
2013-11-18 08:58:37 +04:00
|
|
|
endpoint->index = opal_pointer_array_add (&ugni_module->endpoints, endpoint);
|
2011-12-10 01:24:07 +04:00
|
|
|
|
|
|
|
*ep = endpoint;
|
|
|
|
|
2012-04-20 01:51:55 +04:00
|
|
|
return OMPI_SUCCESS;
|
2011-12-10 01:24:07 +04:00
|
|
|
}
|
|
|
|
|
|
|
|
static inline void mca_btl_ugni_release_ep (mca_btl_base_endpoint_t *ep) {
|
|
|
|
int rc;
|
|
|
|
|
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
|
|
|
if (ep->common) {
|
2013-11-18 08:58:37 +04:00
|
|
|
opal_mutex_lock (&ep->lock);
|
|
|
|
|
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
|
|
|
rc = mca_btl_ugni_ep_disconnect (ep, false);
|
|
|
|
if (OPAL_UNLIKELY(OMPI_SUCCESS != rc)) {
|
|
|
|
BTL_VERBOSE(("btl/ugni error disconnecting endpoint"));
|
|
|
|
}
|
2011-12-10 01:24:07 +04:00
|
|
|
|
2013-11-18 08:58:37 +04:00
|
|
|
/* TODO -- Clear space at the end of the endpoint array */
|
|
|
|
opal_pointer_array_set_item (&ep->btl->endpoints, ep->index, NULL);
|
|
|
|
|
|
|
|
opal_mutex_unlock (&ep->lock);
|
|
|
|
|
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
|
|
|
ompi_common_ugni_endpoint_return (ep->common);
|
|
|
|
}
|
2011-12-10 01:24:07 +04:00
|
|
|
|
|
|
|
OBJ_RELEASE(ep);
|
|
|
|
}
|
|
|
|
|
|
|
|
static inline int mca_btl_ugni_check_endpoint_state (mca_btl_base_endpoint_t *ep) {
|
|
|
|
int rc;
|
|
|
|
|
2012-04-20 01:51:55 +04:00
|
|
|
if (OPAL_LIKELY(MCA_BTL_UGNI_EP_STATE_CONNECTED == ep->state)) {
|
2011-12-10 01:24:07 +04:00
|
|
|
return OMPI_SUCCESS;
|
|
|
|
}
|
|
|
|
|
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);
|
|
|
|
if (OMPI_SUCCESS != rc) {
|
|
|
|
break;
|
|
|
|
}
|
2012-04-20 01:51:55 +04:00
|
|
|
case MCA_BTL_UGNI_EP_STATE_CONNECTING:
|
2011-12-10 01:24:07 +04:00
|
|
|
rc = OMPI_ERR_RESOURCE_BUSY;
|
|
|
|
break;
|
|
|
|
default:
|
|
|
|
rc = OMPI_SUCCESS;
|
|
|
|
}
|
|
|
|
|
2013-11-18 08:58:37 +04:00
|
|
|
opal_mutex_unlock (&ep->lock);
|
2011-12-10 01:24:07 +04:00
|
|
|
|
|
|
|
return rc;
|
|
|
|
}
|
|
|
|
|
|
|
|
static inline int mca_btl_ugni_wildcard_ep_post (mca_btl_ugni_module_t *ugni_module) {
|
2012-04-20 01:51:55 +04:00
|
|
|
gni_return_t rc;
|
2011-12-10 01:24:07 +04:00
|
|
|
|
2013-11-18 08:58:37 +04:00
|
|
|
BTL_VERBOSE(("posting wildcard datagram"));
|
|
|
|
|
2011-12-10 01:24:07 +04:00
|
|
|
memset (&ugni_module->wc_local_attr, 0, sizeof (ugni_module->wc_local_attr));
|
2013-11-18 08:58:37 +04:00
|
|
|
memset (&ugni_module->wc_remote_attr, 0, sizeof (ugni_module->wc_remote_attr));
|
|
|
|
rc = GNI_EpPostDataWId (ugni_module->wildcard_ep, &ugni_module->wc_local_attr,
|
|
|
|
sizeof (ugni_module->wc_local_attr), &ugni_module->wc_remote_attr,
|
|
|
|
sizeof (ugni_module->wc_remote_attr), MCA_BTL_UGNI_CONNECT_WILDCARD_ID);
|
2011-12-10 01:24:07 +04:00
|
|
|
|
|
|
|
return ompi_common_rc_ugni_to_ompi (rc);
|
|
|
|
}
|
|
|
|
|
|
|
|
#endif /* MCA_BTL_UGNI_ENDPOINT_H */
|