Ensure that the proxy "pull" of output gets directed to the requesting tool, which is no longer just the sender since the HNP may be making the request on behalf of someone else
Этот коммит содержится в:
родитель
526682e2f9
Коммит
64fae47d85
@ -55,7 +55,7 @@ void orte_iof_hnp_recv(int status, orte_process_name_t* sender,
|
||||
opal_buffer_t* buffer, orte_rml_tag_t tag,
|
||||
void* cbdata)
|
||||
{
|
||||
orte_process_name_t origin;
|
||||
orte_process_name_t origin, requestor;
|
||||
unsigned char data[ORTE_IOF_BASE_MSG_MAX];
|
||||
orte_iof_tag_t stream;
|
||||
int32_t count, numbytes;
|
||||
@ -99,31 +99,39 @@ void orte_iof_hnp_recv(int status, orte_process_name_t* sender,
|
||||
|
||||
/* check to see if a tool has requested something */
|
||||
if (ORTE_IOF_PULL & stream) {
|
||||
/* get name of the process wishing to be the sink */
|
||||
count = 1;
|
||||
if (ORTE_SUCCESS != (rc = opal_dss.unpack(buffer, &requestor, &count, ORTE_NAME))) {
|
||||
ORTE_ERROR_LOG(rc);
|
||||
goto CLEAN_RETURN;
|
||||
}
|
||||
|
||||
OPAL_OUTPUT_VERBOSE((1, orte_iof_base_framework.framework_output,
|
||||
"%s received pull cmd from remote tool %s for proc %s",
|
||||
ORTE_NAME_PRINT(ORTE_PROC_MY_NAME),
|
||||
ORTE_NAME_PRINT(sender),
|
||||
ORTE_NAME_PRINT(&requestor),
|
||||
ORTE_NAME_PRINT(&origin)));
|
||||
|
||||
/* a tool is requesting that we send it a copy of the specified stream(s)
|
||||
* from the specified process(es), so create a sink for it
|
||||
*/
|
||||
if (ORTE_IOF_STDOUT & stream) {
|
||||
ORTE_IOF_SINK_DEFINE(&sink, &origin, -1, ORTE_IOF_STDOUT,
|
||||
NULL, &mca_iof_hnp_component.sinks);
|
||||
sink->daemon.jobid = sender->jobid;
|
||||
sink->daemon.vpid = sender->vpid;
|
||||
sink->daemon.jobid = requestor.jobid;
|
||||
sink->daemon.vpid = requestor.vpid;
|
||||
}
|
||||
if (ORTE_IOF_STDERR & stream) {
|
||||
ORTE_IOF_SINK_DEFINE(&sink, &origin, -1, ORTE_IOF_STDERR,
|
||||
NULL, &mca_iof_hnp_component.sinks);
|
||||
sink->daemon.jobid = sender->jobid;
|
||||
sink->daemon.vpid = sender->vpid;
|
||||
sink->daemon.jobid = requestor.jobid;
|
||||
sink->daemon.vpid = requestor.vpid;
|
||||
}
|
||||
if (ORTE_IOF_STDDIAG & stream) {
|
||||
ORTE_IOF_SINK_DEFINE(&sink, &origin, -1, ORTE_IOF_STDDIAG,
|
||||
NULL, &mca_iof_hnp_component.sinks);
|
||||
sink->daemon.jobid = sender->jobid;
|
||||
sink->daemon.vpid = sender->vpid;
|
||||
sink->daemon.jobid = requestor.jobid;
|
||||
sink->daemon.vpid = requestor.vpid;
|
||||
}
|
||||
goto CLEAN_RETURN;
|
||||
}
|
||||
|
@ -12,6 +12,7 @@
|
||||
* Copyright (c) 2007-2008 Cisco Systems, Inc. All rights reserved.
|
||||
* Copyright (c) 2012 Los Alamos National Security, LLC.
|
||||
* All rights reserved.
|
||||
* Copyright (c) 2014 Intel, Inc. All rights reserved.
|
||||
* $COPYRIGHT$
|
||||
*
|
||||
* Additional copyrights may follow
|
||||
@ -128,28 +129,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); \
|
||||
* behalf of a tool that had the HNP spawn a job. First
|
||||
* argument is the orte_job_t of the spawned job, second
|
||||
* is a pointer to the name of the requesting tool */
|
||||
#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 = (a)->jobid; \
|
||||
nm.vpid = ORTE_VPID_WILDCARD; \
|
||||
opal_dss.pack(buf, &nm, 1, ORTE_NAME); \
|
||||
/* pack the name of the tool */ \
|
||||
opal_dss.pack(buf, (b), 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 */
|
||||
|
@ -12,6 +12,7 @@
|
||||
* Copyright (c) 2007 Cisco Systems, Inc. All rights reserved.
|
||||
* Copyright (c) 2011-2013 Los Alamos National Security, LLC. All rights
|
||||
* reserved.
|
||||
* Copyright (c) 2014 Intel, Inc. All rights reserved.
|
||||
* $COPYRIGHT$
|
||||
*
|
||||
* Additional copyrights may follow
|
||||
@ -158,7 +159,13 @@ static int tool_pull(const orte_process_name_t* src_name,
|
||||
OBJ_RELEASE(buf);
|
||||
return rc;
|
||||
}
|
||||
|
||||
/* pack our name as the sink */
|
||||
if (ORTE_SUCCESS != (rc = opal_dss.pack(buf, ORTE_PROC_MY_NAME, 1, ORTE_NAME))) {
|
||||
ORTE_ERROR_LOG(rc);
|
||||
OBJ_RELEASE(buf);
|
||||
return rc;
|
||||
}
|
||||
|
||||
/* send the buffer to the correct HNP */
|
||||
ORTE_HNP_NAME_FROM_JOB(&hnp, src_name->jobid);
|
||||
orte_rml.send_buffer_nb(&hnp, buf, ORTE_RML_TAG_IOF_HNP,
|
||||
|
Загрузка…
x
Ссылка в новой задаче
Block a user