From 2fd176ac7f99b554da1706a0bfe7d93c648c8804 Mon Sep 17 00:00:00 2001 From: Nathan Hjelm Date: Mon, 19 Oct 2015 09:49:29 -0600 Subject: [PATCH 1/4] cm: fix selection priority This patch removes a priority check that disables cm if the previous pml had higher priority. The check was incorrect as coded and is unnecessary as we finalize all but one pml anyway. Fixes open-mpi/ompi#1035 Signed-off-by: Nathan Hjelm --- ompi/mca/pml/cm/pml_cm_component.c | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/ompi/mca/pml/cm/pml_cm_component.c b/ompi/mca/pml/cm/pml_cm_component.c index 6e0d9bf9469..94e12d9c9c5 100644 --- a/ompi/mca/pml/cm/pml_cm_component.c +++ b/ompi/mca/pml/cm/pml_cm_component.c @@ -143,11 +143,6 @@ 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; opal_output_verbose( 10, 0, "in cm pml priority is %d\n", *priority); /* find a useable MTL */ @@ -166,9 +161,10 @@ mca_pml_cm_component_init(int* priority, * may still select PML/ob1 (BTLs) or PML/cm (MTLs) if preferable for the app/site. */ *priority = 30; + } else { + *priority = ompi_pml_cm.default_priority; } - if (ompi_mtl->mtl_flags & MCA_MTL_BASE_FLAG_REQUIRE_WORLD) { ompi_pml_cm.super.pml_flags |= MCA_PML_BASE_FLAG_REQUIRE_WORLD; } From bedd80214eb343bd5253ccb108e662f3e0b2768b Mon Sep 17 00:00:00 2001 From: Nathan Hjelm Date: Mon, 19 Oct 2015 09:55:50 -0600 Subject: [PATCH 2/4] pml/ob1: remove priority check This commit removes code that checks the ob1 priority vs the previous priority. The previous priority is meaningless here and may only cause ob1 to disable itself when it shouldn't. Signed-off-by: Nathan Hjelm --- ompi/mca/pml/ob1/pml_ob1_component.c | 4 ---- 1 file changed, 4 deletions(-) diff --git a/ompi/mca/pml/ob1/pml_ob1_component.c b/ompi/mca/pml/ob1/pml_ob1_component.c index 1a6cda759aa..47a62fabe58 100644 --- a/ompi/mca/pml/ob1/pml_ob1_component.c +++ b/ompi/mca/pml/ob1/pml_ob1_component.c @@ -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 ); From 8b5810f7f7cbaadcd3eba528404b4c417dc0e44e Mon Sep 17 00:00:00 2001 From: Nathan Hjelm Date: Mon, 19 Oct 2015 10:39:35 -0600 Subject: [PATCH 3/4] mca/base: add priority output to mca_base_select The mca_base_select function uses returned priorities to select the best component/module. This priority may be of use to the caller so pass that information back in an optional argument. If the priority is not needed pass NULL. Signed-off-by: Nathan Hjelm --- ompi/mca/crcp/base/crcp_base_select.c | 2 +- ompi/mca/mtl/base/base.h | 6 +++++- ompi/mca/mtl/base/mtl_base_frame.c | 5 ++++- opal/mca/base/base.h | 3 ++- opal/mca/base/mca_base_components_select.c | 7 ++++++- opal/mca/compress/base/compress_base_select.c | 5 ++++- opal/mca/crs/base/crs_base_select.c | 2 +- opal/mca/dl/base/dl_base_select.c | 5 ++++- opal/mca/memchecker/base/memchecker_base_select.c | 5 ++++- opal/mca/pmix/base/pmix_base_select.c | 5 ++++- opal/mca/pstat/base/pstat_base_select.c | 5 ++++- opal/mca/reachable/base/reachable_base_select.c | 5 ++++- orte/mca/dfs/base/dfs_base_select.c | 6 ++++-- orte/mca/errmgr/base/errmgr_base_select.c | 6 ++++-- orte/mca/ess/base/ess_base_select.c | 5 +++-- orte/mca/filem/base/filem_base_select.c | 5 +++-- orte/mca/iof/base/iof_base_select.c | 5 ++++- orte/mca/odls/base/odls_base_select.c | 5 ++++- orte/mca/plm/base/plm_base_select.c | 7 ++++--- orte/mca/ras/base/ras_base_select.c | 5 +++-- orte/mca/routed/base/routed_base_frame.c | 7 ++++--- orte/mca/snapc/base/snapc_base_select.c | 6 ++++-- orte/mca/sstore/base/sstore_base_select.c | 5 ++++- orte/mca/state/base/state_base_select.c | 5 +++-- 24 files changed, 87 insertions(+), 35 deletions(-) diff --git a/ompi/mca/crcp/base/crcp_base_select.c b/ompi/mca/crcp/base/crcp_base_select.c index e6b71a4562b..ac005d25169 100644 --- a/ompi/mca/crcp/base/crcp_base_select.c +++ b/ompi/mca/crcp/base/crcp_base_select.c @@ -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; } diff --git a/ompi/mca/mtl/base/base.h b/ompi/mca/mtl/base/base.h index 47c72519406..ad6a2c72a3f 100644 --- a/ompi/mca/mtl/base/base.h +++ b/ompi/mca/mtl/base/base.h @@ -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 @@ -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 @@ -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; diff --git a/ompi/mca/mtl/base/mtl_base_frame.c b/ompi/mca/mtl/base/mtl_base_frame.c index 6f85ae1d7ae..55260d19c94 100644 --- a/ompi/mca/mtl/base/mtl_base_frame.c +++ b/ompi/mca/mtl/base/mtl_base_frame.c @@ -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 @@ -54,6 +55,7 @@ ompi_mtl_base_select(bool enable_progress_threads, 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 @@ -61,7 +63,8 @@ ompi_mtl_base_select(bool enable_progress_threads, 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; } diff --git a/opal/mca/base/base.h b/opal/mca/base/base.h index 65c0b67514b..8eb29408f99 100644 --- a/opal/mca/base/base.h +++ b/opal/mca/base/base.h @@ -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 diff --git a/opal/mca/base/mca_base_components_select.c b/opal/mca/base/mca_base_components_select.c index 64776073668..cf45bf903ec 100644 --- a/opal/mca/base/mca_base_components_select.c +++ b/opal/mca/base/mca_base_components_select.c @@ -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 @@ -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; @@ -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. diff --git a/opal/mca/compress/base/compress_base_select.c b/opal/mca/compress/base/compress_base_select.c index 1311f7a118f..6e98f33a275 100644 --- a/opal/mca/compress/base/compress_base_select.c +++ b/opal/mca/compress/base/compress_base_select.c @@ -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 @@ -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; diff --git a/opal/mca/crs/base/crs_base_select.c b/opal/mca/crs/base/crs_base_select.c index e444925f964..0854ba6b22f 100644 --- a/opal/mca/crs/base/crs_base_select.c +++ b/opal/mca/crs/base/crs_base_select.c @@ -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; } diff --git a/opal/mca/dl/base/dl_base_select.c b/opal/mca/dl/base/dl_base_select.c index 4abcccdbb0f..8db0b5e99b7 100644 --- a/opal/mca/dl/base/dl_base_select.c +++ b/opal/mca/dl/base/dl_base_select.c @@ -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 * @@ -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; diff --git a/opal/mca/memchecker/base/memchecker_base_select.c b/opal/mca/memchecker/base/memchecker_base_select.c index 77d2aa8508a..3e701ed2edf 100644 --- a/opal/mca/memchecker/base/memchecker_base_select.c +++ b/opal/mca/memchecker/base/memchecker_base_select.c @@ -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 @@ -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; diff --git a/opal/mca/pmix/base/pmix_base_select.c b/opal/mca/pmix/base/pmix_base_select.c index fe49f560041..0a4009b95c7 100644 --- a/opal/mca/pmix/base/pmix_base_select.c +++ b/opal/mca/pmix/base/pmix_base_select.c @@ -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 @@ -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; } diff --git a/opal/mca/pstat/base/pstat_base_select.c b/opal/mca/pstat/base/pstat_base_select.c index 5b87c7fe4ef..597ce263368 100644 --- a/opal/mca/pstat/base/pstat_base_select.c +++ b/opal/mca/pstat/base/pstat_base_select.c @@ -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 @@ -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 @@ -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. */ diff --git a/opal/mca/reachable/base/reachable_base_select.c b/opal/mca/reachable/base/reachable_base_select.c index a1e00807658..24cdfc592ed 100644 --- a/opal/mca/reachable/base/reachable_base_select.c +++ b/opal/mca/reachable/base/reachable_base_select.c @@ -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 @@ -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; } diff --git a/orte/mca/dfs/base/dfs_base_select.c b/orte/mca/dfs/base/dfs_base_select.c index 51826442107..bf0a7c2d678 100644 --- a/orte/mca/dfs/base/dfs_base_select.c +++ b/orte/mca/dfs/base/dfs_base_select.c @@ -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 @@ -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 */ diff --git a/orte/mca/errmgr/base/errmgr_base_select.c b/orte/mca/errmgr/base/errmgr_base_select.c index 761019c9ceb..cf6e4c12829 100644 --- a/orte/mca/errmgr/base/errmgr_base_select.c +++ b/orte/mca/errmgr/base/errmgr_base_select.c @@ -1,3 +1,4 @@ +/* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil -*- */ /* * Copyright (c) 2004-2010 The Trustees of Indiana University and Indiana * University Research and Technology @@ -10,7 +11,8 @@ * Copyright (c) 2004-2005 The Regents of the University of California. * All rights reserved. * Copyright (c) 2010 Cisco Systems, Inc. All rights reserved. - * Copyright (c) 2012-2013 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 @@ -43,7 +45,7 @@ int orte_errmgr_base_select(void) if( OPAL_SUCCESS != mca_base_select("errmgr", orte_errmgr_base_framework.framework_output, &orte_errmgr_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 = ORTE_ERROR; goto cleanup; diff --git a/orte/mca/ess/base/ess_base_select.c b/orte/mca/ess/base/ess_base_select.c index 72a2ef860dc..662ba6890b9 100644 --- a/orte/mca/ess/base/ess_base_select.c +++ b/orte/mca/ess/base/ess_base_select.c @@ -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 @@ -10,7 +11,7 @@ * Copyright (c) 2004-2005 The Regents of the University of California. * All rights reserved. * Copyright (c) 2011 Cisco Systems, Inc. All rights reserved. - * Copyright (c) 2013 Los Alamos National Security, LLC. All rights reserved. + * Copyright (c) 2013-2015 Los Alamos National Security, LLC. All rights reserved. * $COPYRIGHT$ * * Additional copyrights may follow @@ -39,7 +40,7 @@ orte_ess_base_select(void) if( OPAL_SUCCESS != mca_base_select("ess", orte_ess_base_framework.framework_output, &orte_ess_base_framework.framework_components, (mca_base_module_t **) &best_module, - (mca_base_component_t **) &best_component) ) { + (mca_base_component_t **) &best_component, NULL) ) { /* error message emitted by fn above */ return ORTE_ERR_SILENT; } diff --git a/orte/mca/filem/base/filem_base_select.c b/orte/mca/filem/base/filem_base_select.c index 0bcee7df966..3488956af63 100644 --- a/orte/mca/filem/base/filem_base_select.c +++ b/orte/mca/filem/base/filem_base_select.c @@ -1,3 +1,4 @@ +/* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil -*- */ /* * Copyright (c) 2004-2008 The Trustees of Indiana University. * All rights reserved. @@ -7,7 +8,7 @@ * University of Stuttgart. All rights reserved. * Copyright (c) 2004-2005 The Regents of the University of California. * All rights reserved. - * Copyright (c) 2012 Los Alamos National Security, LLC. + * Copyright (c) 2012-2015 Los Alamos National Security, LLC. * All rights reserved * $COPYRIGHT$ * @@ -42,7 +43,7 @@ int orte_filem_base_select(void) if( OPAL_SUCCESS != mca_base_select("filem", orte_filem_base_framework.framework_output, &orte_filem_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 to not select anything - we'll just retain * the default none module */ diff --git a/orte/mca/iof/base/iof_base_select.c b/orte/mca/iof/base/iof_base_select.c index e1644bb3c9e..3cfbc883d05 100644 --- a/orte/mca/iof/base/iof_base_select.c +++ b/orte/mca/iof/base/iof_base_select.c @@ -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 @@ -9,6 +10,8 @@ * University of Stuttgart. All rights reserved. * Copyright (c) 2004-2005 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 @@ -45,7 +48,7 @@ int orte_iof_base_select(void) if( OPAL_SUCCESS != mca_base_select("iof", orte_iof_base_framework.framework_output, &orte_iof_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 to not find a module if we are a CM process */ if (ORTE_PROC_IS_CM) { return ORTE_SUCCESS; diff --git a/orte/mca/odls/base/odls_base_select.c b/orte/mca/odls/base/odls_base_select.c index 1eca075a0df..55f75082b30 100644 --- a/orte/mca/odls/base/odls_base_select.c +++ b/orte/mca/odls/base/odls_base_select.c @@ -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 @@ -9,6 +10,8 @@ * University of Stuttgart. All rights reserved. * Copyright (c) 2004-2005 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 @@ -42,7 +45,7 @@ int orte_odls_base_select(void) if( OPAL_SUCCESS != mca_base_select("odls", orte_odls_base_framework.framework_output, &orte_odls_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 ORTE_ERR_NOT_FOUND; } diff --git a/orte/mca/plm/base/plm_base_select.c b/orte/mca/plm/base/plm_base_select.c index 951b79cd41b..f4ab0850441 100644 --- a/orte/mca/plm/base/plm_base_select.c +++ b/orte/mca/plm/base/plm_base_select.c @@ -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 @@ -9,9 +10,9 @@ * University of Stuttgart. All rights reserved. * Copyright (c) 2004-2005 The Regents of the University of California. * All rights reserved. - * Copyright (c) 2011-2013 Los Alamos National Security, LLC. + * Copyright (c) 2011-2015 Los Alamos National Security, LLC. * All rights reserved. -* Copyright (c) 2015 Intel, Inc. All rights reserved. + * Copyright (c) 2015 Intel, Inc. All rights reserved. * $COPYRIGHT$ * * Additional copyrights may follow @@ -49,7 +50,7 @@ int orte_plm_base_select(void) if (OPAL_SUCCESS == (rc = mca_base_select("plm", orte_plm_base_framework.framework_output, &orte_plm_base_framework.framework_components, (mca_base_module_t **) &best_module, - (mca_base_component_t **) &best_component))) { + (mca_base_component_t **) &best_component, NULL))) { /* Save the winner */ orte_plm = *best_module; } diff --git a/orte/mca/ras/base/ras_base_select.c b/orte/mca/ras/base/ras_base_select.c index 14d8872e315..558086e8496 100644 --- a/orte/mca/ras/base/ras_base_select.c +++ b/orte/mca/ras/base/ras_base_select.c @@ -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 @@ -9,7 +10,7 @@ * University of Stuttgart. All rights reserved. * Copyright (c) 2004-2005 The Regents of the University of California. * All rights reserved. - * Copyright (c) 2011-2013 Los Alamos National Security, LLC. All rights + * Copyright (c) 2011-2015 Los Alamos National Security, LLC. All rights * reserved. * $COPYRIGHT$ * @@ -45,7 +46,7 @@ int orte_ras_base_select(void) if( OPAL_SUCCESS != mca_base_select("ras", orte_ras_base_framework.framework_output, &orte_ras_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 */ /* If we didn't find one to select, that is okay */ return ORTE_SUCCESS; diff --git a/orte/mca/routed/base/routed_base_frame.c b/orte/mca/routed/base/routed_base_frame.c index d03d55c0305..c45f753a479 100644 --- a/orte/mca/routed/base/routed_base_frame.c +++ b/orte/mca/routed/base/routed_base_frame.c @@ -1,6 +1,7 @@ +/* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil -*- */ /* - * Copyright (c) 2007-2013 Los Alamos National Security, LLC. - * All rights reserved. + * Copyright (c) 2007-2015 Los Alamos National Security, LLC. All rights + * reserved. * Copyright (c) 2007 Sun Microsystems, Inc. All rights reserved. * Copyright (c) 2004-2010 The Trustees of Indiana University. * All rights reserved. @@ -130,7 +131,7 @@ int orte_routed_base_select(void) if( OPAL_SUCCESS != mca_base_select("routed", orte_routed_base_framework.framework_output, &orte_routed_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 = ORTE_ERR_NOT_FOUND; goto cleanup; diff --git a/orte/mca/snapc/base/snapc_base_select.c b/orte/mca/snapc/base/snapc_base_select.c index 18284b322bd..1f25c57c2a9 100644 --- a/orte/mca/snapc/base/snapc_base_select.c +++ b/orte/mca/snapc/base/snapc_base_select.c @@ -1,3 +1,4 @@ +/* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil -*- */ /* * Copyright (c) 2004-2010 The Trustees of Indiana University. * All rights reserved. @@ -7,7 +8,8 @@ * University of Stuttgart. All rights reserved. * Copyright (c) 2004-2005 The Regents of the University of California. * All rights reserved. - * Copyright (c) 2013 Los Alamos National Security, LLC. All rights reserved. + * Copyright (c) 2013-2015 Los Alamos National Security, LLC. All rights + * reserved. * $COPYRIGHT$ * * Additional copyrights may follow @@ -79,7 +81,7 @@ int orte_snapc_base_select(bool seed, bool app) if( OPAL_SUCCESS != mca_base_select("snapc", orte_snapc_base_framework.framework_output, &orte_snapc_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 = ORTE_ERROR; goto cleanup; diff --git a/orte/mca/sstore/base/sstore_base_select.c b/orte/mca/sstore/base/sstore_base_select.c index 0ea003d56a9..2114f97d04b 100644 --- a/orte/mca/sstore/base/sstore_base_select.c +++ b/orte/mca/sstore/base/sstore_base_select.c @@ -1,6 +1,9 @@ +/* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil -*- */ /* * Copyright (c) 2010 The Trustees of Indiana University. * All rights reserved. + * Copyright (c) 2015 Los Alamos National Security, LLC. All rights + * reserved. * $COPYRIGHT$ * * Additional copyrights may follow @@ -34,7 +37,7 @@ int orte_sstore_base_select(void) if( OPAL_SUCCESS != mca_base_select("sstore", orte_sstore_base_framework.framework_output, &orte_sstore_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 = ORTE_ERROR; goto cleanup; diff --git a/orte/mca/state/base/state_base_select.c b/orte/mca/state/base/state_base_select.c index 29a56c96f71..8197294ddbf 100644 --- a/orte/mca/state/base/state_base_select.c +++ b/orte/mca/state/base/state_base_select.c @@ -1,5 +1,6 @@ +/* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil -*- */ /* - * Copyright (c) 2011-2013 Los Alamos National Security, LLC. + * Copyright (c) 2011-2015 Los Alamos National Security, LLC. * All rights reserved. * $COPYRIGHT$ * @@ -33,7 +34,7 @@ int orte_state_base_select(void) if( OPAL_SUCCESS != mca_base_select("state", orte_state_base_framework.framework_output, &orte_state_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 = ORTE_ERROR; goto cleanup; From 53f6b57c0a9a4c9c157ec9d05333c0d01278cfd2 Mon Sep 17 00:00:00 2001 From: Nathan Hjelm Date: Mon, 19 Oct 2015 10:42:22 -0600 Subject: [PATCH 4/4] pml/cm: use the priority of the mtl component This commit changes the priority of mtl components to be relative to pml/ob1 and updates the mtl interface to expose this priority. cm now sets its own priority based on the priority of the selected mtl component. Signed-off-by: Nathan Hjelm --- ompi/mca/mtl/base/mtl_base_frame.c | 6 ++++-- ompi/mca/mtl/mxm/mtl_mxm_component.c | 3 ++- ompi/mca/mtl/ofi/mtl_ofi_component.c | 2 +- ompi/mca/mtl/psm/mtl_psm_component.c | 3 ++- ompi/mca/mtl/psm2/mtl_psm2_component.c | 6 ++++-- ompi/mca/pml/cm/pml_cm.h | 1 - ompi/mca/pml/cm/pml_cm_component.c | 26 +++----------------------- 7 files changed, 16 insertions(+), 31 deletions(-) diff --git a/ompi/mca/mtl/base/mtl_base_frame.c b/ompi/mca/mtl/base/mtl_base_frame.c index 55260d19c94..ea5784304a6 100644 --- a/ompi/mca/mtl/base/mtl_base_frame.c +++ b/ompi/mca/mtl/base/mtl_base_frame.c @@ -49,8 +49,9 @@ 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; @@ -84,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; } diff --git a/ompi/mca/mtl/mxm/mtl_mxm_component.c b/ompi/mca/mtl/mxm/mtl_mxm_component.c index 6afa47f096f..28c04a3efaf 100644 --- a/ompi/mca/mtl/mxm/mtl_mxm_component.c +++ b/ompi/mca/mtl/mxm/mtl_mxm_component.c @@ -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, diff --git a/ompi/mca/mtl/ofi/mtl_ofi_component.c b/ompi/mca/mtl/ofi/mtl_ofi_component.c index 35fb4e67ff8..4c9d444a618 100644 --- a/ompi/mca/mtl/ofi/mtl_ofi_component.c +++ b/ompi/mca/mtl/ofi/mtl_ofi_component.c @@ -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, diff --git a/ompi/mca/mtl/psm/mtl_psm_component.c b/ompi/mca/mtl/psm/mtl_psm_component.c index b018d7f587f..b4b71b2f99b 100644 --- a/ompi/mca/mtl/psm/mtl_psm_component.c +++ b/ompi/mca/mtl/psm/mtl_psm_component.c @@ -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, diff --git a/ompi/mca/mtl/psm2/mtl_psm2_component.c b/ompi/mca/mtl/psm2/mtl_psm2_component.c index 5a43f77a6a1..28174728a91 100644 --- a/ompi/mca/mtl/psm2/mtl_psm2_component.c +++ b/ompi/mca/mtl/psm2/mtl_psm2_component.c @@ -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 @@ -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$ @@ -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, diff --git a/ompi/mca/pml/cm/pml_cm.h b/ompi/mca/pml/cm/pml_cm.h index 471b4f6056d..2c697910d9c 100644 --- a/ompi/mca/pml/cm/pml_cm.h +++ b/ompi/mca/pml/cm/pml_cm.h @@ -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; diff --git a/ompi/mca/pml/cm/pml_cm_component.c b/ompi/mca/pml/cm/pml_cm_component.c index 94e12d9c9c5..72f79312cf9 100644 --- a/ompi/mca/pml/cm/pml_cm_component.c +++ b/ompi/mca/pml/cm/pml_cm_component.c @@ -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; } @@ -143,26 +135,14 @@ mca_pml_cm_component_init(int* priority, { int ret; + *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; - } else { - *priority = ompi_pml_cm.default_priority; } if (ompi_mtl->mtl_flags & MCA_MTL_BASE_FLAG_REQUIRE_WORLD) {