• Xin Zhao's avatar
    Bug-fix: make RMA work correctly with pair basic type. · ce8bc310
    Xin Zhao authored and Pavan Balaji's avatar Pavan Balaji committed
    
    
    The original implementation of RMA does not consider pair basic
    types (e.g. MPI_FLOAT_INT, MPI_DOUBLE_INT). It only
    works correctly with builtin datatypes (e.g. MPI_INT, MPI_FLOAT).
    This patch makes the RMA work correctly with pair basic types.
    
    The bug is that: (1) when performing the ACC computation, the original
    implementation uses 'eltype' in the datatype structure, which is set
    when all basic elements in this datatype have the same builtin
    datatype. When basic elements have different builtin datatypes, like
    pair datatypes, the 'eltype' is set to MPI_DATATYPE_NULL. This makes
    the ACC computation be unable to work with pair types; (2) for all
    basic type of data, the original implementation assumes that
    they are all contiguous and issues them in an unpacked manner
    with length of data size (count*type_size). This is incorrect for
    pair datatypes, because most pair datatypes are non-contiguous
    (type_extent != type_size).
    
    In the previous patch, we already made 'eltype' to store basic
    type instead of builtin type. In this patch, we fixed this
    bug by (1) modify ACC computation to treat 'eltype' as basic
    type; (2) For non-contiguous basic type data, we use the noncontig
    API so that it will be issued in a packed manner.
    
    Signed-off-by: Pavan Balaji's avatarPavan Balaji <balaji@anl.gov>
    ce8bc310