Skip to content

Update schizo framework #2365

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

Closed
wants to merge 1 commit into from
Closed
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
60 changes: 60 additions & 0 deletions config/opal_check_singularity.m4
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
# -*- shell-script ; indent-tabs-mode:nil -*-
#
# Copyright (c) 2016 Intel, Inc. All rights reserved.
# $COPYRIGHT$
#
# Additional copyrights may follow
#
# $HEADER$
#

# OPAL_CHECK_SINGULARITY(prefix, [action-if-found], [action-if-not-found])
# --------------------------------------------------------
AC_DEFUN([OPAL_CHECK_SINGULARITY],[
OPAL_VAR_SCOPE_PUSH([spath have_singularity])

AC_ARG_WITH([singularity],
[AC_HELP_STRING([--with-singularity(=DIR)],
[Build support for the Singularity container, optionally adding DIR to the search path])])
spath=
AC_MSG_CHECKING([if Singularity support is to be built])
AS_IF([test "$with_singularity" = "no"],
[AC_MSG_RESULT([no])
have_singularity=no],
[AC_MSG_RESULT([yes])
AS_IF([test -z "$with_singularity" || test "$with_singularity" = "yes"],
[ # look for the singularity command in the default path
AC_CHECK_PROG([SINGULARITY], [singularity], [singularity])
AS_IF([test "$SINGULARITY" != ""],
[have_singularity=yes],
[AS_IF([test "$with_singularity" = "yes"],
[AC_MSG_WARN([Singularity support requested, but required executable])
AC_MSG_WARN(["singularity" not found in default locations])
AC_MSG_ERROR([Cannot continue])])
have_singularity=no])],
[ AC_MSG_CHECKING([for existence of $with_singularity/bin])
# look for the singularity command in the bin subdirectory
AS_IF([test ! -d "$with_singularity/bin"],
[AC_MSG_RESULT([not found])
AC_MSG_WARN([Directory $with_singularity/bin not found])
AC_MSG_ERROR([Cannot continue])],
[AC_MSG_RESULT([found])])
save_path=$PATH
PATH=$with_singularity/bin:$PATH
AC_CHECK_PROG([SINGULARITY], [singularity], [singularity])
AS_IF([test "$SINGULARITY" != ""],
[have_singularity=yes
spath=$with_singularity/bin],
[have_singlarity=no
AC_MSG_WARN([Singularity support requested, but required executable])
AC_MSG_WARN(["singularity" not found in either default or specified path])
AC_MSG_ERROR([Cannot continue])])
PATH=$save_path
]
)])

AC_DEFINE_UNQUOTED(OPAL_SINGULARITY_PATH, "$spath", [Path to Singularity binaries])
AS_IF([test "$have_singularity" = "yes"],
[$2], [$3])
OPAL_VAR_SCOPE_POP
])
10 changes: 8 additions & 2 deletions orte/mca/ess/base/ess_base_fns.c
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
* Copyright (c) 2011-2012 Cisco Systems, Inc. All rights reserved.
* Copyright (c) 2011-2012 Los Alamos National Security, LLC.
* All rights reserved.
* Copyright (c) 2014-2015 Intel, Inc. All rights reserved.
* Copyright (c) 2014-2016 Intel, Inc. All rights reserved.
* Copyright (c) 2014 Research Organization for Information Science
* and Technology (RIST). All rights reserved.
* $COPYRIGHT$
Expand Down Expand Up @@ -76,6 +76,9 @@ int orte_ess_base_proc_binding(void)
/* we were not bound at launch */
if (NULL == opal_hwloc_topology) {
/* there is nothing we can do, so just return */
OPAL_OUTPUT_VERBOSE((5, orte_ess_base_framework.framework_output,
"%s NULL topology - Binding not supported",
ORTE_NAME_PRINT(ORTE_PROC_MY_NAME)));
return ORTE_SUCCESS;
}
support = (struct hwloc_topology_support*)hwloc_topology_get_support(opal_hwloc_topology);
Expand Down Expand Up @@ -115,6 +118,9 @@ int orte_ess_base_proc_binding(void)
/* the system is capable of doing processor affinity, but it
* has not yet been set - see if a slot_list was given
*/
OPAL_OUTPUT_VERBOSE((5, orte_ess_base_framework.framework_output,
"%s Binding available - computing",
ORTE_NAME_PRINT(ORTE_PROC_MY_NAME)));
hwloc_bitmap_zero(cpus);
if (OPAL_BIND_TO_CPUSET == OPAL_GET_BINDING_POLICY(opal_hwloc_binding_policy)) {
if (OPAL_SUCCESS != (ret = opal_hwloc_base_slot_list_parse(opal_hwloc_base_slot_list,
Expand Down Expand Up @@ -269,7 +275,7 @@ int orte_ess_base_proc_binding(void)
orte_process_info.cpuset = NULL;
}
if (opal_hwloc_report_bindings || 4 < opal_output_get_verbosity(orte_ess_base_framework.framework_output)) {
opal_output(0, "MCW rank %d is not bound",
opal_output(0, "MCW rank %d is not bound - get_cpubind returned negative",
ORTE_PROC_MY_NAME->vpid);
}
} else {
Expand Down
16 changes: 1 addition & 15 deletions orte/mca/ess/base/ess_base_std_orted.c
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
* Copyright (c) 2011 Cisco Systems, Inc. All rights reserved.
* Copyright (c) 2011-2015 Los Alamos National Security, LLC. All rights
* reserved.
* Copyright (c) 2013-2015 Intel, Inc. All rights reserved.
* Copyright (c) 2013-2016 Intel, Inc. All rights reserved.
* $COPYRIGHT$
*
* Additional copyrights may follow
Expand Down Expand Up @@ -56,7 +56,6 @@
#include "orte/mca/plm/base/base.h"
#include "orte/mca/odls/base/base.h"
#include "orte/mca/errmgr/errmgr.h"
#include "orte/mca/schizo/base/base.h"
#include "orte/mca/filem/base/base.h"
#include "orte/util/proc_info.h"
#include "orte/util/session_dir.h"
Expand Down Expand Up @@ -582,18 +581,6 @@ int orte_ess_base_orted_setup(char **hosts)
goto error;
}

/* setup the SCHIZO framework */
if (ORTE_SUCCESS != (ret = mca_base_framework_open(&orte_schizo_base_framework, 0))) {
ORTE_ERROR_LOG(ret);
error = "orte_schizo_base_open";
goto error;
}
if (ORTE_SUCCESS != (ret = orte_schizo_base_select())) {
ORTE_ERROR_LOG(ret);
error = "orte_schizo_select";
goto error;
}

return ORTE_SUCCESS;

error:
Expand Down Expand Up @@ -625,7 +612,6 @@ int orte_ess_base_orted_finalize(void)
(void) mca_base_framework_close(&opal_pmix_base_framework);

/* close frameworks */
(void) mca_base_framework_close(&orte_schizo_base_framework);
(void) mca_base_framework_close(&orte_filem_base_framework);
(void) mca_base_framework_close(&orte_grpcomm_base_framework);
(void) mca_base_framework_close(&orte_iof_base_framework);
Expand Down
16 changes: 1 addition & 15 deletions orte/mca/ess/base/ess_base_std_tool.c
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
* All rights reserved.
* Copyright (c) 2011-2015 Los Alamos National Security, LLC.
* All rights reserved.
* Copyright (c) 2013-2015 Intel, Inc. All rights reserved.
* Copyright (c) 2013-2016 Intel, Inc. All rights reserved.
* Copyright (c) 2014 Hochschule Esslingen. All rights reserved.
*
* Copyright (c) 2015 Cisco Systems, Inc. All rights reserved.
Expand Down Expand Up @@ -47,7 +47,6 @@
#include "orte/mca/errmgr/base/base.h"
#include "orte/mca/iof/base/base.h"
#include "orte/mca/state/base/base.h"
#include "orte/mca/schizo/base/base.h"
#include "orte/util/proc_info.h"
#include "orte/util/session_dir.h"
#include "orte/util/show_help.h"
Expand Down Expand Up @@ -188,18 +187,6 @@ int orte_ess_base_tool_setup(void)
* base proxy functions */
}

/* setup schizo in case we are parsing cmd lines */
if (ORTE_SUCCESS != (ret = mca_base_framework_open(&orte_schizo_base_framework, 0))) {
ORTE_ERROR_LOG(ret);
error = "orte_schizo_base_open";
goto error;
}
if (ORTE_SUCCESS != (ret = orte_schizo_base_select())) {
ORTE_ERROR_LOG(ret);
error = "orte_schizo_base_select";
goto error;
}

return ORTE_SUCCESS;

error:
Expand All @@ -223,7 +210,6 @@ int orte_ess_base_tool_finalize(void)
}
(void) mca_base_framework_close(&orte_routed_base_framework);
(void) mca_base_framework_close(&orte_rml_base_framework);
(void) mca_base_framework_close(&orte_schizo_base_framework);
(void) mca_base_framework_close(&orte_errmgr_base_framework);

return ORTE_SUCCESS;
Expand Down
16 changes: 1 addition & 15 deletions orte/mca/ess/hnp/ess_hnp_module.c
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
* Copyright (c) 2011-2014 Cisco Systems, Inc. All rights reserved.
* Copyright (c) 2011-2015 Los Alamos National Security, LLC. All rights
* reserved.
* Copyright (c) 2013-2015 Intel, Inc. All rights reserved.
* Copyright (c) 2013-2016 Intel, Inc. All rights reserved.
* $COPYRIGHT$
*
* Additional copyrights may follow
Expand Down Expand Up @@ -68,7 +68,6 @@
#include "orte/mca/odls/base/base.h"
#include "orte/mca/rmaps/base/base.h"
#include "orte/mca/filem/base/base.h"
#include "orte/mca/schizo/base/base.h"
#include "orte/mca/state/base/base.h"
#include "orte/mca/state/state.h"

Expand Down Expand Up @@ -694,18 +693,6 @@ static int rte_init(void)
goto error;
}

