root/opal/mca/pmix/pmix4x/pmix/src/mca/base/pmix_mca_base_components_close.c

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

DEFINITIONS

This source file includes following definitions.
  1. pmix_mca_base_component_unload
  2. pmix_mca_base_component_close
  3. pmix_mca_base_framework_components_close
  4. pmix_mca_base_components_close

   1 /* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil -*- */
   2 /*
   3  * Copyright (c) 2004-2006 The Trustees of Indiana University and Indiana
   4  *                         University Research and Technology
   5  *                         Corporation.  All rights reserved.
   6  * Copyright (c) 2004-2006 The University of Tennessee and The University
   7  *                         of Tennessee Research Foundation.  All rights
   8  *                         reserved.
   9  * Copyright (c) 2004-2006 High Performance Computing Center Stuttgart,
  10  *                         University of Stuttgart.  All rights reserved.
  11  * Copyright (c) 2004-2006 The Regents of the University of California.
  12  *                         All rights reserved.
  13  * Copyright (c) 2013-2015 Los Alamos National Security, LLC. All rights
  14  *                         reserved.
  15  * Copyright (c) 2016      Intel, Inc. All rights reserved.
  16  * $COPYRIGHT$
  17  *
  18  * Additional copyrights may follow
  19  *
  20  * $HEADER$
  21  */
  22 
  23 #include <src/include/pmix_config.h>
  24 
  25 #include "src/class/pmix_list.h"
  26 #include "src/util/output.h"
  27 #include "src/mca/mca.h"
  28 #include "src/mca/base/base.h"
  29 #include "src/mca/base/pmix_mca_base_component_repository.h"
  30 #include "pmix_common.h"
  31 
  32 void pmix_mca_base_component_unload (const pmix_mca_base_component_t *component, int output_id)
  33 {
  34     int ret;
  35 
  36     /* Unload */
  37     pmix_output_verbose (PMIX_MCA_BASE_VERBOSE_COMPONENT, output_id,
  38                          "mca: base: close: unloading component %s",
  39                          component->pmix_mca_component_name);
  40 
  41     ret = pmix_mca_base_var_group_find (component->pmix_mca_project_name, component->pmix_mca_type_name,
  42                                    component->pmix_mca_component_name);
  43     if (0 <= ret) {
  44         pmix_mca_base_var_group_deregister (ret);
  45     }
  46 
  47     pmix_mca_base_component_repository_release (component);
  48 }
  49 
  50 void pmix_mca_base_component_close (const pmix_mca_base_component_t *component, int output_id)
  51 {
  52     /* Close */
  53     if (NULL != component->pmix_mca_close_component) {
  54         component->pmix_mca_close_component();
  55         pmix_output_verbose (PMIX_MCA_BASE_VERBOSE_COMPONENT, output_id,
  56                              "mca: base: close: component %s closed",
  57                              component->pmix_mca_component_name);
  58     }
  59 
  60     pmix_mca_base_component_unload (component, output_id);
  61 }
  62 
  63 int pmix_mca_base_framework_components_close (pmix_mca_base_framework_t *framework,
  64                                               const pmix_mca_base_component_t *skip)
  65 {
  66     return pmix_mca_base_components_close (framework->framework_output,
  67                                            &framework->framework_components,
  68                                            skip);
  69 }
  70 
  71 int pmix_mca_base_components_close(int output_id, pmix_list_t *components,
  72                                    const pmix_mca_base_component_t *skip)
  73 {
  74     pmix_mca_base_component_list_item_t *cli, *next;
  75 
  76     /* Close and unload all components in the available list, except the
  77        "skip" item.  This is handy to close out all non-selected
  78        components.  It's easier to simply remove the entire list and
  79        then simply re-add the skip entry when done. */
  80 
  81     PMIX_LIST_FOREACH_SAFE(cli, next, components, pmix_mca_base_component_list_item_t) {
  82         if (skip == cli->cli_component) {
  83             continue;
  84         }
  85 
  86         pmix_mca_base_component_close (cli->cli_component, output_id);
  87         pmix_list_remove_item (components, &cli->super);
  88 
  89         PMIX_RELEASE(cli);
  90     }
  91 
  92     /* All done */
  93     return PMIX_SUCCESS;
  94 }

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