1
1

Allow the MX BTL to select at runtime if the unexpected handler will

be activated or not.

This commit was SVN r12944.
Этот коммит содержится в:
George Bosilca 2006-12-30 20:57:50 +00:00
родитель 4e157380bf
Коммит 47601e315e
3 изменённых файлов: 20 добавлений и 15 удалений

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

@ -114,8 +114,7 @@ int mca_btl_mx_register( struct mca_btl_base_module_t* btl,
mx_btl->mx_reg[tag].cbfunc = cbfunc;
mx_btl->mx_reg[tag].cbdata = cbdata;
#if !MX_HAVE_UNEXPECTED_HANDLER
if( NULL != cbfunc ) {
if( (NULL != cbfunc) && ( 0 == mca_btl_mx_component.mx_use_unexpected) ) {
mca_btl_mx_frag_t* frag;
mx_return_t mx_return;
mx_segment_t mx_segment;
@ -150,7 +149,6 @@ int mca_btl_mx_register( struct mca_btl_base_module_t* btl,
}
}
}
#endif /* MX_HAVE_UNEXPECTED_HANDLER */
return OMPI_SUCCESS;
}

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

@ -82,6 +82,8 @@ struct mca_btl_mx_component_t {
/**< true if we want to activate the MX support for shared memory */
int32_t mx_support_self;
/**< true if we want to activate the MX support for self communications */
int32_t mx_use_unexpected;
/**< true if Open MPI is allowed to register an unexpected handler with the MX library */
opal_list_t mx_procs; /**< list of mx proc structures */

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

@ -78,7 +78,8 @@ int mca_btl_mx_component_open(void)
/* initialize state */
mca_btl_mx_component.mx_num_btls = 0;
mca_btl_mx_component.mx_btls = NULL;
mca_btl_mx_component.mx_use_unexpected = 0;
/* initialize objects */
OBJ_CONSTRUCT(&mca_btl_mx_component.mx_procs, opal_list_t);
mca_base_param_reg_int( (mca_base_component_t*)&mca_btl_mx_component, "max_btls",
@ -99,7 +100,11 @@ int mca_btl_mx_component_open(void)
mca_base_param_reg_int( (mca_base_component_t*)&mca_btl_mx_component, "shared_mem",
"Enable the MX support for shared memory",
false, false, 0, &mca_btl_mx_component.mx_support_sharedmem );
#if MX_HAVE_UNEXPECTED_HANDLER
mca_base_param_reg_int( (mca_base_component_t*)&mca_btl_mx_component, "register_unexp",
"Enable the MX support for the unexpected request handler (Open MPI matching)",
false, false, 0, &mca_btl_mx_component.mx_use_unexpected );
#endif /* MX_HAVE_UNEXPECTED_HANDLER */
mca_base_param_reg_int( (mca_base_component_t*)&mca_btl_mx_component, "free_list_num",
"Number of allocated default request",
false, false, 8, &mca_btl_mx_component.mx_free_list_num );
@ -307,13 +312,15 @@ static mca_btl_mx_module_t* mca_btl_mx_create(uint64_t addr)
return NULL;
}
#if MX_HAVE_UNEXPECTED_HANDLER
status = mx_register_unexp_handler( mx_btl->mx_endpoint, mca_btl_mx_unexpected_handler,
(void*)mx_btl );
if( MX_SUCCESS != status ) {
opal_output( 0, "mca_btl_mx_init: mx_register_unexp_handler() failed with status %d (%s)\n",
status, mx_strerror(status) );
mca_btl_mx_finalize( &mx_btl->super );
return NULL;
if( mca_btl_mx_component.mx_use_unexpected ) {
status = mx_register_unexp_handler( mx_btl->mx_endpoint, mca_btl_mx_unexpected_handler,
(void*)mx_btl );
if( MX_SUCCESS != status ) {
opal_output( 0, "mca_btl_mx_init: mx_register_unexp_handler() failed with status %d (%s)\n",
status, mx_strerror(status) );
mca_btl_mx_finalize( &mx_btl->super );
return NULL;
}
}
#endif /* MX_HAVE_UNEXPECTED_HANDLER */
return mx_btl;
@ -532,8 +539,7 @@ int mca_btl_mx_component_progress(void)
/* call the completion callback */
frag->base.des_cbfunc( &(mx_btl->super), frag->endpoint,
&(frag->base), OMPI_SUCCESS );
#if !MX_HAVE_UNEXPECTED_HANDLER
} else { /* and this one is a receive */
} else if( !mca_btl_mx_component.mx_use_unexpected ) { /* and this one is a receive */
mca_btl_base_recv_reg_t* reg;
mx_segment_t mx_segment;
@ -555,7 +561,6 @@ int mca_btl_mx_component_progress(void)
opal_output( 0, "Fail to re-register a fragment with the MX NIC ... (%s)\n",
mx_strerror(mx_return) );
}
#endif /* !MX_HAVE_UNEXPECTED_HANDLER */
}
}
num_progressed++;