root/ompi/mca/osc/base/osc_base_frame.c

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

DEFINITIONS

This source file includes following definitions.
  1. ompi_osc_base_find_available
  2. ompi_osc_base_finalize

   1 /*
   2  * Copyright (c) 2004-2005 The Trustees of Indiana University.
   3  *                         All rights reserved.
   4  * Copyright (c) 2004-2005 The Trustees of the University of Tennessee.
   5  *                         All rights reserved.
   6  * Copyright (c) 2004-2005 High Performance Computing Center Stuttgart,
   7  *                         University of Stuttgart.  All rights reserved.
   8  * Copyright (c) 2004-2005 The Regents of the University of California.
   9  *                         All rights reserved.
  10  * Copyright (c) 2014      Research Organization for Information Science
  11  *                         and Technology (RIST). All rights reserved.
  12  * $COPYRIGHT$
  13  *
  14  * Additional copyrights may follow
  15  *
  16  * $HEADER$
  17  */
  18 
  19 #include "ompi_config.h"
  20 #include "ompi/constants.h"
  21 
  22 #include "ompi/mca/mca.h"
  23 #include "opal/util/output.h"
  24 #include "opal/mca/base/base.h"
  25 
  26 
  27 #include "ompi/mca/osc/osc.h"
  28 #include "ompi/mca/osc/base/base.h"
  29 
  30 
  31 /*
  32  * The following file was created by configure.  It contains extern
  33  * statements and the definition of an array of pointers to each
  34  * component's public mca_base_component_t struct.
  35  */
  36 
  37 #include "ompi/mca/osc/base/static-components.h"
  38 
  39 int
  40 ompi_osc_base_find_available(bool enable_progress_threads,
  41                             bool enable_mpi_threads)
  42 {
  43     mca_base_component_list_item_t *cli, *next;
  44 
  45     OPAL_LIST_FOREACH_SAFE(cli, next, &ompi_osc_base_framework.framework_components, mca_base_component_list_item_t) {
  46         int ret;
  47         ompi_osc_base_component_t *component = (ompi_osc_base_component_t*) cli->cli_component;
  48 
  49         /* see if this component is ready to run... */
  50         ret = component->osc_init(enable_progress_threads, enable_mpi_threads);
  51         if (OMPI_SUCCESS != ret) {
  52             /* not available. close the component */
  53             opal_list_remove_item(&ompi_osc_base_framework.framework_components, &cli->super);
  54             mca_base_component_close((mca_base_component_t *)component,
  55                                      ompi_osc_base_framework.framework_output);
  56             OBJ_RELEASE(cli);
  57         }
  58     }
  59     return OMPI_SUCCESS;
  60 }
  61 
  62 int
  63 ompi_osc_base_finalize(void)
  64 {
  65     opal_list_item_t* item;
  66 
  67     /* Finalize all available modules */
  68     while (NULL !=
  69            (item = opal_list_remove_first(&ompi_osc_base_framework.framework_components))) {
  70         ompi_osc_base_component_t *component = (ompi_osc_base_component_t*)
  71             ((mca_base_component_list_item_t*) item)->cli_component;
  72         component->osc_finalize();
  73         OBJ_RELEASE(item);
  74     }
  75     return OMPI_SUCCESS;
  76 }
  77 
  78 MCA_BASE_FRAMEWORK_DECLARE(ompi, osc, "One-sided communication", NULL, NULL, NULL,
  79                            mca_osc_base_static_components, 0);

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