[mpich2-commits] r7761 - in mpich2/trunk/src/pm/hydra: pm/pmiserv tools/bootstrap/external tools/bootstrap/include tools/bootstrap/src tools/bootstrap/utils
balaji at mcs.anl.gov
balaji at mcs.anl.gov
Wed Jan 19 17:07:06 CST 2011
Author: balaji
Date: 2011-01-19 17:07:06 -0600 (Wed, 19 Jan 2011)
New Revision: 7761
Added:
mpich2/trunk/src/pm/hydra/tools/bootstrap/external/external_query_jobid.c
Removed:
mpich2/trunk/src/pm/hydra/tools/bootstrap/external/pbs_query_job_id.c
Modified:
mpich2/trunk/src/pm/hydra/pm/pmiserv/pmip.c
mpich2/trunk/src/pm/hydra/pm/pmiserv/pmip.h
mpich2/trunk/src/pm/hydra/pm/pmiserv/pmip_cb.c
mpich2/trunk/src/pm/hydra/pm/pmiserv/pmip_utils.c
mpich2/trunk/src/pm/hydra/tools/bootstrap/external/Makefile.mk
mpich2/trunk/src/pm/hydra/tools/bootstrap/external/external.h
mpich2/trunk/src/pm/hydra/tools/bootstrap/external/external_init.c
mpich2/trunk/src/pm/hydra/tools/bootstrap/external/pbs.h
mpich2/trunk/src/pm/hydra/tools/bootstrap/include/bsci.h.in
mpich2/trunk/src/pm/hydra/tools/bootstrap/src/bsci_init.c.in
mpich2/trunk/src/pm/hydra/tools/bootstrap/src/bsci_query_job_id.c
mpich2/trunk/src/pm/hydra/tools/bootstrap/utils/bscu.h
mpich2/trunk/src/pm/hydra/tools/bootstrap/utils/bscu_query_job_id.c
Log:
Added JOBID query support for SLURM as well. Generalize the JOBID
query management.
Modified: mpich2/trunk/src/pm/hydra/pm/pmiserv/pmip.c
===================================================================
--- mpich2/trunk/src/pm/hydra/pm/pmiserv/pmip.c 2011-01-19 22:59:26 UTC (rev 7760)
+++ mpich2/trunk/src/pm/hydra/pm/pmiserv/pmip.c 2011-01-19 23:07:06 UTC (rev 7761)
@@ -21,7 +21,7 @@
HYD_pmcd_pmip.system_global.global_core_count = -1;
HYD_pmcd_pmip.system_global.global_process_count = -1;
- HYD_pmcd_pmip.system_global.job_id = NULL;
+ HYD_pmcd_pmip.system_global.jobid = NULL;
HYD_pmcd_pmip.system_global.pmi_port = NULL;
HYD_pmcd_pmip.system_global.pmi_fd = NULL;
HYD_pmcd_pmip.system_global.pmi_rank = -1;
@@ -63,8 +63,8 @@
HYDU_finalize_user_global(&HYD_pmcd_pmip.user_global);
/* System global */
- if (HYD_pmcd_pmip.system_global.job_id)
- HYDU_FREE(HYD_pmcd_pmip.system_global.job_id);
+ if (HYD_pmcd_pmip.system_global.jobid)
+ HYDU_FREE(HYD_pmcd_pmip.system_global.jobid);
if (HYD_pmcd_pmip.system_global.pmi_fd)
HYDU_FREE(HYD_pmcd_pmip.system_global.pmi_fd);
Modified: mpich2/trunk/src/pm/hydra/pm/pmiserv/pmip.h
===================================================================
--- mpich2/trunk/src/pm/hydra/pm/pmiserv/pmip.h 2011-01-19 22:59:26 UTC (rev 7760)
+++ mpich2/trunk/src/pm/hydra/pm/pmiserv/pmip.h 2011-01-19 23:07:06 UTC (rev 7761)
@@ -16,7 +16,7 @@
struct {
int global_core_count;
int global_process_count;
- char *job_id;
+ char *jobid;
/* PMI */
char *pmi_fd;
Modified: mpich2/trunk/src/pm/hydra/pm/pmiserv/pmip_cb.c
===================================================================
--- mpich2/trunk/src/pm/hydra/pm/pmiserv/pmip_cb.c 2011-01-19 22:59:26 UTC (rev 7760)
+++ mpich2/trunk/src/pm/hydra/pm/pmiserv/pmip_cb.c 2011-01-19 23:07:06 UTC (rev 7761)
@@ -604,8 +604,8 @@
}
/* Job ID information */
- if (HYD_pmcd_pmip.system_global.job_id) {
- status = HYDU_append_env_to_list("HYDRA_JOBID", HYD_pmcd_pmip.system_global.job_id,
+ if (HYD_pmcd_pmip.system_global.jobid) {
+ status = HYDU_append_env_to_list("HYDRA_JOBID", HYD_pmcd_pmip.system_global.jobid,
&force_env);
HYDU_ERR_POP(status, "unable to add env to list\n");
}
Modified: mpich2/trunk/src/pm/hydra/pm/pmiserv/pmip_utils.c
===================================================================
--- mpich2/trunk/src/pm/hydra/pm/pmiserv/pmip_utils.c 2011-01-19 22:59:26 UTC (rev 7760)
+++ mpich2/trunk/src/pm/hydra/pm/pmiserv/pmip_utils.c 2011-01-19 23:07:06 UTC (rev 7761)
@@ -468,8 +468,8 @@
HYDU_ERR_POP(status, "unable to query launcher for proxy ID\n");
}
- if (HYD_pmcd_pmip.system_global.job_id == NULL) {
- status = HYDT_bsci_query_job_id(&HYD_pmcd_pmip.system_global.job_id);
+ if (HYD_pmcd_pmip.system_global.jobid == NULL) {
+ status = HYDT_bsci_query_jobid(&HYD_pmcd_pmip.system_global.jobid);
HYDU_ERR_POP(status, "unable to query launcher for job ID\n");
}
Modified: mpich2/trunk/src/pm/hydra/tools/bootstrap/external/Makefile.mk
===================================================================
--- mpich2/trunk/src/pm/hydra/tools/bootstrap/external/Makefile.mk 2011-01-19 22:59:26 UTC (rev 7760)
+++ mpich2/trunk/src/pm/hydra/tools/bootstrap/external/Makefile.mk 2011-01-19 23:07:06 UTC (rev 7761)
@@ -9,6 +9,7 @@
$(top_srcdir)/tools/bootstrap/external/external_finalize.c \
$(top_srcdir)/tools/bootstrap/external/external_env.c \
$(top_srcdir)/tools/bootstrap/external/external_query_native_int.c \
+ $(top_srcdir)/tools/bootstrap/external/external_query_jobid.c \
$(top_srcdir)/tools/bootstrap/external/ssh.c \
$(top_srcdir)/tools/bootstrap/external/slurm_launch.c \
$(top_srcdir)/tools/bootstrap/external/slurm_query_node_list.c \
@@ -18,5 +19,4 @@
$(top_srcdir)/tools/bootstrap/external/ll_query_proxy_id.c \
$(top_srcdir)/tools/bootstrap/external/lsf_query_node_list.c \
$(top_srcdir)/tools/bootstrap/external/sge_query_node_list.c \
- $(top_srcdir)/tools/bootstrap/external/pbs_query_node_list.c \
- $(top_srcdir)/tools/bootstrap/external/pbs_query_job_id.c
+ $(top_srcdir)/tools/bootstrap/external/pbs_query_node_list.c
Modified: mpich2/trunk/src/pm/hydra/tools/bootstrap/external/external.h
===================================================================
--- mpich2/trunk/src/pm/hydra/tools/bootstrap/external/external.h 2011-01-19 22:59:26 UTC (rev 7760)
+++ mpich2/trunk/src/pm/hydra/tools/bootstrap/external/external.h 2011-01-19 23:07:06 UTC (rev 7761)
@@ -19,5 +19,6 @@
HYD_status HYDT_bscd_external_launcher_finalize(void);
HYD_status HYDT_bscd_external_query_env_inherit(const char *env_name, int *ret);
HYD_status HYDT_bscd_external_query_native_int(int *ret);
+HYD_status HYDT_bscd_external_query_jobid(char **jobid);
#endif /* EXTERNAL_H_INCLUDED */
Modified: mpich2/trunk/src/pm/hydra/tools/bootstrap/external/external_init.c
===================================================================
--- mpich2/trunk/src/pm/hydra/tools/bootstrap/external/external_init.c 2011-01-19 22:59:26 UTC (rev 7760)
+++ mpich2/trunk/src/pm/hydra/tools/bootstrap/external/external_init.c 2011-01-19 23:07:06 UTC (rev 7761)
@@ -26,15 +26,16 @@
if (!strcmp(HYDT_bsci_info.rmk, "sge"))
HYDT_bsci_fns.query_node_list = HYDT_bscd_sge_query_node_list;
- if (!strcmp(HYDT_bsci_info.rmk, "pbs")) {
+ if (!strcmp(HYDT_bsci_info.rmk, "pbs"))
HYDT_bsci_fns.query_node_list = HYDT_bscd_pbs_query_node_list;
- HYDT_bsci_fns.query_job_id = HYDT_bscd_pbs_query_job_id;
- }
/* for everything else, set default values */
if (HYDT_bsci_fns.query_native_int == NULL)
HYDT_bsci_fns.query_native_int = HYDT_bscd_external_query_native_int;
+ if (HYDT_bsci_fns.query_jobid == NULL)
+ HYDT_bsci_fns.query_jobid = HYDT_bscd_external_query_jobid;
+
HYDU_FUNC_EXIT();
return status;
Copied: mpich2/trunk/src/pm/hydra/tools/bootstrap/external/external_query_jobid.c (from rev 7759, mpich2/trunk/src/pm/hydra/tools/bootstrap/external/pbs_query_job_id.c)
===================================================================
--- mpich2/trunk/src/pm/hydra/tools/bootstrap/external/external_query_jobid.c (rev 0)
+++ mpich2/trunk/src/pm/hydra/tools/bootstrap/external/external_query_jobid.c 2011-01-19 23:07:06 UTC (rev 7761)
@@ -0,0 +1,30 @@
+/* -*- Mode: C; c-basic-offset:4 ; -*- */
+/*
+ * (C) 2008 by Argonne National Laboratory.
+ * See COPYRIGHT in top-level directory.
+ */
+
+#include "hydra.h"
+#include "bsci.h"
+#include "external.h"
+
+HYD_status HYDT_bscd_external_query_jobid(char **jobid)
+{
+ HYD_status status = HYD_SUCCESS;
+
+ HYDU_FUNC_ENTER();
+
+ if (!strcmp(HYDT_bsci_info.rmk, "pbs"))
+ MPL_env2str("PBS_JOBID", (const char **) jobid);
+ else if (!strcmp(HYDT_bsci_info.rmk, "slurm"))
+ MPL_env2str("SLURM_JOBID", (const char **) jobid);
+ else
+ *jobid = NULL;
+
+ fn_exit:
+ HYDU_FUNC_EXIT();
+ return status;
+
+ fn_fail:
+ goto fn_exit;
+}
Modified: mpich2/trunk/src/pm/hydra/tools/bootstrap/external/pbs.h
===================================================================
--- mpich2/trunk/src/pm/hydra/tools/bootstrap/external/pbs.h 2011-01-19 22:59:26 UTC (rev 7760)
+++ mpich2/trunk/src/pm/hydra/tools/bootstrap/external/pbs.h 2011-01-19 23:07:06 UTC (rev 7761)
@@ -10,6 +10,5 @@
#include "hydra.h"
HYD_status HYDT_bscd_pbs_query_node_list(struct HYD_node **node_list);
-HYD_status HYDT_bscd_pbs_query_job_id(char **job_id);
#endif /* PBS_H_INCLUDED */
Deleted: mpich2/trunk/src/pm/hydra/tools/bootstrap/external/pbs_query_job_id.c
===================================================================
--- mpich2/trunk/src/pm/hydra/tools/bootstrap/external/pbs_query_job_id.c 2011-01-19 22:59:26 UTC (rev 7760)
+++ mpich2/trunk/src/pm/hydra/tools/bootstrap/external/pbs_query_job_id.c 2011-01-19 23:07:06 UTC (rev 7761)
@@ -1,25 +0,0 @@
-/* -*- Mode: C; c-basic-offset:4 ; -*- */
-/*
- * (C) 2008 by Argonne National Laboratory.
- * See COPYRIGHT in top-level directory.
- */
-
-#include "hydra.h"
-#include "bsci.h"
-#include "pbs.h"
-
-HYD_status HYDT_bscd_pbs_query_job_id(char **job_id)
-{
- HYD_status status = HYD_SUCCESS;
-
- HYDU_FUNC_ENTER();
-
- MPL_env2str("PBS_JOBID", (const char **) job_id);
-
- fn_exit:
- HYDU_FUNC_EXIT();
- return status;
-
- fn_fail:
- goto fn_exit;
-}
Modified: mpich2/trunk/src/pm/hydra/tools/bootstrap/include/bsci.h.in
===================================================================
--- mpich2/trunk/src/pm/hydra/tools/bootstrap/include/bsci.h.in 2011-01-19 22:59:26 UTC (rev 7760)
+++ mpich2/trunk/src/pm/hydra/tools/bootstrap/include/bsci.h.in 2011-01-19 23:07:06 UTC (rev 7761)
@@ -46,7 +46,7 @@
HYD_status(*query_node_list) (struct HYD_node **node_list);
/** \brief Query for job ID information */
- HYD_status(*query_job_id) (char **job_id);
+ HYD_status(*query_jobid) (char **jobid);
/** \brief Finalize the RMK */
HYD_status(*rmk_finalize) (void);
@@ -154,13 +154,13 @@
/**
- * \brief HYDT_bsci_query_job_id - Query for Job ID information
+ * \brief HYDT_bsci_query_jobid - Query for Job ID information
*
- * \param[out] job_id Job ID
+ * \param[out] jobid Job ID
*
* This function allows the upper layers to query the job ID.
*/
-HYD_status HYDT_bsci_query_job_id(char **job_id);
+HYD_status HYDT_bsci_query_jobid(char **jobid);
/**
Modified: mpich2/trunk/src/pm/hydra/tools/bootstrap/src/bsci_init.c.in
===================================================================
--- mpich2/trunk/src/pm/hydra/tools/bootstrap/src/bsci_init.c.in 2011-01-19 22:59:26 UTC (rev 7760)
+++ mpich2/trunk/src/pm/hydra/tools/bootstrap/src/bsci_init.c.in 2011-01-19 23:07:06 UTC (rev 7761)
@@ -20,7 +20,7 @@
{
HYDT_bsci_fns.query_native_int = NULL;
HYDT_bsci_fns.query_node_list = NULL;
- HYDT_bsci_fns.query_job_id = NULL;
+ HYDT_bsci_fns.query_jobid = NULL;
HYDT_bsci_fns.rmk_finalize = NULL;
}
@@ -40,8 +40,8 @@
HYDT_bsci_fns.query_native_int = HYDT_bscu_query_native_int;
if (HYDT_bsci_fns.query_node_list == NULL)
HYDT_bsci_fns.query_node_list = HYDT_bscu_query_node_list;
- if (HYDT_bsci_fns.query_job_id == NULL)
- HYDT_bsci_fns.query_job_id = HYDT_bscu_query_job_id;
+ if (HYDT_bsci_fns.query_jobid == NULL)
+ HYDT_bsci_fns.query_jobid = HYDT_bscu_query_jobid;
if (HYDT_bsci_fns.rmk_finalize == NULL)
HYDT_bsci_fns.rmk_finalize = HYDT_bscu_rmk_finalize;
}
Modified: mpich2/trunk/src/pm/hydra/tools/bootstrap/src/bsci_query_job_id.c
===================================================================
--- mpich2/trunk/src/pm/hydra/tools/bootstrap/src/bsci_query_job_id.c 2011-01-19 22:59:26 UTC (rev 7760)
+++ mpich2/trunk/src/pm/hydra/tools/bootstrap/src/bsci_query_job_id.c 2011-01-19 23:07:06 UTC (rev 7761)
@@ -8,13 +8,13 @@
#include "bsci.h"
#include "bscu.h"
-HYD_status HYDT_bsci_query_job_id(char **job_id)
+HYD_status HYDT_bsci_query_jobid(char **jobid)
{
HYD_status status = HYD_SUCCESS;
HYDU_FUNC_ENTER();
- status = HYDT_bsci_fns.query_job_id(job_id);
+ status = HYDT_bsci_fns.query_jobid(jobid);
HYDU_ERR_POP(status, "RMK returned error while querying job ID\n");
fn_exit:
Modified: mpich2/trunk/src/pm/hydra/tools/bootstrap/utils/bscu.h
===================================================================
--- mpich2/trunk/src/pm/hydra/tools/bootstrap/utils/bscu.h 2011-01-19 22:59:26 UTC (rev 7760)
+++ mpich2/trunk/src/pm/hydra/tools/bootstrap/utils/bscu.h 2011-01-19 23:07:06 UTC (rev 7761)
@@ -18,7 +18,7 @@
HYD_status HYDT_bscu_rmk_finalize(void);
HYD_status HYDT_bscu_launcher_finalize(void);
HYD_status HYDT_bscu_query_node_list(struct HYD_node **node_list);
-HYD_status HYDT_bscu_query_job_id(char **job_id);
+HYD_status HYDT_bscu_query_jobid(char **jobid);
HYD_status HYDT_bscu_query_usize(int *size);
HYD_status HYDT_bscu_query_proxy_id(int *proxy_id);
HYD_status HYDT_bscu_wait_for_completion(int timeout);
Modified: mpich2/trunk/src/pm/hydra/tools/bootstrap/utils/bscu_query_job_id.c
===================================================================
--- mpich2/trunk/src/pm/hydra/tools/bootstrap/utils/bscu_query_job_id.c 2011-01-19 22:59:26 UTC (rev 7760)
+++ mpich2/trunk/src/pm/hydra/tools/bootstrap/utils/bscu_query_job_id.c 2011-01-19 23:07:06 UTC (rev 7761)
@@ -7,14 +7,14 @@
#include "hydra.h"
#include "bscu.h"
-HYD_status HYDT_bscu_query_job_id(char **job_id)
+HYD_status HYDT_bscu_query_jobid(char **jobid)
{
HYD_status status = HYD_SUCCESS;
HYDU_FUNC_ENTER();
/* We don't know anything about job ID */
- *job_id = NULL;
+ *jobid = NULL;
HYDU_FUNC_EXIT();
More information about the mpich2-commits
mailing list