root/opal/mca/compress/compress.h

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

INCLUDED FROM


   1 /* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil -*- */
   2 /*
   3  * Copyright (c) 2004-2010 The Trustees of Indiana University and Indiana
   4  *                         University Research and Technology
   5  *                         Corporation.  All rights reserved.
   6  * Copyright (c) 2015      Los Alamos National Security, LLC. All rights
   7  *                         reserved.
   8  *
   9  * Copyright (c) 2019      Intel, Inc.  All rights reserved.
  10  * $COPYRIGHT$
  11  *
  12  * Additional copyrights may follow
  13  *
  14  * $HEADER$
  15  */
  16 /**
  17  * @file
  18  *
  19  * Compression Framework
  20  *
  21  * General Description:
  22  *
  23  * The OPAL Compress framework has been created to provide an abstract interface
  24  * to the compression agent library on the host machine. This fromework is useful
  25  * when distributing files that can be compressed before sending to dimish the
  26  * load on the network.
  27  *
  28  */
  29 
  30 #ifndef MCA_COMPRESS_H
  31 #define MCA_COMPRESS_H
  32 
  33 #include "opal_config.h"
  34 #include "opal/mca/mca.h"
  35 #include "opal/mca/base/base.h"
  36 #include "opal/class/opal_object.h"
  37 
  38 #if defined(c_plusplus) || defined(__cplusplus)
  39 extern "C" {
  40 #endif
  41 
  42 /**
  43  * Module initialization function.
  44  * Returns OPAL_SUCCESS
  45  */
  46 typedef int (*opal_compress_base_module_init_fn_t)
  47      (void);
  48 
  49 /**
  50  * Module finalization function.
  51  * Returns OPAL_SUCCESS
  52  */
  53 typedef int (*opal_compress_base_module_finalize_fn_t)
  54      (void);
  55 
  56 /**
  57  * Compress the file provided
  58  *
  59  * Arguments:
  60  *   fname   = Filename to compress
  61  *   cname   = Compressed filename
  62  *   postfix = postfix added to filename to create compressed filename
  63  * Returns:
  64  *   OPAL_SUCCESS on success, ow OPAL_ERROR
  65  */
  66 typedef int (*opal_compress_base_module_compress_fn_t)
  67     (char * fname, char **cname, char **postfix);
  68 
  69 typedef int (*opal_compress_base_module_compress_nb_fn_t)
  70     (char * fname, char **cname, char **postfix, pid_t *child_pid);
  71 
  72 /**
  73  * Decompress the file provided
  74  *
  75  * Arguments:
  76  *   fname = Filename to compress
  77  *   cname = Compressed filename
  78  * Returns:
  79  *   OPAL_SUCCESS on success, ow OPAL_ERROR
  80  */
  81 typedef int (*opal_compress_base_module_decompress_fn_t)
  82     (char * cname, char **fname);
  83 typedef int (*opal_compress_base_module_decompress_nb_fn_t)
  84     (char * cname, char **fname, pid_t *child_pid);
  85 
  86 /**
  87  * Compress a string
  88  *
  89  * Arguments:
  90  *
  91  */
  92 typedef bool (*opal_compress_base_module_compress_string_fn_t)(uint8_t *inbytes,
  93                                                                size_t inlen,
  94                                                                uint8_t **outbytes,
  95                                                                size_t *olen);
  96 typedef bool (*opal_compress_base_module_decompress_string_fn_t)(uint8_t **outbytes, size_t olen,
  97                                                                  uint8_t *inbytes, size_t len);
  98 
  99 
 100 /**
 101  * Structure for COMPRESS components.
 102  */
 103 struct opal_compress_base_component_2_0_0_t {
 104     /** MCA base component */
 105     mca_base_component_t base_version;
 106     /** MCA base data */
 107     mca_base_component_data_t base_data;
 108 
 109     /** Verbosity Level */
 110     int verbose;
 111     /** Output Handle for opal_output */
 112     int output_handle;
 113     /** Default Priority */
 114     int priority;
 115 };
 116 typedef struct opal_compress_base_component_2_0_0_t opal_compress_base_component_2_0_0_t;
 117 typedef struct opal_compress_base_component_2_0_0_t opal_compress_base_component_t;
 118 
 119 /**
 120  * Structure for COMPRESS modules
 121  */
 122 struct opal_compress_base_module_1_0_0_t {
 123     /** Initialization Function */
 124     opal_compress_base_module_init_fn_t           init;
 125     /** Finalization Function */
 126     opal_compress_base_module_finalize_fn_t       finalize;
 127 
 128     /** Compress interface */
 129     opal_compress_base_module_compress_fn_t       compress;
 130     opal_compress_base_module_compress_nb_fn_t    compress_nb;
 131 
 132     /** Decompress Interface */
 133     opal_compress_base_module_decompress_fn_t     decompress;
 134     opal_compress_base_module_decompress_nb_fn_t  decompress_nb;
 135 
 136     /* COMPRESS STRING */
 137     opal_compress_base_module_compress_string_fn_t      compress_block;
 138     opal_compress_base_module_decompress_string_fn_t    decompress_block;
 139 };
 140 typedef struct opal_compress_base_module_1_0_0_t opal_compress_base_module_1_0_0_t;
 141 typedef struct opal_compress_base_module_1_0_0_t opal_compress_base_module_t;
 142 
 143 OPAL_DECLSPEC extern opal_compress_base_module_t opal_compress;
 144 
 145 /**
 146  * Macro for use in components that are of type COMPRESS
 147  */
 148 #define OPAL_COMPRESS_BASE_VERSION_2_0_0 \
 149     OPAL_MCA_BASE_VERSION_2_1_0("compress", 2, 0, 0)
 150 
 151 #if defined(c_plusplus) || defined(__cplusplus)
 152 }
 153 #endif
 154 
 155 #endif /* OPAL_COMPRESS_H */
 156 

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