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_base_components_close(mca_allocator_base_output,
&mca_allocator_base_components, NULL); &mca_allocator_base_components, NULL);
/* Close the framework output */
opal_output_close (mca_allocator_base_output);
mca_allocator_base_output = -1;
/* All done */ /* All done */
return OMPI_SUCCESS; return OMPI_SUCCESS;

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

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

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

@ -59,10 +59,12 @@ int mca_btl_base_close(void)
/* Close all remaining opened components (may be one if this is a /* Close all remaining opened components (may be one if this is a
OMPI RTE program, or [possibly] multiple if this is ompi_info) */ 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_base_components_close(mca_btl_base_output, &mca_btl_base_components_opened, NULL);
&mca_btl_base_components_opened, NULL);
} /* Close the framework output */
opal_output_close (mca_btl_base_output);
mca_btl_base_output = -1;
/* cleanup */ /* cleanup */
if(NULL != mca_btl_base_include) if(NULL != mca_btl_base_include)

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

@ -45,6 +45,10 @@ int mca_coll_base_close(void)
mca_coll_base_components_available_valid = false; 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 */ /* All done */
return OMPI_SUCCESS; return OMPI_SUCCESS;

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

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

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

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

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

@ -47,8 +47,9 @@ int mca_fbtl_base_close(void)
mca_fbtl_base_components_available_valid = false; 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); opal_output_close (mca_fbtl_base_output);
mca_fbtl_base_output = -1;
/* All done */ /* All done */

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

@ -48,8 +48,9 @@ int mca_fcoll_base_close(void)
mca_fcoll_base_components_available_valid = false; 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); opal_output_close (mca_fcoll_base_output);
mca_fcoll_base_output = -1;
/* All done */ /* All done */

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

@ -48,8 +48,9 @@ int mca_fs_base_close(void)
mca_fs_base_components_available_valid = false; 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); opal_output_close (mca_fs_base_output);
mca_fs_base_output = -1;
/* All done */ /* All done */

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

@ -46,6 +46,10 @@ int mca_io_base_close(void)
mca_io_base_components_available_valid = false; 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 */ /* All done */
return OMPI_SUCCESS; return OMPI_SUCCESS;

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

@ -64,6 +64,10 @@ int mca_mpool_base_close(void)
mca_base_components_close(mca_mpool_base_output, mca_base_components_close(mca_mpool_base_output,
&mca_mpool_base_components, NULL); &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 */ /* deregister memory free callback */
if( (modules_length > 0) && mca_mpool_base_used_mem_hooks && if( (modules_length > 0) && mca_mpool_base_used_mem_hooks &&
0 != (OPAL_MEMORY_FREE_SUPPORT & opal_mem_hooks_support_level())) { 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, mca_base_components_close(ompi_mtl_base_output,
&ompi_mtl_base_components_opened, NULL); &ompi_mtl_base_components_opened, NULL);
/* Close the framework output */
opal_output_close (ompi_mtl_base_output);
ompi_mtl_base_output = -1;
/* All done */ /* All done */
return OMPI_SUCCESS; return OMPI_SUCCESS;
} }

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

@ -46,6 +46,10 @@ int ompi_op_base_close(void)
ompi_op_base_components_available_valid = false; 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 */ /* All done */
return OMPI_SUCCESS; return OMPI_SUCCESS;

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

@ -56,5 +56,9 @@ ompi_osc_base_close(void)
OBJ_DESTRUCT(&ompi_osc_base_open_components); OBJ_DESTRUCT(&ompi_osc_base_open_components);
OBJ_DESTRUCT(&ompi_osc_base_avail_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; return OMPI_SUCCESS;
} }

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

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

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

@ -103,6 +103,9 @@ static int mca_pml_v_component_close(void)
return mca_pml_v_component_parasite_close(); 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 */ /* Mark that we have changed something */
snprintf(mca_pml_base_selected_component.pmlm_version.mca_component_name, snprintf(mca_pml_base_selected_component.pmlm_version.mca_component_name,
MCA_BASE_MAX_TYPE_NAME_LEN, "%s]v%s", MCA_BASE_MAX_TYPE_NAME_LEN, "%s]v%s",

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

@ -53,4 +53,5 @@ int pml_v_output_open(char *output, int verbosity) {
void pml_v_output_close(void) { void pml_v_output_close(void) {
opal_output_close(mca_pml_v.output); 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, &ompi_pubsub_base_components_available,
NULL); NULL);
/* Close the framework output */
opal_output_close (ompi_pubsub_base_output);
ompi_pubsub_base_output = -1;
return OMPI_SUCCESS; return OMPI_SUCCESS;
} }

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

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

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

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

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

@ -48,8 +48,9 @@ int mca_sharedfp_base_close(void)
mca_sharedfp_base_components_available_valid = false; 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); opal_output_close (mca_sharedfp_base_output);
mca_sharedfp_base_output = -1;
/* All done */ /* All done */

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

@ -43,8 +43,9 @@ int mca_topo_base_close(void)
mca_topo_base_components_available_valid = false; 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); opal_output_close (mca_topo_base_output);
mca_topo_base_output = -1;
/* /*
* All done * 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); 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 */ /* All done */
return OPAL_SUCCESS; return OPAL_SUCCESS;
} }

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

@ -36,5 +36,9 @@ int opal_compress_base_close(void)
&opal_compress_base_components_available, &opal_compress_base_components_available,
NULL); NULL);
/* Close the framework output */
opal_output_close (opal_compress_base_output);
opal_compress_base_output = -1;
return OPAL_SUCCESS; return OPAL_SUCCESS;
} }

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

