This source file includes following definitions.
- alps_component_open
- alps_component_close
- component_available
- component_startup
- component_shutdown
- component_send
- component_get_addr
- component_set_addr
- component_is_reachable
- component_ft_event
   1 
   2 
   3 
   4 
   5 
   6 
   7 
   8 
   9 
  10 
  11 
  12 
  13 
  14 
  15 
  16 
  17 
  18 
  19 
  20 
  21 
  22 
  23 
  24 
  25 
  26 
  27 
  28 
  29 
  30 
  31 #include "orte_config.h"
  32 #include "orte/types.h"
  33 #include "opal/types.h"
  34 
  35 #ifdef HAVE_UNISTD_H
  36 #include <unistd.h>
  37 #endif
  38 #ifdef HAVE_SYS_TYPES_H
  39 #include <sys/types.h>
  40 #endif
  41 #include <fcntl.h>
  42 #ifdef HAVE_NETINET_IN_H
  43 #include <netinet/in.h>
  44 #endif
  45 #ifdef HAVE_ARPA_INET_H
  46 #include <arpa/inet.h>
  47 #endif
  48 #ifdef HAVE_NETDB_H
  49 #include <netdb.h>
  50 #endif
  51 #include <ctype.h>
  52 
  53 #include "opal/util/show_help.h"
  54 #include "opal/util/error.h"
  55 #include "opal/util/output.h"
  56 #include "opal/opal_socket_errno.h"
  57 #include "opal/util/if.h"
  58 #include "opal/util/net.h"
  59 #include "opal/util/argv.h"
  60 #include "opal/class/opal_hash_table.h"
  61 #include "opal/class/opal_list.h"
  62 
  63 #include "orte/mca/errmgr/errmgr.h"
  64 #include "orte/mca/ess/ess.h"
  65 #include "orte/mca/routed/routed.h"
  66 #include "orte/mca/state/state.h"
  67 #include "orte/mca/oob/oob.h"
  68 #include "orte/mca/oob/base/base.h"
  69 #include "orte/mca/common/alps/common_alps.h"
  70 #include "orte/util/name_fns.h"
  71 #include "orte/util/parse_options.h"
  72 #include "orte/util/show_help.h"
  73 #include "orte/runtime/orte_globals.h"
  74 
  75 static int alps_component_open(void);
  76 static int alps_component_close(void);
  77 static int component_available(void);
  78 static int component_startup(void);
  79 static void component_shutdown(void);
  80 static int component_send(orte_rml_send_t *msg);
  81 static char* component_get_addr(void);
  82 static int component_set_addr(orte_process_name_t *peer, char **uris);
  83 static bool component_is_reachable(char *routed, orte_process_name_t *peer);
  84 #if OPAL_ENABLE_FT_CR == 1
  85 static int component_ft_event(int state);
  86 #endif
  87 
  88 
  89 
  90 
  91 mca_oob_base_component_t mca_oob_alps_component = {
  92     .oob_base = {
  93         MCA_OOB_BASE_VERSION_2_0_0,
  94         .mca_component_name = "alps",
  95         MCA_BASE_MAKE_VERSION(component, ORTE_MAJOR_VERSION, ORTE_MINOR_VERSION,
  96                               ORTE_RELEASE_VERSION),
  97         .mca_open_component = alps_component_open,
  98         .mca_close_component = alps_component_close,
  99     },
 100     .oob_data = {
 101         
 102         MCA_BASE_METADATA_PARAM_CHECKPOINT
 103     },
 104     .priority = 30, 
 105     .available = component_available,
 106     .startup = component_startup,
 107     .shutdown = component_shutdown,
 108     .send_nb = component_send,
 109     .get_addr = component_get_addr,
 110     .set_addr = component_set_addr,
 111     .is_reachable = component_is_reachable,
 112 #if OPAL_ENABLE_FT_CR == 1
 113     .ft_event = component_ft_event,
 114 #endif
 115 };
 116 
 117 
 118 
 119 
 120 static int alps_component_open(void)
 121 {
 122     return ORTE_SUCCESS;
 123 }
 124 
 125 static int alps_component_close(void)
 126 {
 127     return ORTE_SUCCESS;
 128 }
 129 
 130 static int component_available(void)
 131 {
 132     bool flag = false;
 133 
 134     
 135 
 136 
 137 
 138     if (!ORTE_PROC_IS_APP) {
 139         return ORTE_ERR_NOT_SUPPORTED;
 140     }
 141 
 142     
 143 
 144 
 145 
 146     if (NULL != orte_process_info.my_daemon_uri) {
 147         return ORTE_ERR_NOT_SUPPORTED;
 148     }
 149 
 150     
 151 
 152 
 153 
 154 
 155 
 156     orte_common_alps_proc_in_pagg(&flag);
 157 
 158     if (flag) {
 159         opal_output_verbose(5, orte_oob_base_framework.framework_output,
 160                             "oob:alps: component_available called");
 161         return ORTE_SUCCESS;
 162     }
 163 
 164     return ORTE_ERR_NOT_AVAILABLE;
 165 }
 166 
 167 
 168 static int component_startup(void)
 169 {
 170     opal_output_verbose(2, orte_oob_base_framework.framework_output,
 171                         "%s ALPS STARTUP",
 172                         ORTE_NAME_PRINT(ORTE_PROC_MY_NAME));
 173 
 174     return ORTE_SUCCESS;
 175 }
 176 
 177 static void component_shutdown(void)
 178 {
 179     opal_output_verbose(2, orte_oob_base_framework.framework_output,
 180                         "%s ALPS SHUTDOWN",
 181                         ORTE_NAME_PRINT(ORTE_PROC_MY_NAME));
 182 }
 183 
 184 static int component_send(orte_rml_send_t *msg)
 185 {
 186     opal_output_verbose(10, orte_oob_base_framework.framework_output,
 187                         "%s oob:alps:send_nb to peer %s:%d this should not be happening",
 188                         ORTE_NAME_PRINT(ORTE_PROC_MY_NAME),
 189                         ORTE_NAME_PRINT(&msg->dst), msg->tag);
 190 
 191     return ORTE_ERR_NOT_SUPPORTED;
 192 }
 193 
 194 static char* component_get_addr(void)
 195 {
 196     char hn[OPAL_MAXHOSTNAMELEN], *cptr;
 197 
 198     
 199 
 200 
 201 
 202 
 203     gethostname(hn, sizeof(hn));
 204 
 205     opal_asprintf(&cptr, "gni://%s:%d", hn, getpid());
 206 
 207     opal_output_verbose(10, orte_oob_base_framework.framework_output,
 208                         "%s oob:alps: component_get_addr invoked - %s",
 209                         ORTE_NAME_PRINT(ORTE_PROC_MY_NAME),cptr);
 210     return cptr;
 211 }
 212 
 213 static int component_set_addr(orte_process_name_t *peer,
 214                               char **uris)
 215 {
 216     opal_output_verbose(10, orte_oob_base_framework.framework_output,
 217                         "%s oob:alps: component_set_addr invoked - this should not be happening",
 218                         ORTE_NAME_PRINT(ORTE_PROC_MY_NAME));
 219     return ORTE_ERR_NOT_SUPPORTED;
 220 }
 221 
 222 static bool component_is_reachable(char *routed, orte_process_name_t *peer)
 223 {
 224     opal_output_verbose(10, orte_oob_base_framework.framework_output,
 225                         "%s oob:alps: component_set_addr invoked - this should not be happening",
 226                         ORTE_NAME_PRINT(ORTE_PROC_MY_NAME));
 227     return false;
 228 }
 229 
 230 #if OPAL_ENABLE_FT_CR == 1
 231 static int component_ft_event(int state)
 232 {
 233     opal_output_verbose(2, orte_oob_base_framework.framework_output,
 234                         "%s ALPS EVENT", ORTE_NAME_PRINT(ORTE_PROC_MY_NAME));
 235 
 236     return ORTE_ERR_NOT_SUPPORTED;
 237 }
 238 #endif