Пример #1
0
int opal_pstat_base_select(void)
{
    int ret, exit_status = OPAL_SUCCESS;
    opal_pstat_base_component_t *best_component = NULL;
    opal_pstat_base_module_t *best_module = NULL;

    /*
     * Select the best component
     */
    if( OPAL_SUCCESS != mca_base_select("pstat", opal_pstat_base_output,
                                        &opal_pstat_base_components_opened,
                                        (mca_base_module_t **) &best_module,
                                        (mca_base_component_t **) &best_component) ) {
        /* It is okay if we don't find a runnable component - default
         * to the unsupported default. 
         */
        goto cleanup;
    }

    /* Save the winner */
    opal_pstat_base_component = best_component;
    opal_pstat                = *best_module;

    /* Initialize the winner */
    if (OPAL_SUCCESS != (ret = opal_pstat.init()) ) {
        exit_status = ret;
        goto cleanup;
    }
    
 cleanup:
    return exit_status;
}
Пример #2
0
/*
 * Select one PNP component from all those that are available.
 */
int orcm_leader_base_select(void)
{
    mca_base_component_t *best_component = NULL;
    orcm_leader_base_module_t *best_module = NULL;
    int rc;

    if (selected) {
        /* ensure we don't do this twice */
        return ORCM_SUCCESS;
    }
    selected = true;
    
    /*
     * Select the best component
     */
    if( ORCM_SUCCESS != mca_base_select("leader", orcm_leader_base.output,
                                        &orcm_leader_base.opened,
                                        (mca_base_module_t **) &best_module,
                                        (mca_base_component_t **) &best_component) ) {
        /* This will only happen if no component was selected */
        return ORCM_ERR_NOT_FOUND;
    }

    orcm_leader = *best_module;
    
    /* init the selected module */
    if (NULL != orcm_leader.init) {
        if (ORCM_SUCCESS != (rc = orcm_leader.init())) {
            ORTE_ERROR_LOG(rc);
            return rc;
        }
    }

    return ORCM_SUCCESS;
}
Пример #3
0
/*
 * Select one RAS component from all those that are available.
 */
int orte_ras_base_select(void)
{
    /* For all other systems, provide the following support */

    orte_ras_base_component_t *best_component = NULL;
    orte_ras_base_module_t *best_module = NULL;

    /*
     * Select the best component
     */
    if( OPAL_SUCCESS != mca_base_select("ras", orte_ras_base.ras_output,
                                        &orte_ras_base.ras_opened,
                                        (mca_base_module_t **) &best_module,
                                        (mca_base_component_t **) &best_component) ) {
        /* This will only happen if no component was selected */
        /* If we didn't find one to select, that is okay */
        return ORTE_SUCCESS;
    }

    /* Save the winner */
    /* No component saved */
    orte_ras_base.active_module = best_module;

    return ORTE_SUCCESS;
}
int
orte_routed_base_select(void)
{
    int ret, exit_status = OPAL_SUCCESS;
    orte_routed_component_t *best_component = NULL;
    orte_routed_module_t *best_module = NULL;

    /*
     * Select the best component
     */
    if( OPAL_SUCCESS != mca_base_select("routed", orte_routed_base_output,
                                        &orte_routed_base_components,
                                        (mca_base_module_t **) &best_module,
                                        (mca_base_component_t **) &best_component) ) {
        /* This will only happen if no component was selected */
        exit_status = ORTE_ERR_NOT_FOUND;
        goto cleanup;
    }

    /* Save the winner */
    orte_routed = *best_module;
    active_component = best_component;

    /* initialize the selected component */
    opal_output_verbose(10, orte_routed_base_output,
                        "orte_routed_base_select: initializing selected component %s",
                        best_component->base_version.mca_component_name);
    if (ORTE_SUCCESS != (ret = orte_routed.initialize()) ) {
        exit_status = ret;
        goto cleanup;
    }

 cleanup:
    return exit_status;
}
int ompi_dpm_base_select(void)
{
    int ret;
    ompi_dpm_base_component_t *best_component = NULL;
    ompi_dpm_base_module_t *best_module = NULL;

    /*
     * Select the best component
     */
    if( OPAL_SUCCESS != (ret = mca_base_select("dpm", ompi_dpm_base_framework.framework_output,
                                        &ompi_dpm_base_framework.framework_components,
                                        (mca_base_module_t **) &best_module,
                                        (mca_base_component_t **) &best_component))) {
        /* it is okay not to find any executable components */
        if (OMPI_ERR_NOT_FOUND == ret) {
            ret = OPAL_SUCCESS;
        }
        goto cleanup;
    }

    /* Save the winner */
    ompi_dpm = *best_module;
    ompi_dpm_base_selected_component = *best_component;

    /* init the selected module */
    if (NULL != ompi_dpm.init) {
        ret = ompi_dpm.init();
    }

 cleanup:
    return ret;
}
Пример #6
0
/**
 * Call the init function on all available components to find out if
 * they want to run.  Select the single component with the highest 
 * priority.
 */
