int32_t ompi_datatype_finalize( void )
{
    /* As the synonyms are just copies of the internal data we should not free them.
     * Anyway they are over the limit of OMPI_DATATYPE_MPI_MAX_PREDEFINED so they will never get freed.
     */

    /* As they are statically allocated they cannot be released.
     * But we can call OBJ_DESTRUCT, just to free all internally allocated ressources.
     */
    for( int i = 0; i < ompi_mpi_count.dt.d_f_to_c_index; i++ ) {
        opal_datatype_t* datatype = (opal_datatype_t*)opal_pointer_array_get_item(&ompi_datatype_f_to_c_table, i );
        OBJ_DESTRUCT(datatype);
    }

    /* Get rid of the Fortran2C translation table */
    OBJ_DESTRUCT(&ompi_datatype_f_to_c_table);

#if defined(VERBOSE)
    if( ompi_datatype_dfd != -1 )
        opal_output_close( ompi_datatype_dfd );
    ompi_datatype_dfd = -1;
#endif  /* VERBOSE */

    /* release the local convertors (external32 and local) */
    ompi_datatype_default_convertors_fini();

    opal_datatype_finalize();

    return OMPI_SUCCESS;
}
static void framework_close_output (struct mca_base_framework_t *framework)
{
    if (-1 != framework->framework_output) {
        opal_output_close (framework->framework_output);
        framework->framework_output = -1;
    }
}
示例#3
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;
}
示例#4
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;
}
int32_t ompi_datatype_finalize( void )
{
    /* As the synonyms are just copies of the internal data we should not free them.
     * Anyway they are over the limit of OMPI_DATATYPE_MPI_MAX_PREDEFINED so they will never get freed.
     */

    /* As they are statically allocated they cannot be released.
     * XXX But we can call OBJ_DESTRUCT, just to free all internally allocated ressources.
     */
#if 0
    int i;

    for( i = 0; i < OMPI_DATATYPE_MAX_PREDEFINED; i++ ) {
        OBJ_DESTRUCT( ompi_datatype_basicDatatypes[i] );
    }
#endif /* 0 */

    /* Get rid of the Fortran2C translation table */
    OBJ_DESTRUCT(&ompi_datatype_f_to_c_table);

#if defined(VERBOSE)
    if( ompi_datatype_dfd != -1 )
        opal_output_close( ompi_datatype_dfd );
    ompi_datatype_dfd = -1;
#endif  /* VERBOSE */

    /* release the local convertors (external32 and local) */
    ompi_datatype_default_convertors_fini();

    opal_datatype_finalize();

    return OMPI_SUCCESS;
}
示例#6
0
文件: output.c 项目: anandhis/ompi
/*
 * Shut down the output stream system
 */
void opal_output_finalize(void)
{
    if (initialized) {
        if (verbose_stream != -1) {
            opal_output_close(verbose_stream);
        }
        free(verbose.lds_prefix);
        verbose.lds_prefix = NULL;

        verbose_stream = -1;

        free (output_prefix);
        output_prefix = NULL;

        free (output_dir);
        output_dir = NULL;

        if(NULL != temp_str) {
	    free(temp_str);
	    temp_str = NULL;
	    temp_str_len = 0;
	}
        OBJ_DESTRUCT(&verbose);
        OBJ_DESTRUCT(&mutex);
    }

    initialized = false;
}
示例#7
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;
}
/*
 * Main MCA shutdown.
 */
int mca_base_close(void)
{
  extern bool mca_base_opened;
  if (mca_base_opened) {

      /* release the default paths */
      if (NULL != mca_base_system_default_path) {
          free(mca_base_system_default_path);
      }
      if (NULL != mca_base_user_default_path) {
          free(mca_base_user_default_path);
      }
      
    /* Close down the component repository */
    mca_base_component_repository_finalize();

    /* Shut down the dynamic component finder */
    mca_base_component_find_finalize();

    /* Close opal output stream 0 */
    opal_output_close(0);
  }
  mca_base_opened = false;

  /* All done */

  return OPAL_SUCCESS;
}
示例#9
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;
}
示例#10
0
/*
 * Finalize the malloc debug interface
 */
