2005-03-14 20:57:21 +00:00
|
|
|
/*
|
2005-11-05 19:57:48 +00:00
|
|
|
* 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.
|
2005-03-14 20:57:21 +00:00
|
|
|
* Copyright (c) 2004-2005 High Performance Computing Center Stuttgart,
|
|
|
|
* University of Stuttgart. All rights reserved.
|
2005-03-24 12:43:37 +00:00
|
|
|
* Copyright (c) 2004-2005 The Regents of the University of California.
|
|
|
|
* All rights reserved.
|
2005-03-14 20:57:21 +00:00
|
|
|
* $COPYRIGHT$
|
|
|
|
*
|
|
|
|
* Additional copyrights may follow
|
|
|
|
*
|
|
|
|
* $HEADER$
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
|
|
#include "orte_config.h"
|
2008-02-28 01:57:57 +00:00
|
|
|
#include "orte/constants.h"
|
|
|
|
|
2008-06-18 03:15:56 +00:00
|
|
|
#if !ORTE_DISABLE_FULL_SUPPORT
|
|
|
|
|
2009-02-14 02:26:12 +00:00
|
|
|
#include "opal/util/output.h"
|
2006-02-12 01:33:29 +00:00
|
|
|
#include "opal/mca/mca.h"
|
|
|
|
#include "opal/mca/base/base.h"
|
2006-09-14 21:29:51 +00:00
|
|
|
|
2008-02-28 01:57:57 +00:00
|
|
|
|
|
|
|
#include "orte/mca/plm/plm.h"
|
|
|
|
#include "orte/mca/plm/base/plm_private.h"
|
2005-03-14 20:57:21 +00:00
|
|
|
|
2008-06-18 03:15:56 +00:00
|
|
|
#endif
|
|
|
|
|
|
|
|
#include "orte/mca/plm/base/base.h"
|
2005-03-14 20:57:21 +00:00
|
|
|
|
|
|
|
/*
|
|
|
|
* The following file was created by configure. It contains extern
|
|
|
|
* statements and the definition of an array of pointers to each
|
|
|
|
* module's public mca_base_module_t struct.
|
|
|
|
*/
|
|
|
|
|
2008-02-28 01:57:57 +00:00
|
|
|
#include "orte/mca/plm/base/static-components.h"
|
2005-03-14 20:57:21 +00:00
|
|
|
|
2008-06-18 03:15:56 +00:00
|
|
|
#if ORTE_DISABLE_FULL_SUPPORT
|
|
|
|
/* have to include a bogus function here so that
|
|
|
|
* the build system sees at least one function
|
|
|
|
* in the library
|
|
|
|
*/
|
|
|
|
int orte_plm_base_open(void)
|
|
|
|
{
|
|
|
|
return ORTE_SUCCESS;
|
|
|
|
}
|
|
|
|
|
|
|
|
#else
|
|
|
|
|
|
|
|
|
2009-04-29 00:11:19 +00:00
|
|
|
static void slave_file_construct(orte_slave_files_t *ptr)
|
|
|
|
{
|
|
|
|
ptr->node = NULL;
|
|
|
|
ptr->local = false;
|
|
|
|
ptr->bootproxy = NULL;
|
|
|
|
ptr->positioned = false;
|
|
|
|
OBJ_CONSTRUCT(&ptr->apps, opal_pointer_array_t);
|
|
|
|
opal_pointer_array_init(&ptr->apps, 8, 1024, 8);
|
|
|
|
OBJ_CONSTRUCT(&ptr->files, opal_pointer_array_t);
|
|
|
|
opal_pointer_array_init(&ptr->files, 8, 1024, 8);
|
|
|
|
}
|
|
|
|
static void slave_file_destruct(orte_slave_files_t *ptr)
|
|
|
|
{
|
|
|
|
int i;
|
|
|
|
char *cptr;
|
|
|
|
|
|
|
|
if (NULL != ptr->node) free(ptr->node);
|
|
|
|
if (NULL != ptr->bootproxy) free(ptr->bootproxy);
|
|
|
|
for (i=0; i < ptr->apps.size; i++) {
|
|
|
|
if (NULL != (cptr = (char*)opal_pointer_array_get_item(&ptr->apps, i))) {
|
|
|
|
free(cptr);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
OBJ_DESTRUCT(&ptr->apps);
|
|
|
|
for (i=0; i < ptr->files.size; i++) {
|
|
|
|
if (NULL != (cptr = (char*)opal_pointer_array_get_item(&ptr->files, i))) {
|
|
|
|
free(cptr);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
OBJ_DESTRUCT(&ptr->files);
|
|
|
|
}
|
|
|
|
OBJ_CLASS_INSTANCE(orte_slave_files_t,
|
|
|
|
opal_list_item_t,
|
|
|
|
slave_file_construct,
|
|
|
|
slave_file_destruct);
|
|
|
|
|
2008-02-28 01:57:57 +00:00
|
|
|
/*
|
|
|
|
* Global public variables
|
|
|
|
*/
|
|
|
|
orte_plm_base_t orte_plm_base;
|
2005-03-14 20:57:21 +00:00
|
|
|
|
|
|
|
/*
|
2008-02-28 01:57:57 +00:00
|
|
|
* Global variables for use within PLM frameworks
|
2005-03-14 20:57:21 +00:00
|
|
|
*/
|
2008-02-28 01:57:57 +00:00
|
|
|
orte_plm_globals_t orte_plm_globals;
|
2005-03-14 20:57:21 +00:00
|
|
|
|
2006-09-14 21:29:51 +00:00
|
|
|
/*
|
|
|
|
* The default module
|
|
|
|
*/
|
2008-02-28 01:57:57 +00:00
|
|
|
orte_plm_base_module_t orte_plm = {
|
|
|
|
orte_plm_proxy_init,
|
|
|
|
NULL, /* cannot set hnp name in a proxy */
|
|
|
|
orte_plm_proxy_spawn,
|
2008-04-14 18:26:08 +00:00
|
|
|
NULL, /* cannot remotely spawn by default */
|
2008-02-28 01:57:57 +00:00
|
|
|
NULL, /* cannot terminate job from a proxy */
|
|
|
|
NULL, /* cannot terminate orteds from a proxy */
|
|
|
|
NULL, /* cannot signal job from a proxy */
|
|
|
|
orte_plm_proxy_finalize
|
|
|
|
};
|
2006-09-14 21:29:51 +00:00
|
|
|
|
2005-03-14 20:57:21 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Function for finding and opening either all MCA modules, or the one
|
|
|
|
* that was specifically requested via a MCA parameter.
|
|
|
|
*/
|
2008-02-28 01:57:57 +00:00
|
|
|
int orte_plm_base_open(void)
|
2005-03-14 20:57:21 +00:00
|
|
|
{
|
2006-10-01 22:37:30 +00:00
|
|
|
/* Debugging / verbose output. Always have stream open, with
|
|
|
|
verbose set by the mca open system... */
|
2008-06-09 14:53:58 +00:00
|
|
|
orte_plm_globals.output = opal_output_open(NULL);
|
2006-09-29 12:45:50 +00:00
|
|
|
|
|
|
|
/* init selected to be false */
|
2008-02-28 01:57:57 +00:00
|
|
|
orte_plm_base.selected = false;
|
2005-03-14 20:57:21 +00:00
|
|
|
|
2006-11-13 21:51:34 +00:00
|
|
|
/* initialize the condition variables for orted comm */
|
2008-02-28 01:57:57 +00:00
|
|
|
OBJ_CONSTRUCT(&orte_plm_globals.orted_cmd_lock, opal_mutex_t);
|
|
|
|
OBJ_CONSTRUCT(&orte_plm_globals.orted_cmd_cond, opal_condition_t);
|
|
|
|
|
|
|
|
/* init the next jobid */
|
|
|
|
orte_plm_globals.next_jobid = 0;
|
|
|
|
|
2009-02-09 20:44:44 +00:00
|
|
|
/* init the rsh support */
|
|
|
|
orte_plm_globals.rsh_agent_argv = NULL;
|
|
|
|
orte_plm_globals.rsh_agent_path = NULL;
|
|
|
|
orte_plm_globals.local_slaves = 0;
|
2009-04-29 00:11:19 +00:00
|
|
|
OBJ_CONSTRUCT(&orte_plm_globals.slave_files, opal_list_t);
|
|
|
|
|
2005-03-14 20:57:21 +00:00
|
|
|
/* Open up all the components that we can find */
|
|
|
|
|
|
|
|
if (ORTE_SUCCESS !=
|
2008-02-28 01:57:57 +00:00
|
|
|
mca_base_components_open("plm", orte_plm_globals.output,
|
|
|
|
mca_plm_base_static_components,
|
|
|
|
&orte_plm_base.available_components, true)) {
|
2005-03-14 20:57:21 +00:00
|
|
|
return ORTE_ERROR;
|
|
|
|
}
|
2006-10-01 22:37:30 +00:00
|
|
|
|
2005-03-14 20:57:21 +00:00
|
|
|
/* All done */
|
|
|
|
|
|
|
|
return ORTE_SUCCESS;
|
|
|
|
}
|
2008-06-18 03:15:56 +00:00
|
|
|
|
|
|
|
#endif
|