2004-12-21 22:16:09 +00:00
|
|
|
/*
|
2005-11-05 19:57:48 +00:00
|
|
|
* Copyright (c) 2004-2005 The Trustees of Indiana University and Indiana
|
|
|
|
* University Research and Technology
|
|
|
|
* Corporation. All rights reserved.
|
2006-08-23 03:32:36 +00:00
|
|
|
* Copyright (c) 2004-2006 The University of Tennessee and The University
|
2005-11-05 19:57:48 +00:00
|
|
|
* of Tennessee Research Foundation. All rights
|
|
|
|
* reserved.
|
2004-12-21 22:16:09 +00:00
|
|
|
* Copyright (c) 2004-2005 High Performance Computing Center Stuttgart,
|
|
|
|
* University of Stuttgart. All rights reserved.
|
2005-03-24 12:43:37 +00:00
|
|
|
* Copyright (c) 2004-2005 The Regents of the University of California.
|
|
|
|
* All rights reserved.
|
2008-10-18 11:52:41 +00:00
|
|
|
* Copyright (c) 2008 Cisco Systems, Inc. All rights reserved.
|
2004-12-21 22:16:09 +00:00
|
|
|
* $COPYRIGHT$
|
|
|
|
*
|
|
|
|
* Additional copyrights may follow
|
|
|
|
*
|
|
|
|
* $HEADER$
|
|
|
|
*/
|
|
|
|
/**
|
|
|
|
* @file
|
|
|
|
*
|
|
|
|
* I/O Forwarding Service
|
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef MCA_IOF_BASE_H
|
|
|
|
#define MCA_IOF_BASE_H
|
|
|
|
|
2006-02-12 01:33:29 +00:00
|
|
|
#include "orte_config.h"
|
2005-03-14 20:57:21 +00:00
|
|
|
#ifdef HAVE_SYS_TYPES_H
|
|
|
|
#include <sys/types.h>
|
|
|
|
#endif
|
|
|
|
#ifdef HAVE_SYS_UIO_H
|
|
|
|
#include <sys/uio.h>
|
|
|
|
#endif
|
2007-07-10 03:46:57 +00:00
|
|
|
#ifdef HAVE_NET_UIO_H
|
|
|
|
#include <net/uio.h>
|
|
|
|
#endif
|
2005-03-14 20:57:21 +00:00
|
|
|
#ifdef HAVE_UNISTD_H
|
|
|
|
#include <unistd.h>
|
|
|
|
#endif
|
Roll in the revamped IOF subsystem. Per the devel mailing list email, this is a complete rewrite of the iof framework designed to simplify the code for maintainability, and to support features we had planned to do, but were too difficult to implement in the old code. Specifically, the new code:
1. completely and cleanly separates responsibilities between the HNP, orted, and tool components.
2. removes all wireup messaging during launch and shutdown.
3. maintains flow control for stdin to avoid large-scale consumption of memory by orteds when large input files are forwarded. This is done using an xon/xoff protocol.
4. enables specification of stdin recipients on the mpirun cmd line. Allowed options include rank, "all", or "none". Default is rank 0.
5. creates a new MPI_Info key "ompi_stdin_target" that supports the above options for child jobs. Default is "none".
6. adds a new tool "orte-iof" that can connect to a running mpirun and display the output. Cmd line options allow selection of any combination of stdout, stderr, and stddiag. Default is stdout.
7. adds a new mpirun and orte-iof cmd line option "tag-output" that will tag each line of output with process name and stream ident. For example, "[1,0]<stdout>this is output"
This is not intended for the 1.3 release as it is a major change requiring considerable soak time.
This commit was SVN r19767.
2008-10-18 00:00:49 +00:00
|
|
|
#ifdef HAVE_SIGNAL_H
|
|
|
|
#include <signal.h>
|
|
|
|
#endif
|
2005-03-14 20:57:21 +00:00
|
|
|
|
2005-07-02 16:46:27 +00:00
|
|
|
#include "opal/class/opal_free_list.h"
|
2005-07-03 22:45:48 +00:00
|
|
|
#include "opal/threads/condition.h"
|
2006-02-12 01:33:29 +00:00
|
|
|
#include "opal/mca/mca.h"
|
2008-06-18 03:15:56 +00:00
|
|
|
|
2006-02-12 01:33:29 +00:00
|
|
|
#include "orte/mca/iof/iof.h"
|
2004-12-21 22:16:09 +00:00
|
|
|
|
2008-02-28 01:57:57 +00:00
|
|
|
BEGIN_C_DECLS
|
2004-12-21 22:16:09 +00:00
|
|
|
|
2008-06-18 03:15:56 +00:00
|
|
|
ORTE_DECLSPEC int orte_iof_base_open(void);
|
|
|
|
|
|
|
|
#if !ORTE_DISABLE_FULL_SUPPORT
|
|
|
|
|
Roll in the revamped IOF subsystem. Per the devel mailing list email, this is a complete rewrite of the iof framework designed to simplify the code for maintainability, and to support features we had planned to do, but were too difficult to implement in the old code. Specifically, the new code:
1. completely and cleanly separates responsibilities between the HNP, orted, and tool components.
2. removes all wireup messaging during launch and shutdown.
3. maintains flow control for stdin to avoid large-scale consumption of memory by orteds when large input files are forwarded. This is done using an xon/xoff protocol.
4. enables specification of stdin recipients on the mpirun cmd line. Allowed options include rank, "all", or "none". Default is rank 0.
5. creates a new MPI_Info key "ompi_stdin_target" that supports the above options for child jobs. Default is "none".
6. adds a new tool "orte-iof" that can connect to a running mpirun and display the output. Cmd line options allow selection of any combination of stdout, stderr, and stddiag. Default is stdout.
7. adds a new mpirun and orte-iof cmd line option "tag-output" that will tag each line of output with process name and stream ident. For example, "[1,0]<stdout>this is output"
This is not intended for the 1.3 release as it is a major change requiring considerable soak time.
This commit was SVN r19767.
2008-10-18 00:00:49 +00:00
|
|
|
/*
|
|
|
|
* Maximum size of single msg
|
|
|
|
*/
|
|
|
|
#define ORTE_IOF_BASE_MSG_MAX 1024
|
|
|
|
#define ORTE_IOF_BASE_TAG_MAX 50
|
|
|
|
#define ORTE_IOF_BASE_TAGGED_OUT_MAX 2048
|
2008-10-24 01:42:58 +00:00
|
|
|
#define ORTE_IOF_MAX_INPUT_BUFFERS 100
|
Roll in the revamped IOF subsystem. Per the devel mailing list email, this is a complete rewrite of the iof framework designed to simplify the code for maintainability, and to support features we had planned to do, but were too difficult to implement in the old code. Specifically, the new code:
1. completely and cleanly separates responsibilities between the HNP, orted, and tool components.
2. removes all wireup messaging during launch and shutdown.
3. maintains flow control for stdin to avoid large-scale consumption of memory by orteds when large input files are forwarded. This is done using an xon/xoff protocol.
4. enables specification of stdin recipients on the mpirun cmd line. Allowed options include rank, "all", or "none". Default is rank 0.
5. creates a new MPI_Info key "ompi_stdin_target" that supports the above options for child jobs. Default is "none".
6. adds a new tool "orte-iof" that can connect to a running mpirun and display the output. Cmd line options allow selection of any combination of stdout, stderr, and stddiag. Default is stdout.
7. adds a new mpirun and orte-iof cmd line option "tag-output" that will tag each line of output with process name and stream ident. For example, "[1,0]<stdout>this is output"
This is not intended for the 1.3 release as it is a major change requiring considerable soak time.
This commit was SVN r19767.
2008-10-18 00:00:49 +00:00
|
|
|
|
|
|
|
typedef struct {
|
|
|
|
opal_list_item_t super;
|
|
|
|
bool pending;
|
|
|
|
opal_event_t ev;
|
|
|
|
int fd;
|
|
|
|
opal_list_t outputs;
|
|
|
|
} orte_iof_write_event_t;
|
|
|
|
ORTE_DECLSPEC OBJ_CLASS_DECLARATION(orte_iof_write_event_t);
|
|
|
|
|
2005-03-14 20:57:21 +00:00
|
|
|
struct orte_iof_base_t {
|
Roll in the revamped IOF subsystem. Per the devel mailing list email, this is a complete rewrite of the iof framework designed to simplify the code for maintainability, and to support features we had planned to do, but were too difficult to implement in the old code. Specifically, the new code:
1. completely and cleanly separates responsibilities between the HNP, orted, and tool components.
2. removes all wireup messaging during launch and shutdown.
3. maintains flow control for stdin to avoid large-scale consumption of memory by orteds when large input files are forwarded. This is done using an xon/xoff protocol.
4. enables specification of stdin recipients on the mpirun cmd line. Allowed options include rank, "all", or "none". Default is rank 0.
5. creates a new MPI_Info key "ompi_stdin_target" that supports the above options for child jobs. Default is "none".
6. adds a new tool "orte-iof" that can connect to a running mpirun and display the output. Cmd line options allow selection of any combination of stdout, stderr, and stddiag. Default is stdout.
7. adds a new mpirun and orte-iof cmd line option "tag-output" that will tag each line of output with process name and stream ident. For example, "[1,0]<stdout>this is output"
This is not intended for the 1.3 release as it is a major change requiring considerable soak time.
This commit was SVN r19767.
2008-10-18 00:00:49 +00:00
|
|
|
int iof_output;
|
|
|
|
opal_list_t iof_components_opened;
|
|
|
|
opal_mutex_t iof_write_output_lock;
|
|
|
|
orte_iof_write_event_t iof_write_stdout;
|
|
|
|
orte_iof_write_event_t iof_write_stderr;
|
2005-01-12 20:51:34 +00:00
|
|
|
};
|
2005-03-14 20:57:21 +00:00
|
|
|
typedef struct orte_iof_base_t orte_iof_base_t;
|
2005-01-12 20:51:34 +00:00
|
|
|
|
Roll in the revamped IOF subsystem. Per the devel mailing list email, this is a complete rewrite of the iof framework designed to simplify the code for maintainability, and to support features we had planned to do, but were too difficult to implement in the old code. Specifically, the new code:
1. completely and cleanly separates responsibilities between the HNP, orted, and tool components.
2. removes all wireup messaging during launch and shutdown.
3. maintains flow control for stdin to avoid large-scale consumption of memory by orteds when large input files are forwarded. This is done using an xon/xoff protocol.
4. enables specification of stdin recipients on the mpirun cmd line. Allowed options include rank, "all", or "none". Default is rank 0.
5. creates a new MPI_Info key "ompi_stdin_target" that supports the above options for child jobs. Default is "none".
6. adds a new tool "orte-iof" that can connect to a running mpirun and display the output. Cmd line options allow selection of any combination of stdout, stderr, and stddiag. Default is stdout.
7. adds a new mpirun and orte-iof cmd line option "tag-output" that will tag each line of output with process name and stream ident. For example, "[1,0]<stdout>this is output"
This is not intended for the 1.3 release as it is a major change requiring considerable soak time.
This commit was SVN r19767.
2008-10-18 00:00:49 +00:00
|
|
|
typedef struct {
|
|
|
|
opal_list_item_t super;
|
|
|
|
orte_process_name_t name;
|
|
|
|
orte_process_name_t daemon;
|
|
|
|
orte_iof_tag_t tag;
|
|
|
|
orte_iof_write_event_t wev;
|
|
|
|
#if OMPI_ENABLE_DEBUG
|
|
|
|
char *file;
|
|
|
|
int line;
|
|
|
|
#endif
|
|
|
|
} orte_iof_sink_t;
|
|
|
|
ORTE_DECLSPEC OBJ_CLASS_DECLARATION(orte_iof_sink_t);
|
|
|
|
|
|
|
|
typedef struct {
|
|
|
|
opal_list_item_t super;
|
|
|
|
orte_process_name_t name;
|
|
|
|
opal_event_t ev;
|
|
|
|
orte_iof_tag_t tag;
|
|
|
|
bool active;
|
|
|
|
#if OMPI_ENABLE_DEBUG
|
|
|
|
char *file;
|
|
|
|
int line;
|
|
|
|
#endif
|
|
|
|
} orte_iof_read_event_t;
|
|
|
|
ORTE_DECLSPEC OBJ_CLASS_DECLARATION(orte_iof_read_event_t);
|
|
|
|
|
|
|
|
typedef struct {
|
|
|
|
opal_list_item_t super;
|
|
|
|
char data[ORTE_IOF_BASE_TAGGED_OUT_MAX];
|
|
|
|
int numbytes;
|
|
|
|
} orte_iof_write_output_t;
|
|
|
|
ORTE_DECLSPEC OBJ_CLASS_DECLARATION(orte_iof_write_output_t);
|
2005-01-12 20:51:34 +00:00
|
|
|
|
Roll in the revamped IOF subsystem. Per the devel mailing list email, this is a complete rewrite of the iof framework designed to simplify the code for maintainability, and to support features we had planned to do, but were too difficult to implement in the old code. Specifically, the new code:
1. completely and cleanly separates responsibilities between the HNP, orted, and tool components.
2. removes all wireup messaging during launch and shutdown.
3. maintains flow control for stdin to avoid large-scale consumption of memory by orteds when large input files are forwarded. This is done using an xon/xoff protocol.
4. enables specification of stdin recipients on the mpirun cmd line. Allowed options include rank, "all", or "none". Default is rank 0.
5. creates a new MPI_Info key "ompi_stdin_target" that supports the above options for child jobs. Default is "none".
6. adds a new tool "orte-iof" that can connect to a running mpirun and display the output. Cmd line options allow selection of any combination of stdout, stderr, and stddiag. Default is stdout.
7. adds a new mpirun and orte-iof cmd line option "tag-output" that will tag each line of output with process name and stream ident. For example, "[1,0]<stdout>this is output"
This is not intended for the 1.3 release as it is a major change requiring considerable soak time.
This commit was SVN r19767.
2008-10-18 00:00:49 +00:00
|
|
|
#if OMPI_ENABLE_DEBUG
|
|
|
|
|
|
|
|
#define ORTE_IOF_SINK_DEFINE(snk, nm, fid, tg, wrthndlr, eplist) \
|
|
|
|
do { \
|
|
|
|
orte_iof_sink_t *ep; \
|
|
|
|
OPAL_OUTPUT_VERBOSE((1, orte_iof_base.iof_output, \
|
|
|
|
"defining endpoint: %s %d", \
|
|
|
|
__FILE__, __LINE__)); \
|
|
|
|
ep = OBJ_NEW(orte_iof_sink_t); \
|
|
|
|
ep->name.jobid = (nm)->jobid; \
|
|
|
|
ep->name.vpid = (nm)->vpid; \
|
|
|
|
ep->tag = (tg); \
|
|
|
|
ep->wev.fd = (fid); \
|
|
|
|
opal_event_set(&(ep->wev.ev), ep->wev.fd, \
|
|
|
|
OPAL_EV_WRITE|OPAL_EV_PERSIST, \
|
|
|
|
wrthndlr, &(ep->wev)); \
|
|
|
|
opal_list_append((eplist), &ep->super); \
|
|
|
|
*(snk) = ep; \
|
|
|
|
ep->file = strdup(__FILE__); \
|
|
|
|
ep->line = __LINE__; \
|
|
|
|
} while(0);
|
|
|
|
|
|
|
|
#define ORTE_IOF_READ_EVENT(nm, fid, tg, cbfunc, revlist, actv) \
|
|
|
|
do { \
|
|
|
|
orte_iof_read_event_t *rev; \
|
|
|
|
OPAL_OUTPUT_VERBOSE((1, orte_iof_base.iof_output, \
|
|
|
|
"%s defining read event for %s: %s %d", \
|
|
|
|
ORTE_NAME_PRINT(ORTE_PROC_MY_NAME), \
|
|
|
|
ORTE_NAME_PRINT((nm)), \
|
|
|
|
__FILE__, __LINE__)); \
|
|
|
|
rev = OBJ_NEW(orte_iof_read_event_t); \
|
|
|
|
rev->name.jobid = (nm)->jobid; \
|
|
|
|
rev->name.vpid = (nm)->vpid; \
|
|
|
|
rev->tag = (tg); \
|
|
|
|
rev->file = strdup(__FILE__); \
|
|
|
|
rev->line = __LINE__; \
|
|
|
|
opal_event_set(&rev->ev, (fid), \
|
|
|
|
OPAL_EV_READ | OPAL_EV_PERSIST, \
|
|
|
|
(cbfunc), rev); \
|
|
|
|
if ((actv)) { \
|
|
|
|
opal_event_add(&rev->ev, 0); \
|
|
|
|
opal_list_append((revlist), &rev->super); \
|
|
|
|
} else { \
|
|
|
|
opal_list_prepend((revlist), &rev->super); \
|
|
|
|
} \
|
|
|
|
} while(0);
|
|
|
|
|
|
|
|
|
|
|
|
#else
|
|
|
|
|
2008-10-18 13:09:47 +00:00
|
|
|
#define ORTE_IOF_SINK_DEFINE(snk, nm, fid, tg, wrthndlr, eplist) \
|
|
|
|
do { \
|
|
|
|
orte_iof_sink_t *ep; \
|
|
|
|
ep = OBJ_NEW(orte_iof_sink_t); \
|
|
|
|
ep->name.jobid = (nm)->jobid; \
|
|
|
|
ep->name.vpid = (nm)->vpid; \
|
|
|
|
ep->tag = (tg); \
|
|
|
|
ep->wev.fd = (fid); \
|
|
|
|
opal_event_set(&(ep->wev.ev), ep->wev.fd, \
|
|
|
|
OPAL_EV_WRITE|OPAL_EV_PERSIST, \
|
|
|
|
wrthndlr, &(ep->wev)); \
|
|
|
|
opal_list_append((eplist), &ep->super); \
|
|
|
|
*(snk) = ep; \
|
Roll in the revamped IOF subsystem. Per the devel mailing list email, this is a complete rewrite of the iof framework designed to simplify the code for maintainability, and to support features we had planned to do, but were too difficult to implement in the old code. Specifically, the new code:
1. completely and cleanly separates responsibilities between the HNP, orted, and tool components.
2. removes all wireup messaging during launch and shutdown.
3. maintains flow control for stdin to avoid large-scale consumption of memory by orteds when large input files are forwarded. This is done using an xon/xoff protocol.
4. enables specification of stdin recipients on the mpirun cmd line. Allowed options include rank, "all", or "none". Default is rank 0.
5. creates a new MPI_Info key "ompi_stdin_target" that supports the above options for child jobs. Default is "none".
6. adds a new tool "orte-iof" that can connect to a running mpirun and display the output. Cmd line options allow selection of any combination of stdout, stderr, and stddiag. Default is stdout.
7. adds a new mpirun and orte-iof cmd line option "tag-output" that will tag each line of output with process name and stream ident. For example, "[1,0]<stdout>this is output"
This is not intended for the 1.3 release as it is a major change requiring considerable soak time.
This commit was SVN r19767.
2008-10-18 00:00:49 +00:00
|
|
|
} while(0);
|
|
|
|
|
|
|
|
#define ORTE_IOF_READ_EVENT(nm, fid, tg, cbfunc, revlist, actv) \
|
|
|
|
do { \
|
|
|
|
orte_iof_read_event_t *rev; \
|
|
|
|
rev = OBJ_NEW(orte_iof_read_event_t); \
|
|
|
|
rev->name.jobid = (nm)->jobid; \
|
|
|
|
rev->name.vpid = (nm)->vpid; \
|
|
|
|
rev->tag = (tg); \
|
|
|
|
opal_event_set(&rev->ev, (fid), \
|
|
|
|
OPAL_EV_READ | OPAL_EV_PERSIST, \
|
|
|
|
(cbfunc), rev); \
|
|
|
|
if ((actv)) { \
|
|
|
|
opal_event_add(&rev->ev, 0); \
|
|
|
|
opal_list_append((revlist), &rev->super); \
|
|
|
|
} else { \
|
2008-10-18 11:52:41 +00:00
|
|
|
opal_list_prepend((revlist), &rev->super); \
|
Roll in the revamped IOF subsystem. Per the devel mailing list email, this is a complete rewrite of the iof framework designed to simplify the code for maintainability, and to support features we had planned to do, but were too difficult to implement in the old code. Specifically, the new code:
1. completely and cleanly separates responsibilities between the HNP, orted, and tool components.
2. removes all wireup messaging during launch and shutdown.
3. maintains flow control for stdin to avoid large-scale consumption of memory by orteds when large input files are forwarded. This is done using an xon/xoff protocol.
4. enables specification of stdin recipients on the mpirun cmd line. Allowed options include rank, "all", or "none". Default is rank 0.
5. creates a new MPI_Info key "ompi_stdin_target" that supports the above options for child jobs. Default is "none".
6. adds a new tool "orte-iof" that can connect to a running mpirun and display the output. Cmd line options allow selection of any combination of stdout, stderr, and stddiag. Default is stdout.
7. adds a new mpirun and orte-iof cmd line option "tag-output" that will tag each line of output with process name and stream ident. For example, "[1,0]<stdout>this is output"
This is not intended for the 1.3 release as it is a major change requiring considerable soak time.
This commit was SVN r19767.
2008-10-18 00:00:49 +00:00
|
|
|
} \
|
|
|
|
} while(0);
|
|
|
|
|
|
|
|
#endif
|
2005-01-12 20:51:34 +00:00
|
|
|
|
2006-08-20 15:54:04 +00:00
|
|
|
ORTE_DECLSPEC int orte_iof_base_close(void);
|
|
|
|
ORTE_DECLSPEC int orte_iof_base_select(void);
|
|
|
|
ORTE_DECLSPEC int orte_iof_base_flush(void);
|
2005-01-12 20:51:34 +00:00
|
|
|
|
2006-08-20 15:54:04 +00:00
|
|
|
ORTE_DECLSPEC extern orte_iof_base_t orte_iof_base;
|
2004-12-21 22:16:09 +00:00
|
|
|
|
Roll in the revamped IOF subsystem. Per the devel mailing list email, this is a complete rewrite of the iof framework designed to simplify the code for maintainability, and to support features we had planned to do, but were too difficult to implement in the old code. Specifically, the new code:
1. completely and cleanly separates responsibilities between the HNP, orted, and tool components.
2. removes all wireup messaging during launch and shutdown.
3. maintains flow control for stdin to avoid large-scale consumption of memory by orteds when large input files are forwarded. This is done using an xon/xoff protocol.
4. enables specification of stdin recipients on the mpirun cmd line. Allowed options include rank, "all", or "none". Default is rank 0.
5. creates a new MPI_Info key "ompi_stdin_target" that supports the above options for child jobs. Default is "none".
6. adds a new tool "orte-iof" that can connect to a running mpirun and display the output. Cmd line options allow selection of any combination of stdout, stderr, and stddiag. Default is stdout.
7. adds a new mpirun and orte-iof cmd line option "tag-output" that will tag each line of output with process name and stream ident. For example, "[1,0]<stdout>this is output"
This is not intended for the 1.3 release as it is a major change requiring considerable soak time.
This commit was SVN r19767.
2008-10-18 00:00:49 +00:00
|
|
|
/* base functions */
|
|
|
|
ORTE_DECLSPEC int orte_iof_base_write_output(orte_process_name_t *name, orte_iof_tag_t stream,
|
|
|
|
unsigned char *data, int numbytes,
|
|
|
|
orte_iof_write_event_t *channel);
|
|
|
|
ORTE_DECLSPEC void orte_iof_base_write_handler(int fd, short event, void *cbdata);
|
|
|
|
|
2008-06-18 03:15:56 +00:00
|
|
|
#endif /* ORTE_DISABLE_FULL_SUPPORT */
|
|
|
|
|
2008-02-28 01:57:57 +00:00
|
|
|
END_C_DECLS
|
|
|
|
|
|
|
|
#endif /* MCA_IOF_BASE_H */
|