/* setup the schizo framework */
if (ORTE_SUCCESS != (ret = mca_base_framework_open(&orte_schizo_base_framework, 0))) {
ORTE_ERROR_LOG(ret);
error = "orte_schizo_base_open";
goto error;
}
if (ORTE_SUCCESS != (ret = orte_schizo_base_select())) {
ORTE_ERROR_LOG(ret);
error = "orte_schizo_select";
goto error;
}

/* if a tool has launched us and is requesting event reports,
* then set its contact info into the comm system
*/
Expand Down Expand Up @@ -774,7 +761,6 @@ static int rte_finalize(void)
/* cleanup our data server */
orte_data_server_finalize();

(void) mca_base_framework_close(&orte_schizo_base_framework);
(void) mca_base_framework_close(&orte_dfs_base_framework);
(void) mca_base_framework_close(&orte_filem_base_framework);
/* output any lingering stdout/err data */
Expand Down
55 changes: 21 additions & 34 deletions orte/mca/ess/pmi/ess_pmi_component.c
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
* Copyright (c) 2011 Cisco Systems, Inc. All rights reserved.
* Copyright (c) 2011-2015 Los Alamos National Security, LLC. All
* rights reserved.
* Copyright (c) 2014 Intel, Inc. All rights reserved.
* Copyright (c) 2014-2016 Intel, Inc. All rights reserved.
* $COPYRIGHT$
*
* Additional copyrights may follow
Expand All @@ -26,6 +26,7 @@