@ -40,5 +40,9 @@ int opal_crs_base_close(void)
&opal_crs_base_components_available, &opal_crs_base_components_available,
NULL); NULL);
/* Close the framework output */
opal_output_close (opal_crs_base_output);
opal_crs_base_output = -1;
return OPAL_SUCCESS; return OPAL_SUCCESS;
} }

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

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

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

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

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

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

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

@ -19,7 +19,6 @@
#include "opal/mca/installdirs/base/base.h" #include "opal/mca/installdirs/base/base.h"
#include "opal/mca/installdirs/base/static-components.h" #include "opal/mca/installdirs/base/static-components.h"
int opal_installdirs_base_output;
opal_install_dirs_t opal_install_dirs; opal_install_dirs_t opal_install_dirs;
opal_list_t opal_installdirs_components; 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 /* Close all components that are still open (this should only
happen during laminfo). */ 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); 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 */ /* All done */
return OPAL_SUCCESS; return OPAL_SUCCESS;
} }

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

@ -34,6 +34,10 @@ int opal_pstat_base_close(void)
&opal_pstat_base_components_opened, NULL); &opal_pstat_base_components_opened, NULL);
OBJ_DESTRUCT(&opal_pstat_base_components_opened); 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 */ /* All done */
return OPAL_SUCCESS; return OPAL_SUCCESS;

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

@ -48,6 +48,10 @@ opal_shmem_base_close(void)
opal_shmem_base_components_opened_valid = false; 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 */ /* all done */
return OPAL_SUCCESS; return OPAL_SUCCESS;
} }

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

@ -33,7 +33,11 @@ orte_db_base_close(void)
&orte_db_base.available_components, NULL); &orte_db_base.available_components, NULL);
OBJ_DESTRUCT(&orte_db_base.available_components); 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; return ORTE_SUCCESS;
} }

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

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

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

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

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

@ -42,6 +42,10 @@ orte_ess_base_close(void)
NULL); NULL);
OBJ_DESTRUCT(&orte_ess_base_components_available); 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; return ORTE_SUCCESS;
} }

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

@ -39,5 +39,9 @@ int orte_filem_base_close(void)
&orte_filem_base_components_available, &orte_filem_base_components_available,
NULL); NULL);
/* Close the framework output */
opal_output_close (orte_filem_base_output);
orte_filem_base_output = -1;
return ORTE_SUCCESS; return ORTE_SUCCESS;
} }

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

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

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

@ -42,6 +42,10 @@ int orte_iof_base_close(void)
} }
OBJ_DESTRUCT(&orte_iof_base.iof_components_opened); 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; return ORTE_SUCCESS;
} }

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

@ -53,16 +53,15 @@ int orte_odls_base_close(void)
} }
OBJ_RELEASE(orte_local_children); 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) */ /* Close all available components (only one in this case) */
mca_base_components_close(orte_odls_globals.output, mca_base_components_close(orte_odls_globals.output,
&orte_odls_base.available_components, NULL); &orte_odls_base.available_components, NULL);
/* Close the framework output */
opal_output_close (orte_odls_globals.output);
orte_odls_globals.output = -1;
/* All done */ /* All done */
return ORTE_SUCCESS; return ORTE_SUCCESS;

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

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

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

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

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

@ -40,11 +40,15 @@ int orte_ras_base_finalize(void)
int orte_ras_base_close(void) int orte_ras_base_close(void)
{ {
/* Close all remaining available components (may be one if this is a /* Close all remaining available components (may be one if this is a
Open RTE program, or [possibly] multiple if this is ompi_info) */ Open RTE program, or [possibly] multiple if this is ompi_info) */
mca_base_components_close(orte_ras_base.ras_output, mca_base_components_close(orte_ras_base.ras_output,
&orte_ras_base.ras_opened, NULL); &orte_ras_base.ras_opened, NULL);
/* Close the framework output */
opal_output_close (orte_ras_base.ras_output);
orte_ras_base.ras_output = -1;
return ORTE_SUCCESS; return ORTE_SUCCESS;
} }

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

@ -41,5 +41,9 @@ int orte_rmaps_base_close(void)
mca_base_components_close(orte_rmaps_base.rmaps_output, mca_base_components_close(orte_rmaps_base.rmaps_output,
&orte_rmaps_base.available_components, NULL); &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; return ORTE_SUCCESS;
} }

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

@ -254,6 +254,10 @@ orte_rml_base_close(void)
OBJ_DESTRUCT(&orte_rml_base_components); OBJ_DESTRUCT(&orte_rml_base_components);
OBJ_DESTRUCT(&orte_rml_base_subscriptions); 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; return ORTE_SUCCESS;
} }

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

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

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

@ -40,6 +40,10 @@ int orte_sensor_base_close(void)
mca_base_components_close(orte_sensor_base.output, mca_base_components_close(orte_sensor_base.output,
&mca_sensor_base_components_available, NULL); &mca_sensor_base_components_available, NULL);
/* Close the framework output */
opal_output_close (orte_sensor_base.output);
orte_sensor_base.output = -1;
/* All done */ /* All done */
return ORTE_SUCCESS; return ORTE_SUCCESS;

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

@ -45,5 +45,9 @@ int orte_snapc_base_close(void)
&orte_snapc_base_components_available, &orte_snapc_base_components_available,
NULL); NULL);
/* Close the framework output */
opal_output_close (orte_snapc_base_output);
orte_snapc_base_output = -1;
return ORTE_SUCCESS; return ORTE_SUCCESS;
} }

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

@ -31,5 +31,9 @@ int orte_sstore_base_close(void)
&orte_sstore_base_components_available, &orte_sstore_base_components_available,
NULL); NULL);
/* Close the framework output */
opal_output_close (orte_sstore_base_output);
orte_sstore_base_output = -1;
return ORTE_SUCCESS; return ORTE_SUCCESS;
} }

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

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