1
1

Refs trac:3130: Per comment 8 on the ticket, this MX patch fixes the cases

where the MX BTL and MTL are stepping on each other regarding the
mpool.  Thanks to Yong Qin for assistance in tracking this down.

This commit was SVN r26698.

The following Trac tickets were found above:
  Ticket 3130 --> https://svn.open-mpi.org/trac/ompi/ticket/3130
Этот коммит содержится в:
Jeff Squyres 2012-06-29 13:52:40 +00:00
родитель b936229b54
Коммит 5d030278e1
3 изменённых файлов: 20 добавлений и 20 удалений

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

@ -196,14 +196,16 @@ static int mca_btl_mx_component_open(void)
static int mca_btl_mx_component_close(void)
{
if( NULL == mca_btl_mx_component.mx_btls )
return OMPI_SUCCESS;
if(OMPI_SUCCESS != ompi_common_mx_finalize()) {
return OMPI_ERROR;
}
if( NULL == mca_btl_mx_component.mx_btls )
return OMPI_SUCCESS;
/* release resources */
OBJ_DESTRUCT(&mca_btl_mx_component.mx_procs);
OBJ_DESTRUCT(&mca_btl_mx_component.mx_send_eager_frags);
OBJ_DESTRUCT(&mca_btl_mx_component.mx_send_user_frags);
OBJ_DESTRUCT(&mca_btl_mx_component.mx_procs);
@ -434,20 +436,6 @@ mca_btl_base_module_t** mca_btl_mx_component_init(int *num_btl_modules,
*num_btl_modules = 0;
/**
* As the MX MTL get initialized before the MX BTL it will call the
* mx_init and the environment variables set by the BTL will be useless.
* Closing the MX will force the next call to mx_init to take these
* environment variables into account.
*/
/*(void)ompi_common_mx_finalize();*/
/* set the MX error handle to always return. This function is the only MX function
* allowed to be called before mx_init in order to make sure that if the MX is not
* up and running the MX library does not exit the application.
*/
mx_set_error_handler(MX_ERRORS_RETURN);
/* First check if MX is available ... */
if( OMPI_SUCCESS != ompi_common_mx_initialize() ) {
ompi_modex_send(&mca_btl_mx_component.super.btl_version, NULL, 0);

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

@ -91,6 +91,7 @@ ompi_common_mx_initialize(void)
ompi_common_mx_available = -1;
if (ompi_common_mx_fake_mpool) {
mca_mpool_base_module_destroy(ompi_common_mx_fake_mpool);
ompi_common_mx_fake_mpool = NULL;
}
opal_output(0,
"Error in mx_init (error %s)\n",
@ -111,12 +112,14 @@ ompi_common_mx_initialize(void)
int
ompi_common_mx_finalize(void)
{
mx_return_t mx_return;
ompi_common_mx_initialize_ref_cnt--;
if( 0 == ompi_common_mx_initialize_ref_cnt ) {
mx_return_t mx_return;
if (ompi_common_mx_fake_mpool)
if (ompi_common_mx_fake_mpool) {
mca_mpool_base_module_destroy(ompi_common_mx_fake_mpool);
ompi_common_mx_fake_mpool = NULL;
}
mx_return = mx_finalize();
if(mx_return != MX_SUCCESS){

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

@ -33,6 +33,7 @@
#define MCA_MTL_MX_QUEUE_LENGTH_MAX 2*1024*1024
static int ompi_mtl_mx_component_open(void);
static int ompi_mtl_mx_component_close(void);
static int ompi_mtl_mx_component_initialized = 0;
static mca_mtl_base_module_t* ompi_mtl_mx_component_init( bool enable_progress_threads,
bool enable_mpi_threads );
@ -106,6 +107,13 @@ ompi_mtl_mx_component_open(void)
static int
ompi_mtl_mx_component_close(void)
{
--ompi_mtl_mx_component_initialized;
if( 0 == ompi_mtl_mx_component_initialized ) {
int ret = ompi_common_mx_finalize();
if(OMPI_SUCCESS != ret) {
return NULL;
}
}
return OMPI_SUCCESS;
}
@ -120,7 +128,8 @@ ompi_mtl_mx_component_init(bool enable_progress_threads,
if(OMPI_SUCCESS != ret) {
return NULL;
}
ompi_mtl_mx_component_initialized++;
ret = ompi_mtl_mx_module_init();
if (OMPI_SUCCESS != ret) {
return NULL;