root/opal/mca/compress/base/compress_base_frame.c

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

DEFINITIONS

This source file includes following definitions.
  1. compress_block
  2. decompress_block
  3. opal_compress_base_register
  4. opal_compress_base_open
  5. opal_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 "opal_config.h"
  18 
  19 #include "opal/mca/base/base.h"
  20 #include "opal/mca/compress/base/base.h"
  21 
  22 #include "opal/mca/compress/base/static-components.h"
  23 
  24 /*
  25  * Globals
  26  */
  27 static bool compress_block(uint8_t *inbytes,
  28                            size_t inlen,
  29                            uint8_t **outbytes,
  30                            size_t *olen)
  31 {
  32     return false;
  33 }
  34 
  35 static bool decompress_block(uint8_t **outbytes, size_t olen,
  36                              uint8_t *inbytes, size_t len)
  37 {
  38     return false;
  39 }
  40 
  41 opal_compress_base_module_t opal_compress = {
  42     NULL, /* init             */
  43     NULL, /* finalize         */
  44     NULL, /* compress         */
  45     NULL, /* compress_nb      */
  46     NULL, /* decompress       */
  47     NULL,  /* decompress_nb    */
  48     compress_block,
  49     decompress_block
  50 };
  51 opal_compress_base_t opal_compress_base = {0};
  52 
  53 opal_compress_base_component_t opal_compress_base_selected_component = {{0}};
  54 
  55 static int opal_compress_base_register(mca_base_register_flag_t flags);
  56 
  57 MCA_BASE_FRAMEWORK_DECLARE(opal, compress, "COMPRESS MCA",
  58                            opal_compress_base_register, opal_compress_base_open,
  59                            opal_compress_base_close, mca_compress_base_static_components, 0);
  60 
  61 static int opal_compress_base_register(mca_base_register_flag_t flags)
  62 {
  63     opal_compress_base.compress_limit = 4096;
  64     (void) mca_base_var_register("opal", "compress", "base", "limit",
  65                                  "Threshold beyond which data will be compressed",
  66                                  MCA_BASE_VAR_TYPE_SIZE_T, NULL, 0, 0, OPAL_INFO_LVL_3,
  67                                  MCA_BASE_VAR_SCOPE_READONLY, &opal_compress_base.compress_limit);
  68 
  69     return OPAL_SUCCESS;
  70 }
  71 
  72 /**
  73  * Function for finding and opening either all MCA components,
  74  * or the one that was specifically requested via a MCA parameter.
  75  */
  76 int opal_compress_base_open(mca_base_open_flag_t flags)
  77 {
  78     /* Open up all available components */
  79     return mca_base_framework_components_open(&opal_compress_base_framework, flags);
  80 }
  81 
  82 int opal_compress_base_close(void)
  83 {
  84     /* Call the component's finalize routine */
  85     if( NULL != opal_compress.finalize ) {
  86         opal_compress.finalize();
  87     }
  88 
  89     /* Close all available modules that are open */
  90     return mca_base_framework_components_close (&opal_compress_base_framework, NULL);
  91 }

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