Skip to content

Commit b0692c6

Browse files
authored
Merge pull request #3833 from yosefe/topic/pml-yalla-dt-size-fix
pml/yalla: fix getting size of a continuous type.
2 parents 6e35cfc + 0522179 commit b0692c6

File tree

1 file changed

+4
-5
lines changed

1 file changed

+4
-5
lines changed

ompi/mca/pml/yalla/pml_yalla_datatype.h

+4-5
Original file line numberDiff line numberDiff line change
@@ -26,14 +26,13 @@ OBJ_CLASS_DECLARATION(mca_pml_yalla_convertor_t);
2626

2727
#define PML_YALLA_INIT_MXM_REQ_DATA(_req_base, _buf, _count, _dtype, _stream_type, ...) \
2828
{ \
29-
size_t size; \
30-
ptrdiff_t lb; \
29+
ptrdiff_t span, gap; \
3130
\
3231
if (opal_datatype_is_contiguous_memory_layout(&(_dtype)->super, _count)) { \
33-
ompi_datatype_get_true_extent(_dtype, &lb, &size); \
32+
span = opal_datatype_span(&(_dtype)->super, (_count), &gap); \
3433
(_req_base)->data_type = MXM_REQ_DATA_BUFFER; \
35-
(_req_base)->data.buffer.ptr = (char *)_buf + lb; \
36-
(_req_base)->data.buffer.length = size * (_count); \
34+
(_req_base)->data.buffer.ptr = (char *)_buf + gap; \
35+
(_req_base)->data.buffer.length = span; \
3736
} else { \
3837
mca_pml_yalla_set_noncontig_data_ ## _stream_type(_req_base, \
3938
_buf, _count, \

0 commit comments

Comments
 (0)