Пример #1
0
static int mca_spml_base_close(void)
{
    int i, j;

    /**
     * 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 SPML close function.
     */
    OBJ_DESTRUCT(&mca_spml_base_put_requests);
    OBJ_DESTRUCT(&mca_spml_base_get_requests);

    /* Free all the strings in the array */
    j = opal_pointer_array_get_size(&mca_spml_base_spml);
    for (i = 0; i < j; i++) {
        char * tmp_val;
        tmp_val = (char *) opal_pointer_array_get_item(&mca_spml_base_spml, i);
        if (NULL == tmp_val) {
            continue;
        }
        free(tmp_val);
    }
    OBJ_DESTRUCT(&mca_spml_base_spml);

    /* Close all remaining available components */
    return mca_base_framework_components_close(&oshmem_spml_base_framework, NULL);
}
Пример #2
0
static int mca_rcache_base_close(void)
{
    opal_list_item_t *item;
    mca_rcache_base_selected_module_t *sm;

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

    while (NULL != (item = opal_list_remove_first(&mca_rcache_base_modules))) {
        sm = (mca_rcache_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->rcache_module->rcache_finalize) {
            sm->rcache_module->rcache_finalize(sm->rcache_module);
        }
        OBJ_RELEASE(sm);
    }

    /* deregister memory free callback */
    if (mca_rcache_base_used_mem_hooks) {
        opal_mem_hooks_unregister_release(mca_rcache_base_mem_cb);
    }
    /* All done */

    /* Close all remaining available components */
    return mca_base_framework_components_close(&opal_rcache_base_framework, NULL);
}
Пример #3
0
static int opal_dstore_base_frame_close(void)
{
    opal_dstore_handle_t *hdl;
    opal_list_item_t *item;
    int i;

    /* cycle across all the active dstore handles and let them cleanup - order
     * doesn't matter in this case
     */
    for (i=0; i < opal_dstore_base.handles.size; i++) {
        if (NULL != (hdl = (opal_dstore_handle_t*)opal_pointer_array_get_item(&opal_dstore_base.handles, i))) {
            OBJ_RELEASE(hdl);
        }
    }
    OBJ_DESTRUCT(&opal_dstore_base.handles);

    for (item = opal_list_remove_first(&opal_dstore_base.available_components);
            NULL != item;
            item = opal_list_remove_first(&opal_dstore_base.available_components)) {
        OBJ_RELEASE(item);
    }
    OBJ_DESTRUCT(&opal_dstore_base.available_components);

    /* let the backfill module finalize, should it wish to do so */
    if (NULL != opal_dstore_base.backfill_module && NULL != opal_dstore_base.backfill_module->finalize) {
        opal_dstore_base.backfill_module->finalize((struct opal_dstore_base_module_t*)opal_dstore_base.backfill_module);
    }

    return mca_base_framework_components_close(&opal_dstore_base_framework, NULL);
}
Пример #4
0
static int mca_pml_base_close(void)
{
    int i, j;

    /* 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;
    
    /* Free all the strings in the array */
    j = opal_pointer_array_get_size(&mca_pml_base_pml);
    for (i = 0; i < j; ++i) {
        char *str;
        str = (char*) opal_pointer_array_get_item(&mca_pml_base_pml, i);
        free(str);
    }
    OBJ_DESTRUCT(&mca_pml_base_pml);

    /* Close all remaining available components */
    return mca_base_framework_components_close(&ompi_pml_base_framework, NULL);
}
Пример #5
0
static int opal_hwloc_base_close(void)
{
    int ret;
    if (!opal_hwloc_base_inited) {
        return OPAL_SUCCESS;
    }

    /* no need to close the component as it was statically opened */

    /* for support of tools such as ompi_info */
    ret = mca_base_framework_components_close (&opal_hwloc_base_framework, NULL);
    if (OPAL_SUCCESS != ret) {
        return ret;
    }

    /* free memory */
    if (NULL != opal_hwloc_my_cpuset) {
        hwloc_bitmap_free(opal_hwloc_my_cpuset);
        opal_hwloc_my_cpuset = NULL;
    }

    /* destroy the topology */
    if (NULL != opal_hwloc_topology) {
        opal_hwloc_base_free_topology(opal_hwloc_topology);
        opal_hwloc_topology = NULL;
    }


    /* All done */
    opal_hwloc_base_inited = false;
    return OPAL_SUCCESS;
}
Пример #6
0
static int mca_mpool_base_close(void)
{
  opal_list_item_t *item;
  mca_mpool_base_selected_module_t *sm;

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

  while(NULL != (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 opal_info) */
  (void) mca_base_framework_components_close(&opal_mpool_base_framework, NULL);

  return OPAL_SUCCESS;
}
Пример #7
0
static int orte_schizo_base_close(void)
{
    /* cleanup globals */
    OPAL_LIST_DESTRUCT(&orte_schizo_base.active_modules);

    return mca_base_framework_components_close(&orte_schizo_base_framework, NULL);
}
Пример #8
0
static int orte_oob_base_close(void)
{
    if (NULL != mca_oob.oob_fini) {
        mca_oob.oob_fini();
    }

    return mca_base_framework_components_close(&orte_oob_base_framework, NULL);
}
Пример #9
0
static int orte_dfs_base_close(void)
{
    /* Close selected component */
    if (NULL != orte_dfs.finalize) {
        orte_dfs.finalize();
    }

    return mca_base_framework_components_close(&orte_dfs_base_framework, NULL);
}
Пример #10
0
static int opal_pmix_base_frame_close(void)
{
    int rc;

    rc = mca_base_framework_components_close(&opal_pmix_base_framework, NULL);
    /* reset the opal_pmix function pointers to NULL */
    memset(&opal_pmix, 0, sizeof(opal_pmix));
    return rc;
}
Пример #11
0
/* Use default register/open/close functions */
static int opal_pstat_base_close(void)
{
    /* let the selected module finalize */
    if (NULL != opal_pstat.finalize) {
            opal_pstat.finalize();
    }

    return mca_base_framework_components_close(&opal_pstat_base_framework, NULL);
}
Пример #12
0
static int orcm_analytics_base_close(void)
{
    orcm_analytics_base_comm_stop();

    /* destruct the base objects */
    OPAL_LIST_DESTRUCT(&orcm_analytics_base.workflows);

    return mca_base_framework_components_close(&orcm_analytics_base_framework,
                                               NULL);
}
Пример #13
0
static int orcm_pvsn_base_close(void)
{
    if (orcm_pvsn_base.ev_active) {
        orcm_pvsn_base.ev_active = false;
        /* stop the thread */
        opal_progress_thread_finalize("pvsn");
    }

    return mca_base_framework_components_close(&orcm_pvsn_base_framework, NULL);
}
Пример #14
0
static 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 */
    return mca_base_framework_components_close(&ompi_dpm_base_framework, NULL);
}
Пример #15
0
static int orte_rml_base_close(void)
{
    opal_list_item_t *item;

    while (NULL != (item = opal_list_remove_first(&orte_rml_base.posted_recvs))) {
        OBJ_RELEASE(item);
    }
    OBJ_DESTRUCT(&orte_rml_base.posted_recvs);

    return mca_base_framework_components_close(&orte_rml_base_framework, NULL);
}
Пример #16
0
static int orcm_evgen_base_close(void)
{
    if (NULL != orcm_evgen_evbase) {
        opal_progress_thread_finalize("evgen");
    }

    OPAL_LIST_DESTRUCT(&orcm_evgen_base.actives);

    /* Close all remaining available components */
    return mca_base_framework_components_close(&orcm_evgen_base_framework, NULL);
}
Пример #17
0
static int mca_bml_base_close( void )
{
    int ret;

    /* close any open components (including the selected one) */
    ret = mca_base_framework_components_close(&ompi_bml_base_framework, NULL);
    if (OMPI_SUCCESS != ret) {
        return ret;
    }

    return mca_base_framework_close(&opal_btl_base_framework);
}
Пример #18
0
/* ////////////////////////////////////////////////////////////////////////// */
int
mca_sshmem_base_close(void)
{
    /* if there is a selected sshmem module, finalize it */
    if (NULL != mca_sshmem_base_module &&
        NULL != mca_sshmem_base_module->module_finalize) {
        mca_sshmem_base_module->module_finalize();
    }

    return mca_base_framework_components_close (&oshmem_sshmem_base_framework,
                                                NULL);
}
static int mca_scoll_base_close(void)
{
    /* This call should be done before memheap close */
    if (mca_scoll_sync_array) {
        void* ptr = (void*) mca_scoll_sync_array;

        MCA_MEMHEAP_CALL(private_free(ptr));
        mca_scoll_sync_array = NULL;
    }

    return mca_base_framework_components_close(&oshmem_scoll_base_framework, NULL);
}
Пример #20
0
static int orte_rmaps_base_close(void)
{
    opal_list_item_t *item;

    /* cleanup globals */
    while (NULL != (item = opal_list_remove_first(&orte_rmaps_base.selected_modules))) {
        OBJ_RELEASE(item);
    }
    OBJ_DESTRUCT(&orte_rmaps_base.selected_modules);

    return mca_base_framework_components_close(&orte_rmaps_base_framework, NULL);
}
Пример #21
0
static int opal_if_base_close(void)
{
    opal_list_item_t *item;

    if (!frameopen) {
        return OPAL_SUCCESS;
    }
    
    while (NULL != (item = opal_list_remove_first(&opal_if_list))) {
        OBJ_RELEASE(item);
    }
    OBJ_DESTRUCT(&opal_if_list);

    return mca_base_framework_components_close(&opal_if_base_framework, NULL);
}
Пример #22
0
static int orte_errmgr_base_close(void)
{
    /* Close selected component */
    if (NULL != orte_errmgr.finalize) {
        orte_errmgr.finalize();
    }

    /* always leave a default set of fn pointers */
    orte_errmgr = orte_errmgr_default_fns;

    /* destruct the callback list */
    OPAL_LIST_DESTRUCT(&orte_errmgr_base.error_cbacks);

    return mca_base_framework_components_close(&orte_errmgr_base_framework, NULL);
}
int mca_base_framework_close (struct mca_base_framework_t *framework) {
    bool is_open = !!framework->framework_refcnt;
    int ret, group_id;

    assert (NULL != framework);

    if (!framework_is_registered (framework) && 0 == framework->framework_refcnt) {
        return OPAL_SUCCESS;
    }

    if (framework->framework_refcnt && --framework->framework_refcnt) {
        return OPAL_SUCCESS;
    }

    /* find and deregister all component groups and variables */
    group_id = mca_base_var_group_find (framework->framework_project,
                                        framework->framework_name, NULL);
    if (0 <= group_id) {
        ret = mca_base_var_group_deregister (group_id);
        framework->framework_flags &= ~MCA_BASE_FRAMEWORK_FLAG_REGISTERED;
    }

    /* close the framework and all of its components */
    if (is_open) {
        if (NULL != framework->framework_close) {
            ret = framework->framework_close ();
        } else {
            ret = mca_base_framework_components_close (framework, NULL);
        }

        if (OPAL_SUCCESS != ret) {
            return ret;
        }
    } else {
        opal_list_item_t *item;
        while (NULL != (item = opal_list_remove_first (&framework->framework_components))) {
            mca_base_component_unload ((mca_base_component_t *) item, framework->framework_output);
            OBJ_RELEASE(item);
        }
        ret = OPAL_SUCCESS;
    }

    framework->framework_flags &= ~MCA_BASE_FRAMEWORK_FLAG_REGISTERED;

    framework_close_output (framework);

    return ret;
}
Пример #24
0
int mca_base_components_open (const char *type_name, int output_id,
			      const mca_base_component_t **static_components,
			      opal_list_t *components_available,
			      bool open_dso_components)
{
    /* create a dummy framework --  this leaks -- i know -- but it is temporary */
    mca_base_register_flag_t register_flags;
    mca_base_framework_t *dummy_framework;
    opal_list_item_t *item;
    int ret;

    dummy_framework = calloc (1, sizeof(*dummy_framework));

    dummy_framework->framework_static_components = static_components;
    dummy_framework->framework_output = output_id;
    dummy_framework->framework_name   = strdup(type_name);

    if (open_dso_components) {
        register_flags = MCA_BASE_REGISTER_STATIC_ONLY;
    } else {
        register_flags = MCA_BASE_REGISTER_DEFAULT;
    }

    ret = mca_base_framework_components_register (dummy_framework, register_flags);
    if (OPAL_SUCCESS != ret) {
        free (dummy_framework);
        return ret;
    }

    ret = mca_base_framework_components_open (dummy_framework, 0);
    if (OPAL_SUCCESS != ret) {
        (void) mca_base_framework_components_close (dummy_framework, NULL);
        free (dummy_framework);
        return ret;
    }

    OBJ_CONSTRUCT(components_available, opal_list_t);

    while (NULL != (item = opal_list_remove_first(&dummy_framework->framework_components))) {
        opal_list_append(components_available, item);
    }

    OBJ_DESTRUCT(&dummy_framework->framework_components);

    return OPAL_SUCCESS;
}
Пример #25
0
static int orte_grpcomm_base_close(void)
{
    /* Close the selected component */
    if( NULL != orte_grpcomm.finalize ) {
        orte_grpcomm.finalize();
    }
    OBJ_DESTRUCT(&orte_grpcomm_base.active_colls);
    OBJ_DESTRUCT(&orte_grpcomm_base.modex_requests);

#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
    return mca_base_framework_components_close(&orte_grpcomm_base_framework, NULL);
}
Пример #26
0
static int orte_iof_base_close(void)
{
    /* Close the selected component */
    if (NULL != orte_iof.finalize) {
        orte_iof.finalize();
    }

    if (!ORTE_PROC_IS_DAEMON) {
        if (NULL != orte_iof_base.iof_write_stdout) {
            OBJ_RELEASE(orte_iof_base.iof_write_stdout);
        }
        if (!orte_xml_output && NULL != orte_iof_base.iof_write_stderr) {
            OBJ_RELEASE(orte_iof_base.iof_write_stderr);
        }
    }
    return mca_base_framework_components_close(&orte_iof_base_framework, NULL);
}
Пример #27
0
int opal_crs_base_close(void)
{
    if( !opal_cr_is_enabled ) {
        opal_output_verbose(10, opal_crs_base_framework.framework_output,
                            "crs:close: FT is not enabled, skipping!");
        return OPAL_SUCCESS;
    }

    /* Call the component's finalize routine */
    if( NULL != opal_crs.crs_finalize ) {
        opal_crs.crs_finalize();
    }

    /* Close all available modules that are open */
    return mca_base_framework_components_close (&opal_crs_base_framework,
						NULL);
}
Пример #28
0
static int orte_sensor_base_close(void)
{
    orte_sensor_active_module_t *i_module;
    int i;
    
    for (i=0; i < orte_sensor_base.modules.size; i++) {
        if (NULL == (i_module = (orte_sensor_active_module_t*)opal_pointer_array_get_item(&orte_sensor_base.modules, i))) {
            continue;
        }
        if (NULL != i_module->module->finalize) {
            i_module->module->finalize();
        }
    }
    OBJ_DESTRUCT(&orte_sensor_base.modules);
    
    /* Close all remaining available components */
    return mca_base_framework_components_close(&orte_sensor_base_framework, NULL);
}
Пример #29
0
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(&ompi_bml_base_framework.framework_components); 
         opal_list_get_end(&ompi_bml_base_framework.framework_components) != 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, ompi_bml_base_framework.framework_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; 
    }

    mca_bml_component = *best_component; 
    mca_bml = *best_module; 
    return mca_base_framework_components_close(&ompi_bml_base_framework,
                                               (mca_base_component_t*) best_component);
}
Пример #30
0
static int orte_plm_base_close(void)
{
    int rc;

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

   /* if we are the HNP, then stop our receive */
    if (ORTE_PROC_IS_HNP) {
        if (ORTE_SUCCESS != (rc = orte_plm_base_comm_stop())) {
            ORTE_ERROR_LOG(rc);
            return rc;
        }
    }

    return mca_base_framework_components_close(&orte_plm_base_framework, NULL);
}