int orte_iof_base_select(void)
{
    int exit_status = ORTE_SUCCESS;
    orte_iof_base_component_t *best_component = NULL;
    orte_iof_base_module_t *best_module = NULL;
    
    /*
     * Select the best component
     */
    if( OPAL_SUCCESS != mca_base_select("iof", orte_iof_base.iof_output,
                                        &orte_iof_base.iof_components_opened,
                                        (mca_base_module_t **) &best_module,
                                        (mca_base_component_t **) &best_component) ) {
        /* This will only happen if no component was selected, which
         * is an error.
         *
         * NOTE: processes do not open/select the IOF - only daemons,
         * the HNP, and tools do. 
         */
        exit_status = ORTE_ERR_NOT_FOUND;
        goto cleanup;
    }
    
    /* Save the winner */
    orte_iof = *best_module;

cleanup:
    return exit_status;
    
}
/**
 * Call the query function on all available components to find out if
 * they want to run.  Select the single component with the highest 
 * priority.
 */
int orte_iof_base_select(void)
{
    orte_iof_base_component_t *best_component = NULL;
    orte_iof_base_module_t *best_module = NULL;
    int rc;
    
    /*
     * Select the best component
     */
    if( OPAL_SUCCESS != mca_base_select("iof", orte_iof_base_framework.framework_output,
                                        &orte_iof_base_framework.framework_components,
                                        (mca_base_module_t **) &best_module,
                                        (mca_base_component_t **) &best_component) ) {
        /* it is okay to not find a module if we are a CM process */
        if (ORTE_PROC_IS_CM) {
            return ORTE_SUCCESS;
        }
        /* otherwise, this is a problem */
        return ORTE_ERR_NOT_FOUND;
    }
    
    /* Save the winner */
    orte_iof = *best_module;
    /* init it */
    if (NULL != orte_iof.init) {
        if (ORTE_SUCCESS != (rc = orte_iof.init())) {
            ORTE_ERROR_LOG(rc);
            return rc;
        }
    }

    return ORTE_SUCCESS;
}
Пример #8
0
int orte_errmgr_base_select(void)
{
    int exit_status = OPAL_SUCCESS;
    orte_errmgr_base_component_t *best_component = NULL;
    orte_errmgr_base_module_t *best_module = NULL;

    /*
     * Select the best component
     */
    if( OPAL_SUCCESS != mca_base_select("errmgr", orte_errmgr_base_framework.framework_output,
                                        &orte_errmgr_base_framework.framework_components,
                                        (mca_base_module_t **) &best_module,
                                        (mca_base_component_t **) &best_component, NULL) ) {
        /* This will only happen if no component was selected */
        exit_status = ORTE_ERROR;
        goto cleanup;
    }

    /* Save the winner */
    orte_errmgr = *best_module;

    /* Initialize the winner */
    if (NULL != best_module) {
        if (OPAL_SUCCESS != orte_errmgr.init()) {
            exit_status = OPAL_ERROR;
            goto cleanup;
        }
    }

 cleanup:
    return exit_status;
}
Пример #9
0
/**
 * Function for selecting one component from all those that are
 * available.
 */
