Beispiel #1
0
int mca_topo_base_close(void) 
{
    /* We have to close all the components which are open. This might either 
       be the list of opened components or the list of available components. 
       Note that the components which are opened but are not available are 
       already closed */

    if (mca_topo_base_components_opened_valid) {
        mca_base_components_close (mca_topo_base_output,
                                &mca_topo_base_components_opened, NULL);
        mca_topo_base_components_opened_valid = false;
    } else if (mca_topo_base_components_available_valid) {
        mca_base_components_close (mca_topo_base_output,
                                &mca_topo_base_components_available, NULL);
        mca_topo_base_components_available_valid = false;
    }

    /* Close the output stream for this framework */
    opal_output_close (mca_topo_base_output);

    /*
     * All done
     */
    return OMPI_SUCCESS;
}
Beispiel #2
0
int mca_coll_base_close(void)
{
    /* Close all components that are still open.  This may be the opened
     * list (if we're in ompi_info), or it may be the available list (if
     * we're anywhere else). */

    if (mca_coll_base_components_opened_valid) {
        mca_base_components_close(mca_coll_base_output,
                                  &mca_coll_base_components_opened, NULL);
        OBJ_DESTRUCT(&mca_coll_base_components_opened);
        mca_coll_base_components_opened_valid = false;
    } else if (mca_coll_base_components_available_valid) {
        mca_base_components_close(mca_coll_base_output,
                                  &mca_coll_base_components_available,
                                  NULL);
        OBJ_DESTRUCT(&mca_coll_base_components_available);
        mca_coll_base_components_available_valid = false;
    }

    /* Close the framework output */
    opal_output_close (mca_coll_base_output);
    mca_coll_base_output = -1;

    /* All done */

    return OMPI_SUCCESS;
}
int mca_base_framework_components_close (mca_base_framework_t *framework,
                                         const mca_base_component_t *skip)
{
    return mca_base_components_close (framework->framework_output,
                                      &framework->framework_components,
                                      skip);
}
int orte_errmgr_base_close(void)
{
    OPAL_TRACE(5);

    /* If we have a selected component and module, then finalize it */

    if (orte_errmgr_base_selected) {
        orte_errmgr_base_selected_component.errmgr_finalize();
    }

    /* Close all remaining available components (may be one if this is a
       OMPI RTE program, or [possibly] multiple if this is ompi_info) */

    mca_base_components_close(orte_errmgr_base_output,
                              &orte_errmgr_base_components_available, NULL);

    orte_errmgr_initialized = false;

    /* set the module back to the default so that error logging can continue */
    orte_errmgr = orte_errmgr_default;

    /* All done */

    return ORTE_SUCCESS;
}
Beispiel #5
0
int orte_sensor_base_close(void)
{
    orte_sensor_base_module_t *i_module;
    int i;
    
    for (i=0; i < orte_sensor_base.modules.size; i++) {
        if (NULL == (i_module = (orte_sensor_base_module_t*)opal_pointer_array_get_item(&orte_sensor_base.modules, i))) {
            continue;
        }
        if (NULL != i_module->finalize) {
            i_module->finalize();
        }
    }
    OBJ_DESTRUCT(&orte_sensor_base.modules);
    
    /* Close all remaining available components */
    
    mca_base_components_close(orte_sensor_base.output, 
                              &mca_sensor_base_components_available, NULL);

    /* Close the framework output */
    opal_output_close (orte_sensor_base.output);
    orte_sensor_base.output = -1;

    /* All done */
    
    return ORTE_SUCCESS;
}
Beispiel #6
0
int orte_dfs_base_close(void)
{
    /* if not initialized, then skip this action. */
    if (!orte_dfs_base.initialized) {
        return ORTE_SUCCESS;
    }

    /* Close selected component */
    if (NULL != orte_dfs.finalize) {
        orte_dfs.finalize();
    }

    /* Close all remaining available components (may be one if this is a
     * OMPI RTE program, or [possibly] multiple if this is ompi_info)
     */
    mca_base_components_close(orte_dfs_base.output, 
                              &orte_dfs_base.components_available,
                              NULL);

    /* Close the framework output */
    opal_output_close (orte_dfs_base.output);
    orte_dfs_base.output = -1;

    orte_dfs_base.initialized = false;
    
    return ORTE_SUCCESS;
}
int orte_grpcomm_base_close(void)
{
  /* If we have a selected component and module, then finalize it */

  if (orte_grpcomm_base.selected) {
    orte_grpcomm.finalize();
  }

    /* Close all remaining available components (may be one if this is a
     OpenRTE program, or [possibly] multiple if this is ompi_info) */

  mca_base_components_close(orte_grpcomm_base.output, 
                            &orte_grpcomm_base.components_available, NULL);

#if OPAL_HAVE_HWLOC
  if (NULL != orte_grpcomm_base.working_cpuset) {
      hwloc_bitmap_free(orte_grpcomm_base.working_cpuset);
      orte_grpcomm_base.working_cpuset = NULL;
  }
#endif

  /* All done */

  return ORTE_SUCCESS;
}
Beispiel #8
0
int mca_pml_base_close(void)
{
    /* turn off the progress code for the pml */
    if( NULL != mca_pml.pml_progress ) {
        opal_progress_unregister(mca_pml.pml_progress);
    }

    /* Blatently ignore the return code (what would we do to recover,
       anyway?  This module is going away, so errors don't matter
       anymore) */

    /**
     * Destruct the send and receive queues. The ompi_free_list_t destructor
     * will return the memory to the mpool, so this has to be done before the
     * mpool get released by the PML close function.
     */
    OBJ_DESTRUCT(&mca_pml_base_send_requests);
    OBJ_DESTRUCT(&mca_pml_base_recv_requests);

    mca_pml.pml_progress = mca_pml_base_progress;

    OBJ_DESTRUCT(&mca_pml_base_pml);

    /* Close all remaining available modules (may be one if this is a
       OMPI RTE program, or [possibly] multiple if this is ompi_info) */

    mca_base_components_close(mca_pml_base_output,
                              &mca_pml_base_components_available, NULL, true);

    /* All done */

    return OMPI_SUCCESS;
}
Beispiel #9
0
int
ompi_osc_base_find_available(bool enable_progress_threads,
                            bool enable_mpi_threads)
{
    opal_list_item_t *component_item, *tmp;
    
    for (component_item = opal_list_get_first(&ompi_osc_base_open_components) ; 
         component_item != opal_list_get_end(&ompi_osc_base_open_components) ;
         component_item = opal_list_get_next(component_item)) {
        int ret;
        ompi_osc_base_component_t *component = (ompi_osc_base_component_t*)
            ((mca_base_component_list_item_t*) component_item)->cli_component;

        /* see if this component is ready to run... */
        ret = component->osc_init(enable_progress_threads, enable_mpi_threads);
        if (OMPI_SUCCESS != ret) {
            /* leave the component in the list and move on */
            continue;
        } else {
            /* the component is useable on this node.  put it in the
               available list */
            tmp = component_item;
            component_item = opal_list_remove_item(&ompi_osc_base_open_components,
                                                   component_item);
            opal_list_append(&ompi_osc_base_avail_components, tmp);
        }
    }

    mca_base_components_close(0, &ompi_osc_base_open_components, NULL);

    return OMPI_SUCCESS;
}
int orte_rmaps_base_close(void)
{
    mca_base_components_close(orte_rmaps_base.rmaps_output, 
                              &orte_rmaps_base.available_components, 
                              NULL, true);

    return ORTE_SUCCESS;
}
/* Close and unload any vprotocol MCA component loaded.
 */
