root/opal/mca/pmix/pmix4x/pmix/src/mca/ptl/base/base.h

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

INCLUDED FROM


   1 /* -*- C -*-
   2  *
   3  * Copyright (c) 2004-2007 The Trustees of Indiana University and Indiana
   4  *                         University Research and Technology
   5  *                         Corporation.  All rights reserved.
   6  * Copyright (c) 2004-2006 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) 2012      Los Alamos National Security, Inc.  All rights reserved.
  14  * Copyright (c) 2014-2018 Intel, Inc. All rights reserved.
  15  * Copyright (c) 2015      Research Organization for Information Science
  16  *                         and Technology (RIST). All rights reserved.
  17  * $COPYRIGHT$
  18  *
  19  * Additional copyrights may follow
  20  *
  21  * $HEADER$
  22  *
  23  */
  24 #ifndef PMIX_PTL_BASE_H_
  25 #define PMIX_PTL_BASE_H_
  26 
  27 #include <src/include/pmix_config.h>
  28 
  29 
  30 #ifdef HAVE_SYS_TIME_H
  31 #include <sys/time.h> /* for struct timeval */
  32 #endif
  33 #ifdef HAVE_STRING_H
  34 #include <string.h>
  35 #endif
  36 
  37 #include "src/class/pmix_pointer_array.h"
  38 #include "src/mca/mca.h"
  39 #include "src/mca/base/pmix_mca_base_framework.h"
  40 
  41 #include "src/include/pmix_globals.h"
  42 #include "src/mca/ptl/ptl.h"
  43 
  44 
  45  BEGIN_C_DECLS
  46 
  47 /*
  48  * MCA Framework
  49  */
  50 PMIX_EXPORT extern pmix_mca_base_framework_t pmix_ptl_base_framework;
  51 /**
  52  * PTL select function
  53  *
  54  * Cycle across available components and construct the list
  55  * of active modules
  56  */
  57 PMIX_EXPORT pmix_status_t pmix_ptl_base_select(void);
  58 
  59 /**
  60  * Track an active component
  61  */
  62 struct pmix_ptl_base_active_t {
  63     pmix_list_item_t super;
  64     pmix_status_t pri;
  65     pmix_ptl_base_component_t *component;
  66     pmix_ptl_module_t *module;
  67 };
  68 typedef struct pmix_ptl_base_active_t pmix_ptl_base_active_t;
  69 PMIX_CLASS_DECLARATION(pmix_ptl_base_active_t);
  70 
  71 
  72 /* framework globals */
  73 struct pmix_ptl_globals_t {
  74     pmix_list_t actives;
  75     bool initialized;
  76     pmix_list_t posted_recvs;     // list of pmix_ptl_posted_recv_t
  77     pmix_list_t unexpected_msgs;
  78     int stop_thread[2];
  79     bool listen_thread_active;
  80     pmix_list_t listeners;
  81     uint32_t current_tag;
  82     size_t max_msg_size;
  83 };
  84 typedef struct pmix_ptl_globals_t pmix_ptl_globals_t;
  85 
  86 PMIX_EXPORT extern pmix_ptl_globals_t pmix_ptl_globals;
  87 
  88 /* API stubs */
  89 PMIX_EXPORT pmix_status_t pmix_ptl_base_set_notification_cbfunc(pmix_ptl_cbfunc_t cbfunc);
  90 PMIX_EXPORT char* pmix_ptl_base_get_available_modules(void);
  91 PMIX_EXPORT pmix_ptl_module_t* pmix_ptl_base_assign_module(void);
  92 PMIX_EXPORT pmix_status_t pmix_ptl_base_connect_to_peer(struct pmix_peer_t *peer,
  93                                                         pmix_info_t info[], size_t ninfo);
  94 
  95 PMIX_EXPORT pmix_status_t pmix_ptl_base_register_recv(struct pmix_peer_t *peer,
  96                                                       pmix_ptl_cbfunc_t cbfunc,
  97                                                       pmix_ptl_tag_t tag);
  98 PMIX_EXPORT pmix_status_t pmix_ptl_base_cancel_recv(struct pmix_peer_t *peer,
  99                                                     pmix_ptl_tag_t tag);
 100 
 101 PMIX_EXPORT pmix_status_t pmix_ptl_base_start_listening(pmix_info_t *info, size_t ninfo);
 102 PMIX_EXPORT void pmix_ptl_base_stop_listening(void);
 103 PMIX_EXPORT pmix_status_t pmix_ptl_base_setup_fork(const pmix_proc_t *proc, char ***env);
 104 
 105 /* base support functions */
 106 PMIX_EXPORT void pmix_ptl_base_send(int sd, short args, void *cbdata);
 107 PMIX_EXPORT void pmix_ptl_base_send_recv(int sd, short args, void *cbdata);
 108 PMIX_EXPORT void pmix_ptl_base_send_handler(int sd, short flags, void *cbdata);
 109 PMIX_EXPORT void pmix_ptl_base_recv_handler(int sd, short flags, void *cbdata);
 110 PMIX_EXPORT void pmix_ptl_base_process_msg(int fd, short flags, void *cbdata);
 111 PMIX_EXPORT pmix_status_t pmix_ptl_base_set_nonblocking(int sd);
 112 PMIX_EXPORT pmix_status_t pmix_ptl_base_set_blocking(int sd);
 113 PMIX_EXPORT pmix_status_t pmix_ptl_base_send_blocking(int sd, char *ptr, size_t size);
 114 PMIX_EXPORT pmix_status_t pmix_ptl_base_recv_blocking(int sd, char *data, size_t size);
 115 PMIX_EXPORT pmix_status_t pmix_ptl_base_connect(struct sockaddr_storage *addr,
 116                                                 pmix_socklen_t len, int *fd);
 117 PMIX_EXPORT void pmix_ptl_base_connection_handler(int sd, short args, void *cbdata);
 118 PMIX_EXPORT pmix_status_t pmix_ptl_base_send_connect_ack(int sd);
 119 PMIX_EXPORT pmix_status_t pmix_ptl_base_recv_connect_ack(int sd);
 120 PMIX_EXPORT void pmix_ptl_base_lost_connection(pmix_peer_t *peer, pmix_status_t err);
 121 
 122 
 123 END_C_DECLS
 124 
 125 #endif

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