2015-04-18 04:00:31 +03:00
|
|
|
/* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil -*- */
|
2005-03-14 23:57:21 +03:00
|
|
|
/*
|
2008-05-06 22:08:45 +04:00
|
|
|
* Copyright (c) 2004-2008 The Trustees of Indiana University and Indiana
|
2005-11-05 22:57:48 +03:00
|
|
|
* 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.
|
2015-06-24 06:59:57 +03:00
|
|
|
* Copyright (c) 2004-2005 High Performance Computing Center Stuttgart,
|
2005-03-14 23:57:21 +03:00
|
|
|
* University of Stuttgart. All rights reserved.
|
2005-03-24 15:43:37 +03:00
|
|
|
* Copyright (c) 2004-2005 The Regents of the University of California.
|
|
|
|
* All rights reserved.
|
2009-04-15 20:50:41 +04:00
|
|
|
* Copyright (c) 2007-2009 Cisco Systems, Inc. All rights reserved.
|
2015-04-18 04:00:31 +03:00
|
|
|
* Copyright (c) 2015 Los Alamos National Security, LLC. All rights
|
|
|
|
* reserved.
|
2005-03-14 23:57:21 +03:00
|
|
|
* $COPYRIGHT$
|
2015-06-24 06:59:57 +03:00
|
|
|
*
|
2005-03-14 23:57:21 +03:00
|
|
|
* Additional copyrights may follow
|
2015-06-24 06:59:57 +03:00
|
|
|
*
|
2005-03-14 23:57:21 +03:00
|
|
|
* $HEADER$
|
|
|
|
*/
|
|
|
|
|
|
|
|
#include "orte_config.h"
|
2008-07-23 06:34:41 +04:00
|
|
|
#include "orte/constants.h"
|
2007-07-12 18:46:41 +04:00
|
|
|
|
|
|
|
#include <lsf/lsbatch.h>
|
|
|
|
|
2006-02-12 04:33:29 +03:00
|
|
|
#include "opal/mca/base/base.h"
|
2007-07-10 16:43:05 +04:00
|
|
|
|
|
|
|
#include "ras_lsf.h"
|
2005-03-14 23:57:21 +03:00
|
|
|
|
|
|
|
/*
|
|
|
|
* Local functions
|
|
|
|
*/
|
|
|
|
|
2007-07-10 16:43:05 +04:00
|
|
|
static int orte_ras_lsf_open(void);
|
|
|
|
static int orte_ras_lsf_close(void);
|
2008-05-06 22:08:45 +04:00
|
|
|
static int orte_ras_lsf_component_query(mca_base_module_t **module, int *priority);
|
2005-03-14 23:57:21 +03:00
|
|
|
|
|
|
|
|
2008-07-23 06:34:41 +04:00
|
|
|
orte_ras_base_component_t mca_ras_lsf_component = {
|
2015-04-18 04:00:31 +03:00
|
|
|
.base_version = {
|
2008-02-28 04:57:57 +03:00
|
|
|
/* Indicate that we are a ras v2.0.0 component (which also
|
2015-04-18 04:00:31 +03:00
|
|
|
implies a specific MCA version) */
|
|
|
|
|
2008-02-28 04:57:57 +03:00
|
|
|
ORTE_RAS_BASE_VERSION_2_0_0,
|
2015-04-18 04:00:31 +03:00
|
|
|
|
|
|
|
.mca_component_name = "lsf",
|
|
|
|
MCA_BASE_MAKE_VERSION(component, ORTE_MAJOR_VERSION, ORTE_MINOR_VERSION,
|
|
|
|
ORTE_RELEASE_VERSION),
|
|
|
|
.mca_open_component = orte_ras_lsf_open,
|
|
|
|
.mca_close_component = orte_ras_lsf_close,
|
|
|
|
.mca_query_component = orte_ras_lsf_component_query,
|
|
|
|
},
|
|
|
|
.base_data = {
|
|
|
|
/* The component is checkpoint ready */
|
|
|
|
MCA_BASE_METADATA_PARAM_CHECKPOINT
|
|
|
|
},
|
2005-03-14 23:57:21 +03:00
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
* component open/close/init function
|
|
|
|
*/
|
2007-07-10 16:43:05 +04:00
|
|
|
static int orte_ras_lsf_open(void)
|
2005-03-14 23:57:21 +03:00
|
|
|
{
|
|
|
|
return ORTE_SUCCESS;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2008-05-06 22:08:45 +04:00
|
|
|
static int orte_ras_lsf_component_query(mca_base_module_t **module, int *priority)
|
2005-03-14 23:57:21 +03:00
|
|
|
{
|
2007-07-10 16:43:05 +04:00
|
|
|
/* check if lsf is running here */
|
2007-07-26 22:49:29 +04:00
|
|
|
if (NULL == getenv("LSB_JOBID") || lsb_init("ORTE launcher") < 0) {
|
2007-07-10 16:43:05 +04:00
|
|
|
/* nope, not here */
|
2008-05-06 22:08:45 +04:00
|
|
|
*module = NULL;
|
|
|
|
return ORTE_ERROR;
|
2007-07-10 16:43:05 +04:00
|
|
|
}
|
2015-06-24 06:59:57 +03:00
|
|
|
|
2008-07-23 06:34:41 +04:00
|
|
|
*priority = 75;
|
2008-05-06 22:08:45 +04:00
|
|
|
*module = (mca_base_module_t *) &orte_ras_lsf_module;
|
|
|
|
return ORTE_SUCCESS;
|
2005-03-14 23:57:21 +03:00
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Close all subsystems.
|
|
|
|
*/
|
|
|
|
|
2007-07-10 16:43:05 +04:00
|
|
|
static int orte_ras_lsf_close(void)
|
2005-03-14 23:57:21 +03:00
|
|
|
{
|
|
|
|
return ORTE_SUCCESS;
|
|
|
|
}
|
|
|
|
|
|
|
|
|