1
1

Remove all unnecessary whitespaces and make sure we close the module

correctly.
Этот коммит содержится в:
George Bosilca 2015-03-05 13:00:13 -05:00
родитель 75479c0f17
Коммит 420ae98dfe

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

@ -1,5 +1,5 @@
/*
* Copyright (c) 2004-2007 The Trustees of the University of Tennessee.
* Copyright (c) 2004-2015 The Trustees of the University of Tennessee.
* All rights reserved.
* Copyright (c) 2010 Cisco Systems, Inc. All rights reserved.
* $COPYRIGHT$
@ -8,7 +8,7 @@
*
* $HEADER$
*/
#include "ompi_config.h"
#include "opal/mca/base/base.h"
@ -31,7 +31,7 @@ static int mca_pml_v_component_parasite_finalize(void);
static int mca_pml_v_enable(bool enable);
mca_pml_base_component_2_0_0_t mca_pml_v_component =
mca_pml_base_component_2_0_0_t mca_pml_v_component =
{
/* First, the mca_base_component_t struct containing meta
* information about the component itself */
@ -85,7 +85,7 @@ static int mca_pml_v_component_register(void)
ompi_pml_vprotocol_include_list = "";
/* This parameter needs to go away if pml/v is unloaded so register it with a pml/v name */
var_id = mca_base_component_var_register(&mca_pml_v_component.pmlm_version,
"vprotocol", "Specify a specific vprotocol to use",
"vprotocol", "Specify a specific vprotocol to use",
MCA_BASE_VAR_TYPE_STRING, NULL, 0, 0,
OPAL_INFO_LVL_9, MCA_BASE_VAR_SCOPE_READONLY,
&ompi_pml_vprotocol_include_list);
@ -97,21 +97,26 @@ static int mca_pml_v_component_register(void)
static int mca_pml_v_component_open(void)
{
pml_v_output_open(ompi_pml_v_output, ompi_pml_v_verbose);
V_OUTPUT_VERBOSE(500, "loaded");
mca_vprotocol_base_set_include_list(ompi_pml_vprotocol_include_list);
return mca_base_framework_open(&ompi_vprotocol_base_framework, 0);
}
static int mca_pml_v_component_close(void)
{
if( NULL == mca_vprotocol_base_include_list ) {
/* Nothing to do, let's just close and move away */
return OMPI_SUCCESS;
}
/* Save original PML before making any changes */
mca_pml_v.host_pml_component = mca_pml_base_selected_component;
mca_pml_v.host_pml = mca_pml;
mca_pml_v.host_request_fns = ompi_request_functions;
/* Do not load anything if no FT protocol is selected */
if (NULL != mca_vprotocol_base_include_list && !mca_vprotocol_base_include_list[0]) {
return mca_pml_v_component_parasite_close();
@ -119,20 +124,20 @@ static int mca_pml_v_component_close(void)
/* 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,
MCA_BASE_MAX_TYPE_NAME_LEN, "%s]v%s",
/* Mark that we have changed something */
snprintf(mca_pml_base_selected_component.pmlm_version.mca_component_name,
MCA_BASE_MAX_TYPE_NAME_LEN, "%s]v%s",
mca_pml_v.host_pml_component.pmlm_version.mca_component_name,
mca_vprotocol_component.pmlm_version.mca_component_name);
/* Replace finalize */
mca_pml_base_selected_component.pmlm_finalize =
mca_pml_v_component_parasite_finalize;
mca_pml_base_selected_component.pmlm_finalize =
mca_pml_v_component_parasite_finalize;
/* Make sure we get initialized if some Vprotocol is enabled */
mca_pml.pml_enable = mca_pml_v_enable;
return OMPI_SUCCESS;
}
@ -142,30 +147,30 @@ static int mca_pml_v_component_close(void)
static int mca_pml_v_component_parasite_finalize(void)
{
mca_base_component_list_item_t *cli = NULL;
V_OUTPUT_VERBOSE(500, "parasite_finalize");
/* Make sure we'll get closed again with the true close function */
mca_pml_v_component.pmlm_version.mca_close_component =
mca_pml_v_component.pmlm_version.mca_close_component =
mca_pml_v_component_parasite_close;
cli = OBJ_NEW(mca_base_component_list_item_t);
cli->cli_component = (mca_base_component_t *) &mca_pml_v_component;
opal_list_prepend(&ompi_pml_base_framework.framework_components,
(opal_list_item_t *) cli);
/* finalize vprotocol component */
if(mca_vprotocol_base_selected())
mca_vprotocol_component.pmlm_finalize();
if(mca_pml_v.host_pml_component.pmlm_finalize != NULL)
return mca_pml_v.host_pml_component.pmlm_finalize();
else
else
return OMPI_SUCCESS;
}
static int mca_pml_v_component_parasite_close(void)
{
V_OUTPUT_VERBOSE(500, "parasite_close: Ok, I accept to die and let %s component finish",
V_OUTPUT_VERBOSE(500, "parasite_close: Ok, I accept to die and let %s component finish",
mca_pml_v.host_pml_component.pmlm_version.mca_component_name);
mca_pml_base_selected_component = mca_pml_v.host_pml_component;
@ -189,9 +194,9 @@ static mca_pml_base_module_t *mca_pml_v_component_init(int *priority,
pml_v_enable_progress_treads = enable_progress_threads;
pml_v_enable_mpi_thread_multiple = enable_mpi_thread_multiple;
/* I NEVER want to be the selected PML, so I report less than possible
* priority and a NULL module
/* I NEVER want to be the selected PML, so I report less than possible
* priority and a NULL module
*/
*priority = -1;
return NULL;
@ -200,7 +205,7 @@ static mca_pml_base_module_t *mca_pml_v_component_init(int *priority,
static int mca_pml_v_component_finalize(void)
{
V_OUTPUT_VERBOSE(1, "finalize: I'm not supposed to be here until BTL loading stuff gets fixed!? That's strange...");
/* Nothing to do here. We are not sure we need to be unloaded or not at
/* Nothing to do here. We are not sure we need to be unloaded or not at
* this stage
*/
return OMPI_SUCCESS;
@ -210,30 +215,30 @@ static int mca_pml_v_component_finalize(void)
/*******************************************************************************
* Enable the PML V (and initialize the Vprotocol)
*/
static int mca_pml_v_enable(bool enable)
static int mca_pml_v_enable(bool enable)
{
int ret;
/* Enable the real PML (no threading issues there as threads are started
/* Enable the real PML (no threading issues there as threads are started
* later)
*/
*/
ret = mca_pml_v.host_pml.pml_enable(enable);
if(OMPI_SUCCESS != ret) return ret;
if(enable) {
/* Check if a protocol have been selected during init */
if(! mca_vprotocol_base_selected())
mca_vprotocol_base_select(pml_v_enable_progress_treads,
mca_vprotocol_base_select(pml_v_enable_progress_treads,
pml_v_enable_mpi_thread_multiple);
/* Check if we succeeded selecting a protocol */
if(mca_vprotocol_base_selected()) {
V_OUTPUT_VERBOSE(1, "I don't want to die: I will parasite %s host component %s with %s %s",
V_OUTPUT_VERBOSE(1, "I don't want to die: I will parasite %s host component %s with %s %s",
mca_pml_base_selected_component.pmlm_version.mca_type_name,
mca_pml_base_selected_component.pmlm_version.mca_component_name,
mca_vprotocol_component.pmlm_version.mca_type_name,
mca_vprotocol_component.pmlm_version.mca_component_name);
ret = mca_vprotocol_base_parasite();
if(OMPI_SUCCESS != ret) return ret;
if(mca_vprotocol.enable)