root/orte/mca/state/base/state_base_select.c

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

DEFINITIONS

This source file includes following definitions.
  1. orte_state_base_select

   1 /* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil -*- */
   2 /*
   3  * Copyright (c) 2011-2015 Los Alamos National Security, LLC.
   4  *                         All rights reserved.
   5  * $COPYRIGHT$
   6  *
   7  * Additional copyrights may follow
   8  *
   9  * $HEADER$
  10  */
  11 
  12 
  13 #include "orte_config.h"
  14 #include "orte/constants.h"
  15 
  16 #include <string.h>
  17 
  18 #include "orte/mca/mca.h"
  19 #include "opal/mca/base/base.h"
  20 #include "opal/util/output.h"
  21 
  22 #include "orte/mca/state/base/base.h"
  23 #include "orte/mca/state/base/state_private.h"
  24 
  25 int orte_state_base_select(void)
  26 {
  27     int exit_status = OPAL_SUCCESS;
  28     orte_state_base_component_t *best_component = NULL;
  29     orte_state_base_module_t *best_module = NULL;
  30 
  31     /*
  32      * Select the best component
  33      */
  34     if( OPAL_SUCCESS != mca_base_select("state", orte_state_base_framework.framework_output,
  35                                         &orte_state_base_framework.framework_components,
  36                                         (mca_base_module_t **) &best_module,
  37                                         (mca_base_component_t **) &best_component, NULL) ) {
  38         /* This will only happen if no component was selected */
  39         exit_status = ORTE_ERROR;
  40         goto cleanup;
  41     }
  42 
  43     /* Save the winner */
  44     orte_state = *best_module;
  45 
  46     /* Initialize the winner */
  47     if (NULL != best_module) {
  48         if (OPAL_SUCCESS != orte_state.init()) {
  49             exit_status = OPAL_ERROR;
  50             goto cleanup;
  51         }
  52     }
  53 
  54  cleanup:
  55     return exit_status;
  56 }

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