root/orte/mca/rtc/base/rtc_base_frame.c

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

DEFINITIONS

This source file includes following definitions.
  1. orte_rtc_base_close
  2. orte_rtc_base_open
  3. mdes
  4. rcon
  5. rdes

   1 /*
   2  * Copyright (c) 2014      Intel, Inc. All rights reserved.
   3  * Copyright (c) 2015      Research Organization for Information Science
   4  *                         and Technology (RIST). All rights reserved.
   5  * $COPYRIGHT$
   6  *
   7  * Additional copyrights may follow
   8  *
   9  * $HEADER$
  10  */
  11 
  12 #include "orte_config.h"
  13 #include "orte/constants.h"
  14 
  15 #include <string.h>
  16 
  17 #include "orte/mca/mca.h"
  18 #include "opal/class/opal_list.h"
  19 #include "opal/mca/base/base.h"
  20 
  21 #include "orte/mca/rtc/base/base.h"
  22 /*
  23  * The following file was created by configure.  It contains extern
  24  * statements and the definition of an array of pointers to each
  25  * component's public mca_base_component_t struct.
  26  */
  27 
  28 #include "orte/mca/rtc/base/static-components.h"
  29 
  30 /*
  31  * Global variables
  32  */
  33 orte_rtc_API_module_t orte_rtc = {
  34     orte_rtc_base_assign,
  35     orte_rtc_base_set,
  36     orte_rtc_base_get_avail_vals
  37 };
  38 orte_rtc_base_t orte_rtc_base = {{{0}}};
  39 
  40 static int orte_rtc_base_close(void)
  41 {
  42     opal_list_item_t *item;
  43 
  44     /* cleanup globals */
  45     while (NULL != (item = opal_list_remove_first(&orte_rtc_base.actives))) {
  46         OBJ_RELEASE(item);
  47     }
  48     OBJ_DESTRUCT(&orte_rtc_base.actives);
  49 
  50     return mca_base_framework_components_close(&orte_rtc_base_framework, NULL);
  51 }
  52 
  53 /**
  54  * Function for finding and opening either all MCA components, or the one
  55  * that was specifically requested via a MCA parameter.
  56  */
  57 static int orte_rtc_base_open(mca_base_open_flag_t flags)
  58 {
  59     /* init the globals */
  60     OBJ_CONSTRUCT(&orte_rtc_base.actives, opal_list_t);
  61 
  62     /* Open up all available components */
  63     return mca_base_framework_components_open(&orte_rtc_base_framework, flags);
  64 }
  65 
  66 MCA_BASE_FRAMEWORK_DECLARE(orte, rtc, "ORTE Mapping Subsystem",
  67                            NULL, orte_rtc_base_open, orte_rtc_base_close,
  68                            mca_rtc_base_static_components, 0);
  69 
  70 static void mdes(orte_rtc_base_selected_module_t *active)
  71 {
  72     if (NULL != active->module->finalize) {
  73         active->module->finalize();
  74     }
  75 }
  76 OBJ_CLASS_INSTANCE(orte_rtc_base_selected_module_t,
  77                    opal_list_item_t,
  78                    NULL, mdes);
  79 
  80 static void rcon(orte_rtc_resource_t *p)
  81 {
  82     p->component = NULL;
  83     p->category = NULL;
  84     OBJ_CONSTRUCT(&p->control, opal_value_t);
  85 }
  86 static void rdes(orte_rtc_resource_t *p)
  87 {
  88     if (NULL != p->component) {
  89         free(p->component);
  90     }
  91     if (NULL != p->category) {
  92         free(p->category);
  93     }
  94     OBJ_DESTRUCT(&p->control);
  95 }
  96 OBJ_CLASS_INSTANCE(orte_rtc_resource_t,
  97                    opal_list_item_t,
  98                    rcon, rdes);

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