Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 14 additions & 10 deletions ompi/datatype/ompi_datatype_args.c
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
* reserved.
* Copyright (c) 2015-2017 Research Organization for Information Science
* and Technology (RIST). All rights reserved.
* Copyright (c) 2017 IBM Corporation. All rights reserved.
* $COPYRIGHT$
*
* Additional copyrights may follow
Expand Down Expand Up @@ -837,16 +838,19 @@ ompi_datatype_t* ompi_datatype_get_single_predefined_type_from_args( ompi_dataty
return NULL;
}
}
if( NULL == predef ) { /* This is the first iteration */
predef = current_predef;
} else {
/**
* What exactly should we consider as identical types? If they are
* the same MPI level type, or if they map to the same OPAL datatype?
* In other words, MPI_FLOAT and MPI_REAL4 are they identical?
*/
if( predef != current_predef ) {
return NULL;
if (current_predef != MPI_LB && current_predef != MPI_UB) {
if( NULL == predef ) { /* This is the first iteration */
predef = current_predef;
} else {
/**
* What exactly should we consider as identical types?
* If they are the same MPI level type, or if they map
* to the same OPAL datatype? In other words, MPI_FLOAT
* and MPI_REAL4 are they identical?
*/
if( predef != current_predef ) {
return NULL;
}
}
}
}
Expand Down
8 changes: 5 additions & 3 deletions ompi/mca/osc/base/osc_base_obj_convert.c
Original file line number Diff line number Diff line change
Expand Up @@ -109,12 +109,16 @@ int ompi_osc_base_process_op (void *outbuf, void *inbuf, size_t inbuflen,
bool done;

primitive_datatype = ompi_datatype_get_single_predefined_type_from_args(datatype);
ompi_datatype_type_size (primitive_datatype, &primitive_size);

if (ompi_datatype_is_contiguous_memory_layout (datatype, count) &&
1 == datatype->super.desc.used) {
/* NTH: the datatype is made up of a contiguous block of the primitive
* datatype. fast path. do not set up a convertor to deal with the
* datatype. */
count *= datatype->super.desc.desc[0].elem.count;
(void)ompi_datatype_type_size(datatype, &size);
count *= (size / primitive_size);
assert( 0 == (size % primitive_size) );

/* in case it is possible for the datatype to have a non-zero lb in this case.
* remove me if this is not possible */
Expand All @@ -125,8 +129,6 @@ int ompi_osc_base_process_op (void *outbuf, void *inbuf, size_t inbuflen,
return OMPI_SUCCESS;
}

ompi_datatype_type_size (primitive_datatype, &primitive_size);

/* create convertor */
OBJ_CONSTRUCT(&convertor, opal_convertor_t);
opal_convertor_copy_and_prepare_for_recv(ompi_mpi_local_convertor, &datatype->super,
Expand Down