1
1

Per RFC modify the behavior of mca_base_components_close to NOT close the output. Modify frameworks to always close their output and set to -1.

Reasoning: The old behavior was a little confusing. mca_base_components_open does not open an output stream so it is a little unexpected that mca_base_components_close does. To add to this several frameworks (that don't use mca_base_components_close) failed to close their output in the framework close function and others closed their output a second time. This change is an improvement to the symantics of mca_base_components_open/close as they are now symetric in their functionality.

This commit was SVN r27570.
Этот коммит содержится в:
Nathan Hjelm 2012-11-06 19:09:26 +00:00
родитель f3ce12e71a
Коммит bdedd8b0d3
50 изменённых файлов: 192 добавлений и 35 удалений

Просмотреть файл

@ -39,6 +39,10 @@ int mca_allocator_base_close(void)
mca_base_components_close(mca_allocator_base_output,
&mca_allocator_base_components, NULL);
/* Close the framework output */
opal_output_close (mca_allocator_base_output);
mca_allocator_base_output = -1;
/* All done */
return OMPI_SUCCESS;

Просмотреть файл

@ -27,6 +27,10 @@ int mca_bcol_base_close(void)
mca_base_components_close(mca_bcol_base_output,
&mca_bcol_base_components_opened, NULL);
/* Close the framework output */
opal_output_close (mca_bcol_base_output);
mca_bcol_base_output = -1;
/* All done */
return OMPI_SUCCESS;
}

Просмотреть файл

@ -58,11 +58,13 @@ int mca_btl_base_close(void)
/* 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);
}
mca_base_components_close(mca_btl_base_output,
&mca_btl_base_components_opened, NULL);
/* Close the framework output */
opal_output_close (mca_btl_base_output);
mca_btl_base_output = -1;
/* cleanup */
if(NULL != mca_btl_base_include)

Просмотреть файл

@ -45,6 +45,10 @@ int mca_coll_base_close(void)
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;

Просмотреть файл

@ -36,5 +36,9 @@ int ompi_crcp_base_close(void)
&ompi_crcp_base_components_available,
NULL);
/* Close the framework output */
opal_output_close (ompi_crcp_base_output);
ompi_crcp_base_output = -1;
return OMPI_SUCCESS;
}

Просмотреть файл

@ -36,5 +36,9 @@ int ompi_dpm_base_close(void)
&ompi_dpm_base_components_available,
NULL);
/* Close the framework output */
opal_output_close (ompi_dpm_base_output);
ompi_dpm_base_output = -1;
return OMPI_SUCCESS;
}

Просмотреть файл

@ -47,8 +47,9 @@ int mca_fbtl_base_close(void)
mca_fbtl_base_components_available_valid = false;
}
/* Close the output stream for this framework */
/* Close the framework output */
opal_output_close (mca_fbtl_base_output);
mca_fbtl_base_output = -1;
/* All done */

Просмотреть файл

@ -48,8 +48,9 @@ int mca_fcoll_base_close(void)
mca_fcoll_base_components_available_valid = false;
}
/* Close the output stream for this framework */
/* Close the framework output */
opal_output_close (mca_fcoll_base_output);
mca_fcoll_base_output = -1;
/* All done */

Просмотреть файл

@ -48,8 +48,9 @@ int mca_fs_base_close(void)
mca_fs_base_components_available_valid = false;
}
/* Close the output stream for this framework */
/* Close the framework output */
opal_output_close (mca_fs_base_output);
mca_fs_base_output = -1;
/* All done */

Просмотреть файл

@ -46,6 +46,10 @@ int mca_io_base_close(void)
mca_io_base_components_available_valid = false;
}
/* Close the framework output */
opal_output_close (mca_io_base_output);
mca_io_base_output = -1;
/* All done */
return OMPI_SUCCESS;

Просмотреть файл

@ -64,6 +64,10 @@ int mca_mpool_base_close(void)
mca_base_components_close(mca_mpool_base_output,
&mca_mpool_base_components, NULL);
/* Close the framework output */
opal_output_close (mca_mpool_base_output);
mca_mpool_base_output = -1;
/* deregister memory free callback */
if( (modules_length > 0) && mca_mpool_base_used_mem_hooks &&
0 != (OPAL_MEMORY_FREE_SUPPORT & opal_mem_hooks_support_level())) {

Просмотреть файл

@ -149,6 +149,10 @@ ompi_mtl_base_close(void)
mca_base_components_close(ompi_mtl_base_output,
&ompi_mtl_base_components_opened, NULL);
/* Close the framework output */
opal_output_close (ompi_mtl_base_output);
ompi_mtl_base_output = -1;
/* All done */
return OMPI_SUCCESS;
}

