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

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

DEFINITIONS

This source file includes following definitions.
  1. pmix_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 "pmix_config.h"
  19 
  20 #ifdef HAVE_UNISTD_H
  21 #include "unistd.h"
  22 #endif
  23 
  24 #include "pmix_common.h"
  25 #include "src/util/output.h"
  26 #include "src/mca/mca.h"
  27 #include "src/mca/base/base.h"
  28 #include "src/mca/pcompress/base/base.h"
  29 
  30 int pmix_compress_base_select(void)
  31 {
  32     int ret = PMIX_SUCCESS;
  33     pmix_compress_base_component_t *best_component = NULL;
  34     pmix_compress_base_module_t *best_module = NULL;
  35 
  36     /*
  37      * Select the best component
  38      */
  39     if( PMIX_SUCCESS != pmix_mca_base_select("pcompress", pmix_pcompress_base_framework.framework_output,
  40                                              &pmix_pcompress_base_framework.framework_components,
  41                                              (pmix_mca_base_module_t **) &best_module,
  42                                              (pmix_mca_base_component_t **) &best_component, NULL) ) {
  43         /* This will only happen if no component was selected,
  44          * in which case we use the default one */
  45         goto cleanup;
  46     }
  47 
  48     /* Initialize the winner */
  49     if (NULL != best_module) {
  50         if (PMIX_SUCCESS != (ret = best_module->init()) ) {
  51             goto cleanup;
  52         }
  53         pmix_compress = *best_module;
  54     }
  55 
  56  cleanup:
  57     return ret;
  58 }

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