Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-02-23 10:12:53

0001 /* -*- C -*-
0002  *
0003  * Copyright (c) 2004-2007 The Trustees of Indiana University and Indiana
0004  *                         University Research and Technology
0005  *                         Corporation.  All rights reserved.
0006  * Copyright (c) 2004-2006 The University of Tennessee and The University
0007  *                         of Tennessee Research Foundation.  All rights
0008  *                         reserved.
0009  * Copyright (c) 2004-2005 High Performance Computing Center Stuttgart,
0010  *                         University of Stuttgart.  All rights reserved.
0011  * Copyright (c) 2004-2005 The Regents of the University of California.
0012  *                         All rights reserved.
0013  * Copyright (c) 2012      Los Alamos National Security, Inc.  All rights reserved.
0014  * Copyright (c) 2014-2020 Intel, Inc.  All rights reserved.
0015  * Copyright (c) 2015-2020 Research Organization for Information Science
0016  *                         and Technology (RIST).  All rights reserved.
0017  * Copyright (c) 2018      IBM Corporation.  All rights reserved.
0018  * Copyright (c) 2019      Mellanox Technologies, Inc.
0019  *                         All rights reserved.
0020  * Copyright (c) 2021      Nanook Consulting.  All rights reserved.
0021  * $COPYRIGHT$
0022  *
0023  * Additional copyrights may follow
0024  *
0025  * $HEADER$
0026  *
0027  */
0028 #ifndef PMIX_GDS_BASE_H_
0029 #define PMIX_GDS_BASE_H_
0030 
0031 #include "src/include/pmix_config.h"
0032 
0033 #ifdef HAVE_SYS_TIME_H
0034 #    include <sys/time.h> /* for struct timeval */
0035 #endif
0036 #ifdef HAVE_STRING_H
0037 #    include <string.h>
0038 #endif
0039 
0040 #include "src/class/pmix_list.h"
0041 #include "src/mca/base/pmix_mca_base_framework.h"
0042 #include "src/mca/mca.h"
0043 
0044 #include "src/mca/gds/gds.h"
0045 
0046 BEGIN_C_DECLS
0047 
0048 /*
0049  * MCA Framework
0050  */
0051 PMIX_EXPORT extern pmix_mca_base_framework_t pmix_gds_base_framework;
0052 /**
0053  * GDS select function
0054  *
0055  * Cycle across available components and construct the list
0056  * of active modules
0057  */
0058 PMIX_EXPORT pmix_status_t pmix_gds_base_select(pmix_info_t info[], size_t ninfo);
0059 
0060 /**
0061  * Track an active component / module
0062  */
0063 struct pmix_gds_base_active_module_t {
0064     pmix_list_item_t super;
0065     int pri;
0066     pmix_gds_base_module_t *module;
0067     pmix_gds_base_component_t *component;
0068 };
0069 typedef struct pmix_gds_base_active_module_t pmix_gds_base_active_module_t;
0070 PMIX_CLASS_DECLARATION(pmix_gds_base_active_module_t);
0071 
0072 /* framework globals */
0073 struct pmix_gds_globals_t {
0074     pmix_list_t actives;
0075     bool initialized;
0076     bool selected;
0077     char *all_mods;
0078 };
0079 
0080 typedef enum {
0081     PMIX_MODEX_KEY_INVALID = -1,
0082     PMIX_MODEX_KEY_NATIVE_FMT,
0083     PMIX_MODEX_KEY_KEYMAP_FMT,
0084     PMIX_MODEX_KEY_MAX
0085 } pmix_gds_modex_key_fmt_t;
0086 
0087 /* define a modex blob info */
0088 typedef uint8_t pmix_gds_modex_blob_info_t;
0089 
0090 #define PMIX_GDS_COLLECT_BIT 0x0001
0091 #define PMIX_GDS_KEYMAP_BIT  0x0002
0092 
0093 #define PMIX_GDS_KEYMAP_IS_SET(byte)  (PMIX_GDS_KEYMAP_BIT & (byte))
0094 #define PMIX_GDS_COLLECT_IS_SET(byte) (PMIX_GDS_COLLECT_BIT & (byte))
0095 
0096 typedef struct pmix_gds_globals_t pmix_gds_globals_t;
0097 
0098 typedef void *pmix_gds_base_ctx_t;
0099 typedef pmix_status_t (*pmix_gds_base_store_modex_cb_fn_t)(pmix_gds_base_ctx_t ctx,
0100                                                            pmix_proc_t *proc,
0101                                                            pmix_gds_modex_key_fmt_t key_fmt,
0102                                                            char **kmap, pmix_buffer_t *pbkt);
0103 
0104 PMIX_EXPORT extern pmix_gds_globals_t pmix_gds_globals;
0105 
0106 /* get a list of available support - caller must free results
0107  * when done. The list is returned as a comma-delimited string
0108  * of available components in priority order */
0109 PMIX_EXPORT char *pmix_gds_base_get_available_modules(void);
0110 
0111 /* Select a gds module based on the provided directives */
0112 PMIX_EXPORT pmix_gds_base_module_t *pmix_gds_base_assign_module(pmix_info_t *info, size_t ninfo);
0113 
0114 /**
0115  * Add any envars to a peer's environment that the module needs
0116  * to communicate. The API stub will rotate across all active modules, giving
0117  * each a chance to contribute
0118  *
0119  * @return PMIX_SUCCESS on success.
0120  */
0121 PMIX_EXPORT pmix_status_t pmix_gds_base_setup_fork(const pmix_proc_t *proc, char ***env);
0122 
0123 PMIX_EXPORT pmix_status_t pmix_gds_base_store_modex(struct pmix_namespace_t *nspace,
0124                                                     pmix_buffer_t *buff, pmix_gds_base_ctx_t ctx,
0125                                                     pmix_gds_base_store_modex_cb_fn_t cb_fn,
0126                                                     void *cbdata);
0127 
0128 PMIX_EXPORT
0129 pmix_status_t pmix_gds_base_modex_pack_kval(pmix_gds_modex_key_fmt_t key_fmt, pmix_buffer_t *buf,
0130                                             char ***kmap, pmix_kval_t *kv);
0131 
0132 PMIX_EXPORT
0133 pmix_status_t pmix_gds_base_modex_unpack_kval(pmix_gds_modex_key_fmt_t key_fmt, pmix_buffer_t *buf,
0134                                               char **kmap, pmix_kval_t *kv);
0135 END_C_DECLS
0136 
0137 #endif