root/oshmem/mca/sshmem/ucx/sshmem_ucx.h

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

INCLUDED FROM


   1 /*
   2  * Copyright (c) 2017      Mellanox Technologies, Inc.
   3  *                         All rights reserved.
   4  * $COPYRIGHT$
   5  *
   6  * Additional copyrights may follow
   7  *
   8  * $HEADER$
   9  */
  10 
  11 #ifndef MCA_SSHMEM_UCX_EXPORT_H
  12 #define MCA_SSHMEM_UCX_EXPORT_H
  13 
  14 #include "oshmem_config.h"
  15 
  16 #include "oshmem/mca/sshmem/sshmem.h"
  17 
  18 #include <ucp/api/ucp.h>
  19 
  20 BEGIN_C_DECLS
  21 
  22 typedef struct sshmem_ucx_shadow_allocator sshmem_ucx_shadow_allocator_t;
  23 
  24 /**
  25  * globally exported variable to hold the ucx component.
  26  */
  27 typedef struct mca_sshmem_ucx_component_t {
  28     /* base component struct */
  29     mca_sshmem_base_component_t super;
  30     /* priority for ucx component */
  31     int priority;
  32 } mca_sshmem_ucx_component_t;
  33 
  34 OSHMEM_MODULE_DECLSPEC extern mca_sshmem_ucx_component_t
  35 mca_sshmem_ucx_component;
  36 
  37 typedef struct mca_sshmem_ucx_segment_context {
  38     void                           *dev_mem;
  39     sshmem_ucx_shadow_allocator_t  *shadow_allocator;
  40     ucp_mem_h                       ucp_memh;
  41 } mca_sshmem_ucx_segment_context_t;
  42 
  43 typedef struct mca_sshmem_ucx_module_t {
  44     mca_sshmem_base_module_t super;
  45 } mca_sshmem_ucx_module_t;
  46 extern mca_sshmem_ucx_module_t mca_sshmem_ucx_module;
  47 
  48 sshmem_ucx_shadow_allocator_t *sshmem_ucx_shadow_create(unsigned count);
  49 void sshmem_ucx_shadow_destroy(sshmem_ucx_shadow_allocator_t *allocator);
  50 int sshmem_ucx_shadow_alloc(sshmem_ucx_shadow_allocator_t *allocator,
  51                             unsigned count, unsigned *index);
  52 
  53 /* Reallocate existing allocated buffer. If possible - used inplace
  54  * reallocation.
  55  * Parameter 'inplace' - out, in case if zero - new buffer was allocated
  56  * (inplace is not possible), user should remove original buffer after data
  57  * is copied, else (if inplace == 0) - no additional action required */
  58 int sshmem_ucx_shadow_realloc(sshmem_ucx_shadow_allocator_t *allocator,
  59                               unsigned count, unsigned old_index, unsigned *index,
  60                               int *inplace);
  61 int sshmem_ucx_shadow_free(sshmem_ucx_shadow_allocator_t *allocator,
  62                            unsigned index);
  63 unsigned sshmem_ucx_shadow_size(sshmem_ucx_shadow_allocator_t *allocator,
  64                                 unsigned index);
  65 
  66 END_C_DECLS
  67 
  68 #endif /* MCA_SHMEM_UCX_EXPORT_H */

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