Commit 4efb44c4 authored by Pavan Balaji's avatar Pavan Balaji
Browse files

[svn-r6619] Initial draft of the LSF resource management kernel.

parent 52f80dba
......@@ -196,9 +196,9 @@ AC_SUBST(hydra_bss_names)
#########################################################################
# Check what resource management kernel we should use
#########################################################################
AC_ARG_WITH(hydra-rmk, [ --with-hydra-rmk=name - Resource Management Kernel (pbs)],
AC_ARG_WITH(hydra-rmk, [ --with-hydra-rmk=name - Resource Management Kernel (pbs, lsf)],
[ hydra_rmk=$withval ],
[ hydra_rmk="dummy,pbs" ])
[ hydra_rmk="dummy,pbs,lsf" ])
AC_MSG_CHECKING(resource management kernel)
AC_MSG_RESULT($hydra_rmk)
hydra_rmk_names="`echo $hydra_rmk | sed -e 's/:/ /g' -e 's/,/ /g'`"
......@@ -214,6 +214,10 @@ for hydra_rmk_name in ${hydra_rmk_names}; do
hydra_rmk_pbs=true
available_rmk=`echo $available_rmk pbs`
;;
lsf)
hydra_rmk_lsf=true
available_rmk=`echo $available_rmk lsf`
;;
*)
;;
esac
......@@ -250,6 +254,7 @@ AC_SUBST(hydra_rmk_init_decl)
AC_SUBST(hydra_rmk_name_array)
AC_SUBST(hydra_rmk_init_array)
AM_CONDITIONAL([hydra_rmk_pbs], [$hydra_rmk_pbs])
AM_CONDITIONAL([hydra_rmk_lsf], [$hydra_rmk_lsf])
#########################################################################
......
......@@ -12,3 +12,7 @@ include tools/rmk/utils/Makefile.mk
if hydra_rmk_pbs
include tools/rmk/pbs/Makefile.mk
endif
if hydra_rmk_lsf
include tools/rmk/lsf/Makefile.mk
endif
# -*- Mode: Makefile; -*-
#
# (C) 2008 by Argonne National Laboratory.
# See COPYRIGHT in top-level directory.
#
libhydra_la_SOURCES += $(top_srcdir)/tools/rmk/lsf/rmk_lsf_init.c \
$(top_srcdir)/tools/rmk/lsf/rmk_lsf_query_node_list.c
/* -*- Mode: C; c-basic-offset:4 ; -*- */
/*
* (C) 2008 by Argonne National Laboratory.
* See COPYRIGHT in top-level directory.
*/
#ifndef RMK_LSF_H_INCLUDED
#define RMK_LSF_H_INCLUDED
#include "hydra_base.h"
HYD_status HYDT_rmkd_lsf_query_node_list(struct HYD_node **node_list);
#endif /* RMK_LSF_H_INCLUDED */
/* -*- Mode: C; c-basic-offset:4 ; -*- */
/*
* (C) 2008 by Argonne National Laboratory.
* See COPYRIGHT in top-level directory.
*/
#include "hydra_base.h"
#include "rmki.h"
#include "rmk_lsf.h"
HYD_status HYDT_rmki_lsf_init(void)
{
HYD_status status = HYD_SUCCESS;
HYDU_FUNC_ENTER();
HYDT_rmki_fns.query_node_list = HYDT_rmkd_lsf_query_node_list;
HYDU_FUNC_EXIT();
return status;
}
/* -*- Mode: C; c-basic-offset:4 ; -*- */
/*
* (C) 2008 by Argonne National Laboratory.
* See COPYRIGHT in top-level directory.
*/
#include "hydra_base.h"
#include "rmki.h"
#include "rmk_lsf.h"
HYD_status HYDT_rmkd_lsf_query_node_list(struct HYD_node **node_list)
{
char *hosts, *hostname, *num_procs_str;
int num_procs;
HYD_status status = HYD_SUCCESS;
HYDU_FUNC_ENTER();
if (MPL_env2str("LSB_MCPU_HOSTS", (const char **) &hosts) == 0)
hosts = NULL;
if (hosts == NULL) {
*node_list = NULL;
HYDU_ERR_SETANDJUMP(status, HYD_INTERNAL_ERROR, "No LSF node list found\n");
}
else {
while (1) {
hostname = strtok(hosts, " ");
if (hostname == NULL)
break;
num_procs_str = strtok(hosts, " ");
HYDU_ASSERT(num_procs_str, status);
num_procs = atoi(num_procs_str);
status = HYDU_add_to_node_list(hostname, num_procs, node_list);
HYDU_ERR_POP(status, "unable to add to node list\n");
}
}
fn_exit:
HYDU_FUNC_EXIT();
return status;
fn_fail:
goto fn_exit;
}
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment