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) 2016 Intel, Inc. All rights reserved. 14 * $COPYRIGHT$ 15 * 16 * Additional copyrights may follow 17 * 18 * $HEADER$ 19 */ 20 /** 21 * @file 22 * 23 * The hnp IOF component is used in HNP processes only. It is the 24 * "hub" for all IOF activity, meaning that *all* IOF traffic is 25 * routed to the hnp component, and this component figures out where 26 * it is supposed to go from there. Specifically: there is *no* 27 * direct proxy-to-proxy IOF communication. If a proxy/orted wants to 28 * get a stream from another proxy/orted, the stream will go 29 * proxy/orted -> HNP -> proxy/orted. 30 * 31 * The hnp IOF component does two things: 1. forward fragments between 32 * file descriptors and streams, and 2. maintain forwarding tables to 33 * "route" incoming fragments to outgoing destinations (both file 34 * descriptors and other published streams). 35 * 36 */ 37 38 #ifndef ORTE_IOF_HNP_H 39 #define ORTE_IOF_HNP_H 40 41 #include "orte_config.h" 42 43 #ifdef HAVE_SYS_TYPES_H 44 #include <sys/types.h> 45 #endif /* HAVE_SYS_TYPES_H */ 46 #ifdef HAVE_SYS_UIO_H 47 #include <sys/uio.h> 48 #endif /* HAVE_SYS_UIO_H */ 49 #ifdef HAVE_NET_UIO_H 50 #include <net/uio.h> 51 #endif /* HAVE_NET_UIO_H */ 52 53 #include "orte/mca/iof/iof.h" 54 #include "orte/mca/iof/base/base.h" 55 56 57 BEGIN_C_DECLS 58 59 /** 60 * IOF HNP Component 61 */ 62 struct orte_iof_hnp_component_t { 63 orte_iof_base_component_t super; 64 opal_list_t procs; 65 orte_iof_read_event_t *stdinev; 66 opal_event_t stdinsig; 67 }; 68 typedef struct orte_iof_hnp_component_t orte_iof_hnp_component_t; 69 70 ORTE_MODULE_DECLSPEC extern orte_iof_hnp_component_t mca_iof_hnp_component; 71 extern orte_iof_base_module_t orte_iof_hnp_module; 72 73 void orte_iof_hnp_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_hnp_read_local_handler(int fd, short event, void *cbdata); 78 void orte_iof_hnp_stdin_cb(int fd, short event, void *cbdata); 79 bool orte_iof_hnp_stdin_check(int fd); 80 81 int orte_iof_hnp_send_data_to_endpoint(orte_process_name_t *host, 82 orte_process_name_t *target, 83 orte_iof_tag_t tag, 84 unsigned char *data, int numbytes); 85 86 END_C_DECLS 87 88 #endif