root/opal/mca/pmix/pmix4x/pmix/src/mca/pcompress/base/pcompress_base_frame.c

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

DEFINITIONS

This source file includes following definitions.
  1. compress_block
  2. decompress_block
  3. pmix_compress_base_register
  4. pmix_compress_base_open
  5. pmix_compress_base_close

   1 /* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil -*- */
   2 /*
   3  * Copyright (c) 2004-2010 The Trustees of Indiana University.
   4  *                         All rights reserved.
   5  * Copyright (c) 2011-2013 Los Alamos National Security, LLC.
   6  *                         All rights reserved.
   7  * Copyright (c) 2015      Research Organization for Information Science
   8  *                         and Technology (RIST). All rights reserved.
   9  * Copyright (c) 2019      Intel, Inc.  All rights reserved.
  10  * $COPYRIGHT$
  11  *
  12  * Additional copyrights may follow
  13  *
  14  * $HEADER$
  15  */
  16 
  17 #include "pmix_config.h"
  18 
  19 #include "src/mca/base/base.h"
  20 #include "src/mca/pcompress/base/base.h"
  21 
  22 #include "src/mca/pcompress/base/static-components.h"
  23 
  24 /*
  25  * Globals
  26  */
  27 static bool compress_block(char *instring,
  28                            uint8_t **outbytes,
  29                            size_t *nbytes)
  30 {
  31     return false;
  32 }
  33 
  34 static bool decompress_block(char **outstring,
  35                              uint8_t *inbytes, size_t len)
  36 {
  37     return false;
  38 }
  39 
  40 pmix_compress_base_module_t pmix_compress = {
  41     NULL, /* init             */
  42     NULL, /* finalize         */
  43     NULL, /* compress         */
  44     NULL, /* compress_nb      */
  45     NULL, /* decompress       */
  46     NULL,  /* decompress_nb    */
  47     compress_block,
  48     decompress_block
  49 };
  50 pmix_compress_base_t pmix_compress_base = {0};
  51 
  52 pmix_compress_base_component_t pmix_compress_base_selected_component = {{0}};
  53 
  54 static int pmix_compress_base_register(pmix_mca_base_register_flag_t flags)
  55 {
  56     pmix_compress_base.compress_limit = 4096;
  57     (void) pmix_mca_base_var_register("pmix", "compress", "base", "limit",
  58                                       "Threshold beyond which data will be compressed",
  59                                       PMIX_MCA_BASE_VAR_TYPE_SIZE_T, NULL, 0, 0, PMIX_INFO_LVL_3,
  60                                       PMIX_MCA_BASE_VAR_SCOPE_READONLY, &pmix_compress_base.compress_limit);
  61 
  62     return PMIX_SUCCESS;
  63 }
  64 
  65 /**
  66  * Function for finding and opening either all MCA components,
  67  * or the one that was specifically requested via a MCA parameter.
  68  */
  69 static int pmix_compress_base_open(pmix_mca_base_open_flag_t flags)
  70 {
  71     /* Open up all available components */
  72     return pmix_mca_base_framework_components_open(&pmix_pcompress_base_framework, flags);
  73 }
  74 
  75 static int pmix_compress_base_close(void)
  76 {
  77     /* Call the component's finalize routine */
  78     if( NULL != pmix_compress.finalize ) {
  79         pmix_compress.finalize();
  80     }
  81 
  82     /* Close all available modules that are open */
  83     return pmix_mca_base_framework_components_close (&pmix_pcompress_base_framework, NULL);
  84 }
  85 
  86 PMIX_MCA_BASE_FRAMEWORK_DECLARE(pmix, pcompress, "PCOMPRESS MCA",
  87                                 pmix_compress_base_register, pmix_compress_base_open,
  88                                 pmix_compress_base_close, mca_pcompress_base_static_components, 0);
  89 

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