root/orte/mca/rml/oob/rml_oob_component.c

/* [<][>][^][v][top][bottom][index][help] */

DEFINITIONS

This source file includes following definitions.
  1. recv_nb
  2. recv_buffer_nb
  3. recv_cancel
  4. oob_ping
  5. rml_oob_open
  6. rml_oob_close
  7. component_query

   1 /* -*- Mode: C; c-basic-offset:4 ; -*- */
   2 /*
   3  * Copyright (c) 2004-2010 The Trustees of Indiana University and Indiana
   4  *                         University Research and Technology
   5  *                         Corporation.  All rights reserved.
   6  * Copyright (c) 2004-2011 The University of Tennessee and The University
   7  *                         of Tennessee Research Foundation.  All rights
   8  *                         reserved.
   9  * Copyright (c) 2004-2005 High Performance Computing Center Stuttgart,
  10  *                         University of Stuttgart.  All rights reserved.
  11  * Copyright (c) 2004-2005 The Regents of the University of California.
  12  *                         All rights reserved.
  13  * Copyright (c) 2007-2015 Cisco Systems, Inc.  All rights reserved.
  14  * Copyright (c) 2011-2015 Los Alamos National Security, LLC.
  15  *                         All rights reserved.
  16  * Copyright (c) 2014-2019 Intel, Inc.  All rights reserved.
  17  * Copyright (c) 2016      Research Organization for Information Science
  18  *                         and Technology (RIST). All rights reserved.
  19  * $COPYRIGHT$
  20  *
  21  * Additional copyrights may follow
  22  *
  23  * $HEADER$
  24  */
  25 
  26 #include "orte_config.h"
  27 #include "orte/constants.h"
  28 
  29 #ifdef HAVE_NETINET_IN_H
  30 #include <netinet/in.h>
  31 #endif
  32 #ifdef HAVE_ARPA_INET_H
  33 #include <arpa/inet.h>
  34 #endif
  35 
  36 #include "opal/mca/base/base.h"
  37 #include "opal/util/output.h"
  38 #include "opal/util/argv.h"
  39 #include "opal/mca/backtrace/backtrace.h"
  40 #include "opal/mca/event/event.h"
  41 
  42 #if OPAL_ENABLE_FT_CR == 1
  43 #include "orte/mca/rml/rml.h"
  44 #include "orte/mca/state/state.h"
  45 #endif
  46 #include "orte/mca/rml/base/base.h"
  47 #include "orte/mca/rml/rml_types.h"
  48 #include "orte/mca/routed/routed.h"
  49 #include "orte/mca/errmgr/errmgr.h"
  50 #include "orte/util/name_fns.h"
  51 #include "orte/runtime/orte_globals.h"
  52 
  53 #include "orte/mca/oob/oob.h"
  54 #include "orte/mca/oob/base/base.h"
  55 #include "orte/mca/routed/routed.h"
  56 #include "rml_oob.h"
  57 
  58 static int rml_oob_open(void);
  59 static int rml_oob_close(void);
  60 static int component_query(mca_base_module_t **module, int *priority);
  61 
  62 /**
  63  * component definition
  64  */
  65 orte_rml_component_t mca_rml_oob_component = {
  66       /* First, the mca_base_component_t struct containing meta
  67          information about the component itself */
  68 
  69     .base = {
  70         ORTE_RML_BASE_VERSION_3_0_0,
  71 
  72         .mca_component_name = "oob",
  73         MCA_BASE_MAKE_VERSION(component, ORTE_MAJOR_VERSION, ORTE_MINOR_VERSION,
  74                               ORTE_RELEASE_VERSION),
  75         .mca_open_component = rml_oob_open,
  76         .mca_close_component = rml_oob_close,
  77         .mca_query_component = component_query,
  78 
  79     },
  80     .data = {
  81         /* The component is checkpoint ready */
  82         MCA_BASE_METADATA_PARAM_CHECKPOINT
  83     },
  84     .priority = 5
  85 };
  86 
  87 /* Local variables */
  88 static void recv_nb(orte_process_name_t* peer,
  89                     orte_rml_tag_t tag,
  90                     bool persistent,
  91                     orte_rml_callback_fn_t cbfunc,
  92                     void* cbdata)
  93 {
  94     orte_rml_recv_request_t *req;
  95 
  96     opal_output_verbose(10, orte_rml_base_framework.framework_output,
  97                          "%s rml_recv_nb for peer %s tag %d",
  98                          ORTE_NAME_PRINT(ORTE_PROC_MY_NAME),
  99                          ORTE_NAME_PRINT(peer), tag);
 100 
 101     /* push the request into the event base so we can add
 102      * the receive to our list of posted recvs */
 103     req = OBJ_NEW(orte_rml_recv_request_t);
 104     req->post->buffer_data = false;
 105     req->post->peer.jobid = peer->jobid;
 106     req->post->peer.vpid = peer->vpid;
 107     req->post->tag = tag;
 108     req->post->persistent = persistent;
 109     req->post->cbfunc.iov = cbfunc;
 110     req->post->cbdata = cbdata;
 111     ORTE_THREADSHIFT(req, orte_event_base, orte_rml_base_post_recv, ORTE_MSG_PRI);
 112 }
 113 static void recv_buffer_nb(orte_process_name_t* peer,
 114                            orte_rml_tag_t tag,
 115                            bool persistent,
 116                            orte_rml_buffer_callback_fn_t cbfunc,
 117                            void* cbdata)
 118 {
 119     orte_rml_recv_request_t *req;
 120 
 121     opal_output_verbose(10, orte_rml_base_framework.framework_output,
 122                          "%s rml_recv_buffer_nb for peer %s tag %d",
 123                          ORTE_NAME_PRINT(ORTE_PROC_MY_NAME),
 124                          ORTE_NAME_PRINT(peer), tag);
 125 
 126     /* push the request into the event base so we can add
 127      * the receive to our list of posted recvs */
 128     req = OBJ_NEW(orte_rml_recv_request_t);
 129     req->post->buffer_data = true;
 130     req->post->peer.jobid = peer->jobid;
 131     req->post->peer.vpid = peer->vpid;
 132     req->post->tag = tag;
 133     req->post->persistent = persistent;
 134     req->post->cbfunc.buffer = cbfunc;
 135     req->post->cbdata = cbdata;
 136     ORTE_THREADSHIFT(req, orte_event_base, orte_rml_base_post_recv, ORTE_MSG_PRI);
 137 }
 138 static void recv_cancel(orte_process_name_t* peer, orte_rml_tag_t tag)
 139 {
 140     orte_rml_recv_request_t *req;
 141 
 142     opal_output_verbose(10, orte_rml_base_framework.framework_output,
 143                          "%s rml_recv_cancel for peer %s tag %d",
 144                          ORTE_NAME_PRINT(ORTE_PROC_MY_NAME),
 145                          ORTE_NAME_PRINT(peer), tag);
 146 
 147     ORTE_ACQUIRE_OBJECT(orte_event_base_active);
 148     if (!orte_event_base_active) {
 149         /* no event will be processed any more, so simply return. */
 150         return;
 151     }
 152 
 153     /* push the request into the event base so we can remove
 154      * the receive from our list of posted recvs */
 155     req = OBJ_NEW(orte_rml_recv_request_t);
 156     req->cancel = true;
 157     req->post->peer.jobid = peer->jobid;
 158     req->post->peer.vpid = peer->vpid;
 159     req->post->tag = tag;
 160     ORTE_THREADSHIFT(req, orte_event_base, orte_rml_base_post_recv, ORTE_MSG_PRI);
 161 }
 162 static int oob_ping(const char* uri, const struct timeval* tv)
 163 {
 164     return ORTE_ERR_UNREACH;
 165 }
 166 
 167 static orte_rml_base_module_t base_module = {
 168     .component = (struct orte_rml_component_t*)&mca_rml_oob_component,
 169     .ping = oob_ping,
 170     .send_nb = orte_rml_oob_send_nb,
 171     .send_buffer_nb = orte_rml_oob_send_buffer_nb,
 172     .recv_nb = recv_nb,
 173     .recv_buffer_nb = recv_buffer_nb,
 174     .recv_cancel = recv_cancel,
 175     .purge = NULL
 176 };
 177 
 178 static int rml_oob_open(void)
 179 {
 180     return ORTE_SUCCESS;
 181 }
 182 
 183 
 184 static int rml_oob_close(void)
 185 {
 186     return ORTE_SUCCESS;
 187 }
 188 
 189 static int component_query(mca_base_module_t **module, int *priority)
 190 {
 191     *priority = 50;
 192     *module = (mca_base_module_t *) &base_module;
 193     return ORTE_SUCCESS;
 194 }

/* [<][>][^][v][top][bottom][index][help] */