Skip to content

Change how cm's priority is calculated #1040

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 4 commits into from
Oct 19, 2015
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion ompi/mca/crcp/base/crcp_base_select.c
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,7 @@ int ompi_crcp_base_select(void)
if( OPAL_SUCCESS != mca_base_select("crcp", ompi_crcp_base_framework.framework_output,
&ompi_crcp_base_framework.framework_components,
(mca_base_module_t **) &best_module,
(mca_base_component_t **) &best_component) ) {
(mca_base_component_t **) &best_component, NULL) ) {
/* This will only happen if no component was selected */
return OMPI_ERROR;
}
Expand Down
6 changes: 5 additions & 1 deletion ompi/mca/mtl/base/base.h
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
/* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil -*- */
/*
* Copyright (c) 2004-2005 The Trustees of Indiana University and Indiana
* University Research and Technology
Expand All @@ -9,6 +10,8 @@
* University of Stuttgart. All rights reserved.
* Copyright (c) 2004-2006 The Regents of the University of California.
* All rights reserved.
* Copyright (c) 2015 Los Alamos National Security, LLC. All rights
* reserved.
* $COPYRIGHT$
*
* Additional copyrights may follow
Expand All @@ -34,7 +37,8 @@ BEGIN_C_DECLS
OMPI_DECLSPEC extern mca_mtl_base_component_t* ompi_mtl_base_selected_component;

OMPI_DECLSPEC int ompi_mtl_base_select(bool enable_progress_threads,
bool enable_mpi_threads);
bool enable_mpi_threads,
int *priority);

OMPI_DECLSPEC extern mca_base_framework_t ompi_mtl_base_framework;

Expand Down
11 changes: 8 additions & 3 deletions ompi/mca/mtl/base/mtl_base_frame.c
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
/* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil -*- */
/*
* Copyright (c) 2004-2005 The Trustees of Indiana University and Indiana
* University Research and Technology
Expand Down Expand Up @@ -48,20 +49,23 @@ mca_mtl_base_module_t *ompi_mtl = NULL;
* need to reexamine this at a later time.
*/
int
ompi_mtl_base_select(bool enable_progress_threads,
bool enable_mpi_threads)
ompi_mtl_base_select (bool enable_progress_threads,
bool enable_mpi_threads,
int *priority)
{
int ret = OMPI_ERR_NOT_FOUND;
mca_mtl_base_component_t *best_component = NULL;
mca_mtl_base_module_t *best_module = NULL;
int best_priority;

/*
* Select the best component
*/
if( OPAL_SUCCESS != mca_base_select("mtl", ompi_mtl_base_framework.framework_output,
&ompi_mtl_base_framework.framework_components,
(mca_base_module_t **) &best_module,
(mca_base_component_t **) &best_component) ) {
(mca_base_component_t **) &best_component,
&best_priority) ) {
/* notify caller that no available component found */
return ret;
}
Expand All @@ -81,6 +85,7 @@ ompi_mtl_base_select(bool enable_progress_threads,
"select: init returned success");
ompi_mtl_base_selected_component = best_component;
ompi_mtl = best_module;
*priority = best_priority;
ret = OMPI_SUCCESS;
}

Expand Down
3 changes: 2 additions & 1 deletion ompi/mca/mtl/mxm/mtl_mxm_component.c
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,8 @@ static int ompi_mtl_mxm_component_register(void)
free(runtime_version);
#endif

