Skip to content

Commit 80884d4

Browse files
committed
coll/han: ptrdiff_t max size bugfix
Fix buggy integer comparison of (ptrdiff_t) displ < SIZE_MAX Signed-off-by: Wenduo Wang <[email protected]>
1 parent f2efd55 commit 80884d4

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

ompi/mca/coll/han/coll_han_gatherv.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -170,7 +170,7 @@ int mca_coll_han_gatherv_intra(const void *sbuf, size_t scount, struct ompi_data
170170
}
171171

172172
for (up_peer = 0; up_peer < up_size; ++up_peer) {
173-
up_displs[up_peer] = INT_MAX;
173+
up_displs[up_peer] = PTRDIFF_MAX;
174174
}
175175

176176
/* Calculate recv counts for the inter-node gatherv - no need to gather

ompi/mca/coll/han/coll_han_scatterv.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -174,7 +174,7 @@ int mca_coll_han_scatterv_intra(const void *sbuf, ompi_count_array_t scounts, om
174174
}
175175

176176
for (up_peer = 0; up_peer < up_size; ++up_peer) {
177-
up_displs[up_peer] = SIZE_MAX;
177+
up_displs[up_peer] = PTRDIFF_MAX;
178178
}
179179

180180
/* Calculate send counts for the inter-node scatterv */

0 commit comments

Comments
 (0)