int orte_regx_base_select(void)
{
    orte_regx_base_component_t *best_component = NULL;
    orte_regx_base_module_t *best_module = NULL;
    int rc = ORTE_SUCCESS;

    /*
     * Select the best component
     */
    if (OPAL_SUCCESS != mca_base_select("regx", orte_regx_base_framework.framework_output,
                                        &orte_regx_base_framework.framework_components,
                                        (mca_base_module_t **) &best_module,
                                        (mca_base_component_t **) &best_component, NULL)) {
        /* This will only happen if no component was selected */
        return ORTE_ERR_NOT_FOUND;
    }

    /* Save the winner */
    orte_regx = *best_module;
    /* give it a chance to init */
    if (NULL != orte_regx.init) {
        rc = orte_regx.init();
    }
    return rc;
}
Пример #10
0
int opal_pmix_base_select(void)
{
    int ret, exit_status = OPAL_SUCCESS;
    opal_pmix_base_component_t *best_component = NULL;
    opal_pmix_base_module_t *best_module = NULL;

    /*
     * Select the best component
     */
    if( OPAL_SUCCESS != mca_base_select("pmix", opal_pmix_base_framework.framework_output,
                                        &opal_pmix_base_framework.framework_components,
                                        (mca_base_module_t **) &best_module,
                                        (mca_base_component_t **) &best_component) ) {
        /* notify caller that no available component found */
        return OPAL_ERR_NOT_FOUND;
    }

    /* Save the winner */
    opal_pmix = *best_module;

    /* Initialize the winner */
    if (OPAL_SUCCESS != (ret = opal_pmix.init()) ) {
        /* connection not available is okay - just means
         * that a server hasn't already been defined */
        if (OPAL_ERR_SERVER_NOT_AVAIL == ret) {
            exit_status = OPAL_SUCCESS;
        } else {
            exit_status = ret;
        }
    }

    return exit_status;
}
Пример #11
0
int orte_dfs_base_select(void)
{
    int exit_status = ORTE_SUCCESS;
    orte_dfs_base_component_t *best_component = NULL;
    orte_dfs_base_module_t *best_module = NULL;

    /*
     * Select the best component
     */
    if (OPAL_SUCCESS != mca_base_select("dfs", orte_dfs_base_framework.framework_output,
                                        &orte_dfs_base_framework.framework_components,
                                        (mca_base_module_t **) &best_module,
                                        (mca_base_component_t **) &best_component)) {
        /* This will only happen if no component was selected, which
         * is okay - we don't have to select anything
         */
        return ORTE_SUCCESS;
    }

    /* Save the winner */
    orte_dfs = *best_module;

    /* Initialize the winner */
    if (NULL != best_module && NULL != orte_dfs.init) {
        if (ORTE_SUCCESS != orte_dfs.init()) {
            exit_status = ORTE_ERROR;
            goto cleanup;
        }
    }

 cleanup:
    return exit_status;
}
Пример #12
0
int opal_dl_base_select(void)
{
    int exit_status = OPAL_SUCCESS;
    opal_dl_base_component_t *best_component = NULL;
    opal_dl_base_module_t *best_module = NULL;

    /*
     * Select the best component
     */
    if (OPAL_SUCCESS != mca_base_select("dl",
                                        opal_dl_base_framework.framework_output,
                                        &opal_dl_base_framework.framework_components,
                                        (mca_base_module_t **) &best_module,
                                        (mca_base_component_t **) &best_component) ) {
        /* This will only happen if no component was selected */
        exit_status = OPAL_ERROR;
        goto cleanup;
    }

    /* Save the winner */
    opal_dl_base_selected_component = best_component;
    opal_dl = best_module;

cleanup:
    return exit_status;
}
Пример #13
0
int opal_pmix_base_select(void)
{
    opal_pmix_base_component_t *best_component = NULL;
    opal_pmix_base_module_t *best_module = NULL;

    // Set the PMIx component_show_load_errors MCA param based on the
    // value of OPAL's mca_base_component_show_load_errors (i.e., the
    // bool variable behind Open MPI's mca_component_show_load_errors
    // MCA param).
    char *pmix_show_load_errors_env = mca_base_component_show_load_errors ? "1" : "0";
    opal_setenv("PMIX_MCA_mca_base_component_show_load_errors", pmix_show_load_errors_env, true, &environ);

    /*
     * Select the best component
     */
    if( OPAL_SUCCESS != mca_base_select("pmix", opal_pmix_base_framework.framework_output,
					&opal_pmix_base_framework.framework_components,
					(mca_base_module_t **) &best_module,
					(mca_base_component_t **) &best_component, NULL) ) {
	/* notify caller that no available component found */
	return OPAL_ERR_NOT_FOUND;
    }

    /* Save the winner */
    opal_pmix = *best_module;

    /* do not initialize the module here as the type
     * of process determines which init (client or server)
     * should be done */

    return OPAL_SUCCESS;
}
Пример #14
0
int orte_snapc_base_select(bool seed, bool app)
{
    int exit_status = OPAL_SUCCESS;
    orte_snapc_base_component_t *best_component = NULL;
    orte_snapc_base_module_t *best_module = NULL;
    const char **include_list = NULL;
    int var_id;

    /*
     * Register the framework MCA param and look up include list
     */
    /* XXX -- TODO -- framework_subsytem -- this shouldn't be necessary once the framework system is in place */
    var_id = mca_base_var_find(NULL, "snapc", NULL, NULL);
    mca_base_var_get_value(var_id, &include_list, NULL, NULL);

    if(NULL != include_list && NULL != include_list[0] &&
       0 == strncmp(include_list[0], "none", strlen("none")) ){
        opal_output_verbose(10, orte_snapc_base_framework.framework_output,
                            "snapc:select: Using %s component",
                            include_list[0]);
        best_module    = &none_module;
        /* Close all components since none will be used */
        mca_base_components_close(0, /* Pass 0 to keep this from closing the output handle */
                                  &orte_snapc_base_framework.framework_components,
                                  NULL);
        /* JJH: Todo: Check if none is in the list */
        goto skip_select;
    }

    /*
     * Select the best component
     */
    if( OPAL_SUCCESS != mca_base_select("snapc", orte_snapc_base_framework.framework_output,
                                        &orte_snapc_base_framework.framework_components,
                                        (mca_base_module_t **) &best_module,
                                        (mca_base_component_t **) &best_component) ) {
        /* This will only happen if no component was selected */
        exit_status = ORTE_ERROR;
        goto cleanup;
    }

 skip_select:
    /* Save the winner */
    orte_snapc = *best_module;

    /* Initialize the winner */
    if (NULL != best_module) {
        if (OPAL_SUCCESS != orte_snapc.snapc_init(seed, app)) {
            exit_status = OPAL_ERROR;
            goto cleanup;
        }
    }

 cleanup:

    return exit_status;
}
Пример #15
0
int opal_crs_base_select(void)
{
    int ret, exit_status = OPAL_SUCCESS;
    opal_crs_base_component_t *best_component = NULL;
    opal_crs_base_module_t *best_module = NULL;
    int int_value = 0;

    /*
     * Note: If we are a tool, then we will manually run the selection routine 
     *       for the checkpointer.  The tool will set the MCA parameter 
     *       'crs_base_do_not_select' before opal_init and then reset it after to 
     *       disable the selection logic.
     *       This is useful for opal_restart because it reads the metadata file
     *       that indicates the checkpointer to be used after calling opal_init.
     *       Therefore it would need to select a specific module, but it doesn't
     *       know which one until later. It will set the MCA parameter 'crs' 
     *       before calling this function.
     */
    mca_base_param_reg_int_name("crs", 
                                "base_do_not_select",
                                "Do not do the selection of the CRS component",
                                true, false,
                                false, 
                                &int_value);
    if( OPAL_INT_TO_BOOL(int_value) ) {
        opal_output_verbose(10, opal_crs_base_output,
                            "crs:select: Not selecting at this time!");
        return OPAL_SUCCESS;
    }

    /*
     * Select the best component
     */
    if( OPAL_SUCCESS != mca_base_select("crs", opal_crs_base_output,
                                        &opal_crs_base_components_available,
                                        (mca_base_module_t **) &best_module,
                                        (mca_base_component_t **) &best_component) ) {
        /* This will only happen if no component was selected */
        exit_status = OPAL_ERROR;
        goto cleanup;
    }

    /* Save the winner */
    opal_crs_base_selected_component = *best_component;
    opal_crs = *best_module;

    /* Initialize the winner */
    if (NULL != best_module) {
        if (OPAL_SUCCESS != (ret = opal_crs.crs_init()) ) {
            exit_status = ret;
            goto cleanup;
        }
    }

 cleanup:
    return exit_status;
}
/**
 * Function for selecting one component from all those that are
 * available.
 */