Просмотреть файл

@ -46,6 +46,10 @@ int ompi_op_base_close(void)
ompi_op_base_components_available_valid = false;
}
/* Close the framework output */
opal_output_close (ompi_op_base_output);
ompi_op_base_output = -1;
/* All done */
return OMPI_SUCCESS;

Просмотреть файл

@ -56,5 +56,9 @@ ompi_osc_base_close(void)
OBJ_DESTRUCT(&ompi_osc_base_open_components);
OBJ_DESTRUCT(&ompi_osc_base_avail_components);
/* Close the framework output */
opal_output_close (ompi_osc_base_output);
ompi_osc_base_output = -1;
return OMPI_SUCCESS;
}

Просмотреть файл

@ -75,6 +75,10 @@ int mca_pml_base_close(void)
mca_base_components_close(mca_pml_base_output,
&mca_pml_base_components_available, NULL);
/* Close the framework output */
opal_output_close (mca_pml_base_output);
mca_pml_base_output = -1;
/* All done */
return OMPI_SUCCESS;

Просмотреть файл

@ -102,6 +102,9 @@ static int mca_pml_v_component_close(void)
if (NULL != mca_vprotocol_base_include_list && !mca_vprotocol_base_include_list[0]) {
return mca_pml_v_component_parasite_close();
}
/* Make sure to close out output even if vprotocol isn't in use */
pml_v_output_close ();
/* Mark that we have changed something */
snprintf(mca_pml_base_selected_component.pmlm_version.mca_component_name,

Просмотреть файл

@ -53,4 +53,5 @@ int pml_v_output_open(char *output, int verbosity) {
void pml_v_output_close(void) {
opal_output_close(mca_pml_v.output);
mca_pml_v.output = -1;
}

Просмотреть файл

@ -36,5 +36,9 @@ int ompi_pubsub_base_close(void)
&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;
}

Просмотреть файл

@ -56,6 +56,10 @@ int mca_rcache_base_close(void)
mca_base_components_close(mca_rcache_base_output,
&mca_rcache_base_components, NULL);
/* Close the framework output */
opal_output_close (mca_rcache_base_output);
mca_rcache_base_output = -1;
/* All done */
return OMPI_SUCCESS;

Просмотреть файл

@ -29,6 +29,10 @@ int mca_sbgp_base_close(void)
mca_base_components_close(mca_sbgp_base_output,
&mca_sbgp_base_components_opened, NULL);
/* Close the framework output */
opal_output_close (mca_sbgp_base_output);
mca_sbgp_base_output = -1;
/* All done */
return OMPI_SUCCESS;

Просмотреть файл

@ -48,8 +48,9 @@ int mca_sharedfp_base_close(void)
mca_sharedfp_base_components_available_valid = false;
}
/* Close the output stream for this framework */
/* Close the framework output */
opal_output_close (mca_sharedfp_base_output);
mca_sharedfp_base_output = -1;
/* All done */

Просмотреть файл

@ -43,8 +43,9 @@ int mca_topo_base_close(void)
mca_topo_base_components_available_valid = false;
}
/* Close the output stream for this framework */
/* Close the framework output */
opal_output_close (mca_topo_base_output);
mca_topo_base_output = -1;
/*
* All done

Просмотреть файл

@ -75,15 +75,6 @@ int mca_base_components_close(int output_id,
opal_list_append(components_available, (opal_list_item_t *) skipped_pcli);
}
/*
* If we are not the verbose output stream, and we shouldn't skip
* any components, close the output stream. If there's a skip
* component, this is a 'choose one' framework and we're closing the
* unchoosen components, but will still be using the framework.
*/
if (0 != output_id && NULL == skip) {
opal_output_close (output_id);
}
/* All done */
return OPAL_SUCCESS;
}

Просмотреть файл

@ -35,6 +35,10 @@ int opal_compress_base_close(void)
mca_base_components_close(opal_compress_base_output,
&opal_compress_base_components_available,
NULL);
/* Close the framework output */
opal_output_close (opal_compress_base_output);
opal_compress_base_output = -1;
return OPAL_SUCCESS;
}

