From a074eeda117072a82300c9b937f086e23def9243 Mon Sep 17 00:00:00 2001 From: Richard Warren Date: Mon, 7 Oct 2019 08:56:05 -0400 Subject: Made code review edit suggested by Jerome, plus various code updates to files that I touched to eliminate compile warnings (on my Linux box). --- src/H5Smpio.c | 8 ++++---- testpar/t_file.c | 10 +++++----- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/src/H5Smpio.c b/src/H5Smpio.c index 287bde1..906aea8 100644 --- a/src/H5Smpio.c +++ b/src/H5Smpio.c @@ -45,7 +45,7 @@ #define H5S_MPIO_INITIAL_ALLOC_COUNT 256 #define TWO_GIG_LIMIT 2147483648 #ifndef H5S_MAX_MPI_COUNT -#define H5S_MAX_MPI_COUNT 1073741824 +#define H5S_MAX_MPI_COUNT (1 << 30) #endif @@ -1124,7 +1124,7 @@ H5S__obtain_datatype(H5S_hyper_span_info_t *spans, const hsize_t *down, { H5S_hyper_span_t *span; /* Hyperslab span to iterate with */ size_t alloc_count = 0; /* Number of span tree nodes allocated at this level */ - size_t outercount; /* Number of span tree nodes at this level */ + size_t outercount = 0; /* Number of span tree nodes at this level */ MPI_Datatype *inner_type = NULL; hbool_t inner_types_freed = FALSE; /* Whether the inner_type MPI datatypes have been freed */ int *blocklen = NULL; @@ -1184,7 +1184,7 @@ H5S__obtain_datatype(H5S_hyper_span_info_t *spans, const hsize_t *down, H5_CHECK_OVERFLOW(nelmts, hsize_t, int) blocklen[outercount] = (int)nelmts; - if(bigio_count < blocklen[outercount]) + if(bigio_count < (hsize_t)blocklen[outercount]) large_block = TRUE; /* at least one block type is large, so set this flag to true */ span = span->next; @@ -1201,7 +1201,7 @@ H5S__obtain_datatype(H5S_hyper_span_info_t *spans, const hsize_t *down, MPI_Datatype temp_type = MPI_DATATYPE_NULL; /* create the block type from elmt_type while checking the 32 bit int limit */ - if(blocklen[u] > bigio_count) { + if((hsize_t)(blocklen[u]) > bigio_count) { if(H5S_mpio_create_large_type(blocklen[u], 0, *elmt_type, &temp_type) < 0) HGOTO_ERROR(H5E_DATASPACE, H5E_BADTYPE, FAIL, "couldn't create a large element datatype in span_hyper selection") } /* end if */ diff --git a/testpar/t_file.c b/testpar/t_file.c index e5a4f8a..99ac189 100644 --- a/testpar/t_file.c +++ b/testpar/t_file.c @@ -432,7 +432,7 @@ create_file(const char *filename, hid_t fcpl, hid_t fapl, int metadata_write_str hsize_t dims[RANK], i; hsize_t num_elements; int k; - char dset_name[10]; + char dset_name[20]; H5F_t *f = NULL; H5C_t *cache_ptr = NULL; H5AC_cache_config_t config; @@ -589,7 +589,7 @@ open_file(const char *filename, hid_t fapl, int metadata_write_strategy, hsize_t block[RANK]; int i, k, ndims; hsize_t num_elements; - char dset_name[10]; + char dset_name[20]; H5F_t *f = NULL; H5C_t *cache_ptr = NULL; H5AC_cache_config_t config; @@ -664,8 +664,8 @@ open_file(const char *filename, hid_t fapl, int metadata_write_strategy, ndims = H5Sget_simple_extent_dims(sid, dims, NULL); VRFY((ndims == 2), "H5Sget_simple_extent_dims succeeded"); - VRFY(dims[0] == ROW_FACTOR*mpi_size, "Wrong dataset dimensions"); - VRFY(dims[1] == COL_FACTOR*mpi_size, "Wrong dataset dimensions"); + VRFY(dims[0] == (hsize_t)(ROW_FACTOR*mpi_size), "Wrong dataset dimensions"); + VRFY(dims[1] == (hsize_t)(COL_FACTOR*mpi_size), "Wrong dataset dimensions"); ret = H5Sselect_hyperslab(sid, H5S_SELECT_SET, start, stride, count, block); VRFY((ret >= 0), "H5Sset_hyperslab succeeded"); @@ -678,7 +678,7 @@ open_file(const char *filename, hid_t fapl, int metadata_write_strategy, ret = H5Sclose(sid); VRFY((ret == 0), ""); - for (i=0; i < num_elements; i++) + for (i=0; i < (int)num_elements; i++) VRFY((data_array[i] == mpi_rank+1), "Dataset Verify failed"); } -- cgit v0.12