1
1

Make sure that the pml v parasite never get loaded when user did not requested FT. This does not break the ability to switch protocol on the fly.

This commit was SVN r16114.
Этот коммит содержится в:
Aurelien Bouteiller 2007-09-12 20:47:17 +00:00
родитель 1e7a791349
Коммит ccb3f75e8f
6 изменённых файлов: 54 добавлений и 37 удалений

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

@ -58,8 +58,6 @@ mca_pml_base_component_1_0_0_t mca_pml_v_component =
static bool pml_v_enable_progress_treads = OMPI_ENABLE_PROGRESS_THREADS;
static bool pml_v_enable_mpi_threads = OMPI_ENABLE_MPI_THREADS;
/*******************************************************************************
* MCA level functions - parasite setup
*/
@ -68,30 +66,40 @@ static int mca_pml_v_component_open(void)
char *output;
int verbose;
int priority;
char *vprotocol_include_list;
int ret;
priority = mca_pml_v_param_register_int("priority", -1);
output = mca_pml_v_param_register_string("output", "stderr");
verbose = mca_pml_v_param_register_int("verbose", 0);
mca_base_param_reg_string_name("vprotocol", NULL,
"Specify a specific vprotocol to use",
false, false, "", &vprotocol_include_list);
pml_v_output_open(output, verbose);
if(-1 != priority)
V_OUTPUT_ERR("pml_v: Overriding priority setting (%d) with -1. The PML V should NEVER be the selected component; even when enabling fault tolerance.", priority);
V_OUTPUT_VERBOSE(500, "loaded");
return mca_vprotocol_base_open();
return mca_vprotocol_base_open(vprotocol_include_list);
}
static int mca_pml_v_component_close(void)
{
int ret;
V_OUTPUT_VERBOSE(500, "component_close: I don't want to be unloaded now.");
/* 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;
/* Do not load anything if no FT protocol is selected */
if(! mca_vprotocol_base_include_list[0])
return mca_pml_v_component_parasite_close();
V_OUTPUT_VERBOSE(500, "component_close: I don't want to be unloaded now.");
ret = mca_base_component_repository_retain_component("pml", "v");
if(OPAL_SUCCESS != ret)
{
@ -144,7 +152,7 @@ static int mca_pml_v_component_parasite_finalize(void)
static int mca_pml_v_component_parasite_close(void)
{
V_OUTPUT_VERBOSE(500, "parasite_close: Ok, host component %s is closing, so I accept to die",
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;

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

@ -20,12 +20,13 @@
extern "C" {
#endif
OMPI_DECLSPEC int mca_vprotocol_base_open(void);
OMPI_DECLSPEC int mca_vprotocol_base_open(char *vprotocol_include_list);
OMPI_DECLSPEC int mca_vprotocol_base_select(bool enable_progress_threads,
bool enable_mpi_threads);
bool enable_mpi_threads);
OMPI_DECLSPEC int mca_vprotocol_base_parasite(void);
OMPI_DECLSPEC int mca_vprotocol_base_close(void);
OMPI_DECLSPEC extern char *mca_vprotocol_base_include_list;
OMPI_DECLSPEC extern opal_list_t mca_vprotocol_base_components_available;
OMPI_DECLSPEC extern mca_vprotocol_base_component_t mca_vprotocol_component;
OMPI_DECLSPEC extern mca_vprotocol_base_module_t mca_vprotocol;

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

@ -13,13 +13,19 @@
#include "ompi/mca/pml/v/vprotocol/base/static-components.h"
opal_list_t mca_vprotocol_base_components_available;
char *mca_vprotocol_base_include_list;
/* Load any vprotocol MCA component and call open function of all those
* components.
*
* Also fill the mca_vprotocol_base_include_list with components that exists
*/
int mca_vprotocol_base_open(void)
int mca_vprotocol_base_open(char *vprotocol_include_list)
{
int ret;
OBJ_CONSTRUCT(&mca_vprotocol_base_components_available, opal_list_t);
mca_vprotocol_base_include_list = vprotocol_include_list;
return mca_base_components_open("vprotocol", 0,
mca_vprotocol_base_static_components,
&mca_vprotocol_base_components_available,

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

@ -22,6 +22,7 @@ typedef struct opened_component_t {
mca_vprotocol_base_component_t *om_component;
} opened_component_t;
/*
* Function for selecting one component from all those that are
* available.
@ -54,37 +55,38 @@ int mca_vprotocol_base_select(bool enable_progress_threads,
component = (mca_vprotocol_base_component_t *) cli->cli_component;
V_OUTPUT_VERBOSE(500, "vprotocol select: initializing %s component %s", component->pmlm_version.mca_type_name, component->pmlm_version.mca_component_name);
if (NULL == component->pmlm_init) {
if(strcmp(component->pmlm_version.mca_component_name,
mca_vprotocol_base_include_list)) {
V_OUTPUT_VERBOSE(500, "This component is not in the include list: skipping %s", component->pmlm_version.mca_component_name);
continue;
}
if(NULL == component->pmlm_init) {
V_OUTPUT_VERBOSE(2, "vprotocol select: no init function; ignoring component %s", component->pmlm_version.mca_component_name);
continue;
}
else
module = component->pmlm_init(&priority, enable_progress_threads, enable_mpi_threads);
if (NULL == module) {
V_OUTPUT_VERBOSE(2, "vprotocol select: init returned failure for component %s", component->pmlm_version.mca_component_name);
continue;
}
V_OUTPUT_VERBOSE(500, "vprotocol select: component %s init returned priority %d", component->pmlm_version.mca_component_name, priority);
if (priority > best_priority)
{
module = component->pmlm_init(&priority, enable_progress_threads, enable_mpi_threads);
if (NULL == module) {
V_OUTPUT_VERBOSE(2, "vprotocol select: init returned failure for component %s", component->pmlm_version.mca_component_name);
}
else
{
V_OUTPUT_VERBOSE(500, "vprotocol select: component %s init returned priority %d", component->pmlm_version.mca_component_name, priority);
if (priority > best_priority)
{
best_priority = priority;
best_component = component;
best_module = module;
}
om = malloc(sizeof(opened_component_t));
if (NULL == om) return OMPI_ERR_OUT_OF_RESOURCE;
OBJ_CONSTRUCT(om, opal_list_item_t);
om->om_component = component;
opal_list_append(&opened, (opal_list_item_t*) om);
}
best_priority = priority;
best_component = component;
best_module = module;
}
om = malloc(sizeof(opened_component_t));
if (NULL == om) return OMPI_ERR_OUT_OF_RESOURCE;
OBJ_CONSTRUCT(om, opal_list_item_t);
om->om_component = component;
opal_list_append(&opened, (opal_list_item_t*) om);
}
/* Finished querying all components. Check for the bozo case. */
if (NULL == best_component) {
V_OUTPUT_VERBOSE(2, "vprotocol select: no protocol has returned a positive priority, user don't want fault tolerance");
V_OUTPUT_VERBOSE(2, "vprotocol select: no protocol has returned a positive priority, fault tolerance is OFF");
}
else
{

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

@ -61,11 +61,11 @@ mca_vprotocol_base_component_1_0_0_t mca_vprotocol_pessimist_component =
*/
static int mca_vprotocol_pessimist_component_open(void)
{
_priority = mca_param_register_int("priority", -1);
_priority = mca_param_register_int("priority", 30);
_free_list_num = mca_param_register_int("free_list_num", 16);
_free_list_max = mca_param_register_int("free_list_max", -1);
_free_list_inc = mca_param_register_int("free_list_inc", 64);
_sender_based_size = mca_param_register_int("sender_based_chunk", 100 * 1024 * 1024);
_sender_based_size = mca_param_register_int("sender_based_chunk", 256 * 1024 * 1024);
_event_buffer_size = mca_param_register_int("event_buffer_size", 1024);
_mmap_file_name = mca_param_register_string("sender_based_file", "vprotocol_pessimist-senderbased");
V_OUTPUT_VERBOSE(500, "vprotocol_pessimist: component_open: read priority %d", _priority);

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

@ -16,7 +16,7 @@
#include "ompi/mca/pml/base/pml_base_request.h"
typedef uint64_t vprotocol_pessimist_clock_t;
#define PRIpclock "ullx"
#define PRIpclock "llx"
typedef enum {
VPROTOCOL_PESSIMIST_EVENT_TYPE_MATCHING,