2005-03-31 19:47:37 +04:00
|
|
|
/*
|
2006-03-29 05:26:16 +04:00
|
|
|
* Copyright (c) 2004-2006 The Trustees of Indiana University and Indiana
|
2005-11-05 22:57:48 +03:00
|
|
|
* University Research and Technology
|
|
|
|
* Corporation. All rights reserved.
|
|
|
|
* Copyright (c) 2004-2005 The University of Tennessee and The University
|
|
|
|
* of Tennessee Research Foundation. All rights
|
|
|
|
* reserved.
|
2006-02-08 20:40:11 +03:00
|
|
|
* Copyright (c) 2004-2005 High Performance Computing Center Stuttgart,
|
2005-03-31 19:47:37 +04:00
|
|
|
* University of Stuttgart. All rights reserved.
|
|
|
|
* $COPYRIGHT$
|
2006-02-08 20:40:11 +03:00
|
|
|
*
|
2005-03-31 19:47:37 +04:00
|
|
|
* Additional copyrights may follow
|
2006-02-08 20:40:11 +03:00
|
|
|
*
|
2005-03-31 19:47:37 +04:00
|
|
|
* $HEADER$
|
|
|
|
*/
|
2005-09-19 19:29:14 +04:00
|
|
|
#include "orte_config.h"
|
2005-03-31 19:47:37 +04:00
|
|
|
#include <errno.h>
|
2005-12-12 23:04:00 +03:00
|
|
|
#ifdef HAVE_UNISTD_H
|
2005-03-31 19:47:37 +04:00
|
|
|
#include <unistd.h>
|
2005-12-12 23:04:00 +03:00
|
|
|
#endif /* HAVE_UNISTD_H */
|
|
|
|
#ifdef HAVE_STRING_H
|
2005-03-31 19:47:37 +04:00
|
|
|
#include <string.h>
|
2005-12-12 23:04:00 +03:00
|
|
|
#endif /* HAVE_STRING_H */
|
2005-03-31 19:47:37 +04:00
|
|
|
|
2006-02-12 04:33:29 +03:00
|
|
|
#include "orte/orte_constants.h"
|
2005-07-04 03:31:27 +04:00
|
|
|
#include "opal/util/output.h"
|
2005-09-19 19:29:14 +04:00
|
|
|
#include "opal/util/trace.h"
|
|
|
|
|
2006-09-15 01:29:51 +04:00
|
|
|
#include "orte/mca/rds/rds.h"
|
|
|
|
#include "orte/mca/ras/ras.h"
|
|
|
|
#include "orte/mca/rmaps/rmaps.h"
|
|
|
|
#include "orte/mca/pls/pls.h"
|
2005-09-19 19:29:14 +04:00
|
|
|
#include "orte/mca/errmgr/errmgr.h"
|
|
|
|
#include "orte/mca/rml/rml.h"
|
|
|
|
#include "orte/mca/iof/iof.h"
|
2006-09-15 01:29:51 +04:00
|
|
|
#include "orte/mca/smr/smr.h"
|
2005-09-19 19:29:14 +04:00
|
|
|
|
2006-09-15 01:29:51 +04:00
|
|
|
#include "orte/mca/rmgr/base/rmgr_private.h"
|
2005-09-19 19:29:14 +04:00
|
|
|
#include "orte/mca/rmgr/proxy/rmgr_proxy.h"
|
2005-03-31 19:47:37 +04:00
|
|
|
|
|
|
|
|
2006-09-15 01:29:51 +04:00
|
|
|
static int orte_rmgr_proxy_setup_job(
|
2005-03-31 19:47:37 +04:00
|
|
|
orte_app_context_t** app_context,
|
2006-08-15 23:54:10 +04:00
|
|
|
orte_std_cntr_t num_context,
|
2005-03-31 19:47:37 +04:00
|
|
|
orte_jobid_t* jobid);
|
|
|
|
|
2006-09-15 01:29:51 +04:00
|
|
|
static int orte_rmgr_proxy_spawn_job(
|
2005-03-31 19:47:37 +04:00
|
|
|
orte_app_context_t** app_context,
|
2006-08-15 23:54:10 +04:00
|
|
|
orte_std_cntr_t num_context,
|
2005-03-31 19:47:37 +04:00
|
|
|
orte_jobid_t* jobid,
|
2006-09-19 05:45:05 +04:00
|
|
|
orte_std_cntr_t num_connect,
|
|
|
|
orte_process_name_t *connect,
|
2006-02-08 20:40:11 +03:00
|
|
|
orte_rmgr_cb_fn_t cbfn,
|
|
|
|
orte_proc_state_t cb_conditions);
|
2005-03-31 19:47:37 +04:00
|
|
|
|
|
|
|
orte_rmgr_base_module_t orte_rmgr_proxy_module = {
|
2006-09-15 01:29:51 +04:00
|
|
|
NULL, /* don't need special init */
|
|
|
|
orte_rmgr_proxy_setup_job,
|
|
|
|
orte_rmgr_proxy_spawn_job,
|
2006-09-19 05:45:05 +04:00
|
|
|
orte_rmgr_base_connect,
|
|
|
|
orte_rmgr_base_disconnect,
|
2005-03-31 19:47:37 +04:00
|
|
|
NULL, /* finalize */
|
2006-09-15 01:29:51 +04:00
|
|
|
/** SUPPORT FUNCTIONS ***/
|
|
|
|
orte_rmgr_base_get_app_context,
|
|
|
|
orte_rmgr_base_put_app_context,
|
|
|
|
orte_rmgr_base_check_context_cwd,
|
|
|
|
orte_rmgr_base_check_context_app,
|
|
|
|
orte_rmgr_base_set_vpid_range,
|
|
|
|
orte_rmgr_base_get_vpid_range
|
2005-03-31 19:47:37 +04:00
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
/*
|
2006-09-15 01:29:51 +04:00
|
|
|
* Setup the job segment and initialize the application context. Could
|
|
|
|
* do this in the proxy - but allowing the HNP to do this moves the registry
|
|
|
|
* and name service actions to the HNP for efficiency.
|
2005-03-31 19:47:37 +04:00
|
|
|
*/
|
|
|
|
|
2006-09-15 01:29:51 +04:00
|
|
|
static int orte_rmgr_proxy_setup_job(
|
2005-03-31 19:47:37 +04:00
|
|
|
orte_app_context_t** app_context,
|
2006-08-15 23:54:10 +04:00
|
|
|
orte_std_cntr_t num_context,
|
2005-03-31 19:47:37 +04:00
|
|
|
orte_jobid_t* jobid)
|
|
|
|
{
|
|
|
|
orte_buffer_t cmd;
|
|
|
|
orte_buffer_t rsp;
|
2006-09-15 01:29:51 +04:00
|
|
|
orte_std_cntr_t count;
|
2006-09-30 01:44:11 +04:00
|
|
|
orte_rmgr_cmd_t command=ORTE_RMGR_SETUP_JOB_CMD;
|
2005-03-31 19:47:37 +04:00
|
|
|
int rc;
|
|
|
|
|
2005-09-19 19:29:14 +04:00
|
|
|
OPAL_TRACE(1);
|
2006-02-08 20:40:11 +03:00
|
|
|
|
2005-03-31 19:47:37 +04:00
|
|
|
/* construct command */
|
|
|
|
OBJ_CONSTRUCT(&cmd, orte_buffer_t);
|
2006-09-30 01:10:48 +04:00
|
|
|
|
|
|
|
/* pack the command */
|
|
|
|
if (ORTE_SUCCESS != (rc = orte_dss.pack(&cmd, &command, 1, ORTE_RMGR_CMD))) {
|
|
|
|
ORTE_ERROR_LOG(rc);
|
|
|
|
OBJ_DESTRUCT(&cmd);
|
|
|
|
return rc;
|
|
|
|
}
|
|
|
|
|
2006-09-15 01:29:51 +04:00
|
|
|
/* pack the number of app_contexts */
|
|
|
|
if(ORTE_SUCCESS != (rc = orte_dss.pack(&cmd, &num_context, 1, ORTE_STD_CNTR))) {
|
2005-03-31 19:47:37 +04:00
|
|
|
ORTE_ERROR_LOG(rc);
|
|
|
|
OBJ_DESTRUCT(&cmd);
|
|
|
|
return rc;
|
|
|
|
}
|
2006-09-15 01:29:51 +04:00
|
|
|
|
|
|
|
/* and pack them */
|
|
|
|
if(ORTE_SUCCESS != (rc = orte_dss.pack(&cmd, app_context, num_context, ORTE_APP_CONTEXT))) {
|
2005-03-31 19:47:37 +04:00
|
|
|
ORTE_ERROR_LOG(rc);
|
|
|
|
OBJ_DESTRUCT(&cmd);
|
|
|
|
return rc;
|
|
|
|
}
|
|
|
|
|
2006-09-15 01:29:51 +04:00
|
|
|
/* send the command */
|
|
|
|
if(0 > (rc = orte_rml.send_buffer(ORTE_RML_NAME_SEED, &cmd, ORTE_RML_TAG_RMGR, 0))) {
|
2005-03-31 19:47:37 +04:00
|
|
|
ORTE_ERROR_LOG(rc);
|
|
|
|
OBJ_DESTRUCT(&cmd);
|
|
|
|
return rc;
|
|
|
|
}
|
|
|
|
OBJ_DESTRUCT(&cmd);
|
|
|
|
|
|
|
|
/* wait for response */
|
|
|
|
OBJ_CONSTRUCT(&rsp, orte_buffer_t);
|
2006-09-15 01:29:51 +04:00
|
|
|
if(0 > (rc = orte_rml.recv_buffer(ORTE_RML_NAME_SEED, &rsp, ORTE_RML_TAG_RMGR))) {
|
2005-03-31 19:47:37 +04:00
|
|
|
ORTE_ERROR_LOG(rc);
|
|
|
|
OBJ_DESTRUCT(&rsp);
|
|
|
|
return rc;
|
|
|
|
}
|
|
|
|
|
2006-09-15 01:29:51 +04:00
|
|
|
/* get the returned command */
|
|
|
|
count = 1;
|
|
|
|
if (ORTE_SUCCESS != (rc = orte_dss.unpack(&rsp, &command, &count, ORTE_RMGR_CMD))) {
|
2005-03-31 19:47:37 +04:00
|
|
|
ORTE_ERROR_LOG(rc);
|
|
|
|
OBJ_DESTRUCT(&rsp);
|
|
|
|
return rc;
|
|
|
|
}
|
2006-09-15 01:29:51 +04:00
|
|
|
/* and check it to ensure valid comm */
|
|
|
|
if (ORTE_RMGR_SETUP_JOB_CMD != command) {
|
2006-06-08 22:27:17 +04:00
|
|
|
OBJ_DESTRUCT(&rsp);
|
2006-09-15 01:29:51 +04:00
|
|
|
ORTE_ERROR_LOG(ORTE_ERR_COMM_FAILURE);
|
|
|
|
return ORTE_ERR_COMM_FAILURE;
|
2006-06-08 22:27:17 +04:00
|
|
|
}
|
2006-09-15 01:29:51 +04:00
|
|
|
|
|
|
|
/* get the jobid */
|
|
|
|
count = 1;
|
|
|
|
if(ORTE_SUCCESS != (rc = orte_dss.unpack(&rsp, jobid, &count, ORTE_JOBID))) {
|
2005-03-31 19:47:37 +04:00
|
|
|
ORTE_ERROR_LOG(rc);
|
|
|
|
}
|
2006-09-15 01:29:51 +04:00
|
|
|
|
2005-03-31 19:47:37 +04:00
|
|
|
OBJ_DESTRUCT(&rsp);
|
2006-09-15 01:29:51 +04:00
|
|
|
return rc;
|
2005-03-31 19:47:37 +04:00
|
|
|
}
|
|
|
|
|
2006-03-30 23:44:28 +04:00
|
|
|
static void orte_rmgr_proxy_wireup_stdin(orte_jobid_t jobid)
|
|
|
|
{
|
|
|
|
int rc;
|
|
|
|
orte_process_name_t* name;
|
|
|
|
|
|
|
|
OPAL_TRACE(1);
|
|
|
|
|
|
|
|
if (ORTE_SUCCESS != (rc = orte_ns.create_process_name(&name, 0, jobid, 0))) {
|
|
|
|
ORTE_ERROR_LOG(rc);
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
if (ORTE_SUCCESS != (rc = orte_iof.iof_push(name, ORTE_NS_CMP_JOBID, ORTE_IOF_STDIN, 0))) {
|
|
|
|
ORTE_ERROR_LOG(rc);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2005-03-31 19:47:37 +04:00
|
|
|
static void orte_rmgr_proxy_callback(orte_gpr_notify_data_t *data, void *cbdata)
|
|
|
|
{
|
2006-03-29 05:26:16 +04:00
|
|
|
orte_rmgr_cb_fn_t cbfunc;
|
|
|
|
union {
|
|
|
|
orte_rmgr_cb_fn_t func;
|
|
|
|
void * ptr;
|
|
|
|
} cbfunc_union;
|
2005-07-18 22:49:00 +04:00
|
|
|
orte_gpr_value_t **values, *value;
|
2005-03-31 19:47:37 +04:00
|
|
|
orte_gpr_keyval_t** keyvals;
|
|
|
|
orte_jobid_t jobid;
|
2006-08-15 23:54:10 +04:00
|
|
|
orte_std_cntr_t i, j, k;
|
2005-05-01 04:47:35 +04:00
|
|
|
int rc;
|
2005-03-31 19:47:37 +04:00
|
|
|
|
2005-09-19 19:29:14 +04:00
|
|
|
OPAL_TRACE(1);
|
2006-02-08 20:40:11 +03:00
|
|
|
|
2006-09-15 01:29:51 +04:00
|
|
|
/* ISO C forbids conversion of object pointer to function
|
2006-03-29 05:26:16 +04:00
|
|
|
pointer. So we do this, which is the same thing, but without
|
|
|
|
the warning from GCC */
|
|
|
|
cbfunc_union.ptr = cbdata;
|
|
|
|
cbfunc = cbfunc_union.func;
|
|
|
|
|
2005-06-24 20:59:37 +04:00
|
|
|
/* we made sure in the subscriptions that at least one
|
|
|
|
* value is always returned
|
|
|
|
* get the jobid from the segment name in the first value
|
|
|
|
*/
|
2005-07-18 22:49:00 +04:00
|
|
|
values = (orte_gpr_value_t**)(data->values)->addr;
|
2005-06-24 20:59:37 +04:00
|
|
|
if (ORTE_SUCCESS != (rc =
|
|
|
|
orte_schema.extract_jobid_from_segment_name(&jobid,
|
|
|
|
values[0]->segment))) {
|
2005-03-31 19:47:37 +04:00
|
|
|
ORTE_ERROR_LOG(rc);
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
2005-07-18 22:49:00 +04:00
|
|
|
for(i = 0, k=0; k < data->cnt &&
|
|
|
|
i < (data->values)->size; i++) {
|
|
|
|
if (NULL != values[i]) {
|
|
|
|
k++;
|
|
|
|
value = values[i];
|
|
|
|
/* determine the state change */
|
|
|
|
keyvals = value->keyvals;
|
|
|
|
for(j=0; j<value->cnt; j++) {
|
|
|
|
orte_gpr_keyval_t* keyval = keyvals[j];
|
2006-02-08 20:40:11 +03:00
|
|
|
if(strcmp(keyval->key, ORTE_PROC_NUM_AT_INIT) == 0) {
|
|
|
|
(*cbfunc)(jobid,ORTE_PROC_STATE_INIT);
|
|
|
|
continue;
|
|
|
|
}
|
|
|
|
if(strcmp(keyval->key, ORTE_PROC_NUM_LAUNCHED) == 0) {
|
|
|
|
(*cbfunc)(jobid,ORTE_PROC_STATE_LAUNCHED);
|
|
|
|
continue;
|
|
|
|
}
|
|
|
|
if(strcmp(keyval->key, ORTE_PROC_NUM_RUNNING) == 0) {
|
|
|
|
(*cbfunc)(jobid,ORTE_PROC_STATE_RUNNING);
|
|
|
|
continue;
|
|
|
|
}
|
2005-07-18 22:49:00 +04:00
|
|
|
if(strcmp(keyval->key, ORTE_PROC_NUM_AT_STG1) == 0) {
|
|
|
|
(*cbfunc)(jobid,ORTE_PROC_STATE_AT_STG1);
|
|
|
|
continue;
|
|
|
|
}
|
|
|
|
if(strcmp(keyval->key, ORTE_PROC_NUM_AT_STG2) == 0) {
|
2005-11-10 18:29:52 +03:00
|
|
|
(*cbfunc)(jobid,ORTE_PROC_STATE_AT_STG2);
|
2005-07-18 22:49:00 +04:00
|
|
|
continue;
|
|
|
|
}
|
|
|
|
if(strcmp(keyval->key, ORTE_PROC_NUM_AT_STG3) == 0) {
|
|
|
|
(*cbfunc)(jobid,ORTE_PROC_STATE_AT_STG3);
|
|
|
|
continue;
|
|
|
|
}
|
|
|
|
if(strcmp(keyval->key, ORTE_PROC_NUM_FINALIZED) == 0) {
|
|
|
|
(*cbfunc)(jobid,ORTE_PROC_STATE_FINALIZED);
|
|
|
|
continue;
|
|
|
|
}
|
|
|
|
if(strcmp(keyval->key, ORTE_PROC_NUM_TERMINATED) == 0) {
|
|
|
|
(*cbfunc)(jobid,ORTE_PROC_STATE_TERMINATED);
|
|
|
|
continue;
|
|
|
|
}
|
2005-03-31 19:47:37 +04:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2006-03-30 23:44:28 +04:00
|
|
|
/**
|
|
|
|
* define a callback point for completing the wireup of the stdin for io forwarding
|
|
|
|
*/
|
|
|
|
static void orte_rmgr_proxy_wireup_callback(orte_gpr_notify_data_t *data, void *cbdata)
|
|
|
|
{
|
|
|
|
orte_gpr_value_t **values;
|
|
|
|
orte_jobid_t jobid;
|
|
|
|
int rc;
|
|
|
|
|
|
|
|
OPAL_TRACE(1);
|
|
|
|
|
|
|
|
/* we made sure in the subscriptions that at least one
|
|
|
|
* value is always returned
|
|
|
|
* get the jobid from the segment name in the first value
|
|
|
|
*/
|
|
|
|
values = (orte_gpr_value_t**)(data->values)->addr;
|
|
|
|
if (ORTE_SUCCESS != (rc = orte_schema.extract_jobid_from_segment_name(&jobid, values[0]->segment))) {
|
|
|
|
ORTE_ERROR_LOG(rc);
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
orte_rmgr_proxy_wireup_stdin(jobid);
|
|
|
|
}
|
2005-03-31 19:47:37 +04:00
|
|
|
|
|
|
|
/*
|
|
|
|
* Shortcut for the multiple steps involved in spawning a new job.
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
2006-09-15 01:29:51 +04:00
|
|
|
static int orte_rmgr_proxy_spawn_job(
|
2005-03-31 19:47:37 +04:00
|
|
|
orte_app_context_t** app_context,
|
2006-08-15 23:54:10 +04:00
|
|
|
orte_std_cntr_t num_context,
|
2005-03-31 19:47:37 +04:00
|
|
|
orte_jobid_t* jobid,
|
2006-09-19 05:45:05 +04:00
|
|
|
orte_std_cntr_t num_connect,
|
|
|
|
orte_process_name_t *connect,
|
2006-02-08 20:40:11 +03:00
|
|
|
orte_rmgr_cb_fn_t cbfunc,
|
|
|
|
orte_proc_state_t cb_conditions)
|
2005-03-31 19:47:37 +04:00
|
|
|
{
|
|
|
|
int rc;
|
2006-10-02 18:58:22 +04:00
|
|
|
orte_process_name_t name = {0, ORTE_JOBID_INVALID, 0};
|
2006-02-08 20:40:11 +03:00
|
|
|
|
2005-09-19 19:29:14 +04:00
|
|
|
OPAL_TRACE(1);
|
2006-02-08 20:40:11 +03:00
|
|
|
|
|
|
|
/*
|
2005-03-31 19:47:37 +04:00
|
|
|
* Perform resource discovery.
|
|
|
|
*/
|
2006-09-15 01:29:51 +04:00
|
|
|
if (ORTE_SUCCESS != (rc = orte_rds.query())) {
|
2005-03-31 19:47:37 +04:00
|
|
|
ORTE_ERROR_LOG(rc);
|
|
|
|
return rc;
|
|
|
|
}
|
|
|
|
|
|
|
|
/*
|
2006-09-15 01:29:51 +04:00
|
|
|
* Setup job and allocate resources
|
2005-03-31 19:47:37 +04:00
|
|
|
*/
|
2006-02-08 20:40:11 +03:00
|
|
|
if (ORTE_SUCCESS !=
|
2006-09-15 01:29:51 +04:00
|
|
|
(rc = orte_rmgr_proxy_setup_job(app_context,num_context,jobid))) {
|
2005-03-31 19:47:37 +04:00
|
|
|
ORTE_ERROR_LOG(rc);
|
|
|
|
return rc;
|
|
|
|
}
|
2006-09-15 01:29:51 +04:00
|
|
|
if (ORTE_SUCCESS != (rc = orte_ras.allocate_job(*jobid))) {
|
2005-03-31 19:47:37 +04:00
|
|
|
ORTE_ERROR_LOG(rc);
|
|
|
|
return rc;
|
|
|
|
}
|
2006-09-15 01:29:51 +04:00
|
|
|
if (ORTE_SUCCESS != (rc = orte_rmaps.map_job(*jobid, NULL))) {
|
2005-03-31 19:47:37 +04:00
|
|
|
ORTE_ERROR_LOG(rc);
|
|
|
|
return rc;
|
|
|
|
}
|
|
|
|
|
|
|
|
/*
|
2006-02-08 20:40:11 +03:00
|
|
|
* setup I/O forwarding
|
2005-03-31 19:47:37 +04:00
|
|
|
*/
|
|
|
|
|
2006-10-02 18:58:22 +04:00
|
|
|
name.jobid = *jobid;
|
|
|
|
|
|
|
|
if (ORTE_SUCCESS != (rc = orte_iof.iof_pull(&name, ORTE_NS_CMP_JOBID, ORTE_IOF_STDOUT, 1))) {
|
2005-03-31 19:47:37 +04:00
|
|
|
ORTE_ERROR_LOG(rc);
|
|
|
|
return rc;
|
|
|
|
}
|
2006-10-02 18:58:22 +04:00
|
|
|
if (ORTE_SUCCESS != (rc = orte_iof.iof_pull(&name, ORTE_NS_CMP_JOBID, ORTE_IOF_STDERR, 2))) {
|
2005-03-31 19:47:37 +04:00
|
|
|
ORTE_ERROR_LOG(rc);
|
|
|
|
return rc;
|
|
|
|
}
|
|
|
|
|
2006-10-02 22:29:15 +04:00
|
|
|
/* setup the launch system's stage gate counters and subscriptions */
|
|
|
|
if (ORTE_SUCCESS != (rc = orte_rmgr_base_proc_stage_gate_init(*jobid))) {
|
|
|
|
ORTE_ERROR_LOG(rc);
|
|
|
|
return rc;
|
|
|
|
}
|
|
|
|
|
2006-03-30 23:44:28 +04:00
|
|
|
/** setup the subscription so we can complete the wireup when all processes reach LAUNCHED */
|
2006-09-15 01:29:51 +04:00
|
|
|
rc = orte_smr.job_stage_gate_subscribe(*jobid, orte_rmgr_proxy_wireup_callback, NULL, ORTE_PROC_STATE_LAUNCHED);
|
2006-03-30 23:44:28 +04:00
|
|
|
if(ORTE_SUCCESS != rc) {
|
|
|
|
ORTE_ERROR_LOG(rc);
|
|
|
|
return rc;
|
|
|
|
}
|
|
|
|
|
2006-10-02 22:29:15 +04:00
|
|
|
/*
|
|
|
|
* Define the ERRMGR's callbacks as required
|
|
|
|
*/
|
|
|
|
if (ORTE_SUCCESS != (rc = orte_errmgr.register_job(*jobid))) {
|
|
|
|
ORTE_ERROR_LOG(rc);
|
|
|
|
return rc;
|
|
|
|
}
|
|
|
|
|
2005-03-31 19:47:37 +04:00
|
|
|
/*
|
|
|
|
* setup callback
|
|
|
|
*/
|
|
|
|
|
|
|
|
if(NULL != cbfunc) {
|
2006-03-29 05:26:16 +04:00
|
|
|
union {
|
|
|
|
orte_rmgr_cb_fn_t func;
|
|
|
|
void * ptr;
|
|
|
|
} cbfunc_union;
|
|
|
|
void *cbdata;
|
|
|
|
|
2006-09-15 01:29:51 +04:00
|
|
|
/* ISO C forbids conversion of object pointer to function
|
2006-03-29 05:26:16 +04:00
|
|
|
pointer. So we do this, which is the same thing, but without
|
|
|
|
the warning from GCC */
|
|
|
|
cbfunc_union.func = cbfunc;
|
|
|
|
cbdata = cbfunc_union.ptr;
|
|
|
|
|
2006-09-15 01:29:51 +04:00
|
|
|
rc = orte_smr.job_stage_gate_subscribe(*jobid, orte_rmgr_proxy_callback, cbdata, cb_conditions);
|
2005-03-31 19:47:37 +04:00
|
|
|
if(ORTE_SUCCESS != rc) {
|
|
|
|
ORTE_ERROR_LOG(rc);
|
|
|
|
return rc;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
/*
|
|
|
|
* launch the job
|
|
|
|
*/
|
2006-09-15 01:29:51 +04:00
|
|
|
if (ORTE_SUCCESS != (rc = orte_pls.launch_job(*jobid))) {
|
2005-03-31 19:47:37 +04:00
|
|
|
ORTE_ERROR_LOG(rc);
|
|
|
|
return rc;
|
|
|
|
}
|
|
|
|
|
|
|
|
return ORTE_SUCCESS;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|