int mca_vprotocol_base_close(void)
{
    int ret;
    ret = mca_base_components_close(mca_pml_v.output, 
                                    &mca_vprotocol_base_components_available, 
                                    NULL);
    OBJ_DESTRUCT(&mca_vprotocol_base_components_available);
    return ret;
}
Beispiel #12
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;
}
int orte_ras_base_close(void)
{
    /* Close all remaining available components (may be one if this is a
    Open RTE program, or [possibly] multiple if this is ompi_info) */

    mca_base_components_close(orte_ras_base.ras_output,
                              &orte_ras_base.ras_opened, NULL);

    return ORTE_SUCCESS;
}
/**
 * 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;
}
Beispiel #15
0
int
ompi_mtl_base_close(void)
{
    /* Close all remaining available modules (may be one if this is a
       OMPI RTE program, or [possibly] multiple if this is ompi_info) */
    mca_base_components_close(ompi_mtl_base_output, 
                              &ompi_mtl_base_components_opened, NULL);

    /* All done */
    return OMPI_SUCCESS;
}
int
orte_ess_base_close(void)
{
    /* Close all open components */
    mca_base_components_close (orte_ess_base_output,
			       &orte_ess_base_components_available,
			       NULL);
    OBJ_DESTRUCT(&orte_ess_base_components_available);

    return ORTE_SUCCESS;
}
int opal_timer_base_close(void)
{
    /* Close all components that are still open (this should only
       happen during laminfo). */
    mca_base_components_close(0, &opal_timer_base_components_opened, 
                              NULL, true);
    OBJ_DESTRUCT(&opal_timer_base_components_opened);

    /* All done */
    return OPAL_SUCCESS;
}
/**
 * Closes all the remaining modules.
 *
 * @retval OMPI_SUCCESS
 */