#include "orte/util/proc_info.h"
#include "orte/mca/errmgr/errmgr.h"
#include "orte/mca/schizo/schizo.h"

#include "orte/mca/ess/ess.h"
#include "orte/mca/ess/pmi/ess_pmi.h"
Expand Down Expand Up @@ -67,41 +68,27 @@ static int pmi_component_open(void)

static int pmi_component_query(mca_base_module_t **module, int *priority)
{
int ret;

/* all APPS must use pmix */
if (ORTE_PROC_IS_APP) {
if (NULL == opal_pmix.initialized) {
/* open and setup pmix */
if (OPAL_SUCCESS != (ret = mca_base_framework_open(&opal_pmix_base_framework, 0))) {
ORTE_ERROR_LOG(ret);
*priority = -1;
*module = NULL;
return ret;
}
if (OPAL_SUCCESS != (ret = opal_pmix_base_select())) {
/* don't error log this as it might not be an error at all */
*priority = -1;
*module = NULL;
(void) mca_base_framework_close(&opal_pmix_base_framework);
return ret;
}
}
if (!opal_pmix.initialized() && (OPAL_SUCCESS != (ret = opal_pmix.init()))) {
/* we cannot be in a PMI environment */
*priority = -1;
*module = NULL;
return ORTE_ERROR;
}
*priority = 35;
*module = (mca_base_module_t *)&orte_ess_pmi_module;
return ORTE_SUCCESS;
orte_schizo_launch_environ_t ret;

if (!ORTE_PROC_IS_APP) {
*module = NULL;
*priority = 0;
return ORTE_ERROR;
}

/* find out what our environment looks like */
ret = orte_schizo.check_launch_environment();
if (ORTE_SCHIZO_UNMANAGED_SINGLETON == ret ||
ORTE_SCHIZO_MANAGED_SINGLETON == ret) {
/* not us */
*module = NULL;
*priority = 0;
return ORTE_ERROR;
}

/* we can't run */
*priority = -1;
*module = NULL;
return ORTE_ERROR;
*priority = 35;
*module = (mca_base_module_t *)&orte_ess_pmi_module;
return ORTE_SUCCESS;
}


Expand Down
47 changes: 11 additions & 36 deletions orte/mca/ess/singleton/ess_singleton_component.c
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
* All rights reserved.
* Copyright (c) 2015 Los Alamos National Security, LLC. All rights
* reserved.
* Copyright (c) 2016 Intel, Inc. All rights reserved.
* $COPYRIGHT$
*
* Additional copyrights may follow
Expand All @@ -33,6 +34,7 @@

#include "orte/util/proc_info.h"
#include "orte/mca/errmgr/errmgr.h"
#include "orte/mca/schizo/schizo.h"

#include "orte/mca/ess/ess.h"
#include "orte/mca/ess/singleton/ess_singleton.h"
Expand Down Expand Up @@ -97,7 +99,7 @@ orte_ess_singleton_component_open(void)

int orte_ess_singleton_component_query(mca_base_module_t **module, int *priority)
{
int ret;
orte_schizo_launch_environ_t ret;

/* if we are an HNP, daemon, or tool, then we
* are definitely not a singleton!
Expand All @@ -109,45 +111,18 @@ int orte_ess_singleton_component_query(mca_base_module_t **module, int *priority
return ORTE_ERROR;
}

/* okay, we still could be a singleton or
* an application process. If we have been
* given an HNP URI, then we are definitely
* not a singleton
*/
if (NULL != orte_process_info.my_hnp_uri) {
*module = NULL;
return ORTE_ERROR;
}

/* open and setup pmix */
if (NULL == opal_pmix.initialized) {
if (OPAL_SUCCESS != (ret = mca_base_framework_open(&opal_pmix_base_framework, 0))) {
/* if PMIx is not available, then we are indeed a singleton */
goto single;
}
if (OPAL_SUCCESS != (ret = opal_pmix_base_select())) {
/* if PMIx is not available, then we are indeed a singleton */
(void) mca_base_framework_close(&opal_pmix_base_framework);
goto single;
}
}
if (opal_pmix.initialized()) {
/* we are in a PMI environment and are therefore
* not a singleton */
*priority = -1;
/* find out what our environment looks like */
ret = orte_schizo.check_launch_environment();
if (ORTE_SCHIZO_UNMANAGED_SINGLETON != ret &&
ORTE_SCHIZO_MANAGED_SINGLETON != ret) {
/* not us */
*module = NULL;
*priority = 0;
return ORTE_ERROR;
}

single:
/* okay, we could still be an application process,
* but launched in "standalone" mode - i.e., directly
* launched by an environment instead of via mpirun.
* We need to set our priority low so that any enviro
* component will override us. If they don't, then we
* want to be selected as we must be a singleton
*/
*priority = 25;
/* okay, we want to be selected as we must be a singleton */
*priority = 100;
*module = (mca_base_module_t *)&orte_ess_singleton_module;
return ORTE_SUCCESS;
}
Expand Down
Loading