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.
Этот коммит содержится в:
родитель
d72fc7a05f
Коммит
526682e2f9
@ -127,6 +127,31 @@
|
||||
|
||||
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 */
|
||||
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 */
|
||||
orte_routed.update_routing_plan();
|
||||
|
||||
/*** RHC: USER REQUEST TO TIE-OFF STDXXX TO /DEV/NULL
|
||||
*** WILL BE SENT IN LAUNCH MESSAGE AS PART OF CONTROLS FIELD.
|
||||
*** SO IF USER WANTS NO IO BEING SENT AROUND, THE ORTEDS
|
||||
*** WILL TIE IT OFF AND THE IOF WILL NEVER RECEIVE ANYTHING.
|
||||
*** THE IOF AUTOMATICALLY KNOWS TO OUTPUT ANY STDXXX
|
||||
*** DATA IT -DOES- RECEIVE TO THE APPROPRIATE FD, SO THERE
|
||||
*** IS NOTHING WE NEED DO HERE TO SETUP IOF
|
||||
***/
|
||||
/* If this job is being started by me, then there is nothing
|
||||
* further we need to do as any user directives (e.g., to tie
|
||||
* off IO to /dev/null) will have been included in the launch
|
||||
* message and the IOF knows how to handle any default situation.
|
||||
* However, if this is a proxy spawn request, then the spawner
|
||||
* might be a tool that wants IO forwarded to it. If that's the
|
||||
* 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
|
||||
/*
|
||||
|
@ -201,6 +201,8 @@ const char *orte_attr_key_to_str(orte_attribute_key_t key)
|
||||
return "JOB-INIT-BAR-ID";
|
||||
case ORTE_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:
|
||||
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_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_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
|
||||
|
||||
|
Загрузка…
x
Ссылка в новой задаче
Block a user