Skip to content

Commit

Permalink
Merge pull request open-mpi#11080 from jsquyres/pr/fix-some-test-warn…
Browse files Browse the repository at this point in the history
…ings

test/datatype/partial.c: fix compiler warnings
  • Loading branch information
jsquyres authored Nov 18, 2022
2 parents 37222f7 + 98abc08 commit dd7cbdd
Showing 1 changed file with 10 additions and 8 deletions.
18 changes: 10 additions & 8 deletions test/datatype/partial.c
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
* reserved.
* Copyright (c) 2018 Triad National Security, LLC. All rights
* reserved.
* Copyright (c) 2022 Cisco Systems, Inc. All rights reserved
* $COPYRIGHT$
*
* Additional copyrights may follow
Expand Down Expand Up @@ -53,7 +54,7 @@ static void show_neighborhood(double *ptr, int how_many, bool show_hex)
for (i = -how_many; i < how_many; i++) {
if (0 == i)
printf(" <");
for (int j = 0; j < sizeof(double); j++) {
for (size_t j = 0; j < sizeof(double); j++) {
printf("%02x", cptr[i * sizeof(double) + j]);
}
if (0 == i)
Expand All @@ -76,7 +77,7 @@ static void show_neighborhood(double *ptr, int how_many, bool show_hex)

int main(int argc, char *argv[])
{
opal_datatype_t *vector;
ompi_datatype_t *vector;
ompi_datatype_t *base;
uint32_t iov_count;
size_t max_data, size, length;
Expand All @@ -93,13 +94,13 @@ int main(int argc, char *argv[])
ompi_datatype_create_vector(TYPE_COUNT, TYPE_BLEN, TYPE_STRIDE, MPI_DOUBLE, &base);
ompi_datatype_create_contiguous(CONT_COUNT, base, &vector);

opal_datatype_commit(vector);
opal_datatype_commit(&vector->super);

ompi_datatype_dump(vector);

opal_datatype_type_size(vector, &size);
opal_datatype_type_extent(vector, &extent);
opal_datatype_type_extent(base, &base_extent);
opal_datatype_type_size(&vector->super, &size);
opal_datatype_type_extent(&vector->super, &extent);
opal_datatype_type_extent(&base->super, &base_extent);

array = (double *) malloc(extent * COUNT);
packed = (double *) malloc(size * COUNT);
Expand All @@ -118,7 +119,7 @@ int main(int argc, char *argv[])
* of the buffered operation.
*/
convertor = opal_convertor_create(opal_local_arch, 0);
opal_convertor_prepare_for_recv(convertor, vector, COUNT, array);
opal_convertor_prepare_for_recv(convertor, &vector->super, COUNT, array);

for (length = 0; length < (size * COUNT);) {
iov[0].iov_base = bpacked + length;
Expand All @@ -129,7 +130,8 @@ int main(int argc, char *argv[])
opal_convertor_unpack(convertor, iov, &iov_count, &max_data);
length += max_data;

int idx = 0, checked = 0;
int idx = 0;
size_t checked = 0;
for (int m = 0; m < COUNT; m++) {
char *mptr = (char *) array + m * extent;
for (int k = 0; k < CONT_COUNT; k++) {
Expand Down

0 comments on commit dd7cbdd

Please sign in to comment.