From 65a524dd0d4c3529e8f5e6ab31cf47541e2984bf Mon Sep 17 00:00:00 2001 From: Pak Lui Date: Thu, 24 Aug 2006 20:27:19 +0000 Subject: [PATCH] - need to provide option for showing the grid engine's JOB_ID in case the grid engine job needs to be killed - clean up the orted_path and debug message This commit was SVN r11413. --- orte/mca/pls/gridengine/pls_gridengine_component.c | 2 +- orte/mca/pls/gridengine/pls_gridengine_module.c | 10 +++++----- orte/mca/ras/gridengine/ras_gridengine.h | 1 + orte/mca/ras/gridengine/ras_gridengine_component.c | 6 +++++- orte/mca/ras/gridengine/ras_gridengine_module.c | 7 +++++++ 5 files changed, 19 insertions(+), 7 deletions(-) diff --git a/orte/mca/pls/gridengine/pls_gridengine_component.c b/orte/mca/pls/gridengine/pls_gridengine_component.c index e5668b47a1..a250b09616 100644 --- a/orte/mca/pls/gridengine/pls_gridengine_component.c +++ b/orte/mca/pls/gridengine/pls_gridengine_component.c @@ -138,7 +138,7 @@ orte_pls_gridengine_component_init - initialize component, check if we can run o orte_pls_base_module_t *orte_pls_gridengine_component_init(int *priority) { if (NULL != getenv("SGE_ROOT") && NULL != getenv("ARC") && - NULL != getenv("PE_HOSTFILE")){ + NULL != getenv("PE_HOSTFILE") && NULL != getenv("JOB_ID")) { opal_output(orte_pls_base.pls_output, "pls:gridengine: available for selection"); *priority = mca_pls_gridengine_component.priority; diff --git a/orte/mca/pls/gridengine/pls_gridengine_module.c b/orte/mca/pls/gridengine/pls_gridengine_module.c index a0c4f93432..9d3b93cc3e 100644 --- a/orte/mca/pls/gridengine/pls_gridengine_module.c +++ b/orte/mca/pls/gridengine/pls_gridengine_module.c @@ -530,11 +530,7 @@ int orte_pls_gridengine_launch(orte_jobid_t jobid) } else { if (NULL != prefix_dir) { orted_path = opal_os_path( false, prefix_dir, bin_base, "orted", NULL ); - if (mca_pls_gridengine_component.debug) { - opal_output(0, "pls:gridengine: orted path=%s\n", - argv[orted_index]); - } - } + } /* If we yet did not fill up the orted_path, do so now */ if (NULL == orted_path) { rc = orte_pls_gridengine_fill_orted_path(&orted_path); @@ -543,6 +539,10 @@ int orte_pls_gridengine_launch(orte_jobid_t jobid) } } } + asprintf(&argv[orted_index], orted_path); + if (mca_pls_gridengine_component.debug) { + opal_output(0, "pls:gridengine: orted_path=%s", orted_path); + } /* If we have a prefix, then modify the PATH and LD_LIBRARY_PATH environment variables. We're diff --git a/orte/mca/ras/gridengine/ras_gridengine.h b/orte/mca/ras/gridengine/ras_gridengine.h index 372d19d16a..fae2804c7a 100644 --- a/orte/mca/ras/gridengine/ras_gridengine.h +++ b/orte/mca/ras/gridengine/ras_gridengine.h @@ -40,6 +40,7 @@ struct orte_ras_gridengine_component_t { int debug; int verbose; int priority; + int show_jobid; }; typedef struct orte_ras_gridengine_component_t orte_ras_gridengine_component_t; diff --git a/orte/mca/ras/gridengine/ras_gridengine_component.c b/orte/mca/ras/gridengine/ras_gridengine_component.c index a534f115a5..ce68cc26da 100644 --- a/orte/mca/ras/gridengine/ras_gridengine_component.c +++ b/orte/mca/ras/gridengine/ras_gridengine_component.c @@ -84,6 +84,10 @@ static int orte_ras_gridengine_open(void) mca_base_param_reg_int(c, "verbose", "Enable verbose output for the gridengine ras component", false, false, 0, &value); + mca_base_param_reg_int(c, "show_jobid", + "Show the JOB_ID of the Grid Engine job", + false, false, 0, &mca_ras_gridengine_component.show_jobid); + if (value != 0) { mca_ras_gridengine_component.verbose = opal_output_open(NULL); } else { @@ -97,7 +101,7 @@ static orte_ras_base_module_t *orte_ras_gridengine_init(int* priority) *priority = mca_ras_gridengine_component.priority; if (NULL != getenv("SGE_ROOT") && NULL != getenv("ARC") && - NULL != getenv("PE_HOSTFILE")) { + NULL != getenv("PE_HOSTFILE") && NULL != getenv("JOB_ID")) { opal_output(orte_ras_base.ras_output, "ras:gridengine: available for selection"); return &orte_ras_gridengine_module; diff --git a/orte/mca/ras/gridengine/ras_gridengine_module.c b/orte/mca/ras/gridengine/ras_gridengine_module.c index 3cd75dfff1..1cc0fcd38c 100644 --- a/orte/mca/ras/gridengine/ras_gridengine_module.c +++ b/orte/mca/ras/gridengine/ras_gridengine_module.c @@ -124,12 +124,19 @@ static int orte_ras_gridengine_discover(opal_list_t* nodelist, orte_app_context_t** context, orte_std_cntr_t num_context) { char *pe_hostfile = getenv("PE_HOSTFILE"); + char *job_id = getenv("JOB_ID"); char buf[1024], *tok, *num, *queue, *arch, *ptr; int rc, gridengine_slot_cnt; opal_list_item_t* item; opal_list_t new_nodes; FILE *fp; orte_ras_node_t *node; + + /* show the Grid Engine's JOB_ID */ + if (mca_ras_gridengine_component.show_jobid || + mca_ras_gridengine_component.verbose != 0) { + opal_output(0, "ras:gridengine: JOB_ID: %s", job_id); + } /* query the nodelist from the registry */ if(ORTE_SUCCESS != (rc = orte_ras_gridengine_node_query(nodelist))) {