root/oshmem/mca/spml/base/base.h

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

INCLUDED FROM


   1 /*
   2  * Copyright (c) 2013      Mellanox Technologies, Inc.
   3  *                         All rights reserved.
   4  * Copyright (c) 2015 Cisco Systems, Inc.  All rights reserved.
   5  * Copyright (c) 2016      Research Organization for Information Science
   6  *                         and Technology (RIST). All rights reserved.
   7  * $COPYRIGHT$
   8  *
   9  * Additional copyrights may follow
  10  *
  11  * $HEADER$
  12  */
  13 
  14 #ifndef MCA_SPML_BASE_H
  15 #define MCA_SPML_BASE_H
  16 
  17 #include "oshmem_config.h"
  18 
  19 #include "oshmem/mca/mca.h"
  20 #include "opal/mca/base/mca_base_framework.h"
  21 #include "opal/class/opal_list.h"
  22 #include "opal/class/opal_pointer_array.h"
  23 
  24 #include "oshmem/mca/spml/spml.h"
  25 
  26 /*
  27  * Global functions for the PML
  28  */
  29 
  30 BEGIN_C_DECLS
  31 
  32 /*
  33  * This is the base priority for a SPML wrapper component
  34  * If there exists more than one then it is undefined
  35  * which one is picked.
  36  */
  37 #define SPML_SELECT_WRAPPER_PRIORITY -128
  38 
  39 /*
  40  * Globals
  41  */
  42 OSHMEM_DECLSPEC extern mca_spml_base_component_t mca_spml_base_selected_component;
  43 OSHMEM_DECLSPEC extern opal_pointer_array_t mca_spml_base_spml;
  44 
  45 OSHMEM_DECLSPEC int mca_spml_base_finalize(void);
  46 
  47 /*
  48  * Select an available component.
  49  */
  50 OSHMEM_DECLSPEC  int mca_spml_base_select(bool enable_progress_threads,
  51                                           bool enable_threads);
  52 
  53 /*
  54  * Share in modex the name of the selected component
  55  */
  56 OSHMEM_DECLSPEC int mca_spml_base_spml_selected(const char *name);
  57 
  58 /*
  59  * Verify that all new procs are using the currently selected component
  60  */
  61 OSHMEM_DECLSPEC int mca_spml_base_spml_check_selected(const char *my_spml,
  62                                                       ompi_proc_t **procs,
  63                                                       size_t nprocs);
  64 
  65 OSHMEM_DECLSPEC int mca_spml_base_wait(void* addr,
  66                                        int cmp,
  67                                        void* value,
  68                                        int datatype);
  69 OSHMEM_DECLSPEC int mca_spml_base_wait_nb(void* handle);
  70 OSHMEM_DECLSPEC int mca_spml_base_test(void* addr,
  71                                        int cmp,
  72                                        void* value,
  73                                        int datatype,
  74                                        int *out_value);
  75 OSHMEM_DECLSPEC int mca_spml_base_oob_get_mkeys(shmem_ctx_t ctx,
  76                                                 int pe,
  77                                                 uint32_t seg,
  78                                                 sshmem_mkey_t *mkeys);
  79 
  80 OSHMEM_DECLSPEC void mca_spml_base_rmkey_unpack(shmem_ctx_t ctx, sshmem_mkey_t *mkey, uint32_t seg, int pe, int tr_id);
  81 OSHMEM_DECLSPEC void mca_spml_base_rmkey_free(sshmem_mkey_t *mkey);
  82 OSHMEM_DECLSPEC void *mca_spml_base_rmkey_ptr(const void *dst_addr, sshmem_mkey_t *mkey, int pe);
  83 
  84 OSHMEM_DECLSPEC int mca_spml_base_put_nb(void *dst_addr,
  85                                          size_t size,
  86                                          void *src_addr,
  87                                          int dst,
  88                                          void **handle);
  89 OSHMEM_DECLSPEC int mca_spml_base_get_nb(void *dst_addr,
  90                                          size_t size,
  91                                          void *src_addr,
  92                                          int src,
  93                                          void **handle);
  94 
  95 OSHMEM_DECLSPEC void mca_spml_base_memuse_hook(void *addr, size_t length);
  96 
  97 OSHMEM_DECLSPEC int mca_spml_base_put_all_nb(void *target, const void *source,
  98                                              size_t size, long *counter);
  99 
 100 /*
 101  * MCA framework
 102  */
 103 OSHMEM_DECLSPEC extern mca_base_framework_t oshmem_spml_base_framework;
 104 
 105 /* ******************************************************************** */
 106 #ifdef __BASE_FILE__
 107 #define __SPML_FILE__ __BASE_FILE__
 108 #else
 109 #define __SPML_FILE__ __FILE__
 110 #endif
 111 
 112 #ifdef OPAL_ENABLE_DEBUG
 113 #define SPML_VERBOSE(level, ...) \
 114     oshmem_output_verbose(level, oshmem_spml_base_framework.framework_output, \
 115         "%s:%d - %s()", __SPML_FILE__, __LINE__, __func__, __VA_ARGS__)
 116 #else
 117 #define SPML_VERBOSE(level, ...)
 118 #endif
 119 
 120 #define SPML_VERBOSE_FASTPATH(level, ...)
 121 
 122 #define SPML_ERROR(...) \
 123     oshmem_output(oshmem_spml_base_framework.framework_output, \
 124         "Error %s:%d - %s()", __SPML_FILE__, __LINE__, __func__, __VA_ARGS__)
 125 
 126 #define SPML_WARNING(...) \
 127     oshmem_output_verbose(0, oshmem_spml_base_framework.framework_output, \
 128         "Warning %s:%d - %s()", __SPML_FILE__, __LINE__, __func__, __VA_ARGS__)
 129 
 130 END_C_DECLS
 131 
 132 #endif /* MCA_SPML_BASE_H */

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