static void opal_malloc_finalize(void)
{
    if (-1 != opal_malloc_output) {
        opal_output_close(opal_malloc_output);
        opal_malloc_output = -1;
        OBJ_DESTRUCT(&malloc_stream);
    }
}
示例#11
0
OPAL_DECLSPEC void opal_common_ucx_mca_deregister(void)
{
    /* unregister only on last deregister */
    opal_common_ucx.registered--;
    assert(opal_common_ucx.registered >= 0);
    if (opal_common_ucx.registered) {
        return;
    }
    opal_output_close(opal_common_ucx.output);
}
示例#12
0
static int mca_pml_ob1_component_close(void)
{
    int rc;

    if (OMPI_SUCCESS != (rc = mca_base_framework_close(&ompi_bml_base_framework))) {
         return rc;
    }
    opal_output_close(mca_pml_ob1_output);

    return OMPI_SUCCESS;
}
示例#13
0
static int mca_pml_yalla_component_close(void)
{
    int rc;

    rc = mca_pml_yalla_close();
    if (rc != 0) {
        return rc;
    }

    opal_output_close(ompi_pml_yalla.output);
    return 0;
}
static void framework_open_output (struct mca_base_framework_t *framework)
{
    if (0 < framework->framework_verbose) {
        if (-1 == framework->framework_output) {
            framework->framework_output = opal_output_open (NULL);
        }
        opal_output_set_verbosity(framework->framework_output,
                                  framework->framework_verbose);
    } else if (-1 != framework->framework_output) {
        opal_output_close (framework->framework_output);
        framework->framework_output = -1;
    }
}
示例#15
0
static int mca_pml_ucx_component_close(void)
{
    int rc;

    rc = mca_pml_ucx_close();
    if (rc != 0) {
        return rc;
    }

    opal_mem_hooks_unregister_release(mca_pml_ucx_mem_release_cb);
    opal_output_close(ompi_pml_ucx.output);
    return 0;
}
示例#16
0
int orte_finalize(void)
{
    int rc;

    --orte_initialized;
    if (0 != orte_initialized) {
        /* check for mismatched calls */
        if (0 > orte_initialized) {
            opal_output(0, "%s MISMATCHED CALLS TO ORTE FINALIZE",
                        ORTE_NAME_PRINT(ORTE_PROC_MY_NAME));
        }
        return ORTE_ERROR;
    }

    /* protect against multiple calls */
    if (opal_atomic_trylock(&orte_finalize_lock)) {
        return ORTE_SUCCESS;
    }
    
    /* flag that we are finalizing */
    orte_finalizing = true;

    if (ORTE_PROC_IS_HNP || ORTE_PROC_IS_DAEMON) {
        /* stop listening for connections - will
         * be ignored if no listeners were registered */
        orte_stop_listening();
    }
    
    /* flush the show_help system */
    orte_show_help_finalize();

    /* call the finalize function for this environment */
    if (ORTE_SUCCESS != (rc = orte_ess.finalize())) {
        return rc;
    }

    /* close the ess itself */
    (void) mca_base_framework_close(&orte_ess_base_framework);

    /* cleanup the process info */
    orte_proc_info_finalize();

    /* Close the general debug stream */
    opal_output_close(orte_debug_output);
    
    /* finalize the opal utilities */
    rc = opal_finalize();

    return rc;
}
示例#17
0
static int mca_pml_csum_component_close(void)
{
    int rc;

    if (OMPI_SUCCESS != (rc = mca_bml_base_close())) {
         return rc;
    }
    if (NULL != mca_pml_csum.allocator_name) {
        free(mca_pml_csum.allocator_name);
    }
    opal_output_close(mca_pml_csum_output);

    return OMPI_SUCCESS;
}
示例#18
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;
}
示例#19
0
int orcm_finalize(void)
{
    --orcm_initialized;
    if (0 != orcm_initialized) {
        /* check for mismatched calls */
        if (0 > orcm_initialized) {
            opal_output(0, "%s MISMATCHED CALLS TO ORCM FINALIZE",
                        ORTE_NAME_PRINT(ORTE_PROC_MY_NAME));
        }
        return ORCM_ERROR;
    }
    /* mark that orte is finalizing so that system will work correctly */
    orte_finalizing = true;

    /* everyone must finalize and close the cfgi framework */
    (void) mca_base_framework_close(&orcm_cfgi_base_framework);

    /* cleanup any globals */
    if (NULL != orcm_clusters) {
        OPAL_LIST_RELEASE(orcm_clusters);
    }
    if (NULL != orcm_schedulers) {
        OPAL_LIST_RELEASE(orcm_schedulers);
    }

    (void)orte_ess.finalize();

    /* close the ess itself */
    (void) mca_base_framework_close(&orte_ess_base_framework);

    /* close the sst itself */
    (void) mca_base_framework_close(&orcm_sst_base_framework);

    /* cleanup the process info */
    orte_proc_info_finalize();

    orte_initialized = false;

    /* Close the general debug stream */
    opal_output_close(orte_debug_output);

    /* finalize the opal utilities */
    opal_finalize();

    return ORCM_SUCCESS;
}
示例#20
0
文件: output.c 项目: bringhurst/ompi
/*
 * Shut down the output stream system
 */
