Пример #1
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;
}
Пример #2
0
void opal_hwloc_base_close(void)
{
    if (!opal_hwloc_base_inited) {
        return;
    }

    /* 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;
}
Пример #3
0
static int rte_finalize(void)
{
    int ret = ORTE_SUCCESS;
   
    if (app_init_complete) {
        /* if I am a daemon, finalize using the default procedure */
        if (ORTE_PROC_IS_DAEMON) {
            if (ORTE_SUCCESS != (ret = orte_ess_base_orted_finalize())) {
                ORTE_ERROR_LOG(ret);
            }
        } else {
            /* use the default app procedure to finish */
            if (ORTE_SUCCESS != (ret = orte_ess_base_app_finalize())) {
                ORTE_ERROR_LOG(ret);
            }
            /* remove the envars that we pushed into environ
             * so we leave that structure intact
             */
            unsetenv("OMPI_MCA_grpcomm");
            unsetenv("OMPI_MCA_routed");
            unsetenv("OMPI_MCA_orte_precondition_transports");
        }
    }
    
    /* deconstruct my nidmap and jobmap arrays - this
     * function protects itself from being called
     * before things were initialized
     */
    orte_util_nidmap_finalize();

#if OPAL_HAVE_HWLOC
    if (NULL != opal_hwloc_topology) {
        opal_hwloc_base_free_topology(opal_hwloc_topology);
        opal_hwloc_topology = NULL;
    }
#endif

    return ret;    
}