Skip to content

Commit

Permalink
Merge pull request #1124 from philipmarshall21/ibput_ibget_overlap_ch…
Browse files Browse the repository at this point in the history
…eck_fix

src: Add overlap check to fix ibput/ibget APIs
  • Loading branch information
philipmarshall21 authored May 1, 2024
2 parents 87442b2 + f622b7a commit 5b9a7d8
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions src/data_c.c4
Original file line number Diff line number Diff line change
Expand Up @@ -503,7 +503,8 @@ SHMEM_PROF_DEF_CTX_PUT_N_SIGNAL_NBI(`mem')
SHMEM_ERR_CHECK_STRIDE_GTE_BSIZE(sst, bsize); \
SHMEM_ERR_CHECK_OVERLAP(target, source, \
sizeof(TYPE) * ((nblocks-1) * tst + bsize), \
sizeof(TYPE) * ((nblocks-1) * sst + bsize), 0); \
sizeof(TYPE) * ((nblocks-1) * sst + bsize), \
0, (shmem_internal_my_pe == pe)); \
for ( ; nblocks > 0 ; --nblocks) { \
shmem_internal_put_nb(ctx, target, source, \
bsize * sizeof(TYPE), pe, \
Expand Down Expand Up @@ -555,7 +556,8 @@ SHMEM_PROF_DEF_CTX_PUT_N_SIGNAL_NBI(`mem')
SHMEM_ERR_CHECK_STRIDE_GTE_BSIZE(sst, bsize); \
SHMEM_ERR_CHECK_OVERLAP(target, source, \
(SIZE) * ((nblocks-1) * tst + bsize), \
(SIZE) * ((nblocks-1) * sst + bsize), 0); \
(SIZE) * ((nblocks-1) * sst + bsize), \
0, (shmem_internal_my_pe == pe)); \
for ( ; nblocks > 0 ; --nblocks) { \
shmem_internal_put_nb(ctx, target, source, \
bsize * (SIZE), pe, \
Expand Down Expand Up @@ -607,7 +609,8 @@ SHMEM_PROF_DEF_CTX_PUT_N_SIGNAL_NBI(`mem')
SHMEM_ERR_CHECK_STRIDE_GTE_BSIZE(sst, bsize); \
SHMEM_ERR_CHECK_OVERLAP(target, source, \
sizeof(TYPE) * ((nblocks-1) * tst + bsize), \
sizeof(TYPE) * ((nblocks-1) * sst + bsize), 0); \
sizeof(TYPE) * ((nblocks-1) * sst + bsize), \
0, (shmem_internal_my_pe == pe)); \
for ( ; nblocks > 0 ; --nblocks) { \
shmem_internal_get(ctx, target, source, \
bsize * sizeof(TYPE), pe); \
Expand Down Expand Up @@ -659,7 +662,8 @@ SHMEM_PROF_DEF_CTX_PUT_N_SIGNAL_NBI(`mem')
SHMEM_ERR_CHECK_STRIDE_GTE_BSIZE(sst, bsize); \
SHMEM_ERR_CHECK_OVERLAP(target, source, \
(SIZE) * ((nblocks-1) * tst + bsize), \
(SIZE) * ((nblocks-1) * sst + bsize), 0); \
(SIZE) * ((nblocks-1) * sst + bsize), \
0, (shmem_internal_my_pe == pe)); \
for ( ; nblocks > 0 ; --nblocks) { \
shmem_internal_get(ctx, target, source, \
bsize * (SIZE), pe); \
Expand Down

0 comments on commit 5b9a7d8

Please sign in to comment.