Просмотреть файл

@ -39,6 +39,10 @@ int opal_crs_base_close(void)
mca_base_components_close(opal_crs_base_output,
&opal_crs_base_components_available,
NULL);
/* Close the framework output */
opal_output_close (opal_crs_base_output);
opal_crs_base_output = -1;
return OPAL_SUCCESS;
}

Просмотреть файл

@ -31,6 +31,10 @@ int opal_event_base_close(void)
}
OBJ_DESTRUCT(&opal_event_components);
/* Close the framework output */
opal_output_close (opal_event_base_output);
opal_event_base_output = -1;
/* All done */
return OPAL_SUCCESS;
}

Просмотреть файл

@ -40,6 +40,10 @@ int opal_hwloc_base_close(void)
hwloc_bitmap_free(opal_hwloc_my_cpuset);
opal_hwloc_my_cpuset = NULL;
}
/* Close the framework output */
opal_output_close (opal_hwloc_base_output);
opal_hwloc_base_output = -1;
}
#endif

Просмотреть файл

@ -112,6 +112,10 @@ int opal_if_base_close(void)
}
OBJ_DESTRUCT(&opal_if_components);
/* Close the framework output */
opal_output_close (opal_if_base_output);
opal_if_base_output = -1;
return OPAL_SUCCESS;
}

Просмотреть файл

@ -19,7 +19,6 @@
#include "opal/mca/installdirs/base/base.h"
#include "opal/mca/installdirs/base/static-components.h"
int opal_installdirs_base_output;
opal_install_dirs_t opal_install_dirs;
opal_list_t opal_installdirs_components;

Просмотреть файл

@ -20,9 +20,14 @@ int opal_memchecker_base_close(void)
{
/* Close all components that are still open (this should only
happen during laminfo). */
mca_base_components_close(0, &opal_memchecker_base_components_opened, NULL);
mca_base_components_close(opal_memchecker_base_output,
&opal_memchecker_base_components_opened, NULL);
OBJ_DESTRUCT(&opal_memchecker_base_components_opened);
/* Close the framework output */
opal_output_close (opal_memchecker_base_output);
opal_memchecker_base_output = -1;
/* All done */
return OPAL_SUCCESS;
}

Просмотреть файл

@ -33,6 +33,10 @@ int opal_pstat_base_close(void)
mca_base_components_close(opal_pstat_base_output,
&opal_pstat_base_components_opened, NULL);
OBJ_DESTRUCT(&opal_pstat_base_components_opened);
/* Close the framework output */
opal_output_close (opal_pstat_base_output);
opal_pstat_base_output = -1;
/* All done */

Просмотреть файл

@ -48,6 +48,10 @@ opal_shmem_base_close(void)
opal_shmem_base_components_opened_valid = false;
}
/* Close the framework output */
opal_output_close (opal_shmem_base_output);
opal_shmem_base_output = -1;
/* all done */
return OPAL_SUCCESS;
}

Просмотреть файл

@ -33,7 +33,11 @@ orte_db_base_close(void)
&orte_db_base.available_components, NULL);
OBJ_DESTRUCT(&orte_db_base.available_components);
opal_output_close(orte_db_base.output);
/* Close the framework output */
opal_output_close (orte_db_base.output);
orte_db_base.output = -1;
return ORTE_SUCCESS;
}

Просмотреть файл

@ -38,6 +38,10 @@ int orte_dfs_base_close(void)
&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;

Просмотреть файл

@ -51,6 +51,10 @@ int orte_errmgr_base_close(void)
&orte_errmgr_base_components_available,
NULL);
/* Close the framework output */
opal_output_close (orte_errmgr_base.output);
orte_errmgr_base.output = -1;
orte_errmgr_base.initialized = false;
/* always leave a default set of fn pointers */

Просмотреть файл

@ -42,6 +42,10 @@ orte_ess_base_close(void)
NULL);
OBJ_DESTRUCT(&orte_ess_base_components_available);
/* Close the framework output */
opal_output_close (orte_ess_base_output);
orte_ess_base_output = -1;
return ORTE_SUCCESS;
}

Просмотреть файл

@ -38,6 +38,10 @@ int orte_filem_base_close(void)
mca_base_components_close(orte_filem_base_output,
&orte_filem_base_components_available,
NULL);
/* Close the framework output */
opal_output_close (orte_filem_base_output);
orte_filem_base_output = -1;
return ORTE_SUCCESS;
}

