From 75c71fc838c5bc929938b56d7196a8e07cfd8310 Mon Sep 17 00:00:00 2001 From: Brian Barrett Date: Thu, 23 Sep 2004 14:55:55 +0000 Subject: [PATCH] * add ability to set priority for the hostfile llm * move and rename the default hostfile used by the hostfile llm This commit was SVN r2843. --- etc/Makefile.am | 3 +- .../openmpi-default-hostfile | 0 src/mca/llm/hostfile/Makefile.am | 2 +- src/mca/llm/hostfile/configure.params | 2 +- src/mca/llm/hostfile/etc/Makefile.am | 13 ------- src/mca/llm/hostfile/src/Makefile.am | 2 +- .../llm/hostfile/src/llm_hostfile_component.c | 35 ++++++++++++------- 7 files changed, 27 insertions(+), 30 deletions(-) rename src/mca/llm/hostfile/etc/llm_hostfile => etc/openmpi-default-hostfile (100%) delete mode 100644 src/mca/llm/hostfile/etc/Makefile.am diff --git a/etc/Makefile.am b/etc/Makefile.am index a8986f5544..ef644b6ea4 100644 --- a/etc/Makefile.am +++ b/etc/Makefile.am @@ -6,4 +6,5 @@ include $(top_srcdir)/config/Makefile.options EXTRA_DIST = $(sysconf_DATA) -sysconf_DATA = openmpi-mca-params.conf +sysconf_DATA = openmpi-mca-params.conf \ + openmpi-default-hostfile diff --git a/src/mca/llm/hostfile/etc/llm_hostfile b/etc/openmpi-default-hostfile similarity index 100% rename from src/mca/llm/hostfile/etc/llm_hostfile rename to etc/openmpi-default-hostfile diff --git a/src/mca/llm/hostfile/Makefile.am b/src/mca/llm/hostfile/Makefile.am index 31a84511ed..7407a4d0e4 100644 --- a/src/mca/llm/hostfile/Makefile.am +++ b/src/mca/llm/hostfile/Makefile.am @@ -6,7 +6,7 @@ include $(top_ompi_srcdir)/config/Makefile.options -SUBDIRS = src etc +SUBDIRS = src EXTRA_DIST = VERSION diff --git a/src/mca/llm/hostfile/configure.params b/src/mca/llm/hostfile/configure.params index 071d9401ae..501d5edc48 100644 --- a/src/mca/llm/hostfile/configure.params +++ b/src/mca/llm/hostfile/configure.params @@ -6,4 +6,4 @@ # Specific to this module PARAM_INIT_FILE=src/llm_hostfile.c -PARAM_CONFIG_FILES="Makefile src/Makefile etc/Makefile" +PARAM_CONFIG_FILES="Makefile src/Makefile" diff --git a/src/mca/llm/hostfile/etc/Makefile.am b/src/mca/llm/hostfile/etc/Makefile.am deleted file mode 100644 index f970d25cad..0000000000 --- a/src/mca/llm/hostfile/etc/Makefile.am +++ /dev/null @@ -1,13 +0,0 @@ -# -# $HEADER$ -# - -# Use the top-level Makefile.options - -include $(top_ompi_srcdir)/config/Makefile.options - -sysconf_DATA = \ - llm_hostfile - -EXTRA_DIST = \ - $(sysconf_DATA) diff --git a/src/mca/llm/hostfile/src/Makefile.am b/src/mca/llm/hostfile/src/Makefile.am index 5307b86715..44340770f9 100644 --- a/src/mca/llm/hostfile/src/Makefile.am +++ b/src/mca/llm/hostfile/src/Makefile.am @@ -5,7 +5,7 @@ include $(top_ompi_srcdir)/config/Makefile.options AM_CPPFLAGS = \ - -DOMPI_SYSCONFDIR="\"$(sysconfdir)\"" + -DOMPI_PKGDATADIR="\"$(pkgdatadir)\"" noinst_LTLIBRARIES = libmca_llm_hostfile.la libmca_llm_hostfile_la_SOURCES = \ diff --git a/src/mca/llm/hostfile/src/llm_hostfile_component.c b/src/mca/llm/hostfile/src/llm_hostfile_component.c index 1e5e3a4cc3..c472c40d45 100644 --- a/src/mca/llm/hostfile/src/llm_hostfile_component.c +++ b/src/mca/llm/hostfile/src/llm_hostfile_component.c @@ -50,21 +50,27 @@ const mca_llm_base_component_1_0_0_t mca_llm_hostfile_component = { /* * component variables handles */ -static int mca_llm_hostfile_param_filename; +static int param_filename; +static int param_priority; int mca_llm_hostfile_component_open(void) { - char *default_path = ompi_os_path(false, OMPI_SYSCONFDIR, - "llm_hostfile", NULL); - - mca_llm_hostfile_param_filename = mca_base_param_register_string("llm", - "hostfile", - "hostfile", - NULL, - default_path); + char *default_path = ompi_os_path(false, OMPI_PKGDATADIR, + "openmpi-default-hostfile", NULL); + param_filename = mca_base_param_register_string("llm", + "hostfile", + "hostfile", + NULL, + default_path); if (NULL != default_path) free(default_path); + param_priority = mca_base_param_register_int("llm", + "hostfile", + "priority", + NULL, + 1); + return OMPI_SUCCESS; } @@ -83,13 +89,16 @@ mca_llm_hostfile_component_init(const char *active_pcm, { mca_llm_hostfile_module_t *me; + + mca_base_param_lookup_int(param_priority, priority); + + if (0 == *priority) return NULL; + me = malloc(sizeof(mca_llm_hostfile_module_t)); if (NULL == me) return NULL; - *priority = 1; - - /* fill in params */ - mca_base_param_lookup_string(mca_llm_hostfile_param_filename, + /* fill in the struct */ + mca_base_param_lookup_string(param_filename, &(me->hostfile_filename)); me->super.llm_allocate_resources = mca_llm_hostfile_allocate_resources;