Skip to content

Commit 17b09d9

Browse files
committed
mtl: Fix datatype offsetting
The convertor packing code will automatically add datatype offsets. However, the MTL avoids entering the convertor in some cases and thus was required to add an offset somewhere. The original location - mca_pml_cm_send() - was causing a problem with accelerator buffers as it would add the offset before sending it to the opal_convertor_pack function, doubling the offset. The correct place to add the datatype offset was modified to be in the ompi_mtl_datatype_pack() function which appropriately mirrors the opal_convertor_pack() offset behavior. Signed-off-by: William Zhang <wilzhang@amazon.com>
1 parent cb7b060 commit 17b09d9

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

ompi/mca/mtl/base/mtl_base_datatype.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ ompi_mtl_datatype_pack(struct opal_convertor_t *convertor,
4646
convertor->count) &&
4747
!(convertor->flags & CONVERTOR_ACCELERATOR)) {
4848
*free_after = false;
49-
*buffer = convertor->pBaseBuf;
49+
*buffer = convertor->pBaseBuf + convertor->bConverted + convertor->pDesc->true_lb;
5050
*buffer_len = convertor->local_size;
5151
return OPAL_SUCCESS;
5252
}

ompi/mca/pml/cm/pml_cm.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -374,7 +374,7 @@ mca_pml_cm_send(const void *buf,
374374
MCA_PML_CM_SWITCH_ACCELERATOR_CONVERTOR_OFF(flags, datatype, count);
375375
convertor.flags |= flags;
376376
/* Sets CONVERTOR_ACCELERATOR flag if device buffer */
377-
opal_convertor_prepare_for_send(&convertor, &datatype->super, count, (unsigned char *)buf + datatype->super.true_lb);
377+
opal_convertor_prepare_for_send(&convertor, &datatype->super, count, (unsigned char *)buf);
378378
} else
379379
#endif
380380
{

0 commit comments

Comments
 (0)