int mca_allocator_base_close(void)
{
  /* Close all remaining available modules (may be one if this is a
     OMPI RTE program, or [possibly] multiple if this is ompi_info) */

  mca_base_components_close(mca_allocator_base_output,
                            &mca_allocator_base_components, NULL, true);

  /* All done */

  return OMPI_SUCCESS;
}
Beispiel #19
0
int opal_crs_base_close(void)
{
    /* Call the component's finalize routine */
    if( NULL != opal_crs.crs_finalize ) {
        opal_crs.crs_finalize();
    }

    /* Close all available modules that are open */
    mca_base_components_close(opal_crs_base_output,
                              &opal_crs_base_components_available,
                              NULL, true);

    return OPAL_SUCCESS;
}
int ompi_dpm_base_close(void)
{
    /* Close the selected component */
    if( NULL != ompi_dpm.finalize ) {
        ompi_dpm.finalize();
    }

    /* Close all available modules that are open */
    mca_base_components_close(ompi_dpm_base_output,
                              &ompi_dpm_base_components_available,
                              NULL);
    
    return OMPI_SUCCESS;
}
int
orte_rml_base_close(void)
{
    /* shutdown any remaining opened components */
    if (component_open_called) {
        mca_base_components_close(orte_rml_base_output, 
                                  &orte_rml_base_components, NULL, true);
    }

    OBJ_DESTRUCT(&orte_rml_base_components);
    OBJ_DESTRUCT(&orte_rml_base_subscriptions);

    return ORTE_SUCCESS;
}
Beispiel #22
0
int orcm_clip_base_close(void)
{
    if (NULL != orcm_clip.finalize) {
        orcm_clip.finalize();
    }
    
    /* Close all remaining available components (may be one if this is a
     Open RTE program, or [possibly] multiple if this is ompi_info) */
    
    mca_base_components_close(orcm_clip_base.output, 
                              &orcm_clip_base.opened, NULL);
    
    return ORCM_SUCCESS;
}
int orte_filem_base_close(void)
{
    /* Close the selected component */
    if( NULL != orte_filem.filem_finalize ) {
        orte_filem.filem_finalize();
    }

    /* Close all available modules that are open */
    mca_base_components_close(orte_filem_base_output,
                              &orte_filem_base_components_available,
                              NULL);
    
    return ORTE_SUCCESS;
}
int mca_bml_base_init( bool enable_progress_threads, 
                       bool enable_mpi_threads) {
    opal_list_item_t *item = NULL;
    mca_bml_base_component_t *component = NULL, *best_component = NULL; 
    mca_bml_base_module_t *module = NULL, *best_module = NULL; 
    int priority = 0, best_priority = -1; 
    mca_base_component_list_item_t *cli = NULL; 

    init_called = true;

    for (item = opal_list_get_first(&mca_bml_base_components_available); 
         opal_list_get_end(&mca_bml_base_components_available) != item; 
         item = opal_list_get_next(item)) { 
        cli = (mca_base_component_list_item_t*) item; 
        component = (mca_bml_base_component_t*) cli->cli_component; 
        if(NULL == component->bml_init) {
            opal_output_verbose( 10, mca_bml_base_output, 
                                 "select: no init function; ignoring component %s", 
                                 component->bml_version.mca_component_name ); 
            continue; 
        }
        module = component->bml_init(&priority, 
                                     enable_progress_threads, 
                                     enable_mpi_threads); 

        if(NULL == module) { 
            continue; 
        } 
        if(priority > best_priority) { 
            best_priority = priority;
            best_component = component;
            best_module = module;
        }
        
    }
    if(NULL == best_module) { 
        return OMPI_SUCCESS; 
    }
    else { 
        mca_bml_component = *best_component; 
        mca_bml = *best_module; 
        if (opal_profile) {
            opal_output(0, "bml:%s", mca_bml_component.bml_version.mca_component_name);
        }
        return mca_base_components_close(mca_bml_base_output, 
                                         &mca_bml_base_components_available, 
                                         (mca_base_component_t*) best_component); 
    }
}
int mca_btl_base_close(void)
{
    opal_list_item_t *item;
    mca_btl_base_selected_module_t *sm;

    if( mca_btl_base_already_opened <= 0 ) {
        return OMPI_ERROR;
    } else if (--mca_btl_base_already_opened > 0) {
        return OMPI_SUCCESS;
    }
    /* disable event processing while cleaning up btls */
    opal_event_disable();

    /* Finalize all the btl components and free their list items */

    for (item = opal_list_remove_first(&mca_btl_base_modules_initialized);
         NULL != item; 
         item = opal_list_remove_first(&mca_btl_base_modules_initialized)) {
        sm = (mca_btl_base_selected_module_t *) item;

        /* Blatebtly ignore the return code (what would we do to recover,
           anyway?  This component is going away, so errors don't matter
           anymore) */

        sm->btl_module->btl_finalize(sm->btl_module);
        free(sm);
    }

    /* Close all remaining opened components (may be one if this is a
       OMPI RTE program, or [possibly] multiple if this is ompi_info) */
  
    if (0 != opal_list_get_size(&mca_btl_base_components_opened)) {
        mca_base_components_close(mca_btl_base_output, 
                                  &mca_btl_base_components_opened, NULL,
                                  true);
    }

    /* cleanup */
    if(NULL != mca_btl_base_include)
        free(mca_btl_base_include);
    if(NULL != mca_btl_base_exclude)
        free(mca_btl_base_exclude);

    /* restore event processing */
    opal_event_enable();

    /* All done */
    return OMPI_SUCCESS;
}
Beispiel #26
0
int mca_sbgp_base_close(void)
{

    /* Close all remaining available modules */

    mca_base_components_close(ompi_sbgp_base_framework.framework_output,
                              &mca_sbgp_base_components_opened, NULL);

    /* Close the framework output */
    opal_output_close (ompi_sbgp_base_framework.framework_output);
    ompi_sbgp_base_framework.framework_output = -1;

    /* All done */

    return OMPI_SUCCESS;
}
Beispiel #27
0
int
orte_sds_base_close(void)
{
    /* finalize running component */
    if (NULL != orte_sds_base_module) {
        orte_sds_base_module->finalize();
    }

    /* shutdown any remaining opened components */
    if (! opal_list_is_empty(&orte_sds_base_components_available)) {
        mca_base_components_close(0, 
                                  &orte_sds_base_components_available, NULL);
    }
    OBJ_DESTRUCT(&orte_sds_base_components_available);
    return ORTE_SUCCESS;
}
Beispiel #28
0
int orte_rmcast_base_close(void)
{
    opal_list_item_t *item;

    if (!orte_rmcast_base.opened) {
        return ORTE_SUCCESS;
    }
    
    /* finalize the active module */
    if (NULL != orte_rmcast.finalize) {
        orte_rmcast.finalize();
    }
    
    while (NULL != (item = opal_list_remove_first(&orte_rmcast_base.msg_logs))) {
        OBJ_RELEASE(item);
    }
    OBJ_DESTRUCT(&orte_rmcast_base.msg_logs);

    while (NULL != (item = opal_list_remove_first(&orte_rmcast_base.recvs))) {
        OBJ_RELEASE(item);
    }
    OBJ_DESTRUCT(&orte_rmcast_base.recvs);
    while (NULL != (item = opal_list_remove_first(&orte_rmcast_base.channels))) {
        OBJ_RELEASE(item);
    }
    OBJ_DESTRUCT(&orte_rmcast_base.channels);

    /* cleanup thread stuff */
    OBJ_DESTRUCT(&orte_rmcast_base.main_ctl);
    OBJ_DESTRUCT(&orte_rmcast_base.recv_thread);
    OBJ_DESTRUCT(&orte_rmcast_base.recv_ctl);
    OBJ_DESTRUCT(&orte_rmcast_base.recv_process);
    OBJ_DESTRUCT(&orte_rmcast_base.recv_process_ctl);
    if (NULL != orte_rmcast_base.my_group_name) {
        free(orte_rmcast_base.my_group_name);
    }

    /* Close all remaining available components (may be one if this is a
        Open RTE program, or [possibly] multiple if this is ompi_info) */

    mca_base_components_close(orte_rmcast_base.rmcast_output, 
                              &orte_rmcast_base.rmcast_opened, NULL);
  
    orte_rmcast_base.opened = false;
    return ORTE_SUCCESS;
}
int mca_mpool_base_close(void)
{
  opal_list_item_t *item;
  mca_mpool_base_selected_module_t *sm;
  int32_t modules_length;

  /* Need the initial length in order to know if some of the initializations
   * are done in the open function.
   */
  modules_length = opal_list_get_size(&mca_mpool_base_modules);

  /* Finalize all the mpool components and free their list items */

  for (item = opal_list_remove_first(&mca_mpool_base_modules);
       NULL != item; 
       item = opal_list_remove_first(&mca_mpool_base_modules)) {
    sm = (mca_mpool_base_selected_module_t *) item;

    /* Blatently ignore the return code (what would we do to recover,
       anyway?  This component is going away, so errors don't matter
       anymore).  Note that it's legal for the module to have NULL for
       the finalize function. */

    if (NULL != sm->mpool_module->mpool_finalize) {
        sm->mpool_module->mpool_finalize(sm->mpool_module);
    }
    OBJ_RELEASE(sm);
  }

  /* Close all remaining available components (may be one if this is a
     OMPI RTE program, or [possibly] multiple if this is ompi_info) */

  mca_base_components_close(mca_mpool_base_output, 
                            &mca_mpool_base_components, NULL);

  /* deregister memory free callback */
  if( (modules_length > 0) && mca_mpool_base_used_mem_hooks && 
     0 != (OPAL_MEMORY_FREE_SUPPORT & opal_mem_hooks_support_level())) {
      opal_mem_hooks_unregister_release(mca_mpool_base_mem_cb);
      OBJ_DESTRUCT(&mca_mpool_base_mem_cb_array);
  }
  /* All done */

  return OMPI_SUCCESS;
}
int orte_plm_base_close(void)
{
    /* finalize selected module */
    if (orte_plm_base.selected) {
        orte_plm.finalize();
    }
    
    /* Close all open components */
    mca_base_components_close(orte_plm_globals.output, 
                                &orte_plm_base.available_components, NULL);
    OBJ_DESTRUCT(&orte_plm_base.available_components);

    /* clearout the orted cmd locks */
    OBJ_DESTRUCT(&orte_plm_globals.orted_cmd_lock);
    OBJ_DESTRUCT(&orte_plm_globals.orted_cmd_cond);
    
    return ORTE_SUCCESS;
}