orcm/mca/notifier/base/notifier_base_select.c
/**
 * Check if a component name belongs to an include list and add it to the
 * list of selected modules.
 *
 * @param component        (IN)  component to be included
 * @param module           (IN)  module to be included
 * @param priority         (IN)  module priority
 * @param include_list     (IN)  list of module names to go through
 * @param selected_modules (OUT) list of selected modules to be updated
 * @return                       true/false depending on whether the module
 *                               has been added or not
 */
Check if a component name belongs to an include list and add it to the
list of selected modules.


Check if a component name belongs to an include list and add it to the list of selected modules .
static bool orcm_notifier_add_module(mca_base_component_t *component,
                                     orcm_notifier_base_module_t *module,
                                     int priority,
                                     char *includes,
                                     opal_list_t *selected_modules)
{
    orcm_notifier_base_selected_pair_t *pair, *pair2;
    char *module_name;
    opal_list_item_t *item;
    int i;
    char **include_list=NULL;
    if (NULL == includes) {
        return false;
    }
    module_name = component->mca_component_name;
    include_list = opal_argv_split(includes, ',');
    for (i = 0; NULL != include_list[i]; i++) {
        if (!strcmp(include_list[i], module_name)) {
            break;
        }
    }
    if (NULL == include_list[i]) {
        opal_argv_free(include_list);
        return false;
    }
    opal_argv_free(include_list);
    pair = OBJ_NEW(orcm_notifier_base_selected_pair_t);
    pair->onbsp_component = (orcm_notifier_base_component_t*) component;
    pair->onbsp_module = module;
    pair->onbsp_priority = priority;
    for (item = opal_list_get_first(selected_modules);
         opal_list_get_end(selected_modules) != item;
         item = opal_list_get_next(item)) {
        pair2 = (orcm_notifier_base_selected_pair_t*) item;
        if (priority > pair2->onbsp_priority) {
            opal_list_insert_pos(selected_modules, item, &(pair->super));
            break;
        }
    }
    if (opal_list_get_end(selected_modules) == item) {
        opal_list_append(selected_modules, &(pair->super));
    }
    return true;
}
static bool orcm_notifier_add_module ( mca_base_component_t * component , orcm_notifier_base_module_t * module , int priority , char * includes , opal_list_t * selected_modules ) { orcm_notifier_base_selected_pair_t * pair , * pair2 ; char * module_name ; opal_list_item_t * item ; int i ; char * * include_list = NULL ; if ( NULL == includes ) { return false ; } module_name = component -> mca_component_name ; include_list = opal_argv_split ( includes , ' ' ) ; for ( i = 0 ; NULL != include_list [ i ] ; i ++ ) { if ( ! strcmp ( include_list [ i ] , module_name ) ) { break ; } } if ( NULL == include_list [ i ] ) { opal_argv_free ( include_list ) ; return false ; } opal_argv_free ( include_list ) ; pair = OBJ_NEW ( orcm_notifier_base_selected_pair_t ) ; pair -> onbsp_component = ( orcm_notifier_base_component_t * ) component ; pair -> onbsp_module = module ; pair -> onbsp_priority = priority ; for ( item = opal_list_get_first ( selected_modules ) ; opal_list_get_end ( selected_modules ) != item ; item = opal_list_get_next ( item ) ) { pair2 = ( orcm_notifier_base_selected_pair_t * ) item ; if ( priority > pair2 -> onbsp_priority ) { opal_list_insert_pos ( selected_modules , item , & ( pair -> super ) ) ; break ; } } if ( opal_list_get_end ( selected_modules ) == item ) { opal_list_append ( selected_modules , & ( pair -> super ) ) ; } return true ; }
Check if a component name belongs to an include list and add it to the
 list of selected modules.
Check if a component name belongs to an include list and add it to the list of selected modules .
/* If this component is not in the include list, skip it */ /* Make an item for the list */ /* Put it in the list in priority order */