void opal_output_finalize(void)
{
    if (initialized) {
        if (verbose_stream != -1) {
            opal_output_close(verbose_stream);
        }
        free(verbose.lds_prefix);
        verbose_stream = -1;

        free (output_prefix);
        free (output_dir);
        OBJ_DESTRUCT(&verbose);
        OBJ_DESTRUCT(&mutex);
    }
#if defined(__WINDOWS__)
    WSACleanup();
#endif  /* defined(__WINDOWS__) */
}
示例#21
0
int ompi_pubsub_base_close(void)
{
    /* Close the selected component */
    if( NULL != ompi_pubsub.finalize ) {
        ompi_pubsub.finalize();
    }

    /* Close all available modules that are open */
    mca_base_components_close(ompi_pubsub_base_output,
                              &ompi_pubsub_base_components_available,
                              NULL);
    
    /* Close the framework output */
    opal_output_close (ompi_pubsub_base_output);
    ompi_pubsub_base_output = -1;

    return OMPI_SUCCESS;
}
示例#22
0
static int
mca_btl_portals4_component_close(void)
{
    opal_output_verbose(50, opal_btl_base_framework.framework_output, "mca_btl_portals4_component_close\n");

    /* release resources */
    /* close debugging stream */
    opal_output_close(opal_btl_base_framework.framework_output);
    opal_btl_base_framework.framework_output = -1;

    if (NULL != mca_btl_portals4_component.btls)  free(mca_btl_portals4_component.btls);
    if (NULL != mca_btl_portals4_component.eqs_h) free(mca_btl_portals4_component.eqs_h);
    mca_btl_portals4_component.btls = NULL;
    mca_btl_portals4_component.eqs_h = NULL;

    PtlFini();

    return OPAL_SUCCESS;
}
示例#23
0
int orte_iof_base_close(void)
{
    /* finalize the module */
    if (NULL != orte_iof.finalize) {
        orte_iof.finalize();
    }
    
    /* shutdown any remaining opened components */
    if (0 != opal_list_get_size(&orte_iof_base.iof_components_opened)) {
        mca_base_components_close(orte_iof_base.iof_output, 
                              &orte_iof_base.iof_components_opened, NULL);
    }
    OBJ_DESTRUCT(&orte_iof_base.iof_components_opened);

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

    return ORTE_SUCCESS;
}
示例#24
0
int32_t opal_datatype_finalize( void )
{
    /* As the synonyms are just copies of the internal data we should not free them.
     * Anyway they are over the limit of OPAL_DATATYPE_MAX_PREDEFINED so they will never get freed.
     */

    /* As they are statically allocated they cannot be released. But we
     * can call OBJ_DESTRUCT, just to free all internally allocated ressources.
     */
#if defined(VERBOSE)
    if( opal_datatype_dfd != -1 )
        opal_output_close( opal_datatype_dfd );
    opal_datatype_dfd = -1;
#endif /* VERBOSE */

    /* clear all master convertors */
    opal_convertor_destroy_masters();

    return OPAL_SUCCESS;
}
示例#25
0
void pml_v_output_close(void) {
    opal_output_close(mca_pml_v.output);
    mca_pml_v.output = -1;
}