Skip to content

Commit 0310ff9

Browse files
committed
coll/han: fix compiler warnings
Fix an unused variable, and explictly cast uint64_t to size_t Note that the latter won't be needed after embiggening collectives for large count support. Signed-off-by: Wenduo Wang <wenduwan@amazon.com>
1 parent ac6d734 commit 0310ff9

File tree

4 files changed

+6
-6
lines changed

4 files changed

+6
-6
lines changed

ompi/mca/coll/han/coll_han.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -522,7 +522,7 @@ ompi_coll_han_reorder_gather(const void *sbuf,
522522
int * topo);
523523

524524
size_t
525-
coll_han_utils_gcd(const size_t *numerators, const size_t size);
525+
coll_han_utils_gcd(const uint64_t *numerators, const size_t size);
526526

527527
int
528528
coll_han_utils_create_contiguous_datatype(size_t count, const ompi_datatype_t *oldType,

ompi/mca/coll/han/coll_han_gatherv.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -332,7 +332,7 @@ int mca_coll_han_gatherv_intra(const void *sbuf, int scount, struct ompi_datatyp
332332
}
333333

334334
if (max_data_size > (size_t) INT_MAX) {
335-
datatype_size = coll_han_utils_gcd((const size_t *) low_data_size, low_size);
335+
datatype_size = coll_han_utils_gcd(low_data_size, low_size);
336336
}
337337

338338
low_rcounts = malloc(low_size * sizeof(int));

ompi/mca/coll/han/coll_han_scatterv.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -343,7 +343,7 @@ int mca_coll_han_scatterv_intra(const void *sbuf, const int *scounts, const int
343343
}
344344

345345
if (max_data_size > (size_t) INT_MAX) {
346-
datatype_size = coll_han_utils_gcd((const size_t *) low_data_size, low_size);
346+
datatype_size = coll_han_utils_gcd(low_data_size, low_size);
347347
}
348348

349349
low_scounts = malloc(low_size * sizeof(int));

ompi/mca/coll/han/coll_han_utils.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,12 +25,12 @@
2525
* @param[in] size Number of numerators
2626
* @returns The GCD, where 1 <= GCD
2727
*/
28-
size_t coll_han_utils_gcd(const size_t *numerators, const size_t size)
28+
size_t coll_han_utils_gcd(const uint64_t *numerators, const size_t size)
2929
{
30-
size_t denominator = numerators[0], numerator, tmp;
30+
size_t denominator = (size_t) numerators[0], numerator, tmp;
3131

3232
for (size_t i = 1; i < size; ++i) {
33-
numerator = numerators[i];
33+
numerator = (size_t) numerators[i];
3434

3535
if (0 == denominator) {
3636
denominator = numerator;

0 commit comments

Comments
 (0)