From b260f8ee36d4e11064a12af1ffceac7203c90f1e Mon Sep 17 00:00:00 2001 From: Ralph Castain Date: Mon, 23 Apr 2007 18:26:33 +0000 Subject: [PATCH] Enable the job_family API This commit was SVN r14473. --- orte/mca/ns/ns_types.h | 1 + orte/mca/ns/replica/ns_replica_recv.c | 30 +++++++++++++++++++++++++++ 2 files changed, 31 insertions(+) diff --git a/orte/mca/ns/ns_types.h b/orte/mca/ns/ns_types.h index ffa90cd47d..7abd622bcb 100644 --- a/orte/mca/ns/ns_types.h +++ b/orte/mca/ns/ns_types.h @@ -55,6 +55,7 @@ extern "C" { #define ORTE_NS_USE_NODE "orte-ns-use-node" #define ORTE_NS_INCLUDE_DESCENDANTS "orte-ns-include-desc" #define ORTE_NS_INCLUDE_CHILDREN "orte-ns-include-child" +#define ORTE_NS_USE_JOB_FAMILY "orte-ns-use-job-family" #define ORTE_NAME_ARGS(n) \ diff --git a/orte/mca/ns/replica/ns_replica_recv.c b/orte/mca/ns/replica/ns_replica_recv.c index 32d744311c..3b7c2c7820 100644 --- a/orte/mca/ns/replica/ns_replica_recv.c +++ b/orte/mca/ns/replica/ns_replica_recv.c @@ -277,6 +277,36 @@ void orte_ns_replica_recv(int status, orte_process_name_t* sender, } break; + case ORTE_NS_GET_JOB_FAMILY_CMD: + count = 1; + if (ORTE_SUCCESS != (rc = orte_dss.unpack(buffer, (void*)&job, &count, ORTE_JOBID))) { + ORTE_ERROR_LOG(rc); + goto RETURN_ERROR; + } + + if (ORTE_SUCCESS != (rc = orte_ns_replica_get_job_family(&descendants, &nret, job))) { + ORTE_ERROR_LOG(rc); + goto RETURN_ERROR; + } + + if (ORTE_SUCCESS != (rc = orte_dss.pack(&answer, (void*)&nret, 1, ORTE_STD_CNTR))) { + ORTE_ERROR_LOG(rc); + goto RETURN_ERROR; + } + + if (0 < nret) { + if (ORTE_SUCCESS != (rc = orte_dss.pack(&answer, (void*)descendants, nret, ORTE_JOBID))) { + ORTE_ERROR_LOG(rc); + goto RETURN_ERROR; + } + } + + if (0 > (rc = orte_rml.send_buffer(sender, &answer, tag, 0))) { + ORTE_ERROR_LOG(ORTE_ERR_COMM_FAILURE); + goto RETURN_ERROR; + } + break; + case ORTE_NS_RESERVE_RANGE_CMD: count = 1; if (ORTE_SUCCESS != (rc = orte_dss.unpack(buffer, (void*)&job, &count, ORTE_JOBID))) {