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

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

DEFINITIONS

This source file includes following definitions.
  1. opal_compress_base_select

   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) 2015      Research Organization for Information Science
   6  *                         and Technology (RIST). All rights reserved.
   7  *
   8  * Copyright (c) 2015      Los Alamos National Security, LLC. All rights
   9  *                         reserved.
  10  * Copyright (c) 2019      Intel, Inc.  All rights reserved.
  11  * $COPYRIGHT$
  12  *
  13  * Additional copyrights may follow
  14  *
  15  * $HEADER$
  16  */
  17 
  18 #include "opal_config.h"
  19 
  20 #ifdef HAVE_UNISTD_H
  21 #include "unistd.h"
  22 #endif
  23 
  24 #include "opal/include/opal/constants.h"
  25 #include "opal/util/output.h"
  26 #include "opal/mca/mca.h"
  27 #include "opal/mca/base/base.h"
  28 #include "opal/mca/compress/compress.h"
  29 #include "opal/mca/compress/base/base.h"
  30 
  31 int opal_compress_base_select(void)
  32 {
  33     int ret = OPAL_SUCCESS;
  34     opal_compress_base_component_t *best_component = NULL;
  35     opal_compress_base_module_t *best_module = NULL;
  36 
  37     /*
  38      * Select the best component
  39      */
  40     if( OPAL_SUCCESS != mca_base_select("compress", opal_compress_base_framework.framework_output,
  41                                         &opal_compress_base_framework.framework_components,
  42                                         (mca_base_module_t **) &best_module,
  43                                         (mca_base_component_t **) &best_component, NULL) ) {
  44         /* This will only happen if no component was selected,
  45          * in which case we use the default one */
  46         goto cleanup;
  47     }
  48 
  49     /* Save the winner */
  50     opal_compress_base_selected_component = *best_component;
  51 
  52     /* Initialize the winner */
  53     if (NULL != best_module) {
  54         if (OPAL_SUCCESS != (ret = best_module->init()) ) {
  55             goto cleanup;
  56         }
  57         opal_compress = *best_module;
  58     }
  59 
  60  cleanup:
  61     return ret;
  62 }

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