Просмотреть файл

@ -48,6 +48,10 @@ int orte_grpcomm_base_close(void)
}
#endif
/* Close the framework output */
opal_output_close (orte_grpcomm_base.output);
orte_grpcomm_base.output = -1;
/* All done */
return ORTE_SUCCESS;

Просмотреть файл

@ -42,6 +42,10 @@ int orte_iof_base_close(void)
}
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;
}

Просмотреть файл

@ -53,16 +53,15 @@ int orte_odls_base_close(void)
}
OBJ_RELEASE(orte_local_children);
/* if no components are available, then punt */
if (!orte_odls_base.components_available) {
return ORTE_SUCCESS;
}
/* Close all available components (only one in this case) */
mca_base_components_close(orte_odls_globals.output,
&orte_odls_base.available_components, NULL);
/* Close the framework output */
opal_output_close (orte_odls_globals.output);
orte_odls_globals.output = -1;
/* All done */
return ORTE_SUCCESS;

Просмотреть файл

@ -58,6 +58,10 @@ int mca_oob_base_close(void)
OBJ_DESTRUCT(&mca_oob_base_modules);
OBJ_DESTRUCT(&mca_oob_base_components);
/* Close the framework output */
opal_output_close (mca_oob_base_output);
mca_oob_base_output = -1;
/* All done */
orte_oob_base_already_opened = false;

Просмотреть файл

@ -47,6 +47,10 @@ int orte_plm_base_finalize(void)
return rc;
}
}
/* Close the framework output */
opal_output_close (orte_plm_globals.output);
orte_plm_globals.output = -1;
return ORTE_SUCCESS;
}

Просмотреть файл

@ -40,11 +40,15 @@ int orte_ras_base_finalize(void)
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) */
/* 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);
/* Close the framework output */
opal_output_close (orte_ras_base.ras_output);
orte_ras_base.ras_output = -1;
mca_base_components_close(orte_ras_base.ras_output,
&orte_ras_base.ras_opened, NULL);
return ORTE_SUCCESS;
}

Просмотреть файл

@ -41,5 +41,9 @@ int orte_rmaps_base_close(void)
mca_base_components_close(orte_rmaps_base.rmaps_output,
&orte_rmaps_base.available_components, NULL);
/* Close the framework output */
opal_output_close (orte_rmaps_base.rmaps_output);
orte_rmaps_base.rmaps_output = -1;
return ORTE_SUCCESS;
}

Просмотреть файл

@ -254,6 +254,10 @@ orte_rml_base_close(void)
OBJ_DESTRUCT(&orte_rml_base_components);
OBJ_DESTRUCT(&orte_rml_base_subscriptions);
/* Close the framework output */
opal_output_close (orte_rml_base_output);
orte_rml_base_output = -1;
return ORTE_SUCCESS;
}

Просмотреть файл

@ -202,6 +202,10 @@ orte_routed_base_close(void)
OBJ_DESTRUCT(&orte_routed_base_components);
OBJ_DESTRUCT(&orte_routed_base_lock);
OBJ_DESTRUCT(&orte_routed_base_cond);
/* Close the framework output */
opal_output_close (orte_routed_base_output);
orte_routed_base_output = -1;
opened = false;
selected = false;

Просмотреть файл

@ -39,7 +39,11 @@ int orte_sensor_base_close(void)
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;

Просмотреть файл

@ -44,6 +44,10 @@ int orte_snapc_base_close(void)
mca_base_components_close(orte_snapc_base_output,
&orte_snapc_base_components_available,
NULL);
/* Close the framework output */
opal_output_close (orte_snapc_base_output);
orte_snapc_base_output = -1;
return ORTE_SUCCESS;
}

Просмотреть файл

@ -30,6 +30,10 @@ int orte_sstore_base_close(void)
mca_base_components_close(orte_sstore_base_output,
&orte_sstore_base_components_available,
NULL);
/* Close the framework output */
opal_output_close (orte_sstore_base_output);
orte_sstore_base_output = -1;
return ORTE_SUCCESS;
}

Просмотреть файл

@ -38,6 +38,10 @@ int orte_state_base_close(void)
&orte_state_base_components_available,
NULL);
/* Close the framework output */
opal_output_close (orte_state_base_output);
orte_state_base_output = -1;
orte_state_base.initialized = false;
return ORTE_SUCCESS;