1 /* 2 * Copyright (c) 2004-2007 The Trustees of Indiana University and Indiana 3 * University Research and Technology 4 * Corporation. All rights reserved. 5 * Copyright (c) 2004-2006 The University of Tennessee and The University 6 * of Tennessee Research Foundation. All rights 7 * reserved. 8 * Copyright (c) 2004-2005 High Performance Computing Center Stuttgart, 9 * University of Stuttgart. All rights reserved. 10 * Copyright (c) 2004-2005 The Regents of the University of California. 11 * All rights reserved. 12 * Copyright (c) 2007 Cisco Systems, Inc. All rights reserved. 13 * Copyright (c) 2007 Sun Microsystems, Inc. All rights reserved. 14 * Copyright (c) 2016 Intel, Inc. All rights reserved. 15 * $COPYRIGHT$ 16 * 17 * Additional copyrights may follow 18 * 19 * $HEADER$ 20 */ 21 /** 22 * @file 23 * 24 * The orted IOF component is used in daemons. It is used 25 * to orted all IOF actions back to the "hnp" IOF component (i.e., the 26 * IOF component that runs in the HNP). The orted IOF component is 27 * loaded in an orted and then tied to the stdin, stdout, 28 * and stderr streams of created child processes via pipes. The orted 29 * IOF component in the orted then acts as the relay between the 30 * stdin/stdout/stderr pipes and the IOF component in the HNP. 31 * This design allows us to manipulate stdin/stdout/stderr from before 32 * main() in the child process. 33 * 34 * Much of the intelligence of this component is actually contained in 35 * iof_base_endpoint.c (reading and writing to local file descriptors, 36 * setting up events based on file descriptors, etc.). 37 * 38 * A non-blocking OOB receive is posted at the initialization of this 39 * component to receive all messages from the HNP (e.g., data 40 * fragments from streams, ACKs to fragments). 41 * 42 * Flow control is employed on a per-stream basis to ensure that 43 * SOURCEs don't overwhelm SINK resources (E.g., send an entire input 44 * file to an orted before the target process has read any of it). 45 * 46 */ 47 #ifndef ORTE_IOF_ORTED_H 48 #define ORTE_IOF_ORTED_H 49 50 #include "orte_config.h" 51 52 #include "opal/class/opal_list.h" 53 54 #include "orte/mca/rml/rml_types.h" 55 56 #include "orte/mca/iof/iof.h" 57 58 BEGIN_C_DECLS 59 60 /** 61 * IOF ORTED Component 62 */ 63 struct orte_iof_orted_component_t { 64 orte_iof_base_component_t super; 65 opal_list_t procs; 66 bool xoff; 67 }; 68 typedef struct orte_iof_orted_component_t orte_iof_orted_component_t; 69 70 ORTE_MODULE_DECLSPEC extern orte_iof_orted_component_t mca_iof_orted_component; 71 extern orte_iof_base_module_t orte_iof_orted_module; 72 73 void orte_iof_orted_recv(int status, orte_process_name_t* sender, 74 opal_buffer_t* buffer, orte_rml_tag_t tag, 75 void* cbdata); 76 77 void orte_iof_orted_read_handler(int fd, short event, void *data); 78 void orte_iof_orted_send_xonxoff(orte_iof_tag_t tag); 79 80 END_C_DECLS 81 82 #endif