param_priority = 100;
/* set high enought to defeat ob1's default */
param_priority = 30;
(void) mca_base_component_var_register (c,
"priority", "Priority of the MXM MTL component",
MCA_BASE_VAR_TYPE_INT, NULL, 0, 0,
Expand Down
2 changes: 1 addition & 1 deletion ompi/mca/mtl/ofi/mtl_ofi_component.c
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ mca_mtl_ofi_component_t mca_mtl_ofi_component = {
static int
ompi_mtl_ofi_component_register(void)
{
param_priority = 10; /* for now give a lower priority than the psm mtl */
param_priority = 10; /* for now give a lower priority than the psm mtl and ob1 */
mca_base_component_var_register(&mca_mtl_ofi_component.super.mtl_version,
"priority", "Priority of the OFI MTL component",
MCA_BASE_VAR_TYPE_INT, NULL, 0, 0,
Expand Down
3 changes: 2 additions & 1 deletion ompi/mca/mtl/psm/mtl_psm_component.c
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,8 @@ ompi_mtl_psm_component_register(void)
#endif


param_priority = 100;
/* set priority high enough to beat ob1's default */
param_priority = 30;
(void) mca_base_component_var_register (&mca_mtl_psm_component.super.mtl_version,
"priority", "Priority of the PSM MTL component",
MCA_BASE_VAR_TYPE_INT, NULL, 0, 0,
Expand Down
6 changes: 4 additions & 2 deletions ompi/mca/mtl/psm2/mtl_psm2_component.c
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
/* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil -*- */
/*
* Copyright (c) 2004-2007 The Trustees of Indiana University and Indiana
* University Research and Technology
Expand All @@ -10,7 +11,7 @@
* Copyright (c) 2004-2005 The Regents of the University of California.
* All rights reserved.
* Copyright (c) 2006-2010 QLogic Corporation. All rights reserved.
* Copyright (c) 2012-2013 Los Alamos National Security, LLC.
* Copyright (c) 2012-2015 Los Alamos National Security, LLC.
* All rights reserved.
* Copyright (c) 2013-2015 Intel, Inc. All rights reserved
* $COPYRIGHT$
Expand Down Expand Up @@ -85,7 +86,8 @@ ompi_mtl_psm2_component_register(void)
MCA_BASE_VAR_SCOPE_READONLY,
&ompi_mtl_psm2.connect_timeout);

param_priority = 120;
/* set priority high enough to beat ob1's default (also set higher than psm) */
param_priority = 40;
(void) mca_base_component_var_register (&mca_mtl_psm2_component.super.mtl_version,
"priority", "Priority of the PSM2 MTL component",
MCA_BASE_VAR_TYPE_INT, NULL, 0, 0,
Expand Down
1 change: 0 additions & 1 deletion ompi/mca/pml/cm/pml_cm.h
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,6 @@ struct ompi_pml_cm_t {
int free_list_num;
int free_list_max;
int free_list_inc;
int default_priority;
};
typedef struct ompi_pml_cm_t ompi_pml_cm_t;
extern ompi_pml_cm_t ompi_pml_cm;
Expand Down
30 changes: 3 additions & 27 deletions ompi/mca/pml/cm/pml_cm_component.c
Original file line number Diff line number Diff line change
Expand Up @@ -101,14 +101,6 @@ mca_pml_cm_component_register(void)
MCA_BASE_VAR_SCOPE_READONLY,
&ompi_pml_cm.free_list_inc);

ompi_pml_cm.default_priority = 10;
(void) mca_base_component_var_register(&mca_pml_cm_component.pmlm_version, "priority",
"CM PML selection priority",
MCA_BASE_VAR_TYPE_INT, NULL, 0, 0,
OPAL_INFO_LVL_9,
MCA_BASE_VAR_SCOPE_READONLY,
&ompi_pml_cm.default_priority);

return OPAL_SUCCESS;
}

Expand Down Expand Up @@ -143,32 +135,16 @@ mca_pml_cm_component_init(int* priority,
{
int ret;

if((*priority) > ompi_pml_cm.default_priority) {
*priority = ompi_pml_cm.default_priority;
return NULL;
}
*priority = ompi_pml_cm.default_priority;
*priority = -1;

opal_output_verbose( 10, 0,
"in cm pml priority is %d\n", *priority);
/* find a useable MTL */
ret = ompi_mtl_base_select(enable_progress_threads, enable_mpi_threads);
ret = ompi_mtl_base_select(enable_progress_threads, enable_mpi_threads, priority);
if (OMPI_SUCCESS != ret) {
*priority = -1;
return NULL;
} else if((strcmp(ompi_mtl_base_selected_component->mtl_version.mca_component_name, "psm") == 0) ||
(strcmp(ompi_mtl_base_selected_component->mtl_version.mca_component_name, "psm2") == 0) ||
(strcmp(ompi_mtl_base_selected_component->mtl_version.mca_component_name, "mxm") == 0) ||
(strcmp(ompi_mtl_base_selected_component->mtl_version.mca_component_name, "ofi") == 0) ||
(strcmp(ompi_mtl_base_selected_component->mtl_version.mca_component_name, "portals4") == 0)) {
/*
* If MTL is MXM or PSM then up our priority
* For every other communication layer having MTLs and BTLs, the user/admin
* may still select PML/ob1 (BTLs) or PML/cm (MTLs) if preferable for the app/site.
*/
*priority = 30;
}


if (ompi_mtl->mtl_flags & MCA_MTL_BASE_FLAG_REQUIRE_WORLD) {
ompi_pml_cm.super.pml_flags |= MCA_PML_BASE_FLAG_REQUIRE_WORLD;
}
Expand Down
4 changes: 0 additions & 4 deletions ompi/mca/pml/ob1/pml_ob1_component.c
Original file line number Diff line number Diff line change
Expand Up @@ -254,10 +254,6 @@ mca_pml_ob1_component_init( int* priority,
opal_output_verbose( 10, mca_pml_ob1_output,
"in ob1, my priority is %d\n", mca_pml_ob1.priority);

if((*priority) > mca_pml_ob1.priority) {
*priority = mca_pml_ob1.priority;
return NULL;
}
*priority = mca_pml_ob1.priority;

allocator_component = mca_allocator_component_lookup( mca_pml_ob1.allocator_name );
Expand Down
3 changes: 2 additions & 1 deletion opal/mca/base/base.h
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,8 @@ OPAL_DECLSPEC int mca_base_close(void);
OPAL_DECLSPEC int mca_base_select(const char *type_name, int output_id,
opal_list_t *components_available,
mca_base_module_t **best_module,
mca_base_component_t **best_component);
mca_base_component_t **best_component,
int *priority_out);

/**
* A function for component query functions to discover if they have
Expand Down
7 changes: 6 additions & 1 deletion opal/mca/base/mca_base_components_select.c
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
/* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil -*- */
/*
* Copyright (c) 2004-2008 The Trustees of Indiana University and Indiana
* University Research and Technology
Expand Down Expand Up @@ -33,7 +34,8 @@
int mca_base_select(const char *type_name, int output_id,
opal_list_t *components_available,
mca_base_module_t **best_module,
mca_base_component_t **best_component)
mca_base_component_t **best_component,
int *priority_out)
{
mca_base_component_list_item_t *cli = NULL;
mca_base_component_t *component = NULL;
Expand Down Expand Up @@ -108,6 +110,9 @@ int mca_base_select(const char *type_name, int output_id,
}
}

if (priority_out) {
*priority_out = best_priority;
}

/*
* Finished querying all components.
Expand Down
5 changes: 4 additions & 1 deletion opal/mca/compress/base/compress_base_select.c
Original file line number Diff line number Diff line change
@@ -1,9 +1,12 @@
/* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil -*- */
/*
* Copyright (c) 2004-2010 The Trustees of Indiana University.
* All rights reserved.
* Copyright (c) 2015 Research Organization for Information Science
* and Technology (RIST). All rights reserved.
*
* Copyright (c) 2015 Los Alamos National Security, LLC. All rights
* reserved.
* $COPYRIGHT$
*
* Additional copyrights may follow
Expand Down Expand Up @@ -43,7 +46,7 @@ int opal_compress_base_select(void)
if( OPAL_SUCCESS != mca_base_select("compress", opal_compress_base_framework.framework_output,
&opal_compress_base_framework.framework_components,
(mca_base_module_t **) &best_module,
(mca_base_component_t **) &best_component) ) {
(mca_base_component_t **) &best_component, NULL) ) {
/* This will only happen if no component was selected */
exit_status = OPAL_ERROR;
goto cleanup;
Expand Down
2 changes: 1 addition & 1 deletion opal/mca/crs/base/crs_base_select.c
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ int opal_crs_base_select(void)
if( OPAL_SUCCESS != mca_base_select("crs", opal_crs_base_framework.framework_output,
&opal_crs_base_framework.framework_components,
(mca_base_module_t **) &best_module,
(mca_base_component_t **) &best_component) ) {
(mca_base_component_t **) &best_component, NULL) ) {
/* This will only happen if no component was selected */
return OPAL_ERROR;
}
Expand Down
5 changes: 4 additions & 1 deletion opal/mca/dl/base/dl_base_select.c
Original file line number Diff line number Diff line change
@@ -1,9 +1,12 @@
/* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil -*- */
/*
* Copyright (c) 2004-2010 The Trustees of Indiana University.
* All rights reserved.
*
* Copyright (c) 2015 Cisco Systems, Inc. All rights reserved.
* $COPYRIGHT$
* Copyright (c) 2015 Los Alamos National Security, LLC. All rights
* reserved.
*
* Additional copyrights may follow
*
Expand Down Expand Up @@ -37,7 +40,7 @@ int opal_dl_base_select(void)
opal_dl_base_framework.framework_output,
&opal_dl_base_framework.framework_components,
(mca_base_module_t **) &best_module,
(mca_base_component_t **) &best_component) ) {
(mca_base_component_t **) &best_component, NULL) ) {
/* This will only happen if no component was selected */
exit_status = OPAL_ERROR;
goto cleanup;
Expand Down
5 changes: 4 additions & 1 deletion opal/mca/memchecker/base/memchecker_base_select.c
Original file line number Diff line number Diff line change
@@ -1,8 +1,11 @@
/* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil -*- */
/*
* Copyright (c) 2004-2007 High Performance Computing Center Stuttgart,
* University of Stuttgart. All rights reserved.
* Copyright (c) 2004-2008 The Trustees of Indiana University.
* All rights reserved.
* Copyright (c) 2015 Los Alamos National Security, LLC. All rights
* reserved.
* $COPYRIGHT$
*
* Additional copyrights may follow
Expand Down Expand Up @@ -40,7 +43,7 @@ int opal_memchecker_base_select(void)
if( OPAL_SUCCESS != mca_base_select("memchecker", opal_memchecker_base_framework.framework_output,
&opal_memchecker_base_framework.framework_components,
(mca_base_module_t **) &best_module,
(mca_base_component_t **) &best_component) ) {
(mca_base_component_t **) &best_component, NULL) ) {
/* This will only happen if no component was selected */
exit_status = OPAL_ERR_NOT_FOUND;
goto cleanup;
Expand Down
5 changes: 4 additions & 1 deletion opal/mca/pmix/base/pmix_base_select.c
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
/* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil -*- */
/*
* Copyright (c) 2014-2015 Intel, Inc. All rights reserved.
* Copyright (c) 2015 Los Alamos National Security, LLC. All rights
* reserved.
* $COPYRIGHT$
*
* Additional copyrights may follow
Expand Down Expand Up @@ -31,7 +34,7 @@ int opal_pmix_base_select(void)
if( OPAL_SUCCESS != mca_base_select("pmix", opal_pmix_base_framework.framework_output,
&opal_pmix_base_framework.framework_components,
(mca_base_module_t **) &best_module,
(mca_base_component_t **) &best_component) ) {
(mca_base_component_t **) &best_component, NULL) ) {
/* notify caller that no available component found */
return OPAL_ERR_NOT_FOUND;
}
Expand Down
5 changes: 4 additions & 1 deletion opal/mca/pstat/base/pstat_base_select.c
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
/* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil -*- */
/*
* Copyright (c) 2004-2008 The Trustees of Indiana University and Indiana
* University Research and Technology
Expand All @@ -10,6 +11,8 @@
* Copyright (c) 2004-2005 The Regents of the University of California.
* All rights reserved.
* Copyright (c) 2007 Cisco Systems, Inc. All rights reserved.
* Copyright (c) 2015 Los Alamos National Security, LLC. All rights
* reserved.
* $COPYRIGHT$
*
* Additional copyrights may follow
Expand Down Expand Up @@ -42,7 +45,7 @@ int opal_pstat_base_select(void)
if( OPAL_SUCCESS != mca_base_select("pstat", opal_pstat_base_framework.framework_output,
&opal_pstat_base_framework.framework_components,
(mca_base_module_t **) &best_module,
(mca_base_component_t **) &best_component) ) {
(mca_base_component_t **) &best_component, NULL) ) {
/* It is okay if we don't find a runnable component - default
* to the unsupported default.
*/
Expand Down
5 changes: 4 additions & 1 deletion opal/mca/reachable/base/reachable_base_select.c
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
/* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil -*- */
/*
* Copyright (c) 2014 Intel, Inc. All rights reserved.
* Copyright (c) 2015 Los Alamos National Security, LLC. All rights
* reserved.
* $COPYRIGHT$
*
* Additional copyrights may follow
Expand Down Expand Up @@ -32,7 +35,7 @@ int opal_reachable_base_select(void)
if( OPAL_SUCCESS != mca_base_select("reachable", opal_reachable_base_framework.framework_output,
&opal_reachable_base_framework.framework_components,
(mca_base_module_t **) &best_module,
(mca_base_component_t **) &best_component) ) {
(mca_base_component_t **) &best_component, NULL) ) {
/* notify caller that no available component found */
return OPAL_ERR_NOT_FOUND;
}
Expand Down
6 changes: 4 additions & 2 deletions orte/mca/dfs/base/dfs_base_select.c
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
/* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil -*- */
/*
* Copyright (c) 2012 Los Alamos National Security, Inc. All rights reserved.
* Copyright (c) 2012-2015 Los Alamos National Security, Inc. All rights
* reserved.
* $COPYRIGHT$
*
* Additional copyrights may follow
Expand Down Expand Up @@ -31,7 +33,7 @@ int orte_dfs_base_select(void)
if (OPAL_SUCCESS != mca_base_select("dfs", orte_dfs_base_framework.framework_output,
&orte_dfs_base_framework.framework_components,
(mca_base_module_t **) &best_module,
(mca_base_component_t **) &best_component)) {
(mca_base_component_t **) &best_component, NULL)) {
/* This will only happen if no component was selected, which
* is okay - we don't have to select anything
*/
Expand Down
Loading