Ejemplo n.º 1
0
/*
 * Module destructor
 */
static void mca_coll_sm_module_destruct(mca_coll_sm_module_t *module)
{
    mca_coll_sm_comm_t *c = module->sm_comm_data;

    if (NULL != c) {
        /* Munmap the per-communicator shmem data segment */
        if (NULL != c->sm_bootstrap_meta) {
            /* Ignore any errors -- what are we going to do about
               them? */
            mca_common_sm_fini(c->sm_bootstrap_meta);
        }
        free(c);
    }

    /* It should always be non-NULL, but just in case */
    if (NULL != module->previous_reduce_module) {
        OBJ_RELEASE(module->previous_reduce_module);
    }

    module->enabled = false;
}
static int mca_btl_vader_component_close(void)
{
    int return_value = OMPI_SUCCESS;

    /**
     * We don't have to destroy the fragment lists. They are allocated
     * directly into the mmapped file, they will auto-magically disappear
     * when the file get unmapped.
     */
    /*OBJ_DESTRUCT(&mca_btl_vader_component.vader_frags_eager);*/

    /* unmap the shared memory control structure */
    if(mca_btl_vader_component.vader_seg != NULL) {
        return_value = mca_common_sm_fini( mca_btl_vader_component.vader_seg );
        if( OMPI_SUCCESS != return_value ) {
            return_value=OMPI_ERROR;
            opal_output(0," mca_common_sm_fini failed\n");
            goto CLEANUP;
        }

        /* unlink file, so that it will be deleted when all references
         * to it are gone - no error checking, since we want all procs
         * to call this, so that in an abnormal termination scenario,
         * this file will still get cleaned up */
        /* XXX LANL TODO -- remove unlink once the shmem segment uses xpmem */
        unlink(mca_btl_vader_component.vader_seg->shmem_ds.seg_name);
        OBJ_RELEASE(mca_btl_vader_component.vader_seg);
    }

    if (NULL != mca_btl_vader_component.vader_mpool_name) {
        free(mca_btl_vader_component.vader_mpool_name);
    }

    OBJ_DESTRUCT(&mca_btl_vader_component.active_sends);

 CLEANUP:

    /* return */
    return return_value;
}
Ejemplo n.º 3
0
static void sm_module_finalize(mca_mpool_base_module_t* module)
{
    mca_mpool_sm_module_t *sm_module = (mca_mpool_sm_module_t*) module;

    if (NULL != sm_module->sm_common_module) {
        if (OPAL_SUCCESS == 
            mca_common_sm_fini(sm_module->sm_common_module)) {
#if OPAL_ENABLE_FT_CR == 1
            /* Only unlink the file if we are *not* restarting.  If we
               are restarting the file will be unlinked at a later
               time. */
            if (OPAL_CR_STATUS_RESTART_PRE  != opal_cr_checkpointing_state &&
                OPAL_CR_STATUS_RESTART_POST != opal_cr_checkpointing_state ) {
                unlink(sm_module->sm_common_module->shmem_ds.seg_name);
            }
#else
            unlink(sm_module->sm_common_module->shmem_ds.seg_name);
#endif
        }
        OBJ_RELEASE(sm_module->sm_common_module);
        sm_module->sm_common_module = NULL;
    }
}