Skip to content

Commit 4bfb0fc

Browse files
authored
Merge pull request #3577 from markalle/pr/osc_rdma_rangecheck
fix for buffer length check (rdma osc w/ odd datatypes)
2 parents 7d5cc8e + df14cbf commit 4bfb0fc

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

ompi/mca/osc/rdma/osc_rdma_comm.c

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
* Copyright (c) 2016 Intel, Inc. All rights reserved.
66
* Copyright (c) 2017 Research Organization for Information Science
77
* and Technology (RIST). All rights reserved.
8+
* Copyright (c) 2017 IBM Corporation. All rights reserved.
89
* $COPYRIGHT$
910
*
1011
* Additional copyrights may follow
@@ -793,7 +794,14 @@ static inline int ompi_osc_rdma_put_w_req (ompi_osc_rdma_sync_t *sync, const voi
793794
return OMPI_SUCCESS;
794795
}
795796

796-
ret = osc_rdma_get_remote_segment (module, peer, target_disp, target_datatype->super.size * target_count,
797+
ptrdiff_t len, offset;
798+
// a buffer defined by (buf, count, dt)
799+
// will have data starting at buf+offset and ending len bytes later:
800+
len = opal_datatype_span(&target_datatype->super, target_count, &offset);
801+
802+
// the below function wants arg4 to be the number of bytes after
803+
// source_disp that the data ends, which is offset+len
804+
ret = osc_rdma_get_remote_segment (module, peer, target_disp, offset+len,
797805
&target_address, &target_handle);
798806
if (OPAL_UNLIKELY(OMPI_SUCCESS != ret)) {
799807
return ret;

0 commit comments

Comments
 (0)