Add a plm component for local-only operation that doesn't require rsh/ssh to be installed. Requested by Fedora packagers for testing purposes.
cmr=v1.7.5:reviewer=jsquyres:subject=Add a plm component for local-only operation This commit was SVN r30645.
Этот коммит содержится в:
родитель
636493393c
Коммит
0dc5f50d27
45
orte/mca/plm/isolated/Makefile.am
Обычный файл
45
orte/mca/plm/isolated/Makefile.am
Обычный файл
@ -0,0 +1,45 @@
|
||||
#
|
||||
# Copyright (c) 2004-2005 The Trustees of Indiana University and Indiana
|
||||
# University Research and Technology
|
||||
# Corporation. All rights reserved.
|
||||
# Copyright (c) 2004-2005 The University of Tennessee and The University
|
||||
# of Tennessee Research Foundation. All rights
|
||||
# reserved.
|
||||
# Copyright (c) 2004-2005 High Performance Computing Center Stuttgart,
|
||||
# University of Stuttgart. All rights reserved.
|
||||
# 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) 2014 Intel, Inc. All rights reserved.
|
||||
# $COPYRIGHT$
|
||||
#
|
||||
# Additional copyrights may follow
|
||||
#
|
||||
# $HEADER$
|
||||
#
|
||||
|
||||
sources = \
|
||||
plm_isolated.h \
|
||||
plm_isolated_component.c \
|
||||
plm_isolated.c
|
||||
|
||||
# Make the output library in this directory, and name it either
|
||||
# mca_<type>_<name>.la (for DSO builds) or libmca_<type>_<name>.la
|
||||
# (for static builds).
|
||||
|
||||
if MCA_BUILD_orte_plm_isolated_DSO
|
||||
component_noinst =
|
||||
component_install = mca_plm_isolated.la
|
||||
else
|
||||
component_noinst = libmca_plm_isolated.la
|
||||
component_install =
|
||||
endif
|
||||
|
||||
mcacomponentdir = $(ompilibdir)
|
||||
mcacomponent_LTLIBRARIES = $(component_install)
|
||||
mca_plm_isolated_la_SOURCES = $(sources)
|
||||
mca_plm_isolated_la_LDFLAGS = -module -avoid-version
|
||||
|
||||
noinst_LTLIBRARIES = $(component_noinst)
|
||||
libmca_plm_isolated_la_SOURCES =$(sources)
|
||||
libmca_plm_isolated_la_LDFLAGS = -module -avoid-version
|
32
orte/mca/plm/isolated/configure.m4
Обычный файл
32
orte/mca/plm/isolated/configure.m4
Обычный файл
@ -0,0 +1,32 @@
|
||||
# -*- shell-script -*-
|
||||
#
|
||||
# Copyright (c) 2004-2005 The Trustees of Indiana University and Indiana
|
||||
# University Research and Technology
|
||||
# Corporation. All rights reserved.
|
||||
# Copyright (c) 2004-2005 The University of Tennessee and The University
|
||||
# of Tennessee Research Foundation. All rights
|
||||
# reserved.
|
||||
# Copyright (c) 2004-2005 High Performance Computing Center Stuttgart,
|
||||
# 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 reserved.
|
||||
# Copyright (c) 2010 Cisco Systems, Inc. All rights reserved.
|
||||
# Copyright (c) 2014 Intel, Inc. All rights reserved.
|
||||
# $COPYRIGHT$
|
||||
#
|
||||
# Additional copyrights may follow
|
||||
#
|
||||
# $HEADER$
|
||||
#
|
||||
|
||||
# MCA_plm_isolated_CONFIG([action-if-found], [action-if-not-found])
|
||||
# -----------------------------------------------------------
|
||||
AC_DEFUN([MCA_orte_plm_isolated_CONFIG],[
|
||||
AC_CONFIG_FILES([orte/mca/plm/isolated/Makefile])
|
||||
|
||||
AC_CHECK_FUNC([fork], [plm_isolated_happy="yes"], [plm_isolated_happy="no"])
|
||||
|
||||
AS_IF([test "$plm_isolated_happy" = "yes"], [$1], [$2])
|
||||
])dnl
|
145
orte/mca/plm/isolated/plm_isolated.c
Обычный файл
145
orte/mca/plm/isolated/plm_isolated.c
Обычный файл
@ -0,0 +1,145 @@
|
||||
/*
|
||||
* Copyright (c) 2004-2010 The Trustees of Indiana University and Indiana
|
||||
* University Research and Technology
|
||||
* Corporation. All rights reserved.
|
||||
* Copyright (c) 2004-2007 The University of Tennessee and The University
|
||||
* of Tennessee Research Foundation. All rights
|
||||
* reserved.
|
||||
* Copyright (c) 2004-2006 High Performance Computing Center Stuttgart,
|
||||
* University of Stuttgart. All rights reserved.
|
||||
* Copyright (c) 2004-2005 The Regents of the University of California.
|
||||
* All rights reserved.
|
||||
* Copyright (c) 2006-2007 Cisco Systems, Inc. All rights reserved.
|
||||
* Copyright (c) 2007-2012 Los Alamos National Security, LLC. All rights
|
||||
* reserved.
|
||||
* Copyright (c) 2008-2009 Sun Microsystems, Inc. All rights reserved.
|
||||
* Copyright (c) 2011 IBM Corporation. All rights reserved.
|
||||
* Copyright (c) 2014 Intel, Inc. All rights reserved.
|
||||
* $COPYRIGHT$
|
||||
*
|
||||
* Additional copyrights may follow
|
||||
*
|
||||
* $HEADER$
|
||||
*
|
||||
* These symbols are in a file by themselves to provide nice linker
|
||||
* semantics. Since linkers generally pull in symbols by object
|
||||
* files, keeping these symbols as the only symbols in this file
|
||||
* prevents utility programs such as "ompi_info" from having to import
|
||||
* entire components just to query their version and parameters.
|
||||
*/
|
||||
|
||||
#include "orte_config.h"
|
||||
#include "orte/constants.h"
|
||||
|
||||
#include "opal/util/output.h"
|
||||
#include "opal/mca/event/event.h"
|
||||
|
||||
#include "orte/util/show_help.h"
|
||||
#include "orte/runtime/orte_globals.h"
|
||||
#include "orte/util/name_fns.h"
|
||||
#include "orte/util/proc_info.h"
|
||||
|
||||
#include "orte/mca/errmgr/errmgr.h"
|
||||
#include "orte/mca/state/state.h"
|
||||
|
||||
#include "orte/mca/plm/plm.h"
|
||||
#include "orte/mca/plm/base/base.h"
|
||||
#include "orte/mca/plm/base/plm_private.h"
|
||||
#include "orte/mca/plm/isolated/plm_isolated.h"
|
||||
|
||||
static int isolated_init(void);
|
||||
static int isolated_launch(orte_job_t *jdata);
|
||||
static int remote_spawn(opal_buffer_t *launch);
|
||||
static int isolated_terminate_orteds(void);
|
||||
static int isolated_finalize(void);
|
||||
|
||||
orte_plm_base_module_t orte_plm_isolated_module = {
|
||||
isolated_init,
|
||||
orte_plm_base_set_hnp_name,
|
||||
isolated_launch,
|
||||
remote_spawn,
|
||||
orte_plm_base_orted_terminate_job,
|
||||
isolated_terminate_orteds,
|
||||
orte_plm_base_orted_kill_local_procs,
|
||||
orte_plm_base_orted_signal_local_procs,
|
||||
isolated_finalize
|
||||
};
|
||||
|
||||
static void launch_daemons(int fd, short args, void *cbdata);
|
||||
|
||||
/**
|
||||
* Init the module
|
||||
*/
|
||||
static int isolated_init(void)
|
||||
{
|
||||
int rc;
|
||||
|
||||
/* point to our launch command */
|
||||
if (ORTE_SUCCESS != (rc = orte_state.add_job_state(ORTE_JOB_STATE_LAUNCH_DAEMONS,
|
||||
launch_daemons, ORTE_SYS_PRI))) {
|
||||
ORTE_ERROR_LOG(rc);
|
||||
return rc;
|
||||
}
|
||||
|
||||
/* start the recvs */
|
||||
if (ORTE_SUCCESS != (rc = orte_plm_base_comm_start())) {
|
||||
ORTE_ERROR_LOG(rc);
|
||||
}
|
||||
|
||||
return rc;
|
||||
}
|
||||
|
||||
/*
|
||||
* launch a set of daemons from a remote daemon
|
||||
*/
|
||||
static int remote_spawn(opal_buffer_t *launch)
|
||||
{
|
||||
/* unused function in this mode */
|
||||
return ORTE_SUCCESS;
|
||||
}
|
||||
|
||||
static int isolated_launch(orte_job_t *jdata)
|
||||
{
|
||||
if (ORTE_JOB_CONTROL_RESTART & jdata->controls) {
|
||||
/* this is a restart situation - skip to the mapping stage */
|
||||
ORTE_ACTIVATE_JOB_STATE(jdata, ORTE_JOB_STATE_MAP);
|
||||
} else {
|
||||
/* new job - set it up */
|
||||
ORTE_ACTIVATE_JOB_STATE(jdata, ORTE_JOB_STATE_INIT);
|
||||
}
|
||||
return ORTE_SUCCESS;
|
||||
}
|
||||
|
||||
static void launch_daemons(int fd, short args, void *cbdata)
|
||||
{
|
||||
orte_state_caddy_t *state = (orte_state_caddy_t*)cbdata;
|
||||
|
||||
/* there are no daemons to launch, so just trigger the
|
||||
* daemon-launch-complete state
|
||||
*/
|
||||
ORTE_ACTIVATE_JOB_STATE(state->jdata, ORTE_JOB_STATE_DAEMONS_REPORTED);
|
||||
OBJ_RELEASE(state);
|
||||
}
|
||||
|
||||
static int isolated_terminate_orteds(void)
|
||||
{
|
||||
int rc;
|
||||
|
||||
/* send ourselves the halt command */
|
||||
if (ORTE_SUCCESS != (rc = orte_plm_base_orted_exit(ORTE_DAEMON_HALT_VM_CMD))) {
|
||||
ORTE_ERROR_LOG(rc);
|
||||
}
|
||||
return rc;
|
||||
}
|
||||
|
||||
static int isolated_finalize(void)
|
||||
{
|
||||
int rc;
|
||||
|
||||
/* cleanup any pending recvs */
|
||||
if (ORTE_SUCCESS != (rc = orte_plm_base_comm_stop())) {
|
||||
ORTE_ERROR_LOG(rc);
|
||||
}
|
||||
|
||||
return rc;
|
||||
}
|
42
orte/mca/plm/isolated/plm_isolated.h
Обычный файл
42
orte/mca/plm/isolated/plm_isolated.h
Обычный файл
@ -0,0 +1,42 @@
|
||||
/*
|
||||
* Copyright (c) 2004-2008 The Trustees of Indiana University and Indiana
|
||||
* University Research and Technology
|
||||
* Corporation. All rights reserved.
|
||||
* Copyright (c) 2004-2009 The University of Tennessee and The University
|
||||
* of Tennessee Research Foundation. All rights
|
||||
* reserved.
|
||||
* Copyright (c) 2004-2005 High Performance Computing Center Stuttgart,
|
||||
* University of Stuttgart. All rights reserved.
|
||||
* Copyright (c) 2004-2005 The Regents of the University of California.
|
||||
* All rights reserved.
|
||||
* Copyright (c) 2011 Los Alamos National Security, LLC. All rights
|
||||
* reserved.
|
||||
* Copyright (c) 2008 Sun Microsystems, Inc. All rights reserved.
|
||||
* Copyright (c) 2011 IBM Corporation. All rights reserved.
|
||||
* Copyright (c) 2014 Intel, Inc. All rights reserved.
|
||||
* $COPYRIGHT$
|
||||
*
|
||||
* Additional copyrights may follow
|
||||
*
|
||||
* $HEADER$
|
||||
*/
|
||||
|
||||
#ifndef ORTE_PLM_ISOLATED_EXPORT_H
|
||||
#define ORTE_PLM_ISOLATED_EXPORT_H
|
||||
|
||||
#include "orte_config.h"
|
||||
|
||||
#include "opal/mca/mca.h"
|
||||
|
||||
#include "orte/mca/plm/plm.h"
|
||||
|
||||
BEGIN_C_DECLS
|
||||
|
||||
|
||||
ORTE_MODULE_DECLSPEC extern orte_plm_base_component_t mca_plm_isolated_component;
|
||||
extern orte_plm_base_module_t orte_plm_isolated_module;
|
||||
|
||||
|
||||
END_C_DECLS
|
||||
|
||||
#endif /* ORTE_PLS_ISOLATED_EXPORT_H */
|
108
orte/mca/plm/isolated/plm_isolated_component.c
Обычный файл
108
orte/mca/plm/isolated/plm_isolated_component.c
Обычный файл
@ -0,0 +1,108 @@
|
||||
/*
|
||||
* Copyright (c) 2004-2008 The Trustees of Indiana University and Indiana
|
||||
* University Research and Technology
|
||||
* Corporation. All rights reserved.
|
||||
* Copyright (c) 2004-2006 The University of Tennessee and The University
|
||||
* of Tennessee Research Foundation. All rights
|
||||
* reserved.
|
||||
* Copyright (c) 2004-2005 High Performance Computing Center Stuttgart,
|
||||
* University of Stuttgart. All rights reserved.
|
||||
* Copyright (c) 2004-2005 The Regents of the University of California.
|
||||
* All rights reserved.
|
||||
* Copyright (c) 2007-2011 Los Alamos National Security, LLC. All rights
|
||||
* reserved.
|
||||
* Copyright (c) 2008-2009 Sun Microsystems, Inc. All rights reserved.
|
||||
* Copyright (c) 2010 Oracle and/or its affiliates. All rights
|
||||
* reserved.
|
||||
* Copyright (c) 2009 Cisco Systems, Inc. All rights reserved.
|
||||
* Copyright (c) 2011 IBM Corporation. All rights reserved.
|
||||
* Copyright (c) 2014 Intel, Inc. All rights reserved.
|
||||
* $COPYRIGHT$
|
||||
*
|
||||
* Additional copyrights may follow
|
||||
*
|
||||
* $HEADER$
|
||||
*
|
||||
* These symbols are in a file by themselves to provide nice linker
|
||||
* semantics. Since linkers generally pull in symbols by object
|
||||
* files, keeping these symbols as the only symbols in this file
|
||||
* prevents utility programs such as "ompi_info" from having to import
|
||||
* entire components just to query their version and parameters.
|
||||
*/
|
||||
|
||||
#include "orte_config.h"
|
||||
#include "orte/constants.h"
|
||||
|
||||
#include <stdlib.h>
|
||||
#ifdef HAVE_UNISTD_H
|
||||
#include <unistd.h>
|
||||
#endif
|
||||
#include <ctype.h>
|
||||
|
||||
#include "orte/runtime/orte_globals.h"
|
||||
|
||||
#include "orte/mca/plm/plm.h"
|
||||
#include "orte/mca/plm/isolated/plm_isolated.h"
|
||||
|
||||
/*
|
||||
* Public string showing the plm ompi_isolated component version number
|
||||
*/
|
||||
const char *mca_plm_isolated_component_version_string =
|
||||
"Open MPI isolated plm MCA component version " ORTE_VERSION;
|
||||
|
||||
|
||||
static int isolated_component_open(void);
|
||||
static int isolated_component_query(mca_base_module_t **module, int *priority);
|
||||
static int isolated_component_close(void);
|
||||
|
||||
/*
|
||||
* Instantiate the public struct with all of our public information
|
||||
* and pointers to our public functions in it
|
||||
*/
|
||||
|
||||
orte_plm_base_component_t mca_plm_isolated_component = {
|
||||
{
|
||||
ORTE_PLM_BASE_VERSION_2_0_0,
|
||||
|
||||
/* Component name and version */
|
||||
"isolated",
|
||||
ORTE_MAJOR_VERSION,
|
||||
ORTE_MINOR_VERSION,
|
||||
ORTE_RELEASE_VERSION,
|
||||
|
||||
/* Component open and close functions */
|
||||
isolated_component_open,
|
||||
isolated_component_close,
|
||||
isolated_component_query,
|
||||
NULL
|
||||
},
|
||||
{
|
||||
/* The component is checkpoint ready */
|
||||
MCA_BASE_METADATA_PARAM_CHECKPOINT
|
||||
}
|
||||
};
|
||||
|
||||
static int isolated_component_open(void)
|
||||
{
|
||||
return ORTE_SUCCESS;
|
||||
}
|
||||
|
||||
|
||||
static int isolated_component_query(mca_base_module_t **module, int *priority)
|
||||
{
|
||||
/* make ourselves available at a very low priority */
|
||||
if (ORTE_PROC_IS_HNP) {
|
||||
*priority = 0;
|
||||
*module = (mca_base_module_t *) &orte_plm_isolated_module;
|
||||
return ORTE_SUCCESS;
|
||||
}
|
||||
*module = NULL;
|
||||
return ORTE_ERROR;
|
||||
}
|
||||
|
||||
|
||||
static int isolated_component_close(void)
|
||||
{
|
||||
return ORTE_SUCCESS;
|
||||
}
|
||||
|
Загрузка…
Ссылка в новой задаче
Block a user