Skip to content

Commit fd55204

Browse files
authored
Merge pull request #2196 from tkordenbrock/topic/master/osc-portals4.put.use.true_extent
osc-portals4: fix datatype errors in put()
2 parents b703f2e + cc863ff commit fd55204

File tree

1 file changed

+10
-6
lines changed

1 file changed

+10
-6
lines changed

ompi/mca/osc/portals4/osc_portals4_comm.c

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -763,8 +763,8 @@ ompi_osc_portals4_put(const void *origin_addr,
763763
ompi_osc_portals4_module_t *module =
764764
(ompi_osc_portals4_module_t*) win->w_osc_module;
765765
ptl_process_t peer = ompi_osc_portals4_get_peer(module, target);
766-
size_t offset;
767-
OPAL_PTRDIFF_TYPE length, origin_lb, target_lb;
766+
size_t offset, size;
767+
OPAL_PTRDIFF_TYPE length, origin_lb, target_lb, extent;
768768

769769
OPAL_OUTPUT_VERBOSE((50, ompi_osc_base_framework.framework_output,
770770
"put: 0x%lx, %d, %s, %d, %lu, %d, %s, 0x%lx",
@@ -781,18 +781,22 @@ ompi_osc_portals4_put(const void *origin_addr,
781781
"MPI_Put: transfer of non-contiguous memory is not currently supported.\n");
782782
return OMPI_ERR_NOT_SUPPORTED;
783783
} else {
784-
ret = ompi_datatype_get_extent(origin_dt, &origin_lb, &length);
784+
ret = ompi_datatype_get_true_extent(origin_dt, &origin_lb, &extent);
785785
if (OMPI_SUCCESS != ret) {
786786
return ret;
787787
}
788-
ret = ompi_datatype_type_lb(target_dt, &target_lb);
788+
ret = ompi_datatype_get_true_extent(target_dt, &target_lb, &extent);
789789
if (OMPI_SUCCESS != ret) {
790790
return ret;
791791
}
792-
length *= origin_count;
792+
ompi_datatype_type_size(origin_dt, &size);
793+
length = size * origin_count;
794+
793795
opal_atomic_add_64(&module->opcount, number_of_fragment(length, mca_osc_portals4_component.ptl_max_msg_size));
796+
794797
OPAL_OUTPUT_VERBOSE((90, ompi_osc_base_framework.framework_output,
795-
"%s,%d Put", __FUNCTION__, __LINE__));
798+
"%s,%d Put(origin_count=%d, origin_lb=%lu, target_count=%d, target_lb=%lu, length=%lu, op_count=%ld)",
799+
__FUNCTION__, __LINE__, origin_count, origin_lb, target_count, target_lb, length, module->opcount));
796800
ret = splittedPtlPut(module->md_h,
797801
(ptl_size_t) origin_addr + origin_lb,
798802
length,

0 commit comments

Comments
 (0)