2015-02-19 13:41:41 -07:00
|
|
|
/* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil -*- */
|
2011-07-26 04:36:21 +00: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 18:56:47 +00:00
|
|
|
* Copyright (C) 2001-2011 Mellanox Technologies Ltd. ALL RIGHTS RESERVED.
|
2015-06-18 09:53:20 -07:00
|
|
|
* Copyright (c) 2013-2015 Intel, Inc. All rights reserved
|
2014-11-11 17:00:42 -08:00
|
|
|
* Copyright (c) 2014 Research Organization for Information Science
|
|
|
|
* and Technology (RIST). All rights reserved.
|
2015-02-19 13:41:41 -07:00
|
|
|
* Copyright (c) 2015 Los Alamos National Security, LLC. All rights
|
|
|
|
* reserved.
|
2011-07-26 04:36:21 +00:00
|
|
|
* $COPYRIGHT$
|
|
|
|
*
|
|
|
|
* Additional copyrights may follow
|
|
|
|
*
|
|
|
|
* $HEADER$
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
|
|
#include "ompi_config.h"
|
|
|
|
|
|
|
|
#include "ompi/mca/mtl/mtl.h"
|
|
|
|
#include "ompi/mca/mtl/base/mtl_base_datatype.h"
|
|
|
|
#include "ompi/proc/proc.h"
|
|
|
|
#include "ompi/communicator/communicator.h"
|
2013-05-14 12:27:44 +00:00
|
|
|
#include "opal/memoryhooks/memory.h"
|
2013-12-19 19:37:21 +00:00
|
|
|
#include "opal/util/show_help.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 18:56:47 +00:00
|
|
|
#include "opal/mca/pmix/pmix.h"
|
2011-07-26 04:36:21 +00:00
|
|
|
|
|
|
|
#include "mtl_mxm.h"
|
|
|
|
#include "mtl_mxm_types.h"
|
|
|
|
#include "mtl_mxm_endpoint.h"
|
|
|
|
#include "mtl_mxm_request.h"
|
|
|
|
|
|
|
|
mca_mtl_mxm_module_t ompi_mtl_mxm = {
|
|
|
|
{
|
|
|
|
0, /* max context id */
|
|
|
|
0, /* max tag value */
|
|
|
|
0, /* request reserve space */
|
|
|
|
0, /* flags */
|
|
|
|
ompi_mtl_mxm_add_procs,
|
|
|
|
ompi_mtl_mxm_del_procs,
|
|
|
|
ompi_mtl_mxm_finalize,
|
|
|
|
ompi_mtl_mxm_send,
|
|
|
|
ompi_mtl_mxm_isend,
|
|
|
|
ompi_mtl_mxm_irecv,
|
|
|
|
ompi_mtl_mxm_iprobe,
|
2012-03-26 19:27:03 +00:00
|
|
|
ompi_mtl_mxm_imrecv,
|
|
|
|
ompi_mtl_mxm_improbe,
|
2011-07-26 04:36:21 +00:00
|
|
|
ompi_mtl_mxm_cancel,
|
|
|
|
ompi_mtl_mxm_add_comm,
|
|
|
|
ompi_mtl_mxm_del_comm
|
2013-05-14 12:27:44 +00:00
|
|
|
},
|
|
|
|
0,
|
|
|
|
0,
|
|
|
|
NULL,
|
|
|
|
NULL
|
2011-07-26 04:36:21 +00:00
|
|
|
};
|
|
|
|
|
2014-06-01 13:29:24 +00:00
|
|
|
#if MXM_API < MXM_VERSION(2,0)
|
2011-07-26 04:36:21 +00:00
|
|
|
static uint32_t ompi_mtl_mxm_get_job_id(void)
|
|
|
|
{
|
|
|
|
uint8_t unique_job_key[16];
|
|
|
|
uint32_t job_key;
|
|
|
|
unsigned long long *uu;
|
|
|
|
char *generated_key;
|
|
|
|
|
|
|
|
uu = (unsigned long long *) unique_job_key;
|
|
|
|
|
|
|
|
generated_key = getenv("OMPI_MCA_orte_precondition_transports");
|
|
|
|
memset(uu, 0, sizeof(unique_job_key));
|
|
|
|
|
|
|
|
if (!generated_key || (strlen(generated_key) != 33) || sscanf(generated_key, "%016llx-%016llx", &uu[0], &uu[1]) != 2) {
|
2013-02-12 21:10:11 +00:00
|
|
|
opal_show_help("help-mtl-mxm.txt", "no uuid present", true,
|
2011-07-26 04:36:21 +00:00
|
|
|
generated_key ? "could not be parsed from" :
|
2013-01-27 23:25:10 +00:00
|
|
|
"not present in", ompi_process_info.nodename);
|
2011-07-26 04:36:21 +00:00
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
2014-09-03 18:22:11 +00:00
|
|
|
/*
|
2012-02-02 15:00:47 +00:00
|
|
|
* decode OMPI_MCA_orte_precondition_transports that looks as
|
|
|
|
* 000003ca00000000-0000000100000000
|
|
|
|
* jobfam-stepid
|
|
|
|
* to get jobid coded with ORTE_CONSTRUCT_LOCAL_JOBID()
|
|
|
|
*/
|
|
|
|
#define GET_LOCAL_JOBID(local, job) \
|
|
|
|
( ((local) & 0xffff0000) | ((job) & 0x0000ffff) )
|
|
|
|
job_key = GET_LOCAL_JOBID((uu[0]>>(8 * sizeof(int))) << 16, uu[1]>>(8 * sizeof(int)));
|
|
|
|
|
2011-07-26 04:36:21 +00:00
|
|
|
return job_key;
|
|
|
|
}
|
2014-06-01 13:29:24 +00:00
|
|
|
#endif
|
2011-07-26 04:36:21 +00:00
|
|
|
|
|
|
|
int ompi_mtl_mxm_progress(void);
|
2013-05-14 12:27:44 +00:00
|
|
|
#if MXM_API >= MXM_VERSION(2,0)
|
|
|
|
static void ompi_mtl_mxm_mem_release_cb(void *buf, size_t length,
|
|
|
|
void *cbdata, bool from_alloc);
|
|
|
|
#endif
|
2011-07-26 04:36:21 +00:00
|
|
|
|
2013-12-04 09:11:55 +00:00
|
|
|
#if MXM_API < MXM_VERSION(2,0)
|
2011-07-26 04:36:21 +00:00
|
|
|
static int ompi_mtl_mxm_get_ep_address(ompi_mtl_mxm_ep_conn_info_t *ep_info, mxm_ptl_id_t ptlid)
|
|
|
|
{
|
|
|
|
size_t addrlen;
|
|
|
|
mxm_error_t err;
|
|
|
|
|
|
|
|
addrlen = sizeof(ep_info->ptl_addr[ptlid]);
|
|
|
|
err = mxm_ep_address(ompi_mtl_mxm.ep, ptlid,
|
2012-12-09 22:58:37 +00:00
|
|
|
(struct sockaddr *) &ep_info->ptl_addr[ptlid], &addrlen);
|
2011-07-26 04:36:21 +00:00
|
|
|
if (MXM_OK != err) {
|
2013-04-12 16:37:42 +00:00
|
|
|
opal_show_help("help-mtl-mxm.txt", "unable to extract endpoint ptl address",
|
2012-12-09 22:58:37 +00:00
|
|
|
true, (int)ptlid, mxm_error_string(err));
|
2011-07-26 04:36:21 +00:00
|
|
|
return OMPI_ERROR;
|
|
|
|
}
|
|
|
|
|
|
|
|
return OMPI_SUCCESS;
|
|
|
|
}
|
2012-12-09 22:58:37 +00:00
|
|
|
#else
|
2013-04-12 16:37:42 +00:00
|
|
|
static int ompi_mtl_mxm_get_ep_address(void **address_p, size_t *address_len_p)
|
2012-12-09 22:58:37 +00:00
|
|
|
{
|
|
|
|
mxm_error_t err;
|
|
|
|
|
2013-04-12 16:37:42 +00:00
|
|
|
*address_len_p = 0;
|
|
|
|
err = mxm_ep_get_address(ompi_mtl_mxm.ep, NULL, address_len_p);
|
|
|
|
if (err != MXM_ERR_BUFFER_TOO_SMALL) {
|
|
|
|
MXM_ERROR("Failed to get ep address length");
|
|
|
|
return OMPI_ERROR;
|
|
|
|
}
|
|
|
|
|
|
|
|
*address_p = malloc(*address_len_p);
|
|
|
|
if (*address_p == NULL) {
|
|
|
|
MXM_ERROR("Failed to allocate ep address buffer");
|
|
|
|
return OMPI_ERR_OUT_OF_RESOURCE;
|
|
|
|
}
|
|
|
|
|
|
|
|
err = mxm_ep_get_address(ompi_mtl_mxm.ep, *address_p, address_len_p);
|
|
|
|
if (MXM_OK != err) {
|
2013-02-12 21:10:11 +00:00
|
|
|
opal_show_help("help-mtl-mxm.txt", "unable to extract endpoint address",
|
2013-04-12 16:37:42 +00:00
|
|
|
true, mxm_error_string(err));
|
2012-12-09 22:58:37 +00:00
|
|
|
return OMPI_ERROR;
|
|
|
|
}
|
2013-04-12 16:37:42 +00:00
|
|
|
|
|
|
|
return OMPI_SUCCESS;
|
2012-12-09 22:58:37 +00:00
|
|
|
}
|
|
|
|
#endif
|
2011-07-26 04:36:21 +00:00
|
|
|
|
2011-10-03 12:59:55 +00:00
|
|
|
#define max(a,b) ((a)>(b)?(a):(b))
|
2011-07-26 04:36:21 +00:00
|
|
|
|
2013-04-12 16:37:42 +00:00
|
|
|
static mxm_error_t
|
|
|
|
ompi_mtl_mxm_create_ep(mxm_h ctx, mxm_ep_h *ep, unsigned ptl_bitmap, int lr,
|
|
|
|
uint32_t jobid, uint64_t mxlr, int nlps)
|
|
|
|
{
|
2012-08-08 15:29:38 +00:00
|
|
|
mxm_error_t err;
|
|
|
|
|
2013-12-04 09:11:55 +00:00
|
|
|
#if MXM_API < MXM_VERSION(2,0)
|
|
|
|
ompi_mtl_mxm.mxm_ep_opts->job_id = jobid;
|
|
|
|
ompi_mtl_mxm.mxm_ep_opts->local_rank = lr;
|
|
|
|
ompi_mtl_mxm.mxm_ep_opts->num_local_procs = nlps;
|
|
|
|
err = mxm_ep_create(ctx, ompi_mtl_mxm.mxm_ep_opts, ep);
|
2013-04-12 16:37:42 +00:00
|
|
|
#else
|
2013-12-04 09:11:55 +00:00
|
|
|
err = mxm_ep_create(ctx, ompi_mtl_mxm.mxm_ep_opts, ep);
|
2012-08-08 15:29:38 +00:00
|
|
|
#endif
|
|
|
|
return err;
|
|
|
|
}
|
|
|
|
|
2013-04-12 16:37:42 +00:00
|
|
|
/*
|
|
|
|
* send information using modex (in some case there is limitation on data size for example ess/pmi)
|
|
|
|
* set size of data sent for once
|
|
|
|
*
|
|
|
|
*/
|
|
|
|
static int ompi_mtl_mxm_send_ep_address(void *address, size_t address_len)
|
2013-01-31 08:38:08 +00:00
|
|
|
{
|
2013-04-12 16:37:42 +00:00
|
|
|
char *modex_component_name = mca_base_component_to_string(&mca_mtl_mxm_component.super.mtl_version);
|
|
|
|
char *modex_name = malloc(strlen(modex_component_name) + 5);
|
|
|
|
const size_t modex_max_size = 0x60;
|
|
|
|
unsigned char *modex_buf_ptr;
|
|
|
|
size_t modex_buf_size;
|
|
|
|
size_t modex_cur_size;
|
|
|
|
int modex_name_id = 0;
|
|
|
|
int rc;
|
2013-02-04 06:59:24 +00:00
|
|
|
|
2013-04-12 16:37:42 +00:00
|
|
|
/* Send address length */
|
|
|
|
sprintf(modex_name, "%s-len", modex_component_name);
|
2015-06-18 09:53:20 -07:00
|
|
|
OPAL_MODEX_SEND_STRING(rc, OPAL_PMIX_GLOBAL,
|
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 18:56:47 +00:00
|
|
|
modex_name, &address_len, sizeof(address_len));
|
2013-04-12 16:37:42 +00:00
|
|
|
if (OMPI_SUCCESS != rc) {
|
|
|
|
MXM_ERROR("failed to send address length");
|
|
|
|
goto bail;
|
2013-02-04 06:59:24 +00:00
|
|
|
}
|
|
|
|
|
2013-04-12 16:37:42 +00:00
|
|
|
/* Send address, in parts.
|
|
|
|
* modex name looks as mtl.mxm.1.5-18 where mtl.mxm.1.5 is the component and 18 is part index.
|
2013-02-04 06:59:24 +00:00
|
|
|
*/
|
2013-04-12 16:37:42 +00:00
|
|
|
modex_buf_size = address_len;
|
|
|
|
modex_buf_ptr = address;
|
|
|
|
while (modex_buf_size) {
|
|
|
|
sprintf(modex_name, "%s-%d", modex_component_name, modex_name_id);
|
|
|
|
modex_cur_size = (modex_buf_size < modex_max_size) ? modex_buf_size : modex_max_size;
|
2015-06-18 09:53:20 -07:00
|
|
|
OPAL_MODEX_SEND_STRING(rc, OPAL_PMIX_GLOBAL,
|
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 18:56:47 +00:00
|
|
|
modex_name, modex_buf_ptr, modex_cur_size);
|
2013-02-04 06:59:24 +00:00
|
|
|
if (OMPI_SUCCESS != rc) {
|
2013-04-12 16:37:42 +00:00
|
|
|
MXM_ERROR("Open MPI couldn't distribute EP connection details");
|
|
|
|
goto bail;
|
2013-02-04 06:59:24 +00:00
|
|
|
}
|
|
|
|
|
2013-04-12 16:37:42 +00:00
|
|
|
modex_name_id++;
|
|
|
|
modex_buf_ptr += modex_cur_size;
|
|
|
|
modex_buf_size -= modex_cur_size;
|
|
|
|
}
|
2013-02-04 06:59:24 +00:00
|
|
|
|
2013-04-12 16:37:42 +00:00
|
|
|
rc = OMPI_SUCCESS;
|
2013-02-04 06:59:24 +00:00
|
|
|
|
2013-04-12 16:37:42 +00:00
|
|
|
bail:
|
|
|
|
free(modex_component_name);
|
|
|
|
free(modex_name);
|
|
|
|
return rc;
|
|
|
|
}
|
2013-02-04 06:59:24 +00:00
|
|
|
|
2013-04-12 16:37:42 +00:00
|
|
|
/*
|
|
|
|
* recieve information using modex
|
|
|
|
*/
|
|
|
|
static int ompi_mtl_mxm_recv_ep_address(ompi_proc_t *source_proc, void **address_p,
|
|
|
|
size_t *address_len_p)
|
|
|
|
{
|
|
|
|
char *modex_component_name = mca_base_component_to_string(&mca_mtl_mxm_component.super.mtl_version);
|
|
|
|
char *modex_name = malloc(strlen(modex_component_name) + 5);
|
|
|
|
unsigned char *modex_buf_ptr;
|
|
|
|
size_t modex_cur_size;
|
|
|
|
size_t modex_buf_size;
|
|
|
|
size_t *address_len_buf_ptr;
|
|
|
|
int modex_name_id = 0;
|
|
|
|
int rc;
|
2013-02-04 06:59:24 +00:00
|
|
|
|
2013-04-12 16:37:42 +00:00
|
|
|
*address_p = NULL;
|
|
|
|
*address_len_p = 0;
|
2013-02-04 06:59:24 +00:00
|
|
|
|
2013-04-12 16:37:42 +00:00
|
|
|
/* Receive address length */
|
|
|
|
sprintf(modex_name, "%s-len", modex_component_name);
|
2015-06-18 09:53:20 -07:00
|
|
|
OPAL_MODEX_RECV_STRING(rc, modex_name, &source_proc->super.proc_name,
|
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 18:56:47 +00:00
|
|
|
(char**)&address_len_buf_ptr,
|
|
|
|
&modex_cur_size);
|
2013-04-12 16:37:42 +00:00
|
|
|
if (OMPI_SUCCESS != rc) {
|
|
|
|
MXM_ERROR("Failed to receive ep address length");
|
|
|
|
goto bail;
|
|
|
|
}
|
2013-02-04 06:59:24 +00:00
|
|
|
|
2013-04-12 16:37:42 +00:00
|
|
|
/* Allocate buffer to hold the address */
|
|
|
|
*address_len_p = *address_len_buf_ptr;
|
|
|
|
*address_p = malloc(*address_len_p);
|
|
|
|
if (*address_p == NULL) {
|
|
|
|
MXM_ERROR("Failed to allocate modex receive buffer");
|
|
|
|
rc = OMPI_ERR_OUT_OF_RESOURCE;
|
|
|
|
goto bail;
|
|
|
|
}
|
2013-02-04 06:54:24 +00:00
|
|
|
|
2013-04-12 16:37:42 +00:00
|
|
|
/* Receive the data, in parts */
|
|
|
|
modex_buf_size = 0;
|
|
|
|
while (modex_buf_size < *address_len_p) {
|
|
|
|
sprintf(modex_name, "%s-%d", modex_component_name, modex_name_id);
|
2015-06-18 09:53:20 -07:00
|
|
|
OPAL_MODEX_RECV_STRING(rc, modex_name, &source_proc->super.proc_name,
|
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 18:56:47 +00:00
|
|
|
(char**)&modex_buf_ptr,
|
|
|
|
&modex_cur_size);
|
2013-04-12 16:37:42 +00:00
|
|
|
if (OMPI_SUCCESS != rc) {
|
|
|
|
MXM_ERROR("Open MPI couldn't distribute EP connection details");
|
2015-02-24 17:52:08 +04:00
|
|
|
free(*address_p);
|
|
|
|
*address_p = NULL;
|
|
|
|
*address_len_p = 0;
|
2013-04-12 16:37:42 +00:00
|
|
|
goto bail;
|
2013-02-04 06:59:24 +00:00
|
|
|
}
|
|
|
|
|
2013-04-12 16:37:42 +00:00
|
|
|
memcpy((char*)(*address_p) + modex_buf_size, modex_buf_ptr, modex_cur_size);
|
|
|
|
modex_buf_size += modex_cur_size;
|
|
|
|
modex_name_id++;
|
|
|
|
}
|
2013-02-04 06:59:24 +00:00
|
|
|
|
2013-04-12 16:37:42 +00:00
|
|
|
rc = OMPI_SUCCESS;
|
|
|
|
bail:
|
|
|
|
free(modex_component_name);
|
|
|
|
free(modex_name);
|
|
|
|
return rc;
|
2013-02-04 06:59:24 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
int ompi_mtl_mxm_module_init(void)
|
|
|
|
{
|
2013-04-12 16:37:42 +00:00
|
|
|
#if MXM_API < MXM_VERSION(2,0)
|
2011-07-26 04:36:21 +00:00
|
|
|
ompi_mtl_mxm_ep_conn_info_t ep_info;
|
2013-04-12 16:37:42 +00:00
|
|
|
#endif
|
|
|
|
void *ep_address;
|
|
|
|
size_t ep_address_len;
|
2011-07-26 04:36:21 +00:00
|
|
|
mxm_error_t err;
|
|
|
|
uint32_t jobid;
|
2011-10-03 12:59:55 +00:00
|
|
|
uint64_t mxlr;
|
2014-01-09 15:15:14 +00:00
|
|
|
ompi_proc_t **procs;
|
2012-12-09 22:58:37 +00:00
|
|
|
unsigned ptl_bitmap;
|
2011-10-03 12:59:55 +00:00
|
|
|
size_t totps, proc;
|
|
|
|
int lr, nlps;
|
2013-04-12 16:37:42 +00:00
|
|
|
int rc;
|
2011-10-03 12:59:55 +00:00
|
|
|
|
|
|
|
mxlr = 0;
|
|
|
|
lr = -1;
|
2014-06-01 13:29:24 +00:00
|
|
|
jobid = 0;
|
2011-07-26 04:36:21 +00:00
|
|
|
|
2014-06-01 13:29:24 +00:00
|
|
|
#if MXM_API < MXM_VERSION(2,0)
|
2011-07-26 04:36:21 +00:00
|
|
|
jobid = ompi_mtl_mxm_get_job_id();
|
|
|
|
if (0 == jobid) {
|
|
|
|
MXM_ERROR("Failed to generate jobid");
|
|
|
|
return OMPI_ERROR;
|
|
|
|
}
|
2014-06-01 13:29:24 +00:00
|
|
|
#endif
|
2011-07-26 04:36:21 +00:00
|
|
|
|
2011-10-03 12:59:55 +00:00
|
|
|
if (NULL == (procs = ompi_proc_world(&totps))) {
|
|
|
|
MXM_ERROR("Unable to obtain process list");
|
|
|
|
return OMPI_ERROR;
|
|
|
|
}
|
|
|
|
|
2012-06-02 11:07:20 +00:00
|
|
|
if (totps < (size_t)ompi_mtl_mxm.mxm_np) {
|
2012-06-03 21:48:42 +00:00
|
|
|
MXM_VERBOSE(1, "MXM support will be disabled because of total number "
|
|
|
|
"of processes (%lu) is less than the minimum set by the "
|
|
|
|
"mtl_mxm_np MCA parameter (%u)", totps, ompi_mtl_mxm.mxm_np);
|
2015-02-24 17:52:08 +04:00
|
|
|
free(procs);
|
2012-06-03 21:48:42 +00:00
|
|
|
return OMPI_ERR_NOT_SUPPORTED;
|
2012-06-02 11:07:20 +00:00
|
|
|
}
|
|
|
|
MXM_VERBOSE(1, "MXM support enabled");
|
|
|
|
|
2013-01-27 23:25:10 +00:00
|
|
|
if (ORTE_NODE_RANK_INVALID == (lr = ompi_process_info.my_node_rank)) {
|
2012-06-05 09:13:16 +00:00
|
|
|
MXM_ERROR("Unable to obtain local node rank");
|
2015-02-24 17:52:08 +04:00
|
|
|
free(procs);
|
2012-06-05 09:13:16 +00:00
|
|
|
return OMPI_ERROR;
|
|
|
|
}
|
2013-01-27 23:25:10 +00:00
|
|
|
nlps = ompi_process_info.num_local_peers + 1;
|
2011-10-03 12:59:55 +00:00
|
|
|
|
2012-06-05 09:13:16 +00:00
|
|
|
for (proc = 0; proc < totps; proc++) {
|
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 (OPAL_PROC_ON_LOCAL_NODE(procs[proc]->super.proc_flags)) {
|
2014-11-11 17:00:42 -08:00
|
|
|
mxlr = max(mxlr, procs[proc]->super.proc_name.vpid);
|
2011-10-03 12:59:55 +00:00
|
|
|
}
|
|
|
|
}
|
2015-02-24 17:52:08 +04:00
|
|
|
free(procs);
|
2011-10-03 12:59:55 +00:00
|
|
|
|
2012-02-02 15:00:47 +00:00
|
|
|
/* Setup the endpoint options and local addresses to bind to. */
|
2013-12-04 09:11:55 +00:00
|
|
|
#if MXM_API < MXM_VERSION(2,0)
|
|
|
|
ptl_bitmap = ompi_mtl_mxm.mxm_ctx_opts->ptl_bitmap;
|
2012-12-09 22:58:37 +00:00
|
|
|
#else
|
|
|
|
ptl_bitmap = 0;
|
2012-08-08 15:29:38 +00:00
|
|
|
#endif
|
2011-07-26 04:36:21 +00:00
|
|
|
|
|
|
|
/* Open MXM endpoint */
|
2012-08-08 15:29:38 +00:00
|
|
|
err = ompi_mtl_mxm_create_ep(ompi_mtl_mxm.mxm_context, &ompi_mtl_mxm.ep,
|
2013-04-12 16:37:42 +00:00
|
|
|
ptl_bitmap, lr, jobid, mxlr, nlps);
|
2011-07-26 04:36:21 +00:00
|
|
|
if (MXM_OK != err) {
|
2013-02-12 21:10:11 +00:00
|
|
|
opal_show_help("help-mtl-mxm.txt", "unable to create endpoint", true,
|
2011-07-26 04:36:21 +00:00
|
|
|
mxm_error_string(err));
|
|
|
|
return OMPI_ERROR;
|
|
|
|
}
|
|
|
|
|
|
|
|
/*
|
|
|
|
* Get address for each PTL on this endpoint, and share it with other ranks.
|
|
|
|
*/
|
2012-12-09 22:58:37 +00:00
|
|
|
#if MXM_API < MXM_VERSION(2,0)
|
2011-10-31 10:17:43 +00:00
|
|
|
if ((ptl_bitmap & MXM_BIT(MXM_PTL_SELF)) &&
|
|
|
|
OMPI_SUCCESS != ompi_mtl_mxm_get_ep_address(&ep_info, MXM_PTL_SELF)) {
|
2011-07-26 04:36:21 +00:00
|
|
|
return OMPI_ERROR;
|
|
|
|
}
|
2011-10-31 10:17:43 +00:00
|
|
|
if ((ptl_bitmap & MXM_BIT(MXM_PTL_RDMA)) &&
|
|
|
|
OMPI_SUCCESS != ompi_mtl_mxm_get_ep_address(&ep_info, MXM_PTL_RDMA)) {
|
2011-07-26 04:36:21 +00:00
|
|
|
return OMPI_ERROR;
|
|
|
|
}
|
2011-10-31 10:17:43 +00:00
|
|
|
if ((ptl_bitmap & MXM_BIT(MXM_PTL_SHM)) &&
|
|
|
|
OMPI_SUCCESS != ompi_mtl_mxm_get_ep_address(&ep_info, MXM_PTL_SHM)) {
|
2011-10-03 12:59:55 +00:00
|
|
|
return OMPI_ERROR;
|
|
|
|
}
|
2013-02-04 06:59:24 +00:00
|
|
|
|
2013-04-12 16:37:42 +00:00
|
|
|
ep_address = &ep_info;
|
|
|
|
ep_address_len = sizeof(ep_info);
|
2013-02-04 06:59:24 +00:00
|
|
|
#else
|
2013-04-12 16:37:42 +00:00
|
|
|
rc = ompi_mtl_mxm_get_ep_address(&ep_address, &ep_address_len);
|
|
|
|
if (OMPI_SUCCESS != rc) {
|
|
|
|
return rc;
|
|
|
|
}
|
|
|
|
#endif
|
|
|
|
|
|
|
|
rc = ompi_mtl_mxm_send_ep_address(ep_address, ep_address_len);
|
|
|
|
if (OMPI_SUCCESS != rc) {
|
|
|
|
MXM_ERROR("Modex session failed.");
|
|
|
|
return rc;
|
2013-02-04 06:59:24 +00:00
|
|
|
}
|
2013-04-12 16:37:42 +00:00
|
|
|
|
|
|
|
#if MXM_API >= MXM_VERSION(2,0)
|
|
|
|
free(ep_address);
|
2013-02-04 06:59:24 +00:00
|
|
|
#endif
|
2014-09-03 18:22:11 +00:00
|
|
|
|
2011-07-26 04:36:21 +00:00
|
|
|
/* Register the MXM progress function */
|
|
|
|
opal_progress_register(ompi_mtl_mxm_progress);
|
2013-05-14 12:27:44 +00:00
|
|
|
|
|
|
|
#if MXM_API >= MXM_VERSION(2,0)
|
|
|
|
if (ompi_mtl_mxm.using_mem_hooks) {
|
|
|
|
opal_mem_hooks_register_release(ompi_mtl_mxm_mem_release_cb, NULL);
|
|
|
|
}
|
|
|
|
#endif
|
2011-07-26 04:36:21 +00:00
|
|
|
return OMPI_SUCCESS;
|
|
|
|
}
|
|
|
|
|
|
|
|
int ompi_mtl_mxm_finalize(struct mca_mtl_base_module_t* mtl)
|
|
|
|
{
|
2013-05-14 12:27:44 +00:00
|
|
|
#if MXM_API >= MXM_VERSION(2,0)
|
|
|
|
if (ompi_mtl_mxm.using_mem_hooks) {
|
|
|
|
opal_mem_hooks_unregister_release(ompi_mtl_mxm_mem_release_cb);
|
|
|
|
}
|
|
|
|
#endif
|
2011-07-26 04:36:21 +00:00
|
|
|
opal_progress_unregister(ompi_mtl_mxm_progress);
|
|
|
|
mxm_ep_destroy(ompi_mtl_mxm.ep);
|
|
|
|
return OMPI_SUCCESS;
|
|
|
|
}
|
|
|
|
|
|
|
|
int ompi_mtl_mxm_add_procs(struct mca_mtl_base_module_t *mtl, size_t nprocs,
|
2013-08-30 16:54:55 +00:00
|
|
|
struct ompi_proc_t** procs)
|
2011-07-26 04:36:21 +00:00
|
|
|
{
|
2013-04-12 16:37:42 +00:00
|
|
|
#if MXM_API < MXM_VERSION(2,0)
|
2012-02-02 15:00:47 +00:00
|
|
|
ompi_mtl_mxm_ep_conn_info_t *ep_info;
|
2011-07-26 04:36:21 +00:00
|
|
|
mxm_conn_req_t *conn_reqs;
|
2014-03-27 08:39:51 +00:00
|
|
|
size_t ep_index = 0;
|
2013-04-12 16:37:42 +00:00
|
|
|
#endif
|
2015-02-24 17:52:08 +04:00
|
|
|
void *ep_address = NULL;
|
2013-04-12 16:37:42 +00:00
|
|
|
size_t ep_address_len;
|
2011-07-26 04:36:21 +00:00
|
|
|
mxm_error_t err;
|
2014-03-27 08:39:51 +00:00
|
|
|
size_t i;
|
2011-07-26 04:36:21 +00:00
|
|
|
int rc;
|
2013-08-30 16:54:55 +00:00
|
|
|
mca_mtl_mxm_endpoint_t *endpoint;
|
2011-07-26 04:36:21 +00:00
|
|
|
|
|
|
|
assert(mtl == &ompi_mtl_mxm.super);
|
|
|
|
|
2013-04-12 16:37:42 +00:00
|
|
|
#if MXM_API < MXM_VERSION(2,0)
|
2011-07-26 04:36:21 +00:00
|
|
|
/* Allocate connection requests */
|
2013-04-12 16:37:42 +00:00
|
|
|
conn_reqs = calloc(nprocs, sizeof(mxm_conn_req_t));
|
|
|
|
ep_info = calloc(nprocs, sizeof(ompi_mtl_mxm_ep_conn_info_t));
|
2011-07-26 04:36:21 +00:00
|
|
|
if (NULL == conn_reqs || NULL == ep_info) {
|
|
|
|
rc = OMPI_ERR_OUT_OF_RESOURCE;
|
|
|
|
goto bail;
|
|
|
|
}
|
2013-04-12 16:37:42 +00:00
|
|
|
#endif
|
2011-07-26 04:36:21 +00:00
|
|
|
|
|
|
|
/* Get the EP connection requests for all the processes from modex */
|
|
|
|
for (i = 0; i < nprocs; ++i) {
|
2014-03-03 13:50:37 +00:00
|
|
|
if (NULL != procs[i]->proc_endpoints[OMPI_PROC_ENDPOINT_TAG_MTL]) {
|
|
|
|
continue; /* already connected to this endpoint */
|
|
|
|
}
|
2013-04-12 16:37:42 +00:00
|
|
|
rc = ompi_mtl_mxm_recv_ep_address(procs[i], &ep_address, &ep_address_len);
|
|
|
|
if (rc != OMPI_SUCCESS) {
|
|
|
|
goto bail;
|
2012-02-02 15:00:47 +00:00
|
|
|
}
|
2011-07-26 04:36:21 +00:00
|
|
|
|
2012-12-09 22:58:37 +00:00
|
|
|
#if MXM_API < MXM_VERSION(2,0)
|
2013-04-12 16:37:42 +00:00
|
|
|
if (ep_address_len != sizeof(ep_info[i])) {
|
|
|
|
MXM_ERROR("Invalid endpoint address length");
|
2015-02-24 17:52:08 +04:00
|
|
|
free(ep_address);
|
2013-04-12 16:37:42 +00:00
|
|
|
rc = OMPI_ERROR;
|
|
|
|
goto bail;
|
|
|
|
}
|
|
|
|
|
|
|
|
memcpy(&ep_info[i], ep_address, ep_address_len);
|
2015-02-24 17:52:08 +04:00
|
|
|
free(ep_address);
|
2014-03-03 13:50:37 +00:00
|
|
|
conn_reqs[ep_index].ptl_addr[MXM_PTL_SELF] = (struct sockaddr *)&(ep_info[i].ptl_addr[MXM_PTL_SELF]);
|
|
|
|
conn_reqs[ep_index].ptl_addr[MXM_PTL_SHM] = (struct sockaddr *)&(ep_info[i].ptl_addr[MXM_PTL_SHM]);
|
|
|
|
conn_reqs[ep_index].ptl_addr[MXM_PTL_RDMA] = (struct sockaddr *)&(ep_info[i].ptl_addr[MXM_PTL_RDMA]);
|
|
|
|
ep_index++;
|
2013-12-04 09:11:55 +00:00
|
|
|
|
2012-12-09 22:58:37 +00:00
|
|
|
#else
|
2013-08-30 16:54:55 +00:00
|
|
|
endpoint = OBJ_NEW(mca_mtl_mxm_endpoint_t);
|
|
|
|
endpoint->mtl_mxm_module = &ompi_mtl_mxm;
|
|
|
|
err = mxm_ep_connect(ompi_mtl_mxm.ep, ep_address, &endpoint->mxm_conn);
|
2015-02-24 17:52:08 +04:00
|
|
|
free(ep_address);
|
2013-04-12 16:37:42 +00:00
|
|
|
if (err != MXM_OK) {
|
|
|
|
MXM_ERROR("MXM returned connect error: %s\n", mxm_error_string(err));
|
|
|
|
rc = OMPI_ERROR;
|
|
|
|
goto bail;
|
|
|
|
}
|
2013-08-30 16:54:55 +00:00
|
|
|
procs[i]->proc_endpoints[OMPI_PROC_ENDPOINT_TAG_MTL] = endpoint;
|
2012-12-09 22:58:37 +00:00
|
|
|
#endif
|
2011-07-26 04:36:21 +00:00
|
|
|
}
|
|
|
|
|
2013-04-12 16:37:42 +00:00
|
|
|
#if MXM_API < MXM_VERSION(2,0)
|
2011-07-26 04:36:21 +00:00
|
|
|
/* Connect to remote peers */
|
2014-03-03 13:50:37 +00:00
|
|
|
err = mxm_ep_connect(ompi_mtl_mxm.ep, conn_reqs, ep_index, -1);
|
2011-07-26 04:36:21 +00:00
|
|
|
if (MXM_OK != err) {
|
|
|
|
MXM_ERROR("MXM returned connect error: %s\n", mxm_error_string(err));
|
2014-03-03 13:50:37 +00:00
|
|
|
for (i = 0; i < ep_index; ++i) {
|
2011-07-26 04:36:21 +00:00
|
|
|
if (MXM_OK != conn_reqs[i].error) {
|
2013-12-04 09:11:55 +00:00
|
|
|
MXM_ERROR("MXM EP connect to %s error: %s\n",
|
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
|
|
|
(NULL == procs[i]->super.proc_hostname) ?
|
|
|
|
"unknown" : procs[i]->proc_hostname,
|
2011-07-26 04:36:21 +00:00
|
|
|
mxm_error_string(conn_reqs[i].error));
|
|
|
|
}
|
|
|
|
}
|
2011-11-08 12:34:01 +00:00
|
|
|
rc = OMPI_ERROR;
|
2011-07-26 04:36:21 +00:00
|
|
|
goto bail;
|
|
|
|
}
|
|
|
|
|
|
|
|
/* Save returned connections */
|
2014-03-03 13:50:37 +00:00
|
|
|
for (i = 0; i < ep_index; ++i) {
|
2013-08-30 16:54:55 +00:00
|
|
|
endpoint = OBJ_NEW(mca_mtl_mxm_endpoint_t);
|
|
|
|
endpoint->mtl_mxm_module = &ompi_mtl_mxm;
|
|
|
|
endpoint->mxm_conn = conn_reqs[i].conn;
|
|
|
|
procs[i]->proc_endpoints[OMPI_PROC_ENDPOINT_TAG_MTL] = endpoint;
|
2011-07-26 04:36:21 +00:00
|
|
|
}
|
2013-12-04 09:11:55 +00:00
|
|
|
|
2013-04-12 16:37:42 +00:00
|
|
|
#endif
|
2013-12-04 09:11:55 +00:00
|
|
|
|
2014-07-17 08:35:55 +00:00
|
|
|
#if MXM_API >= MXM_VERSION(3,1)
|
|
|
|
if (ompi_mtl_mxm.bulk_connect) {
|
|
|
|
mxm_ep_wireup(ompi_mtl_mxm.ep);
|
|
|
|
}
|
|
|
|
#endif
|
|
|
|
|
2013-04-12 16:37:42 +00:00
|
|
|
rc = OMPI_SUCCESS;
|
2011-07-26 04:36:21 +00:00
|
|
|
|
|
|
|
bail:
|
2013-04-12 16:37:42 +00:00
|
|
|
#if MXM_API < MXM_VERSION(2,0)
|
|
|
|
free(conn_reqs);
|
|
|
|
free(ep_info);
|
|
|
|
#endif
|
2011-07-26 04:36:21 +00:00
|
|
|
return rc;
|
|
|
|
}
|
|
|
|
|
2014-09-03 18:22:11 +00:00
|
|
|
int ompi_mtl_add_single_proc(struct mca_mtl_base_module_t *mtl,
|
|
|
|
struct ompi_proc_t* procs)
|
|
|
|
{
|
2015-02-24 17:52:08 +04:00
|
|
|
void *ep_address = NULL;
|
2014-09-03 18:22:11 +00:00
|
|
|
size_t ep_address_len;
|
|
|
|
mxm_error_t err;
|
|
|
|
int rc;
|
|
|
|
mca_mtl_mxm_endpoint_t *endpoint;
|
|
|
|
|
|
|
|
assert(mtl == &ompi_mtl_mxm.super);
|
|
|
|
|
|
|
|
if (NULL != procs->proc_endpoints[OMPI_PROC_ENDPOINT_TAG_MTL]) {
|
|
|
|
return OMPI_SUCCESS;
|
|
|
|
}
|
|
|
|
rc = ompi_mtl_mxm_recv_ep_address(procs, &ep_address, &ep_address_len);
|
|
|
|
if (rc != OMPI_SUCCESS) {
|
|
|
|
return rc;
|
|
|
|
}
|
|
|
|
|
|
|
|
#if MXM_API < MXM_VERSION(2,0)
|
|
|
|
ompi_mtl_mxm_ep_conn_info_t ep_info;
|
|
|
|
mxm_conn_req_t conn_req;
|
|
|
|
|
|
|
|
if (ep_address_len != sizeof(ep_info)) {
|
|
|
|
MXM_ERROR("Invalid endpoint address length");
|
2015-02-24 17:52:08 +04:00
|
|
|
free(ep_address);
|
2014-09-03 18:22:11 +00:00
|
|
|
return OMPI_ERROR;
|
|
|
|
}
|
|
|
|
|
|
|
|
memcpy(&ep_info, ep_address, ep_address_len);
|
2015-02-24 17:52:08 +04:00
|
|
|
free(ep_address);
|
2014-09-03 18:22:11 +00:00
|
|
|
conn_req.ptl_addr[MXM_PTL_SELF] = (struct sockaddr *)&(ep_info.ptl_addr[MXM_PTL_SELF]);
|
|
|
|
conn_req.ptl_addr[MXM_PTL_SHM] = (struct sockaddr *)&(ep_info.ptl_addr[MXM_PTL_SHM]);
|
|
|
|
conn_req.ptl_addr[MXM_PTL_RDMA] = (struct sockaddr *)&(ep_info.ptl_addr[MXM_PTL_RDMA]);
|
|
|
|
|
|
|
|
/* Connect to remote peers */
|
|
|
|
err = mxm_ep_connect(ompi_mtl_mxm.ep, conn_req, 1, -1);
|
|
|
|
if (MXM_OK != err) {
|
|
|
|
MXM_ERROR("MXM returned connect error: %s\n", mxm_error_string(err));
|
|
|
|
if (MXM_OK != conn_req.error) {
|
|
|
|
MXM_ERROR("MXM EP connect to %s error: %s\n",
|
|
|
|
(NULL == procs->super.proc_hostname) ?
|
|
|
|
"unknown" : procs->proc_hostname,
|
|
|
|
mxm_error_string(conn_reqs.error));
|
|
|
|
}
|
|
|
|
return OMPI_ERROR;
|
|
|
|
}
|
|
|
|
|
|
|
|
/* Save returned connections */
|
|
|
|
endpoint = OBJ_NEW(mca_mtl_mxm_endpoint_t);
|
|
|
|
endpoint->mtl_mxm_module = &ompi_mtl_mxm;
|
|
|
|
endpoint->mxm_conn = conn_reqs.conn;
|
|
|
|
procs->proc_endpoints[OMPI_PROC_ENDPOINT_TAG_MTL] = endpoint;
|
|
|
|
#else
|
|
|
|
endpoint = OBJ_NEW(mca_mtl_mxm_endpoint_t);
|
|
|
|
endpoint->mtl_mxm_module = &ompi_mtl_mxm;
|
|
|
|
err = mxm_ep_connect(ompi_mtl_mxm.ep, ep_address, &endpoint->mxm_conn);
|
2015-02-24 17:52:08 +04:00
|
|
|
free(ep_address);
|
2014-09-03 18:22:11 +00:00
|
|
|
if (err != MXM_OK) {
|
|
|
|
MXM_ERROR("MXM returned connect error: %s\n", mxm_error_string(err));
|
|
|
|
return OMPI_ERROR;
|
|
|
|
}
|
|
|
|
procs->proc_endpoints[OMPI_PROC_ENDPOINT_TAG_MTL] = endpoint;
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#if MXM_API >= MXM_VERSION(3,1)
|
|
|
|
if (ompi_mtl_mxm.bulk_connect) {
|
|
|
|
mxm_ep_wireup(ompi_mtl_mxm.ep);
|
|
|
|
}
|
|
|
|
#endif
|
|
|
|
return OMPI_SUCCESS;
|
|
|
|
}
|
|
|
|
|
2011-07-26 04:36:21 +00:00
|
|
|
int ompi_mtl_mxm_del_procs(struct mca_mtl_base_module_t *mtl, size_t nprocs,
|
2013-08-30 16:54:55 +00:00
|
|
|
struct ompi_proc_t** procs)
|
2011-07-26 04:36:21 +00:00
|
|
|
{
|
|
|
|
size_t i;
|
|
|
|
|
2014-07-17 08:35:55 +00:00
|
|
|
#if MXM_API >= MXM_VERSION(3,1)
|
2014-08-11 11:52:23 +00:00
|
|
|
if (ompi_mtl_mxm.bulk_disconnect) {
|
|
|
|
size_t nprocs_world;
|
2015-03-12 11:49:22 +02:00
|
|
|
ompi_proc_t **procs;
|
|
|
|
procs = ompi_proc_world(&nprocs_world);
|
2014-08-11 11:52:23 +00:00
|
|
|
if (nprocs == nprocs_world) {
|
|
|
|
mxm_ep_powerdown(ompi_mtl_mxm.ep);
|
|
|
|
}
|
2015-03-12 11:49:22 +02:00
|
|
|
free(procs);
|
2014-07-17 08:35:55 +00:00
|
|
|
}
|
|
|
|
#endif
|
|
|
|
|
2014-03-11 15:57:11 +00:00
|
|
|
/* XXX: Directly accessing the obj_reference_count is an abstraction
|
|
|
|
* violation of the object system. We know this needs to be fixed, but
|
|
|
|
* are deferring the fix to a later time as it involves a design issue
|
|
|
|
* in the way we handle endpoints as objects
|
|
|
|
*/
|
2011-07-26 04:36:21 +00:00
|
|
|
for (i = 0; i < nprocs; ++i) {
|
2014-05-01 22:17:09 +00:00
|
|
|
mca_mtl_mxm_endpoint_t *endpoint = (mca_mtl_mxm_endpoint_t*)
|
|
|
|
procs[i]->proc_endpoints[OMPI_PROC_ENDPOINT_TAG_MTL];
|
2014-09-03 18:22:11 +00:00
|
|
|
if (endpoint) {
|
|
|
|
mxm_ep_disconnect(endpoint->mxm_conn);
|
|
|
|
OBJ_RELEASE(endpoint);
|
|
|
|
}
|
2011-07-26 04:36:21 +00:00
|
|
|
}
|
2015-03-02 12:56:02 +02:00
|
|
|
opal_pmix.fence(NULL, 0);
|
2011-07-26 04:36:21 +00:00
|
|
|
return OMPI_SUCCESS;
|
|
|
|
}
|
|
|
|
|
|
|
|
int ompi_mtl_mxm_add_comm(struct mca_mtl_base_module_t *mtl,
|
|
|
|
struct ompi_communicator_t *comm)
|
|
|
|
{
|
|
|
|
mxm_error_t err;
|
|
|
|
mxm_mq_h mq;
|
|
|
|
|
|
|
|
assert(mtl == &ompi_mtl_mxm.super);
|
|
|
|
assert(NULL != ompi_mtl_mxm.mxm_context);
|
|
|
|
|
|
|
|
err = mxm_mq_create(ompi_mtl_mxm.mxm_context, comm->c_contextid, &mq);
|
|
|
|
if (MXM_OK != err) {
|
2013-02-12 21:10:11 +00:00
|
|
|
opal_show_help("help-mtl-mxm.txt", "mxm mq create", true, mxm_error_string(err));
|
2011-07-26 04:36:21 +00:00
|
|
|
return OMPI_ERROR;
|
|
|
|
}
|
|
|
|
|
|
|
|
comm->c_pml_comm = (void*)mq;
|
|
|
|
return OMPI_SUCCESS;
|
|
|
|
}
|
|
|
|
|
|
|
|
int ompi_mtl_mxm_del_comm(struct mca_mtl_base_module_t *mtl,
|
|
|
|
struct ompi_communicator_t *comm)
|
|
|
|
{
|
|
|
|
assert(mtl == &ompi_mtl_mxm.super);
|
|
|
|
if (NULL != ompi_mtl_mxm.mxm_context) {
|
|
|
|
mxm_mq_destroy((mxm_mq_h)comm->c_pml_comm);
|
|
|
|
}
|
|
|
|
return OMPI_SUCCESS;
|
|
|
|
}
|
|
|
|
|
|
|
|
int ompi_mtl_mxm_progress(void)
|
|
|
|
{
|
|
|
|
mxm_error_t err;
|
|
|
|
|
|
|
|
err = mxm_progress(ompi_mtl_mxm.mxm_context);
|
|
|
|
if ((MXM_OK != err) && (MXM_ERR_NO_PROGRESS != err) ) {
|
2013-02-12 21:10:11 +00:00
|
|
|
opal_show_help("help-mtl-mxm.txt", "errors during mxm_progress", true, mxm_error_string(err));
|
2011-07-26 04:36:21 +00:00
|
|
|
}
|
|
|
|
return 1;
|
|
|
|
}
|
2012-07-25 13:26:40 +00:00
|
|
|
|
2013-05-14 12:27:44 +00:00
|
|
|
#if MXM_API >= MXM_VERSION(2,0)
|
|
|
|
static void ompi_mtl_mxm_mem_release_cb(void *buf, size_t length,
|
|
|
|
void *cbdata, bool from_alloc)
|
|
|
|
{
|
|
|
|
mxm_mem_unmap(ompi_mtl_mxm.mxm_context, buf, length,
|
|
|
|
from_alloc ? MXM_MEM_UNMAP_MARK_INVALID : 0);
|
|
|
|
}
|
|
|
|
#endif
|
|
|
|
|
2012-07-25 13:26:40 +00:00
|
|
|
OBJ_CLASS_INSTANCE(
|
|
|
|
ompi_mtl_mxm_message_t,
|
2015-02-19 13:41:41 -07:00
|
|
|
opal_free_list_item_t,
|
2012-07-25 13:26:40 +00:00
|
|
|
NULL,
|
|
|
|
NULL);
|