1
1

More updates for the async error handler for btl's

In order to provide backwards compatability the framework versions are bumped
and the handler registeration function is at the end of the btl struct.
Testing done on sm, openib, and gm.. 

This commit was SVN r11256.
Этот коммит содержится в:
Galen Shipman 2006-08-17 22:02:01 +00:00
родитель f1bfd174da
Коммит e5c594c211
35 изменённых файлов: 79 добавлений и 52 удалений

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

@ -731,10 +731,18 @@ int mca_bml_r2_register_error(
uint32_t i;
int rc;
mca_btl_base_module_t *btl;
uint32_t ver;
for(i = 0; i < mca_bml_r2.num_btl_modules; i++) {
btl = mca_bml_r2.btl_modules[i];
if(btl->btl_register_error) {
/* this wont work for version numbers greater than 256... seems
reasonable.. */
ver = btl->btl_component->btl_version.mca_type_major_version << 16 |
btl->btl_component->btl_version.mca_type_minor_version << 8 |
btl->btl_component->btl_version.mca_type_release_version;
/* is version number greater than or equal to 1.0.1? */
if(ver >= ((1 << 16) | (0 << 8) | 1) &&
NULL != btl->btl_register_error) {
rc = btl->btl_register_error(btl, cbfunc);
if(OMPI_SUCCESS != rc) {
return rc;

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

@ -277,14 +277,14 @@ typedef int (*mca_btl_base_component_progress_fn_t)(void);
* and component open/close/init functions.
*/
struct mca_btl_base_component_1_0_0_t {
struct mca_btl_base_component_1_0_1_t {
mca_base_component_t btl_version;
mca_base_component_data_1_0_0_t btl_data;
mca_btl_base_component_init_fn_t btl_init;
mca_btl_base_component_progress_fn_t btl_progress;
};
typedef struct mca_btl_base_component_1_0_0_t mca_btl_base_component_1_0_0_t;
typedef struct mca_btl_base_component_1_0_0_t mca_btl_base_component_t;
typedef struct mca_btl_base_component_1_0_1_t mca_btl_base_component_1_0_1_t;
typedef struct mca_btl_base_component_1_0_1_t mca_btl_base_component_t;
/*
@ -545,7 +545,6 @@ struct mca_btl_base_module_t {
mca_btl_base_module_add_procs_fn_t btl_add_procs;
mca_btl_base_module_del_procs_fn_t btl_del_procs;
mca_btl_base_module_register_fn_t btl_register;
mca_btl_base_module_register_error_fn_t btl_register_error;
mca_btl_base_module_finalize_fn_t btl_finalize;
mca_btl_base_module_alloc_fn_t btl_alloc;
@ -556,19 +555,22 @@ struct mca_btl_base_module_t {
mca_btl_base_module_put_fn_t btl_put;
mca_btl_base_module_get_fn_t btl_get;
mca_btl_base_module_dump_fn_t btl_dump; /* diagnostics */
/* the mpool associated with this btl (optional) */
mca_mpool_base_module_t* btl_mpool;
/* register a default error handler */
mca_btl_base_module_register_error_fn_t btl_register_error;
};
typedef struct mca_btl_base_module_t mca_btl_base_module_t;
/*
* Macro for use in modules that are of type btl v1.0.0
*/
#define MCA_BTL_BASE_VERSION_1_0_0 \
#define MCA_BTL_BASE_VERSION_1_0_1 \
/* coll v1.0 is chained to MCA v1.0 */ \
MCA_BASE_VERSION_1_0_0, \
/* btl v1.0 */ \
"btl", 1, 0, 0
"btl", 1, 0, 1
#endif /* OMPI_MCA_BTL_H */

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

@ -70,7 +70,6 @@ mca_btl_gm_module_t mca_btl_gm_module = {
mca_btl_gm_add_procs,
mca_btl_gm_del_procs,
mca_btl_gm_register,
mca_btl_gm_register_error_cb,
mca_btl_gm_finalize,
mca_btl_gm_alloc,
mca_btl_gm_free,
@ -85,7 +84,10 @@ mca_btl_gm_module_t mca_btl_gm_module = {
mca_btl_gm_put_nl,
mca_btl_gm_get_nl,
#endif
mca_btl_base_dump
mca_btl_base_dump,
NULL, /* mpool */
mca_btl_gm_register_error_cb
}
};

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

@ -51,7 +51,7 @@ extern "C" {
*/
struct mca_btl_gm_component_t {
mca_btl_base_component_1_0_0_t super; /**< base BTL component */
mca_btl_base_component_1_0_1_t super; /**< base BTL component */
size_t gm_num_btls; /**< number of hcas available to the GM component */
size_t gm_max_btls; /**< maximum number of supported hcas */

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

@ -56,7 +56,7 @@ mca_btl_gm_component_t mca_btl_gm_component = {
/* Indicate that we are a pml v1.0.0 component (which also implies a
specific MCA version) */
MCA_BTL_BASE_VERSION_1_0_0,
MCA_BTL_BASE_VERSION_1_0_1,
"gm", /* MCA component name */
OMPI_MAJOR_VERSION, /* MCA component major version */

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

@ -60,7 +60,9 @@ mca_btl_mvapi_module_t mca_btl_mvapi_module = {
mca_btl_mvapi_send,
mca_btl_mvapi_put,
mca_btl_mvapi_get,
mca_btl_mvapi_dump
mca_btl_mvapi_dump,
NULL, /* mpool */
NULL /* error call back registration */
}
};

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

@ -56,7 +56,7 @@ extern "C" {
*/
struct mca_btl_mvapi_component_t {
mca_btl_base_component_1_0_0_t super; /**< base BTL component */
mca_btl_base_component_1_0_1_t super; /**< base BTL component */
uint32_t ib_max_btls;
/**< maximum number of hcas available to the IB component */

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

@ -61,7 +61,7 @@ mca_btl_mvapi_component_t mca_btl_mvapi_component = {
/* Indicate that we are a pml v1.0.0 component (which also implies a
specific MCA version) */
MCA_BTL_BASE_VERSION_1_0_0,
MCA_BTL_BASE_VERSION_1_0_1,
"mvapi", /* MCA component name */
OMPI_MAJOR_VERSION, /* MCA component major version */

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

@ -47,7 +47,6 @@ mca_btl_mx_module_t mca_btl_mx_module = {
mca_btl_mx_add_procs,
mca_btl_mx_del_procs,
mca_btl_mx_register,
NULL, /* register error */
mca_btl_mx_finalize,
mca_btl_mx_alloc,
mca_btl_mx_free,
@ -55,8 +54,10 @@ mca_btl_mx_module_t mca_btl_mx_module = {
mca_btl_mx_prepare_dst,
mca_btl_mx_send,
NULL, /* put */
NULL, /* get */
mca_btl_base_dump
NULL, /* get */
mca_btl_base_dump,
NULL, /* mpool */
NULL /* register error */
}
};

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

@ -48,7 +48,7 @@ extern "C" {
*/
struct mca_btl_mx_component_t {
mca_btl_base_component_1_0_0_t super; /**< base BTL component */
mca_btl_base_component_1_0_1_t super; /**< base BTL component */
int32_t mx_num_btls;
int32_t mx_max_btls;

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

@ -45,7 +45,7 @@ mca_btl_mx_component_t mca_btl_mx_component = {
/* Indicate that we are a pml v1.0.0 component (which also implies a
specific MCA version) */
MCA_BTL_BASE_VERSION_1_0_0,
MCA_BTL_BASE_VERSION_1_0_1,
"mx", /* MCA component name */
OMPI_MAJOR_VERSION, /* MCA component major version */

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

@ -51,7 +51,6 @@ mca_btl_openib_module_t mca_btl_openib_module = {
mca_btl_openib_add_procs,
mca_btl_openib_del_procs,
mca_btl_openib_register,
mca_btl_openib_register_error_cb,
mca_btl_openib_finalize,
/* we need alloc free, pack */
mca_btl_openib_alloc,
@ -61,7 +60,9 @@ mca_btl_openib_module_t mca_btl_openib_module = {
mca_btl_openib_send,
mca_btl_openib_put,
mca_btl_openib_get,
mca_btl_base_dump
mca_btl_base_dump,
NULL, /* mpool */
mca_btl_openib_register_error_cb /* error call back registration */
}
};

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

@ -53,7 +53,7 @@ extern "C" {
*/
struct mca_btl_openib_component_t {
mca_btl_base_component_1_0_0_t super; /**< base BTL component */
mca_btl_base_component_1_0_1_t super; /**< base BTL component */
int ib_max_btls;
/**< maximum number of hcas available to the IB component */

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

@ -85,7 +85,7 @@ mca_btl_openib_component_t mca_btl_openib_component = {
/* Indicate that we are a pml v1.0.0 component (which also implies a
specific MCA version) */
MCA_BTL_BASE_VERSION_1_0_0,
MCA_BTL_BASE_VERSION_1_0_1,
"openib", /* MCA component name */
OMPI_MAJOR_VERSION, /* MCA component major version */

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

@ -65,6 +65,8 @@ mca_btl_portals_module_t mca_btl_portals_module = {
mca_btl_portals_put,
mca_btl_portals_get,
mca_btl_base_dump
NULL, /* mpool */
NULL /* register error */
},
};

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

@ -38,7 +38,7 @@
*/
struct mca_btl_portals_component_t {
/* base BTL component */
mca_btl_base_component_1_0_0_t super;
mca_btl_base_component_1_0_1_t super;
/* output channel for debugging. Value settings when using
* output_verbose:

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

@ -43,7 +43,7 @@ mca_btl_portals_component_t mca_btl_portals_component = {
/* Indicate that we are a pml v1.0.0 module (which also
implies a specific MCA version) */
MCA_BTL_BASE_VERSION_1_0_0,
MCA_BTL_BASE_VERSION_1_0_1,
"portals", /* MCA module name */
OMPI_MAJOR_VERSION, /* MCA module major version */

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

@ -57,7 +57,6 @@ mca_btl_base_module_t mca_btl_self = {
mca_btl_self_add_procs,
mca_btl_self_del_procs,
mca_btl_self_register,
NULL,
mca_btl_self_finalize,
mca_btl_self_alloc,
mca_btl_self_free,
@ -66,7 +65,9 @@ mca_btl_base_module_t mca_btl_self = {
mca_btl_self_send,
mca_btl_self_rdma, /* put */
mca_btl_self_rdma,
mca_btl_base_dump
mca_btl_base_dump,
NULL, /* mpool */
NULL /* register error cb */
};

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

@ -44,7 +44,7 @@ extern "C" {
* Shared Memory (SELF) BTL module.
*/
struct mca_btl_self_component_t {
mca_btl_base_component_1_0_0_t super; /**< base BTL component */
mca_btl_base_component_1_0_1_t super; /**< base BTL component */
int free_list_num; /**< initial size of free lists */
int free_list_max; /**< maximum size of free lists */
int free_list_inc; /**< number of elements to alloc when growing free lists */

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

@ -52,7 +52,7 @@ mca_btl_self_component_t mca_btl_self_component = {
{
/* Indicate that we are a pml v1.0.0 component (which also implies a
specific MCA version) */
MCA_BTL_BASE_VERSION_1_0_0,
MCA_BTL_BASE_VERSION_1_0_1,
"self", /* MCA component name */
OMPI_MAJOR_VERSION, /* MCA component major version */
OMPI_MINOR_VERSION, /* MCA component minor version */

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

@ -98,7 +98,6 @@ mca_btl_sm_t mca_btl_sm[2] = {
mca_btl_sm_add_procs_same_base_addr,
mca_btl_sm_del_procs,
mca_btl_sm_register,
NULL,
mca_btl_sm_finalize,
mca_btl_sm_alloc,
mca_btl_sm_free,
@ -107,7 +106,9 @@ mca_btl_sm_t mca_btl_sm[2] = {
mca_btl_sm_send,
NULL, /* put */
NULL, /* get */
mca_btl_base_dump
mca_btl_base_dump,
NULL, /* mpool */
NULL /* register error */
}
},
{
@ -125,7 +126,6 @@ mca_btl_sm_t mca_btl_sm[2] = {
mca_btl_sm_add_procs,
mca_btl_sm_del_procs,
mca_btl_sm_register,
NULL,
mca_btl_sm_finalize,
mca_btl_sm_alloc,
mca_btl_sm_free,
@ -134,7 +134,9 @@ mca_btl_sm_t mca_btl_sm[2] = {
mca_btl_sm_send,
NULL, /* put function */
NULL, /* get function */
mca_btl_base_dump
mca_btl_base_dump,
NULL, /* mpool */
NULL /* register error */
}
}
};

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

@ -81,7 +81,7 @@ typedef mca_btl_base_recv_reg_t mca_btl_sm_recv_reg_t;
* Shared Memory (SM) BTL module.
*/
struct mca_btl_sm_component_t {
mca_btl_base_component_1_0_0_t super; /**< base BTL component */
mca_btl_base_component_1_0_1_t super; /**< base BTL component */
int sm_free_list_num; /**< initial size of free lists */
int sm_free_list_max; /**< maximum size of free lists */
int sm_free_list_inc; /**< number of elements to alloc when growing free lists */

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

@ -66,7 +66,7 @@ mca_btl_sm_component_t mca_btl_sm_component = {
{
/* Indicate that we are a pml v1.0.0 component (which also implies a
specific MCA version) */
MCA_BTL_BASE_VERSION_1_0_0,
MCA_BTL_BASE_VERSION_1_0_1,
"sm", /* MCA component name */
OMPI_MAJOR_VERSION, /* MCA component major version */
OMPI_MINOR_VERSION, /* MCA component minor version */

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

@ -48,7 +48,6 @@ mca_btl_tcp_module_t mca_btl_tcp_module = {
mca_btl_tcp_add_procs,
mca_btl_tcp_del_procs,
mca_btl_tcp_register,
NULL, /* register error */
mca_btl_tcp_finalize,
mca_btl_tcp_alloc,
mca_btl_tcp_free,
@ -57,7 +56,9 @@ mca_btl_tcp_module_t mca_btl_tcp_module = {
mca_btl_tcp_send,
mca_btl_tcp_put,
NULL, /* get */
mca_btl_base_dump
mca_btl_base_dump,
NULL, /* mpool */
NULL /* register error */
}
};

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

@ -57,7 +57,7 @@ extern "C" {
*/
struct mca_btl_tcp_component_t {
mca_btl_base_component_1_0_0_t super; /**< base BTL component */
mca_btl_base_component_1_0_1_t super; /**< base BTL component */
uint32_t tcp_num_btls; /**< number of hcas available to the TCP component */
struct mca_btl_tcp_module_t **tcp_btls; /**< array of available BTL modules */
struct mca_btl_tcp_proc_t* tcp_local; /**< local proc struct */

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

@ -75,7 +75,7 @@ mca_btl_tcp_component_t mca_btl_tcp_component = {
/* Indicate that we are a pml v1.0.0 component (which also implies a
specific MCA version) */
MCA_BTL_BASE_VERSION_1_0_0,
MCA_BTL_BASE_VERSION_1_0_1,
"tcp", /* MCA component name */
1, /* MCA component major version */

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

@ -47,7 +47,6 @@ mca_btl_template_module_t mca_btl_template_module = {
mca_btl_template_add_procs,
mca_btl_template_del_procs,
mca_btl_template_register,
NULL,
mca_btl_template_finalize,
mca_btl_template_alloc,
mca_btl_template_free,
@ -55,7 +54,10 @@ mca_btl_template_module_t mca_btl_template_module = {
mca_btl_template_prepare_dst,
mca_btl_template_send,
mca_btl_template_put,
NULL /* get */
NULL, /* get */
NULL, /*dump */
NULL, /* mpool */
NULL /* register error cb */
}
};

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

@ -48,7 +48,7 @@ extern "C" {
*/
struct mca_btl_template_component_t {
mca_btl_base_component_1_0_0_t super; /**< base BTL component */
mca_btl_base_component_1_0_1_t super; /**< base BTL component */
uint32_t template_num_btls;
/**< number of hcas available to the TEMPLATE component */

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

@ -44,7 +44,7 @@ mca_btl_template_component_t mca_btl_template_component = {
/* Indicate that we are a pml v1.0.0 component (which also implies a
specific MCA version) */
MCA_BTL_BASE_VERSION_1_0_0,
MCA_BTL_BASE_VERSION_1_0_1,
"template", /* MCA component name */
OMPI_MAJOR_VERSION, /* MCA component major version */

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

@ -56,7 +56,6 @@ mca_btl_ud_module_t mca_btl_ud_module = {
mca_btl_ud_add_procs,
mca_btl_ud_del_procs,
mca_btl_ud_register,
NULL, /* register error */
mca_btl_ud_finalize,
/* we need alloc free, pack */
mca_btl_ud_alloc,
@ -66,7 +65,10 @@ mca_btl_ud_module_t mca_btl_ud_module = {
mca_btl_ud_send,
NULL, /*mca_btl_ud_put */
NULL, /*mca_btl_ud_get */
mca_btl_ud_dump
mca_btl_ud_dump,
NULL, /* mpool */
NULL /* register error */
}
};

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

@ -56,7 +56,7 @@ extern "C" {
*/
struct mca_btl_ud_component_t {
mca_btl_base_component_1_0_0_t super; /**< base BTL component */
mca_btl_base_component_1_0_1_t super; /**< base BTL component */
uint32_t ib_max_btls;
/**< maximum number of hcas available to the IB component */

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

@ -57,7 +57,7 @@ mca_btl_ud_component_t mca_btl_ud_component = {
/* Indicate that we are a pml v1.0.0 component (which also implies a
specific MCA version) */
MCA_BTL_BASE_VERSION_1_0_0,
MCA_BTL_BASE_VERSION_1_0_1,
"ud", /* MCA component name */
OMPI_MAJOR_VERSION, /* MCA component major version */

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

@ -53,7 +53,6 @@ mca_btl_udapl_module_t mca_btl_udapl_module = {
mca_btl_udapl_add_procs,
mca_btl_udapl_del_procs,
mca_btl_udapl_register,
NULL, /* register error */
mca_btl_udapl_finalize,
mca_btl_udapl_alloc,
mca_btl_udapl_free,
@ -63,6 +62,8 @@ mca_btl_udapl_module_t mca_btl_udapl_module = {
NULL, /* put */
NULL, /* get */
mca_btl_base_dump
NULL, /* mpool */
NULL /* register error cb */
}
};

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

@ -50,7 +50,7 @@ extern "C" {
*/
struct mca_btl_udapl_component_t {
mca_btl_base_component_1_0_0_t super; /**< base BTL component */
mca_btl_base_component_1_0_1_t super; /**< base BTL component */
size_t udapl_num_btls; /**< number of hcas available to the uDAPL component */
size_t udapl_max_btls; /**< maximum number of supported hcas */

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

@ -54,7 +54,7 @@ mca_btl_udapl_component_t mca_btl_udapl_component = {
/* Indicate that we are a pml v1.0.0 component (which also implies a
specific MCA version) */
MCA_BTL_BASE_VERSION_1_0_0,
MCA_BTL_BASE_VERSION_1_0_1,
"udapl", /* MCA component name */
OMPI_MAJOR_VERSION, /* MCA component major version */