Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-02-22 10:47:30

0001 /* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil -*- */
0002 /*
0003  * Copyright (c) 2014-2020 Intel, Inc.  All rights reserved.
0004  * Copyright (c) 2015      Los Alamos National Security, LLC. All rights
0005  *                         reserved.
0006  * Copyright (c) 2017-2019 Amazon.com, Inc. or its affiliates.
0007  *                         All Rights reserved.
0008  * Copyright (c) 2020      Cisco Systems, Inc.  All rights reserved
0009  * Copyright (c) 2021-2022 Nanook Consulting.  All rights reserved.
0010  * $COPYRIGHT$
0011  *
0012  * Additional copyrights may follow
0013  *
0014  * $HEADER$
0015  */
0016 
0017 #ifndef PRTE_REACHABLE_H
0018 #define PRTE_REACHABLE_H
0019 
0020 #include "prte_config.h"
0021 
0022 #include "src/pmix/pmix-internal.h"
0023 #include "src/class/pmix_list.h"
0024 #include "src/include/types.h"
0025 
0026 #include "src/mca/mca.h"
0027 
0028 BEGIN_C_DECLS
0029 
0030 /**
0031  * Reachability matrix between endpoints of a given pair of hosts
0032  *
0033  * The output of the reachable() call is a prte_reachable_t, which
0034  * gives an matrix of the connectivity between local and remote
0035  * ethernet endpoints.  Any given value in weights is the connectivity
0036  * between the local endpoint index (first index) and the remote
0037  * endpoint index (second index), and is a value between 0 and INT_MAX
0038  * representing a relative connectivity.
0039  */
0040 struct prte_reachable_t {
0041     pmix_object_t super;
0042     /** number of local interfaces passed to reachable() */
0043     int num_local;
0044     /** number of remote interfaces passed to reachable() */
0045     int num_remote;
0046     /** matric of connectivity weights */
0047     int **weights;
0048     /** \internal */
0049     void *memory;
0050 };
0051 typedef struct prte_reachable_t prte_reachable_t;
0052 PMIX_CLASS_DECLARATION(prte_reachable_t);
0053 
0054 /* Init */
0055 typedef int (*prte_reachable_base_module_init_fn_t)(void);
0056 
0057 /* Finalize */
0058 typedef int (*prte_reachable_base_module_fini_fn_t)(void);
0059 
0060 /* Build reachability matrix between local and remote ethernet
0061  * interfaces
0062  *
0063  * @param local_ifs (IN)     Local list of pmix_pif_t objects
0064  *                           The pmix_pif_t objects must be fully populated
0065  * @param remote_ifs (IN)    Remote list of pmix_pif_t objects
0066  *                           The pmix_pif_t objects must have the following fields populated:
0067  *                              uint16_t                 af_family;
0068  *                              struct sockaddr_storage  if_addr;
0069  *                              uint32_t                 if_mask;
0070  *                              uint32_t                 if_bandwidth;
0071  * @return prte_reachable_t  The reachability matrix was successfully created
0072  * @return NULL              The reachability matrix could not be constructed
0073  *
0074  * Given a list of local interfaces and remote interfaces from a
0075  * single peer, build a reachability matrix between the two peers.
0076  * This function does not select the best pairing of local and remote
0077  * interfaces, but only a (comparable) reachability between any pair
0078  * of local/remote interfaces.
0079  *
0080  *
0081  */
0082 typedef prte_reachable_t *(*prte_reachable_base_module_reachable_fn_t)(pmix_list_t *local_ifs,
0083                                                                        pmix_list_t *remote_ifs);
0084 
0085 /*
0086  * the standard public API data structure
0087  */
0088 typedef struct {
0089     /* currently used APIs */
0090     prte_reachable_base_module_init_fn_t init;
0091     prte_reachable_base_module_fini_fn_t finalize;
0092     prte_reachable_base_module_reachable_fn_t reachable;
0093 } prte_reachable_base_module_t;
0094 
0095 typedef struct {
0096     pmix_mca_base_component_t base_version;
0097     int priority;
0098 } prte_reachable_base_component_t;
0099 
0100 /*
0101  * Macro for use in components that are of type reachable
0102  */
0103 #define PRTE_REACHABLE_BASE_VERSION_2_0_0 PRTE_MCA_BASE_VERSION_3_0_0("prtereachable", 2, 0, 0)
0104 
0105 /* Global structure for accessing reachability functions */
0106 PRTE_EXPORT extern prte_reachable_base_module_t prte_reachable;
0107 
0108 END_C_DECLS
0109 
0110 #endif