1
1

Patch based on Takahiro Kawashima fixing the issues with some

of the Fortran datatypes. This patch prevent the copy of the
datatype description from the OPAL to the OMPI layer in order
to decrease the memory requirements.

This commit was SVN r28553.
Этот коммит содержится в:
George Bosilca 2013-05-22 18:35:21 +00:00
родитель 6d173af329
Коммит a9aae9c538
2 изменённых файлов: 2 добавлений и 55 удалений

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

@ -361,7 +361,6 @@
#endif
OMPI_DECLSPEC extern union dt_elem_desc ompi_datatype_predefined_elem_desc[2 * OMPI_DATATYPE_MPI_MAX_PREDEFINED];
extern const ompi_datatype_t* ompi_datatype_basicDatatypes[OMPI_DATATYPE_MPI_MAX_PREDEFINED];
/* There 3 types of predefined data types.
@ -418,20 +417,6 @@ extern const ompi_datatype_t* ompi_datatype_basicDatatypes[OMPI_DATATYPE_MPI_MAX
#if OMPI_BUILD_FORTRAN_BINDINGS
/*
* For Fortran, we need to pass information, such as ALIGNMENT and SIZE as well
* Therefore, for initialization at compile-time, pass this data as well.
*
* However, there is no underlying OPAL-TYPE, therefore we just pass NAME, SIZE,
* ALIGN and the FLAGS. Additionally, ONLY for Fortran we need the
* ompi_datatype_predefined_elem_desc for the additional types.
*/
#define OMPI_DATATYPE_INIT_DESC_PREDEFINED(TYPE, SIZE) \
{ \
1 /*length*/, 1 /*used*/, \
&(ompi_datatype_predefined_elem_desc[2 * OPAL_DATATYPE_ ## TYPE ## SIZE]) /*desc*/ \
}
/*
* Fortran types are based on the underlying OPAL types: They share the ID -- however,
* the alignment is overwritten.
@ -449,8 +434,8 @@ extern const ompi_datatype_t* ompi_datatype_basicDatatypes[OMPI_DATATYPE_MPI_MAX
(ALIGN) /*align*/, \
1 /*nbElems*/, \
OPAL_DATATYPE_INIT_NAME(TYPE ## SIZE) /*name*/, \
OMPI_DATATYPE_INIT_DESC_PREDEFINED(TYPE, SIZE) /*desc*/, \
OMPI_DATATYPE_INIT_DESC_PREDEFINED(TYPE, SIZE) /*opt_desc*/, \
OPAL_DATATYPE_INIT_DESC_PREDEFINED(TYPE ## SIZE) /*desc*/, \
OPAL_DATATYPE_INIT_DESC_PREDEFINED(TYPE ## SIZE) /*opt_desc*/, \
OPAL_DATATYPE_INIT_BTYPES_ARRAY_ ## TYPE ## SIZE /*btypes*/ \
}

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

@ -35,7 +35,6 @@
/* by default the debuging is turned off */
int ompi_datatype_dfd = -1;
OMPI_DECLSPEC union dt_elem_desc ompi_datatype_predefined_elem_desc[2 * OMPI_DATATYPE_MPI_MAX_PREDEFINED];
/**
* This is the number of predefined datatypes. It is different than the MAX_PREDEFINED
@ -425,43 +424,6 @@ int32_t ompi_datatype_init( void )
{
int32_t i;
for( i = 0; i < OMPI_DATATYPE_MPI_MAX_PREDEFINED; i++ ) {
ompi_datatype_t* datatype = (ompi_datatype_t*)ompi_datatype_basicDatatypes[i];
dt_elem_desc_t* pDesc;
if( 0 == datatype->super.size ) continue;
/**
* Most of the OMPI datatypes have been initialized with the basic desc of the
* OPAL datatypes. Thus don't modify the desc, instead rebase the desc back into
* the OMPI predefined_elem_desc and update the fields there.
*/
pDesc = &ompi_datatype_predefined_elem_desc[2 * i];
if( pDesc != datatype->super.desc.desc ) {
memcpy(pDesc, datatype->super.desc.desc, 2 * sizeof(dt_elem_desc_t));
datatype->super.desc.desc = pDesc;
} else {
datatype->super.desc.desc[0].elem.common.flags = OPAL_DATATYPE_FLAG_PREDEFINED |
OPAL_DATATYPE_FLAG_DATA |
OPAL_DATATYPE_FLAG_CONTIGUOUS |
OPAL_DATATYPE_FLAG_NO_GAPS;
datatype->super.desc.desc[0].elem.common.type = i;
datatype->super.desc.desc[0].elem.count = 1;
datatype->super.desc.desc[0].elem.disp = 0;
datatype->super.desc.desc[0].elem.extent = datatype->super.size;
datatype->super.desc.desc[1].end_loop.common.flags = 0;
datatype->super.desc.desc[1].end_loop.common.type = OPAL_DATATYPE_END_LOOP;
datatype->super.desc.desc[1].end_loop.items = 1;
datatype->super.desc.desc[1].end_loop.first_elem_disp = datatype->super.desc.desc[0].elem.disp;
datatype->super.desc.desc[1].end_loop.size = datatype->super.size;
}
/* Check if the data contain gaps */
if( (datatype->super.ub - datatype->super.lb) != (OPAL_PTRDIFF_TYPE)datatype->super.size ) {
datatype->super.desc.desc[0].elem.common.flags &= ~OPAL_DATATYPE_FLAG_NO_GAPS;
}
}
/* Create the f2c translation table */
OBJ_CONSTRUCT(&ompi_datatype_f_to_c_table, opal_pointer_array_t);
if( OPAL_SUCCESS != opal_pointer_array_init(&ompi_datatype_f_to_c_table,