int orte_notifier_base_select(void)
{
    int ret, exit_status = ORTE_SUCCESS;
    orte_notifier_base_component_t *best_component = NULL;
    orte_notifier_base_module_t *best_module = NULL;
    char *include_list = NULL;

    /*
     * Register the framework MCA param and look up include list
     */
    mca_base_param_reg_string_name("notifier", NULL,
                                   "Which notifier component to use (empty = none)",
                                   false, false,
                                   NULL, &include_list);
    
    /* If we do not have any components to select this is ok. Just use the default
     * "no-op" component and move on.
     */
    if( 0 >= opal_list_get_size(&mca_notifier_base_components_available) || NULL == include_list) { 
        /* Close all components since none will be used */
        mca_base_components_close(orte_notifier_base_output,
                                  &mca_notifier_base_components_available,
                                  NULL, false);
        goto cleanup;
    }
    
    /*
     * Select the best component
     */
    if( OPAL_SUCCESS != mca_base_select("notifier", orte_notifier_base_output,
                                        &mca_notifier_base_components_available,
                                        (mca_base_module_t **) &best_module,
                                        (mca_base_component_t **) &best_component) ) {
        /* It is okay if no component was selected - we just leave
         * the orte_notifier module as the default
         */
        exit_status = ORTE_SUCCESS;
        goto cleanup;
    }

    if (NULL != orte_notifier.init) {
        /* if an init function is provided, use it */
        if (ORTE_SUCCESS != (ret = orte_notifier.init()) ) {
            exit_status = ret;
            goto cleanup;
        }
    }

    /* Save the winner */
    orte_notifier = *best_module;

 cleanup:
    return exit_status;
}
Пример #17
0
int opal_crs_base_select(void)
{
    opal_crs_base_component_t *best_component = NULL;
    opal_crs_base_module_t *best_module = NULL;
    int ret;

    if( !opal_cr_is_enabled ) {
        opal_output_verbose(10, opal_crs_base_framework.framework_output,
                            "crs:select: FT is not enabled, skipping!");
        return OPAL_SUCCESS;
    }

    if( opal_crs_base_do_not_select ) {
	opal_output_verbose(10, opal_crs_base_framework.framework_output,
                            "crs:select: Not selecting at this time!");
        return OPAL_SUCCESS;
    }

    /*
     * Select the best component
     */
    if( OPAL_SUCCESS != mca_base_select("crs", opal_crs_base_framework.framework_output,
                                        &opal_crs_base_framework.framework_components,
                                        (mca_base_module_t **) &best_module,
                                        (mca_base_component_t **) &best_component) ) {
        /* This will only happen if no component was selected */
        return OPAL_ERROR;
    }

    /* best_module and best_component should not be NULL here */

    /* Save the winner */
    opal_crs_base_selected_component = *best_component;
    opal_crs = *best_module;

    /* Initialize the winner */
    if (OPAL_SUCCESS != (ret = opal_crs.crs_init()) ) {
        return ret;
    }

    return OPAL_SUCCESS;
}
Пример #18
0
int opal_compress_base_select(void)
{
    int ret, exit_status = OPAL_SUCCESS;
    opal_compress_base_component_t *best_component = NULL;
    opal_compress_base_module_t *best_module = NULL;

    /* Compression currently only used with C/R */
    if( !opal_cr_is_enabled ) {
        opal_output_verbose(10, opal_compress_base_framework.framework_output,
                            "compress:open: FT is not enabled, skipping!");
        return OPAL_SUCCESS;
    }

    /*
     * Select the best component
     */
    if( OPAL_SUCCESS != mca_base_select("compress", opal_compress_base_framework.framework_output,
                                        &opal_compress_base_framework.framework_components,
                                        (mca_base_module_t **) &best_module,
                                        (mca_base_component_t **) &best_component) ) {
        /* This will only happen if no component was selected */
        exit_status = OPAL_ERROR;
        goto cleanup;
    }

    /* Save the winner */
    opal_compress_base_selected_component = *best_component;

    /* Initialize the winner */
    if (NULL != best_module) {
        if (OPAL_SUCCESS != (ret = best_module->init()) ) {
            exit_status = ret;
            goto cleanup;
        }
        opal_compress = *best_module;
    }

 cleanup:
    return exit_status;
}
Пример #19
0
int orte_plm_base_select(void)
{
    int exit_status = ORTE_SUCCESS;
    orte_plm_base_component_t *best_component = NULL;
    orte_plm_base_module_t *best_module = NULL;

    /*
     * Select the best component
     */
    if( OPAL_SUCCESS != mca_base_select("plm", orte_plm_globals.output,
                                        &orte_plm_base.available_components,
                                        (mca_base_module_t **) &best_module,
                                        (mca_base_component_t **) &best_component) ) {
        /* This will only happen if no component was selected
         *
         * If we didn't find one, and we are a daemon, then default to retaining the proxy.
         * Otherwise, if we didn't find one to select, that is unacceptable. 
         */
        if (orte_process_info.daemon) {
            /* don't record a selected component or flag selected
             * so we finalize correctly - just leave the plm alone
             * as it defaults to pointing at the proxy
             */
            goto cleanup;
        } else {
            exit_status = ORTE_ERR_NOT_FOUND;
            goto cleanup;
        }
    }

    /* Save the winner */
    orte_plm = *best_module;
    orte_plm_base.selected_component = *best_component;
    orte_plm_base.selected = true;
    
 cleanup:
    return exit_status;
}
Пример #20
0
int opal_memchecker_base_select(void)
{
#if OPAL_WANT_MEMCHECKER
    int ret, exit_status = OPAL_SUCCESS;
    opal_memchecker_base_component_2_0_0_t *best_component = NULL;
    opal_memchecker_base_module_1_0_0_t *best_module = NULL;

    /*
     * Select the best component
     */
    if( OPAL_SUCCESS != mca_base_select("memchecker", opal_memchecker_base_framework.framework_output,
                                        &opal_memchecker_base_framework.framework_components,
                                        (mca_base_module_t **) &best_module,
                                        (mca_base_component_t **) &best_component) ) {
        /* This will only happen if no component was selected */
        exit_status = OPAL_ERR_NOT_FOUND;
        goto cleanup;
    }

    /* Save the winner */
    opal_memchecker_base_component = best_component;
    opal_memchecker_base_module    = best_module;
    opal_memchecker_base_selected  = true;

    /* Initialize the winner */
    if (NULL != opal_memchecker_base_module) {
        if (OPAL_SUCCESS != (ret = opal_memchecker_base_module->init()) ) {
            exit_status = ret;
            goto cleanup;
        }
    }

 cleanup:
    return exit_status;
#else
    return OPAL_SUCCESS;
#endif /* OPAL_WANT_MEMCHECKER */
}
Пример #21
0
int
orte_ess_base_select(void)
{
    orte_ess_base_component_t *best_component = NULL;
    orte_ess_base_module_t *best_module = NULL;

    /*
     * Select the best component
     */
    if( OPAL_SUCCESS != mca_base_select("ess", orte_ess_base_framework.framework_output,
                                        &orte_ess_base_framework.framework_components,
                                        (mca_base_module_t **) &best_module,
                                        (mca_base_component_t **) &best_component) ) {
        /* error message emitted by fn above */
        return ORTE_ERR_SILENT;
    }

    /* Save the winner */
    /* No global component structure */
    orte_ess = *best_module;

    return ORTE_SUCCESS;
}
Пример #22
0
int ompi_crcp_base_select(void)
{
    int ret, exit_status = OMPI_SUCCESS;
    ompi_crcp_base_component_t *best_component = NULL;
    ompi_crcp_base_module_t *best_module = NULL;
    char *include_list = NULL;

    /*
     * Register the framework MCA param and look up include list
     */
    mca_base_param_reg_string_name("crcp", NULL,
                                   "Which CRCP component to use (empty = auto-select)",
                                   false, false,
                                   strdup("none"), &include_list);

    if(NULL != include_list && 0 == strncmp(include_list, "none", strlen("none")) ){ 
        opal_output_verbose(10, ompi_crcp_base_output,
                            "crcp:select: Using %s component",
                            include_list);
        best_component = &none_component;
        best_module    = &none_module;
        /* JJH: Todo: Check if none is in the list */
        /* Close all components since none will be used */
        mca_base_components_close(0, /* Pass 0 to keep this from closing the output handle */
                                  &ompi_crcp_base_components_available,
                                  NULL);
        goto skip_select;
    }

    /*
     * Select the best component
     */
    if( OPAL_SUCCESS != mca_base_select("crcp", ompi_crcp_base_output,
                                        &ompi_crcp_base_components_available,
                                        (mca_base_module_t **) &best_module,
                                        (mca_base_component_t **) &best_component) ) {
        /* This will only happen if no component was selected */
        exit_status = OMPI_ERROR;
        goto cleanup;
    }

 skip_select:
    /* Save the winner */
    ompi_crcp_base_selected_component = *best_component;
    ompi_crcp = *best_module;

    /* Initialize the winner */
    if (NULL != best_module) {
        if (OPAL_SUCCESS != (ret = ompi_crcp.crcp_init()) ) {
            exit_status = ret;
            goto cleanup;
        }
    }

 cleanup:
    if( NULL != include_list ) {
        free(include_list);
        include_list = NULL;
    }

    return exit_status;
}
Пример #23
0
int orte_snapc_base_select(bool seed, bool app)
{
    int exit_status = OPAL_SUCCESS;
    orte_snapc_base_component_t *best_component = NULL;
    orte_snapc_base_module_t *best_module = NULL;
    char *include_list = NULL;

    /*
     * Register the framework MCA param and look up include list
     */
    mca_base_param_reg_string_name("snapc", NULL,
                                   "Which SNAPC component to use (empty = auto-select)",
                                   false, false,
                                   strdup("none"), &include_list);
    if(NULL != include_list && 0 == strncmp(include_list, "none", strlen("none")) ){ 
        opal_output_verbose(10, orte_snapc_base_output,
                            "snapc:select: Using %s component",
                            include_list);
        best_component = &none_component;
        best_module    = &none_module;
        /* Close all components since none will be used */
        mca_base_components_close(orte_snapc_base_output,
                                  &orte_snapc_base_components_available,
                                  NULL, false);
        /* JJH: Todo: Check if none is in the list */
        goto skip_select;
    }

    /*
     * Select the best component
     */
    if( OPAL_SUCCESS != mca_base_select("snapc", orte_snapc_base_output,
                                        &orte_snapc_base_components_available,
                                        (mca_base_module_t **) &best_module,
                                        (mca_base_component_t **) &best_component) ) {
        /* This will only happen if no component was selected */
        exit_status = ORTE_ERROR;
        goto cleanup;
    }

 skip_select:
    /* Save the winner */
    orte_snapc_base_selected_component = *best_component;
    orte_snapc = *best_module;

    /* Initialize the winner */
    if (NULL != best_module) {
        if (OPAL_SUCCESS != orte_snapc.snapc_init(seed, app)) {
            exit_status = OPAL_ERROR;
            goto cleanup;
        }
    }

 cleanup:
    if( NULL != include_list ) {
        free(include_list);
        include_list = NULL;
    }

    return exit_status;
}
Пример #24
0
int orte_filem_base_select(void)
{
    int exit_status = OPAL_SUCCESS;
    orte_filem_base_component_t *best_component = NULL;
    orte_filem_base_module_t *best_module = NULL;
    char *include_list = NULL;

    /*
     * Register the framework MCA param and look up include list
     */
    mca_base_param_reg_string_name("filem", NULL,
                                   "Which FILEM component to use (empty = auto-select)",
                                   false, false,
                                   NULL, &include_list);

    /* If we do not have any components to select this is ok. The user likely
     * decided not to build with filem components. Just use the none
     * component and move on.
     */
    if( 0 >= opal_list_get_size(&orte_filem_base_components_available) || 
        (NULL != include_list && 0 == strncmp(include_list, "none", strlen("none")) ) ) { 
        opal_output_verbose(1, orte_filem_base_output,
                            "filem:select: Warning: Using none component. Some functionality (e.g., --preload-binary) will not work in this mode.");
        best_component = &none_component;
        best_module    = &none_module;

        /* JJH: Todo: Check if none is in the list */
        /* Close all components since none will be used */
        mca_base_components_close(0, /* Pass 0 to keep this from closing the output handle */
                                  &orte_filem_base_components_available,
                                  NULL);
        goto skip_select;
    }

    /*
     * Select the best component
     */
    if( OPAL_SUCCESS != mca_base_select("filem", orte_filem_base_output,
                                        &orte_filem_base_components_available,
                                        (mca_base_module_t **) &best_module,
                                        (mca_base_component_t **) &best_component) ) {
        /* This will only happen if no component was selected */
        exit_status = ORTE_ERROR;
        goto cleanup;
    }

 skip_select:
    /* Save the winner */
    orte_filem_base_selected_component = *best_component;
    orte_filem = *best_module;

    /* Initialize the winner */
    if (NULL != best_module) {
        if (OPAL_SUCCESS != orte_filem.filem_init()) {
            exit_status = OPAL_ERROR;
            goto cleanup;
        }
    }

 cleanup:
    if( NULL != include_list ) {
        free(include_list);
        include_list = NULL;
    }

    return exit_status;
}