2004-12-22 01:16:09 +03:00
|
|
|
/*
|
2007-03-17 02:11:45 +03:00
|
|
|
* Copyright (c) 2004-2007 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.
|
2004-12-22 01:16:09 +03:00
|
|
|
* Copyright (c) 2004-2005 High Performance Computing Center Stuttgart,
|
|
|
|
* University of Stuttgart. All rights reserved.
|
2005-03-24 15:43:37 +03:00
|
|
|
* Copyright (c) 2004-2005 The Regents of the University of California.
|
|
|
|
* All rights reserved.
|
2004-12-22 01:16:09 +03:00
|
|
|
* $COPYRIGHT$
|
|
|
|
*
|
|
|
|
* Additional copyrights may follow
|
|
|
|
*
|
|
|
|
* $HEADER$
|
|
|
|
*/
|
|
|
|
/**
|
|
|
|
* @file
|
|
|
|
*
|
|
|
|
* I/O Forwarding Service
|
|
|
|
*/
|
|
|
|
|
2005-03-14 23:57:21 +03:00
|
|
|
#ifndef ORTE_IOF_H
|
|
|
|
#define ORTE_IOF_H
|
2004-12-22 01:16:09 +03:00
|
|
|
|
2005-03-14 23:57:21 +03:00
|
|
|
#include "orte_config.h"
|
2005-07-03 20:22:16 +04:00
|
|
|
#include "opal/class/opal_list.h"
|
2006-02-12 04:33:29 +03:00
|
|
|
#include "opal/mca/mca.h"
|
|
|
|
#include "orte/mca/ns/ns.h"
|
2004-12-22 01:16:09 +03:00
|
|
|
|
2007-03-17 02:11:45 +03:00
|
|
|
#include "opal/mca/crs/crs.h"
|
|
|
|
#include "opal/mca/crs/base/base.h"
|
|
|
|
|
2004-12-22 01:16:09 +03:00
|
|
|
#if defined(c_plusplus) || defined(__cplusplus)
|
|
|
|
extern "C" {
|
|
|
|
#endif
|
|
|
|
|
|
|
|
/* suggested tag values */
|
|
|
|
enum {
|
2005-03-14 23:57:21 +03:00
|
|
|
ORTE_IOF_ANY = -1,
|
|
|
|
ORTE_IOF_STDIN = 0,
|
|
|
|
ORTE_IOF_STDOUT = 1,
|
|
|
|
ORTE_IOF_STDERR = 2
|
2004-12-22 01:16:09 +03:00
|
|
|
};
|
2005-03-14 23:57:21 +03:00
|
|
|
typedef int orte_iof_base_tag_t;
|
2004-12-22 01:16:09 +03:00
|
|
|
|
|
|
|
/* endpoint mode */
|
2006-07-14 23:55:14 +04:00
|
|
|
enum {
|
|
|
|
ORTE_IOF_SOURCE = 0,
|
2005-03-14 23:57:21 +03:00
|
|
|
ORTE_IOF_SINK
|
2006-07-14 23:55:14 +04:00
|
|
|
};
|
|
|
|
typedef int orte_iof_base_mode_t;
|
2004-12-22 01:16:09 +03:00
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Publish a local file descriptor as an endpoint that is logically
|
|
|
|
* associated with the specified process name (e.g. file descriptor
|
|
|
|
* corresponding to the master side of a pipe/pty connected to a
|
|
|
|
* child process)
|
|
|
|
*
|
|
|
|
* @param name Process name associated with the endpoint.
|
|
|
|
* @param mode Is the endpoint an input or output.
|
|
|
|
* @param tag The logical tag associated with this file descriptor.
|
|
|
|
* @param fd Local file descriptor
|
|
|
|
*
|
|
|
|
*/
|
|
|
|
|
2005-03-14 23:57:21 +03:00
|
|
|
typedef int (*orte_iof_base_publish_fn_t)(
|
|
|
|
const orte_process_name_t* name,
|
|
|
|
orte_iof_base_mode_t mode,
|
|
|
|
orte_iof_base_tag_t tag,
|
2004-12-22 01:16:09 +03:00
|
|
|
int fd
|
|
|
|
);
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Remove all endpoints matching the specified process
|
|
|
|
* name, mask and tag values.
|
|
|
|
*
|
|
|
|
* @param name Process name associated with the endpoint.
|
|
|
|
* @param mask A mask indicating the set of processes to unpublish.
|
|
|
|
* @param tag The endpoint tag.
|
|
|
|
*
|
|
|
|
*/
|
|
|
|
|
2005-03-14 23:57:21 +03:00
|
|
|
typedef int (*orte_iof_base_unpublish_fn_t)(
|
|
|
|
const orte_process_name_t* name,
|
|
|
|
orte_ns_cmp_bitmask_t mask,
|
|
|
|
orte_iof_base_tag_t tag
|
2004-12-22 01:16:09 +03:00
|
|
|
);
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Explicitly push data from the specified input file
|
|
|
|
* descriptor to the indicated set of peers.
|
|
|
|
*
|
|
|
|
* @param dst_name Name used to qualify set of peers.
|
|
|
|
* @param dst_mask Mask that specified how name is interpreted.
|
|
|
|
* @param dst_tag Match a specific peer endpoint.
|
|
|
|
* @param fd Local file descriptor for input.
|
|
|
|
*/
|
|
|
|
|
2005-03-14 23:57:21 +03:00
|
|
|
typedef int (*orte_iof_base_push_fn_t)(
|
|
|
|
const orte_process_name_t* dst_name,
|
|
|
|
orte_ns_cmp_bitmask_t dst_mask,
|
|
|
|
orte_iof_base_tag_t dst_tag,
|
2004-12-22 01:16:09 +03:00
|
|
|
int fd
|
|
|
|
);
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Explicitly pull data from the specified set of peers
|
|
|
|
* and dump to the indicated output file descriptor.
|
|
|
|
*
|
|
|
|
* @param dst_name Name used to qualify set of peers.
|
|
|
|
* @param dst_mask Mask that specified how name is interpreted.
|
|
|
|
* @param dst_tag Match a specific peer endpoint.
|
|
|
|
* @param fd Local file descriptor for output.
|
|
|
|
*/
|
|
|
|
|
2005-03-14 23:57:21 +03:00
|
|
|
typedef int (*orte_iof_base_pull_fn_t)(
|
|
|
|
const orte_process_name_t* src_name,
|
|
|
|
orte_ns_cmp_bitmask_t src_mask,
|
|
|
|
orte_iof_base_tag_t src_tag,
|
2004-12-22 01:16:09 +03:00
|
|
|
int fd
|
|
|
|
);
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Setup buffering for a specified set of endpoints.
|
|
|
|
*/
|
|
|
|
|
2005-03-14 23:57:21 +03:00
|
|
|
typedef int (*orte_iof_base_buffer_fn_t)(
|
|
|
|
const orte_process_name_t* src_name,
|
|
|
|
orte_ns_cmp_bitmask_t src_mask,
|
|
|
|
orte_iof_base_tag_t src_tag,
|
2004-12-22 01:16:09 +03:00
|
|
|
size_t buffer_size
|
|
|
|
);
|
|
|
|
|
|
|
|
/*
|
|
|
|
* Subscribe to receive a callback on receipt of data
|
|
|
|
* from a specified set of peers.
|
|
|
|
*/
|
|
|
|
|
2005-11-10 07:49:51 +03:00
|
|
|
typedef void (*orte_iof_base_callback_fn_t)(
|
2005-03-14 23:57:21 +03:00
|
|
|
orte_process_name_t* src_name,
|
|
|
|
orte_iof_base_tag_t src_tag,
|
2004-12-22 01:16:09 +03:00
|
|
|
void *cbdata,
|
|
|
|
const unsigned char* data,
|
|
|
|
size_t count
|
|
|
|
);
|
|
|
|
|
2005-03-14 23:57:21 +03:00
|
|
|
typedef int (*orte_iof_base_subscribe_fn_t)(
|
|
|
|
const orte_process_name_t* src_name,
|
|
|
|
orte_ns_cmp_bitmask_t src_mask,
|
|
|
|
orte_iof_base_tag_t src_tag,
|
|
|
|
orte_iof_base_callback_fn_t cb,
|
2004-12-22 01:16:09 +03:00
|
|
|
void* cbdata
|
|
|
|
);
|
|
|
|
|
2005-03-14 23:57:21 +03:00
|
|
|
typedef int (*orte_iof_base_unsubscribe_fn_t)(
|
|
|
|
const orte_process_name_t* src_name,
|
|
|
|
orte_ns_cmp_bitmask_t src_mask,
|
|
|
|
orte_iof_base_tag_t src_tag
|
2004-12-22 01:16:09 +03:00
|
|
|
);
|
|
|
|
|
2005-01-18 19:43:47 +03:00
|
|
|
|
|
|
|
/*
|
|
|
|
* Flush all output and block until output is delivered.
|
|
|
|
*/
|
|
|
|
|
2005-03-14 23:57:21 +03:00
|
|
|
typedef int (*orte_iof_base_flush_fn_t)(void);
|
2005-01-18 19:43:47 +03:00
|
|
|
|
2006-02-04 00:01:11 +03:00
|
|
|
typedef int (*orte_iof_base_finalize_fn_t)(void);
|
2007-03-17 02:11:45 +03:00
|
|
|
|
|
|
|
/*
|
|
|
|
* FT Event Notification
|
|
|
|
*/
|
|
|
|
typedef int (*orte_iof_base_ft_event_fn_t)(int state);
|
2006-02-04 00:01:11 +03:00
|
|
|
|
2004-12-22 01:16:09 +03:00
|
|
|
/**
|
|
|
|
* IOF module.
|
|
|
|
*/
|
|
|
|
|
2005-03-14 23:57:21 +03:00
|
|
|
struct orte_iof_base_module_1_0_0_t {
|
|
|
|
orte_iof_base_publish_fn_t iof_publish;
|
|
|
|
orte_iof_base_unpublish_fn_t iof_unpublish;
|
|
|
|
orte_iof_base_push_fn_t iof_push;
|
|
|
|
orte_iof_base_pull_fn_t iof_pull;
|
|
|
|
orte_iof_base_subscribe_fn_t iof_subscribe;
|
|
|
|
orte_iof_base_unsubscribe_fn_t iof_unsubscribe;
|
|
|
|
orte_iof_base_flush_fn_t iof_flush;
|
2006-02-04 00:01:11 +03:00
|
|
|
orte_iof_base_finalize_fn_t iof_finalize;
|
2007-03-17 02:11:45 +03:00
|
|
|
orte_iof_base_ft_event_fn_t ft_event;
|
2004-12-22 01:16:09 +03:00
|
|
|
};
|
|
|
|
|
2005-03-14 23:57:21 +03:00
|
|
|
typedef struct orte_iof_base_module_1_0_0_t orte_iof_base_module_1_0_0_t;
|
|
|
|
typedef orte_iof_base_module_1_0_0_t orte_iof_base_module_t;
|
2006-08-20 19:54:04 +04:00
|
|
|
ORTE_DECLSPEC extern orte_iof_base_module_t orte_iof;
|
2004-12-22 01:16:09 +03:00
|
|
|
|
|
|
|
/**
|
|
|
|
* IOF component descriptor. Contains component version information
|
|
|
|
* and component open/close/init functions.
|
|
|
|
*/
|
|
|
|
|
2005-03-14 23:57:21 +03:00
|
|
|
typedef orte_iof_base_module_t* (*orte_iof_base_component_init_fn_t)(
|
2004-12-22 01:16:09 +03:00
|
|
|
int *priority,
|
2005-01-12 23:51:34 +03:00
|
|
|
bool *allow_user_threads,
|
|
|
|
bool *have_hidden_threads
|
2004-12-22 01:16:09 +03:00
|
|
|
);
|
|
|
|
|
2005-03-14 23:57:21 +03:00
|
|
|
struct orte_iof_base_component_1_0_0_t {
|
2004-12-22 01:16:09 +03:00
|
|
|
mca_base_component_t iof_version;
|
|
|
|
mca_base_component_data_1_0_0_t iof_data;
|
2005-03-14 23:57:21 +03:00
|
|
|
orte_iof_base_component_init_fn_t iof_init;
|
2004-12-22 01:16:09 +03:00
|
|
|
};
|
2005-03-14 23:57:21 +03:00
|
|
|
typedef struct orte_iof_base_component_1_0_0_t orte_iof_base_component_1_0_0_t;
|
|
|
|
typedef struct orte_iof_base_component_1_0_0_t orte_iof_base_component_t;
|
2004-12-22 01:16:09 +03:00
|
|
|
|
|
|
|
/*
|
|
|
|
* Macro for use in components that are of type iof v1.0.0
|
|
|
|
*/
|
2005-03-14 23:57:21 +03:00
|
|
|
#define ORTE_IOF_BASE_VERSION_1_0_0 \
|
2004-12-22 01:16:09 +03:00
|
|
|
/* iof v1.0 is chained to MCA v1.0 */ \
|
|
|
|
MCA_BASE_VERSION_1_0_0, \
|
|
|
|
/* iof v1.0 */ \
|
|
|
|
"iof", 1, 0, 0
|
|
|
|
|
|
|
|
#if defined(c_plusplus) || defined(__cplusplus)
|
|
|
|
}
|
|
|
|
#endif
|
2005-03-14 23:57:21 +03:00
|
|
|
#endif /* ORTE_IOF_H */
|