From 0522179efca03ebb0e8104bce57580dbca92ee2b Mon Sep 17 00:00:00 2001 From: Yossi Itigin Date: Mon, 10 Jul 2017 01:25:02 +0300 Subject: [PATCH] pml/yalla: use opal_datatype_span() to get config type length. Signed-off-by: Yossi Itigin --- ompi/mca/pml/yalla/pml_yalla_datatype.h | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/ompi/mca/pml/yalla/pml_yalla_datatype.h b/ompi/mca/pml/yalla/pml_yalla_datatype.h index 2432c11234..744ee2ece3 100644 --- a/ompi/mca/pml/yalla/pml_yalla_datatype.h +++ b/ompi/mca/pml/yalla/pml_yalla_datatype.h @@ -26,15 +26,13 @@ OBJ_CLASS_DECLARATION(mca_pml_yalla_convertor_t); #define PML_YALLA_INIT_MXM_REQ_DATA(_req_base, _buf, _count, _dtype, _stream_type, ...) \ { \ - size_t size; \ - ptrdiff_t lb, extent; \ + ptrdiff_t span, gap; \ \ if (opal_datatype_is_contiguous_memory_layout(&(_dtype)->super, _count)) { \ - ompi_datatype_get_true_extent(_dtype, &lb, &extent); \ - ompi_datatype_type_size(_dtype, &size); \ + span = opal_datatype_span(&(_dtype)->super, (_count), &gap); \ (_req_base)->data_type = MXM_REQ_DATA_BUFFER; \ - (_req_base)->data.buffer.ptr = (char *)_buf + lb; \ - (_req_base)->data.buffer.length = size * (_count); \ + (_req_base)->data.buffer.ptr = (char *)_buf + gap; \ + (_req_base)->data.buffer.length = span; \ } else { \ mca_pml_yalla_set_noncontig_data_ ## _stream_type(_req_base, \ _buf, _count, \