This source file includes following definitions.
- udreg_open
- udreg_register
- udreg_close
- udreg_init
   1 
   2 
   3 
   4 
   5 
   6 
   7 
   8 
   9 
  10 
  11 
  12 
  13 
  14 
  15 
  16 
  17 
  18 
  19 
  20 
  21 
  22 
  23 
  24 
  25 #define OPAL_DISABLE_ENABLE_MEM_DEBUG 1
  26 #include "opal_config.h"
  27 #include "opal/mca/base/base.h"
  28 #include "opal/runtime/opal_params.h"
  29 #include "rcache_udreg.h"
  30 #ifdef HAVE_UNISTD_H
  31 #include <unistd.h>
  32 #endif
  33 #ifdef HAVE_MALLOC_H
  34 #include <malloc.h>
  35 #endif
  36 
  37 #include <fcntl.h>
  38 
  39 
  40 
  41 
  42 static int udreg_open(void);
  43 static int udreg_close(void);
  44 static int udreg_register(void);
  45 static mca_rcache_base_module_t* udreg_init(
  46         struct mca_rcache_base_resources_t* resources);
  47 
  48 mca_rcache_udreg_component_t mca_rcache_udreg_component = {
  49     {
  50         
  51 
  52 
  53         .rcache_version ={
  54             MCA_RCACHE_BASE_VERSION_3_0_0,
  55 
  56             .mca_component_name = "udreg",
  57             MCA_BASE_MAKE_VERSION(component, OPAL_MAJOR_VERSION, OPAL_MINOR_VERSION,
  58                                   OPAL_RELEASE_VERSION),
  59             .mca_open_component = udreg_open,
  60             .mca_close_component = udreg_close,
  61             .mca_register_component_params = udreg_register,
  62         },
  63         .rcache_data = {
  64             
  65             MCA_BASE_METADATA_PARAM_CHECKPOINT
  66         },
  67 
  68         .rcache_init = udreg_init
  69     }
  70 };
  71 
  72 
  73 
  74 
  75 static int udreg_open(void)
  76 {
  77     return OPAL_SUCCESS;
  78 }
  79 
  80 
  81 static int udreg_register(void)
  82 {
  83     mca_rcache_udreg_component.print_stats = false;
  84     (void) mca_base_component_var_register(&mca_rcache_udreg_component.super.rcache_version,
  85                                            "print_stats", "print pool usage statistics at the end of the run",
  86                                            MCA_BASE_VAR_TYPE_BOOL, NULL, 0, 0,
  87                                            OPAL_INFO_LVL_9,
  88                                            MCA_BASE_VAR_SCOPE_READONLY,
  89                                            &mca_rcache_udreg_component.print_stats);
  90 
  91     return OPAL_SUCCESS;
  92 }
  93 
  94 
  95 static int udreg_close(void)
  96 {
  97     return OPAL_SUCCESS;
  98 }
  99 
 100 static mca_rcache_base_module_t *
 101 udreg_init(struct mca_rcache_base_resources_t *resources)
 102 {
 103     mca_rcache_udreg_resources_t *udreg_resources = (mca_rcache_udreg_resources_t *) resources;
 104     mca_rcache_udreg_module_t* rcache_module;
 105     static int inited = false;
 106     int rc;
 107 
 108     
 109 
 110 
 111     mca_rcache_udreg_component.leave_pinned = (int)
 112         (1 == opal_leave_pinned || opal_leave_pinned_pipeline);
 113 
 114     if (!inited) {
 115         inited = true;
 116     }
 117 
 118     rcache_module =
 119         (mca_rcache_udreg_module_t *) malloc (sizeof (mca_rcache_udreg_module_t));
 120 
 121     memmove (&rcache_module->resources, udreg_resources, sizeof (*udreg_resources));
 122 
 123     rc = mca_rcache_udreg_module_init(rcache_module);
 124     if (OPAL_SUCCESS != rc) {
 125         free (rcache_module);
 126         return NULL;
 127     }
 128 
 129     return &rcache_module->super;
 130 }