2007-12-21 09:02:00 +03:00
|
|
|
/* -*- Mode: C; c-basic-offset:4 ; -*- */
|
2004-01-30 06:54:52 +03:00
|
|
|
/*
|
2010-03-13 02:57:50 +03:00
|
|
|
* Copyright (c) 2004-2010 The Trustees of Indiana University and Indiana
|
2005-11-05 22:57:48 +03:00
|
|
|
* University Research and Technology
|
|
|
|
* Corporation. All rights reserved.
|
2007-12-21 09:02:00 +03:00
|
|
|
* Copyright (c) 2004-2007 The University of Tennessee and The University
|
2005-11-05 22:57:48 +03:00
|
|
|
* of Tennessee Research Foundation. All rights
|
|
|
|
* reserved.
|
2015-02-06 22:27:23 +03:00
|
|
|
* Copyright (c) 2004-2005 High Performance Computing Center Stuttgart,
|
2004-11-28 23:09:25 +03:00
|
|
|
* University of Stuttgart. All rights reserved.
|
2005-03-24 15:43:37 +03:00
|
|
|
* Copyright (c) 2004-2005 The Regents of the University of California.
|
|
|
|
* All rights reserved.
|
2012-04-06 18:23:13 +04:00
|
|
|
* Copyright (c) 2012 Los Alamos National Security, LLC. All rights
|
2015-02-06 22:27:23 +03:00
|
|
|
* reserved.
|
Per the PMIx RFC:
WHAT: Merge the PMIx branch into the devel repo, creating a new
OPAL “lmix” framework to abstract PMI support for all RTEs.
Replace the ORTE daemon-level collectives with a new PMIx
server and update the ORTE grpcomm framework to support
server-to-server collectives
WHY: We’ve had problems dealing with variations in PMI implementations,
and need to extend the existing PMI definitions to meet exascale
requirements.
WHEN: Mon, Aug 25
WHERE: https://github.com/rhc54/ompi-svn-mirror.git
Several community members have been working on a refactoring of the current PMI support within OMPI. Although the APIs are common, Slurm and Cray implement a different range of capabilities, and package them differently. For example, Cray provides an integrated PMI-1/2 library, while Slurm separates the two and requires the user to specify the one to be used at runtime. In addition, several bugs in the Slurm implementations have caused problems requiring extra coding.
All this has led to a slew of #if’s in the PMI code and bugs when the corner-case logic for one implementation accidentally traps the other. Extending this support to other implementations would have increased this complexity to an unacceptable level.
Accordingly, we have:
* created a new OPAL “pmix” framework to abstract the PMI support, with separate components for Cray, Slurm PMI-1, and Slurm PMI-2 implementations.
* Replaced the current ORTE grpcomm daemon-based collective operation with an integrated PMIx server, and updated the grpcomm APIs to provide more flexible, multi-algorithm support for collective operations. At this time, only the xcast and allgather operations are supported.
* Replaced the current global collective id with a signature based on the names of the participating procs. The allows an unlimited number of collectives to be executed by any group of processes, subject to the requirement that only one collective can be active at a time for a unique combination of procs. Note that a proc can be involved in any number of simultaneous collectives - it is the specific combination of procs that is subject to the constraint
* removed the prior OMPI/OPAL modex code
* added new macros for executing modex send/recv to simplify use of the new APIs. The send macros allow the caller to specify whether or not the BTL supports async modex operations - if so, then the non-blocking “fence” operation is used, if the active PMIx component supports it. Otherwise, the default is a full blocking modex exchange as we currently perform.
* retained the current flag that directs us to use a blocking fence operation, but only to retrieve data upon demand
This commit was SVN r32570.
2014-08-21 22:56:47 +04:00
|
|
|
* Copyright (c) 2013-2014 Intel, Inc. All rights reserved
|
2015-02-06 22:26:44 +03:00
|
|
|
* Copyright (c) 2015 Cisco Systems, Inc. All rights reserved.
|
2004-11-22 04:38:40 +03:00
|
|
|
* $COPYRIGHT$
|
2015-02-06 22:27:23 +03:00
|
|
|
*
|
2004-11-22 04:38:40 +03:00
|
|
|
* Additional copyrights may follow
|
2015-02-06 22:27:23 +03:00
|
|
|
*
|
2004-01-30 06:54:52 +03:00
|
|
|
* $HEADER$
|
|
|
|
*/
|
|
|
|
|
2004-06-07 19:33:53 +04:00
|
|
|
#include "ompi_config.h"
|
2004-01-30 06:54:52 +03:00
|
|
|
|
2009-03-13 05:10:32 +03:00
|
|
|
#include <string.h>
|
|
|
|
|
2005-07-03 20:22:16 +04:00
|
|
|
#include "opal/class/opal_list.h"
|
2009-02-14 05:26:12 +03:00
|
|
|
#include "opal/util/output.h"
|
2013-02-13 01:10:11 +04:00
|
|
|
#include "opal/util/show_help.h"
|
2005-09-13 00:22:59 +04:00
|
|
|
#include "opal/runtime/opal_progress.h"
|
2015-03-06 06:50:44 +03:00
|
|
|
#include "ompi/mca/mca.h"
|
2005-09-14 13:37:20 +04:00
|
|
|
#include "opal/mca/base/base.h"
|
2008-12-10 02:49:02 +03:00
|
|
|
#include "opal/runtime/opal.h"
|
Per the PMIx RFC:
WHAT: Merge the PMIx branch into the devel repo, creating a new
OPAL “lmix” framework to abstract PMI support for all RTEs.
Replace the ORTE daemon-level collectives with a new PMIx
server and update the ORTE grpcomm framework to support
server-to-server collectives
WHY: We’ve had problems dealing with variations in PMI implementations,
and need to extend the existing PMI definitions to meet exascale
requirements.
WHEN: Mon, Aug 25
WHERE: https://github.com/rhc54/ompi-svn-mirror.git
Several community members have been working on a refactoring of the current PMI support within OMPI. Although the APIs are common, Slurm and Cray implement a different range of capabilities, and package them differently. For example, Cray provides an integrated PMI-1/2 library, while Slurm separates the two and requires the user to specify the one to be used at runtime. In addition, several bugs in the Slurm implementations have caused problems requiring extra coding.
All this has led to a slew of #if’s in the PMI code and bugs when the corner-case logic for one implementation accidentally traps the other. Extending this support to other implementations would have increased this complexity to an unacceptable level.
Accordingly, we have:
* created a new OPAL “pmix” framework to abstract the PMI support, with separate components for Cray, Slurm PMI-1, and Slurm PMI-2 implementations.
* Replaced the current ORTE grpcomm daemon-based collective operation with an integrated PMIx server, and updated the grpcomm APIs to provide more flexible, multi-algorithm support for collective operations. At this time, only the xcast and allgather operations are supported.
* Replaced the current global collective id with a signature based on the names of the participating procs. The allows an unlimited number of collectives to be executed by any group of processes, subject to the requirement that only one collective can be active at a time for a unique combination of procs. Note that a proc can be involved in any number of simultaneous collectives - it is the specific combination of procs that is subject to the constraint
* removed the prior OMPI/OPAL modex code
* added new macros for executing modex send/recv to simplify use of the new APIs. The send macros allow the caller to specify whether or not the BTL supports async modex operations - if so, then the non-blocking “fence” operation is used, if the active PMIx component supports it. Otherwise, the default is a full blocking modex exchange as we currently perform.
* retained the current flag that directs us to use a blocking fence operation, but only to retrieve data upon demand
This commit was SVN r32570.
2014-08-21 22:56:47 +04:00
|
|
|
#include "opal/mca/pmix/pmix.h"
|
2008-02-28 04:57:57 +03:00
|
|
|
|
2006-02-12 04:33:29 +03:00
|
|
|
#include "ompi/constants.h"
|
2005-09-14 13:37:20 +04:00
|
|
|
#include "ompi/mca/pml/pml.h"
|
|
|
|
#include "ompi/mca/pml/base/base.h"
|
2007-02-09 19:38:16 +03:00
|
|
|
#include "ompi/proc/proc.h"
|
2004-01-30 06:54:52 +03:00
|
|
|
|
2004-08-02 04:24:22 +04:00
|
|
|
typedef struct opened_component_t {
|
2005-07-03 20:22:16 +04:00
|
|
|
opal_list_item_t super;
|
2004-08-02 04:24:22 +04:00
|
|
|
mca_pml_base_component_t *om_component;
|
|
|
|
} opened_component_t;
|
2004-01-30 06:54:52 +03:00
|
|
|
|
2008-06-26 17:22:48 +04:00
|
|
|
static bool modex_reqd=false;
|
|
|
|
|
2004-01-30 06:54:52 +03:00
|
|
|
/**
|
2004-08-02 04:24:22 +04:00
|
|
|
* Function for selecting one component from all those that are
|
2004-01-30 06:54:52 +03:00
|
|
|
* available.
|
|
|
|
*
|
2004-08-02 04:24:22 +04:00
|
|
|
* Call the init function on all available components and get their
|
|
|
|
* priorities. Select the component with the highest priority. All
|
|
|
|
* other components will be closed and unloaded. The selected component
|
2004-01-31 02:00:48 +03:00
|
|
|
* will have all of its function pointers saved and returned to the
|
|
|
|
* caller.
|
2004-01-30 06:54:52 +03:00
|
|
|
*/
|
2005-03-27 17:05:23 +04:00
|
|
|
int mca_pml_base_select(bool enable_progress_threads,
|
|
|
|
bool enable_mpi_threads)
|
2004-01-30 06:54:52 +03:00
|
|
|
{
|
2008-06-26 17:22:48 +04:00
|
|
|
int i, priority = 0, best_priority = 0, num_pml = 0;
|
2005-07-03 20:22:16 +04:00
|
|
|
opal_list_item_t *item = NULL;
|
2005-06-20 20:40:12 +04:00
|
|
|
mca_base_component_list_item_t *cli = NULL;
|
|
|
|
mca_pml_base_component_t *component = NULL, *best_component = NULL;
|
|
|
|
mca_pml_base_module_t *module = NULL, *best_module = NULL;
|
2005-07-03 20:22:16 +04:00
|
|
|
opal_list_t opened;
|
2005-06-20 20:40:12 +04:00
|
|
|
opened_component_t *om = NULL;
|
2007-02-03 05:32:00 +03:00
|
|
|
bool found_pml;
|
2010-03-13 02:57:50 +03:00
|
|
|
#if OPAL_ENABLE_FT_CR == 1
|
2007-04-24 21:08:48 +04:00
|
|
|
mca_pml_base_component_t *wrapper_component = NULL;
|
|
|
|
int wrapper_priority = -1;
|
|
|
|
#endif
|
2007-02-21 19:18:43 +03:00
|
|
|
|
2005-06-20 20:40:12 +04:00
|
|
|
/* Traverse the list of available components; call their init
|
|
|
|
functions. */
|
|
|
|
|
|
|
|
best_priority = -1;
|
|
|
|
best_component = NULL;
|
|
|
|
module = NULL;
|
2005-07-03 20:22:16 +04:00
|
|
|
OBJ_CONSTRUCT(&opened, opal_list_t);
|
2013-03-28 01:17:31 +04:00
|
|
|
OPAL_LIST_FOREACH(cli, &ompi_pml_base_framework.framework_components, mca_base_component_list_item_t) {
|
2005-06-20 20:40:12 +04:00
|
|
|
component = (mca_pml_base_component_t *) cli->cli_component;
|
2007-02-21 19:18:43 +03:00
|
|
|
|
2005-06-20 20:40:12 +04:00
|
|
|
/* if there is an include list - item must be in the list to be included */
|
2007-02-03 05:32:00 +03:00
|
|
|
found_pml = false;
|
2015-02-06 22:27:23 +03:00
|
|
|
for( i = 0; i < opal_pointer_array_get_size(&mca_pml_base_pml); i++) {
|
2007-02-21 19:18:43 +03:00
|
|
|
char * tmp_val = NULL;
|
2007-12-21 09:02:00 +03:00
|
|
|
tmp_val = (char *) opal_pointer_array_get_item(&mca_pml_base_pml, i);
|
2007-02-21 19:18:43 +03:00
|
|
|
if( NULL == tmp_val) {
|
|
|
|
continue;
|
|
|
|
}
|
|
|
|
|
2015-02-06 22:27:23 +03:00
|
|
|
if(0 == strncmp(component->pmlm_version.mca_component_name,
|
2007-02-21 19:18:43 +03:00
|
|
|
tmp_val, strlen(component->pmlm_version.mca_component_name)) ) {
|
2007-02-03 05:32:00 +03:00
|
|
|
found_pml = true;
|
2007-04-05 17:52:05 +04:00
|
|
|
break;
|
2007-02-03 05:01:18 +03:00
|
|
|
}
|
|
|
|
}
|
2007-02-21 19:18:43 +03:00
|
|
|
|
2015-02-06 22:27:23 +03:00
|
|
|
if(!found_pml && opal_pointer_array_get_size(&mca_pml_base_pml)) {
|
2013-03-28 01:17:31 +04:00
|
|
|
opal_output_verbose( 10, ompi_pml_base_framework.framework_output,
|
2007-02-03 05:32:00 +03:00
|
|
|
"select: component %s not in the include list",
|
|
|
|
component->pmlm_version.mca_component_name );
|
2015-02-06 22:27:23 +03:00
|
|
|
|
2005-06-20 20:40:12 +04:00
|
|
|
continue;
|
2005-07-12 09:40:56 +04:00
|
|
|
}
|
2007-02-21 19:18:43 +03:00
|
|
|
|
|
|
|
/* if there is no init function - ignore it */
|
2005-06-20 20:40:12 +04:00
|
|
|
if (NULL == component->pmlm_init) {
|
2013-03-28 01:17:31 +04:00
|
|
|
opal_output_verbose( 10, ompi_pml_base_framework.framework_output,
|
2005-07-12 09:40:56 +04:00
|
|
|
"select: no init function; ignoring component %s",
|
|
|
|
component->pmlm_version.mca_component_name );
|
|
|
|
continue;
|
2004-01-30 06:54:52 +03:00
|
|
|
}
|
2007-02-21 19:18:43 +03:00
|
|
|
|
2008-06-26 17:22:48 +04:00
|
|
|
/* this is a pml that could be considered */
|
|
|
|
num_pml++;
|
|
|
|
|
2007-02-21 19:18:43 +03:00
|
|
|
/* Init component to get its priority */
|
2015-02-06 22:27:23 +03:00
|
|
|
opal_output_verbose( 10, ompi_pml_base_framework.framework_output,
|
2005-07-12 09:40:56 +04:00
|
|
|
"select: initializing %s component %s",
|
|
|
|
component->pmlm_version.mca_type_name,
|
|
|
|
component->pmlm_version.mca_component_name );
|
2007-02-03 05:01:18 +03:00
|
|
|
priority = best_priority;
|
2005-07-12 09:40:56 +04:00
|
|
|
module = component->pmlm_init(&priority, enable_progress_threads,
|
|
|
|
enable_mpi_threads);
|
|
|
|
if (NULL == module) {
|
2013-03-28 01:17:31 +04:00
|
|
|
opal_output_verbose( 10, ompi_pml_base_framework.framework_output,
|
2005-07-12 09:40:56 +04:00
|
|
|
"select: init returned failure for component %s",
|
|
|
|
component->pmlm_version.mca_component_name );
|
|
|
|
continue;
|
|
|
|
}
|
2007-02-21 19:18:43 +03:00
|
|
|
|
2013-03-28 01:17:31 +04:00
|
|
|
opal_output_verbose( 10, ompi_pml_base_framework.framework_output,
|
2005-07-12 09:40:56 +04:00
|
|
|
"select: init returned priority %d", priority );
|
2010-03-13 02:57:50 +03:00
|
|
|
#if OPAL_ENABLE_FT_CR == 1
|
2007-03-17 02:11:45 +03:00
|
|
|
/* Determine if this is the wrapper component */
|
|
|
|
if( priority <= PML_SELECT_WRAPPER_PRIORITY) {
|
2013-03-28 01:17:31 +04:00
|
|
|
opal_output_verbose( 10, ompi_pml_base_framework.framework_output,
|
2007-03-17 02:11:45 +03:00
|
|
|
"pml:select: Wrapper Component: Component %s was determined to be a Wrapper PML with priority %d",
|
|
|
|
component->pmlm_version.mca_component_name, priority );
|
|
|
|
wrapper_priority = priority;
|
|
|
|
wrapper_component = component;
|
|
|
|
continue;
|
|
|
|
}
|
|
|
|
/* Otherwise determine if this is the best component */
|
2015-02-06 22:27:23 +03:00
|
|
|
else
|
2007-04-24 21:08:48 +04:00
|
|
|
#endif
|
|
|
|
if (priority > best_priority) {
|
2005-07-12 09:40:56 +04:00
|
|
|
best_priority = priority;
|
|
|
|
best_component = component;
|
|
|
|
best_module = module;
|
|
|
|
}
|
2015-02-06 22:27:23 +03:00
|
|
|
|
2006-08-24 20:38:08 +04:00
|
|
|
om = (opened_component_t*)malloc(sizeof(opened_component_t));
|
2005-07-12 09:40:56 +04:00
|
|
|
if (NULL == om) {
|
|
|
|
return OMPI_ERR_OUT_OF_RESOURCE;
|
|
|
|
}
|
|
|
|
OBJ_CONSTRUCT(om, opal_list_item_t);
|
|
|
|
om->om_component = component;
|
|
|
|
opal_list_append(&opened, (opal_list_item_t*) om);
|
2004-01-30 06:54:52 +03:00
|
|
|
}
|
|
|
|
|
2005-07-12 09:40:56 +04:00
|
|
|
/* Finished querying all components. Check for the bozo case. */
|
2015-02-06 22:27:23 +03:00
|
|
|
|
2005-07-12 09:40:56 +04:00
|
|
|
if( NULL == best_component ) {
|
2015-02-06 22:26:44 +03:00
|
|
|
opal_show_help("help-mca-base.txt", "find-available:none found",
|
|
|
|
true, "pml",
|
|
|
|
opal_process_info.nodename,
|
|
|
|
"pml");
|
2015-02-06 22:27:23 +03:00
|
|
|
for( i = 0; i < opal_pointer_array_get_size(&mca_pml_base_pml); i++) {
|
2007-02-21 19:18:43 +03:00
|
|
|
char * tmp_val = NULL;
|
2007-12-21 09:02:00 +03:00
|
|
|
tmp_val = (char *) opal_pointer_array_get_item(&mca_pml_base_pml, i);
|
2007-02-21 19:18:43 +03:00
|
|
|
if( NULL == tmp_val) {
|
|
|
|
continue;
|
|
|
|
}
|
2013-01-28 03:25:10 +04:00
|
|
|
ompi_rte_abort(1, "PML %s cannot be selected", tmp_val);
|
2007-02-03 05:01:18 +03:00
|
|
|
}
|
2015-02-06 22:27:23 +03:00
|
|
|
if(0 == i) {
|
2013-01-28 03:25:10 +04:00
|
|
|
ompi_rte_abort(2, "No pml component available. This shouldn't happen.");
|
2005-07-12 23:30:51 +04:00
|
|
|
}
|
2015-02-06 22:27:23 +03:00
|
|
|
}
|
|
|
|
|
2013-03-28 01:17:31 +04:00
|
|
|
opal_output_verbose( 10, ompi_pml_base_framework.framework_output,
|
2015-02-06 22:27:23 +03:00
|
|
|
"selected %s best priority %d\n",
|
2007-02-03 05:01:18 +03:00
|
|
|
best_component->pmlm_version.mca_component_name, best_priority);
|
2015-02-06 22:27:23 +03:00
|
|
|
|
2008-06-26 17:22:48 +04:00
|
|
|
/* if more than one PML could be considered, then we still need the
|
|
|
|
* modex since we cannot know which one will be selected on all procs
|
|
|
|
*/
|
|
|
|
if (1 < num_pml) {
|
|
|
|
modex_reqd = true;
|
|
|
|
}
|
2015-02-06 22:27:23 +03:00
|
|
|
|
2005-07-12 09:40:56 +04:00
|
|
|
/* Finalize all non-selected components */
|
2004-01-30 06:54:52 +03:00
|
|
|
|
2005-07-12 09:40:56 +04:00
|
|
|
for (item = opal_list_remove_first(&opened);
|
|
|
|
NULL != item;
|
|
|
|
item = opal_list_remove_first(&opened)) {
|
|
|
|
om = (opened_component_t *) item;
|
2007-04-24 21:08:48 +04:00
|
|
|
|
|
|
|
if (om->om_component != best_component
|
2010-03-13 02:57:50 +03:00
|
|
|
#if OPAL_ENABLE_FT_CR == 1
|
2007-04-24 21:08:48 +04:00
|
|
|
&& om->om_component != wrapper_component
|
|
|
|
#endif
|
|
|
|
) {
|
2007-03-17 19:33:43 +03:00
|
|
|
/* Finalize */
|
2015-02-06 22:27:23 +03:00
|
|
|
|
2007-03-17 19:33:43 +03:00
|
|
|
if (NULL != om->om_component->pmlm_finalize) {
|
2015-02-06 22:27:23 +03:00
|
|
|
|
2007-03-17 19:33:43 +03:00
|
|
|
/* Blatently ignore the return code (what would we do to
|
|
|
|
recover, anyway? This component is going away, so errors
|
|
|
|
don't matter anymore) */
|
2015-02-06 22:27:23 +03:00
|
|
|
|
2007-03-17 19:33:43 +03:00
|
|
|
om->om_component->pmlm_finalize();
|
2015-02-06 22:27:23 +03:00
|
|
|
opal_output_verbose(10, ompi_pml_base_framework.framework_output,
|
2007-03-17 19:33:43 +03:00
|
|
|
"select: component %s not selected / finalized",
|
|
|
|
om->om_component->pmlm_version.mca_component_name);
|
2005-07-12 09:40:56 +04:00
|
|
|
}
|
|
|
|
}
|
|
|
|
OBJ_DESTRUCT( om );
|
|
|
|
free(om);
|
2004-01-30 06:54:52 +03:00
|
|
|
}
|
2005-07-12 09:40:56 +04:00
|
|
|
OBJ_DESTRUCT( &opened );
|
2007-03-17 02:11:45 +03:00
|
|
|
|
2010-03-13 02:57:50 +03:00
|
|
|
#if OPAL_ENABLE_FT_CR == 1
|
2013-03-28 01:17:31 +04:00
|
|
|
/* Remove the wrapper component from the ompi_pml_base_framework.framework_components list
|
2007-03-17 02:11:45 +03:00
|
|
|
* so we don't unload it prematurely in the next call
|
|
|
|
*/
|
|
|
|
if( NULL != wrapper_component ) {
|
2013-03-28 01:17:31 +04:00
|
|
|
OPAL_LIST_FOREACH(cli, &ompi_pml_base_framework.framework_components, mca_base_component_list_item_t) {
|
2007-03-17 02:11:45 +03:00
|
|
|
component = (mca_pml_base_component_t *) cli->cli_component;
|
2015-02-06 22:27:23 +03:00
|
|
|
|
2007-03-17 02:11:45 +03:00
|
|
|
if( component == wrapper_component ) {
|
2013-03-28 01:17:31 +04:00
|
|
|
opal_list_remove_item(&ompi_pml_base_framework.framework_components, item);
|
2007-03-17 02:11:45 +03:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
2007-04-24 21:08:48 +04:00
|
|
|
#endif
|
2007-03-17 02:11:45 +03:00
|
|
|
|
2005-07-12 09:40:56 +04:00
|
|
|
/* Save the winner */
|
|
|
|
|
|
|
|
mca_pml_base_selected_component = *best_component;
|
|
|
|
mca_pml = *best_module;
|
2015-02-06 22:27:23 +03:00
|
|
|
opal_output_verbose( 10, ompi_pml_base_framework.framework_output,
|
2005-07-12 09:40:56 +04:00
|
|
|
"select: component %s selected",
|
2007-08-16 09:46:11 +04:00
|
|
|
mca_pml_base_selected_component.pmlm_version.mca_component_name );
|
2007-03-17 02:11:45 +03:00
|
|
|
|
2007-08-03 06:23:24 +04:00
|
|
|
/* This base function closes, unloads, and removes from the
|
|
|
|
available list all unselected components. The available list will
|
|
|
|
contain only the selected component. */
|
|
|
|
|
2015-02-06 22:27:23 +03:00
|
|
|
mca_base_components_close(ompi_pml_base_framework.framework_output,
|
|
|
|
&ompi_pml_base_framework.framework_components,
|
2007-08-03 06:23:24 +04:00
|
|
|
(mca_base_component_t *) best_component);
|
2015-02-06 22:27:23 +03:00
|
|
|
|
2010-03-13 02:57:50 +03:00
|
|
|
#if OPAL_ENABLE_FT_CR == 1
|
2007-03-17 02:11:45 +03:00
|
|
|
/* If we have a wrapper then initalize it */
|
|
|
|
if( NULL != wrapper_component ) {
|
|
|
|
priority = PML_SELECT_WRAPPER_PRIORITY;
|
2013-03-28 01:17:31 +04:00
|
|
|
opal_output_verbose( 10, ompi_pml_base_framework.framework_output,
|
2015-02-06 22:27:23 +03:00
|
|
|
"pml:select: Wrapping: Component %s [%d] is being wrapped by component %s [%d]",
|
2007-03-17 02:11:45 +03:00
|
|
|
mca_pml_base_selected_component.pmlm_version.mca_component_name,
|
|
|
|
best_priority,
|
|
|
|
wrapper_component->pmlm_version.mca_component_name,
|
|
|
|
wrapper_priority );
|
|
|
|
|
|
|
|
/* Ask the wrapper commponent to wrap around the currently
|
|
|
|
* selected component. Indicated by the priority value provided
|
|
|
|
* this will cause the wrapper to do something different this time around
|
|
|
|
*/
|
|
|
|
module = wrapper_component->pmlm_init(&priority,
|
|
|
|
enable_progress_threads,
|
|
|
|
enable_mpi_threads);
|
|
|
|
/* Replace with the wrapper */
|
|
|
|
best_component = wrapper_component;
|
|
|
|
mca_pml_base_selected_component = *best_component;
|
|
|
|
best_module = module;
|
|
|
|
mca_pml = *best_module;
|
|
|
|
}
|
2007-04-24 21:08:48 +04:00
|
|
|
#endif
|
2007-03-17 02:11:45 +03:00
|
|
|
|
2005-07-12 09:40:56 +04:00
|
|
|
/* register the winner's callback */
|
2007-10-10 03:28:53 +04:00
|
|
|
if( NULL != mca_pml.pml_progress ) {
|
|
|
|
opal_progress_register(mca_pml.pml_progress);
|
|
|
|
}
|
2007-02-09 19:38:16 +03:00
|
|
|
|
|
|
|
/* register winner in the modex */
|
2013-01-28 03:25:10 +04:00
|
|
|
if (modex_reqd && 0 == OMPI_PROC_MY_NAME->vpid) {
|
2008-06-26 17:22:48 +04:00
|
|
|
mca_pml_base_pml_selected(best_component->pmlm_version.mca_component_name);
|
|
|
|
}
|
2007-02-09 19:38:16 +03:00
|
|
|
|
2005-07-12 09:40:56 +04:00
|
|
|
/* All done */
|
|
|
|
|
|
|
|
return OMPI_SUCCESS;
|
2004-01-30 06:54:52 +03:00
|
|
|
}
|
2007-02-09 19:38:16 +03:00
|
|
|
|
|
|
|
/* need a "commonly" named PML structure so everything ends up in the
|
|
|
|
same modex field */
|
|
|
|
static mca_base_component_t pml_base_component = {
|
2015-03-06 06:50:44 +03:00
|
|
|
OMPI_MCA_BASE_VERSION_2_1_0("pml", 2, 0, 0),
|
|
|
|
.mca_component_name = "base",
|
|
|
|
.mca_component_major_version = 2,
|
|
|
|
.mca_component_minor_version = 0,
|
|
|
|
.mca_component_release_version = 0,
|
2007-02-09 19:38:16 +03:00
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
int
|
|
|
|
mca_pml_base_pml_selected(const char *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 22:56:47 +04:00
|
|
|
int rc;
|
|
|
|
|
2015-06-18 19:53:20 +03:00
|
|
|
OPAL_MODEX_SEND(rc, OPAL_PMIX_GLOBAL, &pml_base_component, name, strlen(name) + 1);
|
Per the PMIx RFC:
WHAT: Merge the PMIx branch into the devel repo, creating a new
OPAL “lmix” framework to abstract PMI support for all RTEs.
Replace the ORTE daemon-level collectives with a new PMIx
server and update the ORTE grpcomm framework to support
server-to-server collectives
WHY: We’ve had problems dealing with variations in PMI implementations,
and need to extend the existing PMI definitions to meet exascale
requirements.
WHEN: Mon, Aug 25
WHERE: https://github.com/rhc54/ompi-svn-mirror.git
Several community members have been working on a refactoring of the current PMI support within OMPI. Although the APIs are common, Slurm and Cray implement a different range of capabilities, and package them differently. For example, Cray provides an integrated PMI-1/2 library, while Slurm separates the two and requires the user to specify the one to be used at runtime. In addition, several bugs in the Slurm implementations have caused problems requiring extra coding.
All this has led to a slew of #if’s in the PMI code and bugs when the corner-case logic for one implementation accidentally traps the other. Extending this support to other implementations would have increased this complexity to an unacceptable level.
Accordingly, we have:
* created a new OPAL “pmix” framework to abstract the PMI support, with separate components for Cray, Slurm PMI-1, and Slurm PMI-2 implementations.
* Replaced the current ORTE grpcomm daemon-based collective operation with an integrated PMIx server, and updated the grpcomm APIs to provide more flexible, multi-algorithm support for collective operations. At this time, only the xcast and allgather operations are supported.
* Replaced the current global collective id with a signature based on the names of the participating procs. The allows an unlimited number of collectives to be executed by any group of processes, subject to the requirement that only one collective can be active at a time for a unique combination of procs. Note that a proc can be involved in any number of simultaneous collectives - it is the specific combination of procs that is subject to the constraint
* removed the prior OMPI/OPAL modex code
* added new macros for executing modex send/recv to simplify use of the new APIs. The send macros allow the caller to specify whether or not the BTL supports async modex operations - if so, then the non-blocking “fence” operation is used, if the active PMIx component supports it. Otherwise, the default is a full blocking modex exchange as we currently perform.
* retained the current flag that directs us to use a blocking fence operation, but only to retrieve data upon demand
This commit was SVN r32570.
2014-08-21 22:56:47 +04:00
|
|
|
return rc;
|
2007-02-09 19:38:16 +03:00
|
|
|
}
|
|
|
|
|
|
|
|
int
|
|
|
|
mca_pml_base_pml_check_selected(const char *my_pml,
|
|
|
|
ompi_proc_t **procs,
|
|
|
|
size_t nprocs)
|
|
|
|
{
|
2008-06-26 17:22:48 +04:00
|
|
|
size_t size;
|
2007-02-09 19:38:16 +03:00
|
|
|
int ret;
|
|
|
|
char *remote_pml;
|
|
|
|
|
2008-06-26 17:22:48 +04:00
|
|
|
/* if no modex was required by the PML, then
|
|
|
|
* we can assume success
|
|
|
|
*/
|
|
|
|
if (!modex_reqd) {
|
2013-03-28 01:17:31 +04:00
|
|
|
opal_output_verbose( 10, ompi_pml_base_framework.framework_output,
|
2008-06-26 17:22:48 +04:00
|
|
|
"check:select: modex not reqd");
|
|
|
|
return OMPI_SUCCESS;
|
|
|
|
}
|
2015-02-06 22:27:23 +03:00
|
|
|
|
2008-06-26 17:22:48 +04:00
|
|
|
/* if we are rank=0, then we can also assume success */
|
2013-01-28 03:25:10 +04:00
|
|
|
if (0 == OMPI_PROC_MY_NAME->vpid) {
|
2013-03-28 01:17:31 +04:00
|
|
|
opal_output_verbose( 10, ompi_pml_base_framework.framework_output,
|
2008-06-26 17:22:48 +04:00
|
|
|
"check:select: rank=0");
|
|
|
|
return OMPI_SUCCESS;
|
|
|
|
}
|
2015-02-06 22:27:23 +03:00
|
|
|
|
2008-06-26 17:22:48 +04:00
|
|
|
/* get the name of the PML module selected by rank=0 */
|
Per the PMIx RFC:
WHAT: Merge the PMIx branch into the devel repo, creating a new
OPAL “lmix” framework to abstract PMI support for all RTEs.
Replace the ORTE daemon-level collectives with a new PMIx
server and update the ORTE grpcomm framework to support
server-to-server collectives
WHY: We’ve had problems dealing with variations in PMI implementations,
and need to extend the existing PMI definitions to meet exascale
requirements.
WHEN: Mon, Aug 25
WHERE: https://github.com/rhc54/ompi-svn-mirror.git
Several community members have been working on a refactoring of the current PMI support within OMPI. Although the APIs are common, Slurm and Cray implement a different range of capabilities, and package them differently. For example, Cray provides an integrated PMI-1/2 library, while Slurm separates the two and requires the user to specify the one to be used at runtime. In addition, several bugs in the Slurm implementations have caused problems requiring extra coding.
All this has led to a slew of #if’s in the PMI code and bugs when the corner-case logic for one implementation accidentally traps the other. Extending this support to other implementations would have increased this complexity to an unacceptable level.
Accordingly, we have:
* created a new OPAL “pmix” framework to abstract the PMI support, with separate components for Cray, Slurm PMI-1, and Slurm PMI-2 implementations.
* Replaced the current ORTE grpcomm daemon-based collective operation with an integrated PMIx server, and updated the grpcomm APIs to provide more flexible, multi-algorithm support for collective operations. At this time, only the xcast and allgather operations are supported.
* Replaced the current global collective id with a signature based on the names of the participating procs. The allows an unlimited number of collectives to be executed by any group of processes, subject to the requirement that only one collective can be active at a time for a unique combination of procs. Note that a proc can be involved in any number of simultaneous collectives - it is the specific combination of procs that is subject to the constraint
* removed the prior OMPI/OPAL modex code
* added new macros for executing modex send/recv to simplify use of the new APIs. The send macros allow the caller to specify whether or not the BTL supports async modex operations - if so, then the non-blocking “fence” operation is used, if the active PMIx component supports it. Otherwise, the default is a full blocking modex exchange as we currently perform.
* retained the current flag that directs us to use a blocking fence operation, but only to retrieve data upon demand
This commit was SVN r32570.
2014-08-21 22:56:47 +04:00
|
|
|
OPAL_MODEX_RECV(ret, &pml_base_component,
|
2015-06-18 19:53:20 +03:00
|
|
|
&procs[0]->super.proc_name, (void**) &remote_pml, &size);
|
2015-02-06 22:27:23 +03:00
|
|
|
|
2013-09-25 20:04:00 +04:00
|
|
|
/* if this key wasn't found, then just assume all is well... */
|
|
|
|
if (OMPI_SUCCESS != ret) {
|
2013-03-28 01:17:31 +04:00
|
|
|
opal_output_verbose( 10, ompi_pml_base_framework.framework_output,
|
2013-09-25 20:04:00 +04:00
|
|
|
"check:select: modex data not found");
|
2008-06-26 17:22:48 +04:00
|
|
|
return OMPI_SUCCESS;
|
2007-02-09 19:38:16 +03:00
|
|
|
}
|
|
|
|
|
2008-06-26 18:08:36 +04:00
|
|
|
/* the remote pml returned should never be NULL if an error
|
|
|
|
* wasn't returned, but just to be safe, and since the check
|
|
|
|
* is fast...let's be sure
|
|
|
|
*/
|
|
|
|
if (NULL == remote_pml) {
|
2013-03-28 01:17:31 +04:00
|
|
|
opal_output_verbose( 10, ompi_pml_base_framework.framework_output,
|
2008-06-26 18:08:36 +04:00
|
|
|
"check:select: got a NULL pml from rank=0");
|
|
|
|
return OMPI_ERR_UNREACH;
|
|
|
|
}
|
2015-02-06 22:27:23 +03:00
|
|
|
|
2013-03-28 01:17:31 +04:00
|
|
|
opal_output_verbose( 10, ompi_pml_base_framework.framework_output,
|
2008-06-26 17:22:48 +04:00
|
|
|
"check:select: checking my pml %s against rank=0 pml %s",
|
|
|
|
my_pml, remote_pml);
|
2015-02-06 22:27:23 +03:00
|
|
|
|
2008-06-26 17:22:48 +04:00
|
|
|
/* if that module doesn't match my own, return an error */
|
|
|
|
if ((size != strlen(my_pml) + 1) ||
|
|
|
|
(0 != strcmp(my_pml, remote_pml))) {
|
As per the email discussion, revise the sparse handling of hostnames so that we avoid potential infinite loops while allowing large-scale users to improve their startup time:
* add a new MCA param orte_hostname_cutoff to specify the number of nodes at which we stop including hostnames. This defaults to INT_MAX => always include hostnames. If a value is given, then we will include hostnames for any allocation smaller than the given limit.
* remove ompi_proc_get_hostname. Replace all occurrences with a direct link to ompi_proc_t's proc_hostname, protected by appropriate "if NULL"
* modify the OMPI-ORTE integration component so that any call to modex_recv automatically loads the ompi_proc_t->proc_hostname field as well as returning the requested info. Thus, any process whose modex info you retrieve will automatically receive the hostname. Note that on-demand retrieval is still enabled - i.e., if we are running under direct launch with PMI, the hostname will be fetched upon first call to modex_recv, and then the ompi_proc_t->proc_hostname field will be loaded
* removed a stale MCA param "mpi_keep_peer_hostnames" that was no longer used anywhere in the code base
* added an envar lookup in ess/pmi for the number of nodes in the allocation. Sadly, PMI itself doesn't provide that info, so we have to get it a different way. Currently, we support PBS-based systems and SLURM - for any other, rank0 will emit a warning and we assume max number of daemons so we will always retain hostnames
This commit was SVN r29052.
2013-08-20 22:59:36 +04:00
|
|
|
opal_output(0, "%s selected pml %s, but peer %s on %s selected pml %s",
|
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
|
|
|
OMPI_NAME_PRINT(&ompi_proc_local()->super.proc_name),
|
|
|
|
my_pml, OMPI_NAME_PRINT(&procs[0]->super.proc_name),
|
|
|
|
(NULL == procs[0]->super.proc_hostname) ? "unknown" : procs[0]->super.proc_hostname,
|
As per the email discussion, revise the sparse handling of hostnames so that we avoid potential infinite loops while allowing large-scale users to improve their startup time:
* add a new MCA param orte_hostname_cutoff to specify the number of nodes at which we stop including hostnames. This defaults to INT_MAX => always include hostnames. If a value is given, then we will include hostnames for any allocation smaller than the given limit.
* remove ompi_proc_get_hostname. Replace all occurrences with a direct link to ompi_proc_t's proc_hostname, protected by appropriate "if NULL"
* modify the OMPI-ORTE integration component so that any call to modex_recv automatically loads the ompi_proc_t->proc_hostname field as well as returning the requested info. Thus, any process whose modex info you retrieve will automatically receive the hostname. Note that on-demand retrieval is still enabled - i.e., if we are running under direct launch with PMI, the hostname will be fetched upon first call to modex_recv, and then the ompi_proc_t->proc_hostname field will be loaded
* removed a stale MCA param "mpi_keep_peer_hostnames" that was no longer used anywhere in the code base
* added an envar lookup in ess/pmi for the number of nodes in the allocation. Sadly, PMI itself doesn't provide that info, so we have to get it a different way. Currently, we support PBS-based systems and SLURM - for any other, rank0 will emit a warning and we assume max number of daemons so we will always retain hostnames
This commit was SVN r29052.
2013-08-20 22:59:36 +04:00
|
|
|
remote_pml);
|
2008-06-26 17:31:36 +04:00
|
|
|
free(remote_pml); /* cleanup before returning */
|
2008-06-26 17:22:48 +04:00
|
|
|
return OMPI_ERR_UNREACH;
|
|
|
|
}
|
2015-02-06 22:27:23 +03:00
|
|
|
|
2008-06-26 17:22:48 +04:00
|
|
|
free(remote_pml);
|
2007-02-09 19:38:16 +03:00
|
|
|
return OMPI_SUCCESS;
|
|
|
|
}
|