1
1

Add the ability for a tool that requests spawn of a job to also request forwarding of all output to the tool. The tool is responsible for its own call to push its stdin to the new job. The push request can come -after- the job is started, but the pull request has to be done during the spawn procedure or else output can be lost.

Этот коммит содержится в:
Ralph Castain 2014-10-23 08:15:00 -07:00
родитель d72fc7a05f
Коммит 526682e2f9
4 изменённых файлов: 42 добавлений и 8 удалений

Просмотреть файл

@ -127,6 +127,31 @@
BEGIN_C_DECLS BEGIN_C_DECLS
/* define a macro for requesting a proxy PULL of IO on
* behalf of a tool that had the HNP spawn a job */
#define ORTE_IOF_PROXY_PULL(a, b) \
do { \
opal_buffer_t *buf; \
orte_iof_tag_t tag; \
orte_process_name_t nm; \
\
buf = OBJ_NEW(opal_buffer_t); \
\
/* setup the tag to pull from HNP */ \
tag = ORTE_IOF_STDOUTALL | ORTE_IOF_PULL; \
\
opal_dss.pack(buf, &tag, 1, ORTE_IOF_TAG); \
/* pack the name of the source we want to pull */ \
nm.jobid = (b)->jobid; \
nm.vpid = ORTE_VPID_WILDCARD; \
opal_dss.pack(buf, &nm, 1, ORTE_NAME); \
\
/* send the buffer to the HNP */ \
orte_rml.send_buffer_nb(ORTE_PROC_MY_HNP, buf, \
ORTE_RML_TAG_IOF_HNP, \
orte_rml_send_callback, NULL); \
} while(0);
/* Initialize the selected module */ /* Initialize the selected module */
typedef int (*orte_iof_base_init_fn_t)(void); typedef int (*orte_iof_base_init_fn_t)(void);

Просмотреть файл

@ -359,14 +359,20 @@ void orte_plm_base_complete_setup(int fd, short args, void *cbdata)
/* ensure our routing plan is up-to-date */ /* ensure our routing plan is up-to-date */
orte_routed.update_routing_plan(); orte_routed.update_routing_plan();
/*** RHC: USER REQUEST TO TIE-OFF STDXXX TO /DEV/NULL /* If this job is being started by me, then there is nothing
*** WILL BE SENT IN LAUNCH MESSAGE AS PART OF CONTROLS FIELD. * further we need to do as any user directives (e.g., to tie
*** SO IF USER WANTS NO IO BEING SENT AROUND, THE ORTEDS * off IO to /dev/null) will have been included in the launch
*** WILL TIE IT OFF AND THE IOF WILL NEVER RECEIVE ANYTHING. * message and the IOF knows how to handle any default situation.
*** THE IOF AUTOMATICALLY KNOWS TO OUTPUT ANY STDXXX * However, if this is a proxy spawn request, then the spawner
*** DATA IT -DOES- RECEIVE TO THE APPROPRIATE FD, SO THERE * might be a tool that wants IO forwarded to it. If that's the
*** IS NOTHING WE NEED DO HERE TO SETUP IOF * situation, then the job object will contain an attribute
***/ * indicating that request */
if (orte_get_attribute(&jdata->attributes, ORTE_JOB_FWDIO_TO_TOOL, NULL, OPAL_BOOL)) {
/* send a message to our IOF containing the requested pull */
ORTE_IOF_PROXY_PULL(jdata, &jdata->originator);
/* the tool will PUSH its stdin, so nothing we need to do here
* about stdin */
}
#if OPAL_ENABLE_FT_CR == 1 #if OPAL_ENABLE_FT_CR == 1
/* /*

Просмотреть файл

@ -201,6 +201,8 @@ const char *orte_attr_key_to_str(orte_attribute_key_t key)
return "JOB-INIT-BAR-ID"; return "JOB-INIT-BAR-ID";
case ORTE_JOB_FINI_BAR_ID: case ORTE_JOB_FINI_BAR_ID:
return "JOB-FINI-BAR-ID"; return "JOB-FINI-BAR-ID";
case ORTE_JOB_FWDIO_TO_TOOL:
return "JOB-FWD-IO-TO-TOOL";
case ORTE_PROC_NOBARRIER: case ORTE_PROC_NOBARRIER:
return "PROC-NOBARRIER"; return "PROC-NOBARRIER";

Просмотреть файл

@ -118,6 +118,7 @@ typedef uint16_t orte_job_flags_t;
#define ORTE_JOB_PEER_MODX_ID (ORTE_JOB_START_KEY + 30) // orte_grpcomm_coll_id_t - collective id #define ORTE_JOB_PEER_MODX_ID (ORTE_JOB_START_KEY + 30) // orte_grpcomm_coll_id_t - collective id
#define ORTE_JOB_INIT_BAR_ID (ORTE_JOB_START_KEY + 31) // orte_grpcomm_coll_id_t - collective id #define ORTE_JOB_INIT_BAR_ID (ORTE_JOB_START_KEY + 31) // orte_grpcomm_coll_id_t - collective id
#define ORTE_JOB_FINI_BAR_ID (ORTE_JOB_START_KEY + 32) // orte_grpcomm_coll_id_t - collective id #define ORTE_JOB_FINI_BAR_ID (ORTE_JOB_START_KEY + 32) // orte_grpcomm_coll_id_t - collective id
#define ORTE_JOB_FWDIO_TO_TOOL (ORTE_JOB_START_KEY + 33) // Forward IO for this job to the tool requesting its spawn
#define ORTE_JOB_MAX_KEY 300 #define ORTE_JOB_MAX_KEY 300