summaryrefslogtreecommitdiffstats
path: root/testpar
diff options
context:
space:
mode:
Diffstat (limited to 'testpar')
-rw-r--r--testpar/t_coll_chunk.c54
-rw-r--r--testpar/t_dset.c45
-rw-r--r--testpar/t_file.c8
-rw-r--r--testpar/t_fphdf5.c107
-rw-r--r--testpar/t_mdset.c73
-rw-r--r--testpar/t_mpi.c15
-rw-r--r--testpar/t_span_tree.c12
-rw-r--r--testpar/testphdf5.c16
-rw-r--r--testpar/testphdf5.h2
9 files changed, 162 insertions, 170 deletions
diff --git a/testpar/t_coll_chunk.c b/testpar/t_coll_chunk.c
index 1dc3c71..8b9554e 100644
--- a/testpar/t_coll_chunk.c
+++ b/testpar/t_coll_chunk.c
@@ -23,18 +23,18 @@
*/
/* some commonly used routines for collective chunk IO tests*/
-static void ccslab_set(int mpi_rank,int mpi_size,hssize_t start[],hsize_t count[],
+static void ccslab_set(int mpi_rank,int mpi_size,hsize_t start[],hsize_t count[],
hsize_t stride[],hsize_t block[],int mode);
-static void ccdataset_fill(hssize_t start[],hsize_t count[],
+static void ccdataset_fill(hsize_t start[],hsize_t count[],
hsize_t stride[],hsize_t block[],DATATYPE*dataset);
-static void ccdataset_print(hssize_t start[],hsize_t block[],DATATYPE*dataset);
+static void ccdataset_print(hsize_t start[],hsize_t block[],DATATYPE*dataset);
-static int ccdataset_vrfy(hssize_t start[], hsize_t count[], hsize_t stride[],
+static int ccdataset_vrfy(hsize_t start[], hsize_t count[], hsize_t stride[],
hsize_t block[], DATATYPE *dataset, DATATYPE *original);
-static void coll_chunktest(char* filename,int chunk_factor,int select_factor);
+static void coll_chunktest(const char* filename,int chunk_factor,int select_factor);
/*-------------------------------------------------------------------------
* Function: coll_chunk1
@@ -56,8 +56,8 @@ void
coll_chunk1(void)
{
- char *filename;
- filename = (char *) GetTestParameters();
+ const char *filename;
+ filename = GetTestParameters();
coll_chunktest(filename,1,BYROW_CONT);
}
@@ -66,8 +66,8 @@ void
coll_chunk2(void)
{
- char *filename;
- filename = (char *) GetTestParameters();
+ const char *filename;
+ filename = GetTestParameters();
coll_chunktest(filename,1,BYROW_DISCONT);
}
@@ -77,11 +77,11 @@ void
coll_chunk3(void)
{
- char *filename;
+ const char *filename;
int mpi_size;
MPI_Comm comm = MPI_COMM_WORLD;
MPI_Comm_size(comm,&mpi_size);
- filename = (char *) GetTestParameters();
+ filename = GetTestParameters();
coll_chunktest(filename,mpi_size,BYROW_CONT);
}
@@ -90,17 +90,17 @@ void
coll_chunk4(void)
{
- char *filename;
+ const char *filename;
int mpi_size;
MPI_Comm comm = MPI_COMM_WORLD;
MPI_Comm_size(comm,&mpi_size);
- filename = (char *) GetTestParameters();
+ filename = GetTestParameters();
coll_chunktest(filename,mpi_size*2,BYROW_DISCONT);
}
static void
-coll_chunktest(char* filename,int chunk_factor,int select_factor) {
+coll_chunktest(const char* filename,int chunk_factor,int select_factor) {
hid_t file,dataset, file_dataspace;
hid_t acc_plist,xfer_plist,crp_plist;
@@ -108,7 +108,7 @@ coll_chunktest(char* filename,int chunk_factor,int select_factor) {
int* data_array1 = NULL;
int* data_origin1 = NULL;
herr_t status;
- hssize_t start[RANK];
+ hsize_t start[RANK];
hsize_t count[RANK],stride[RANK],block[RANK];
#ifdef H5_HAVE_INSTRUMENTED_LIBRARY
unsigned prop_value;
@@ -330,7 +330,7 @@ coll_chunktest(char* filename,int chunk_factor,int select_factor) {
static void
-ccslab_set(int mpi_rank, int mpi_size, hssize_t start[], hsize_t count[],
+ccslab_set(int mpi_rank, int mpi_size, hsize_t start[], hsize_t count[],
hsize_t stride[], hsize_t block[], int mode)
{
switch (mode){
@@ -374,8 +374,8 @@ if (VERBOSE_MED) printf("slab_set wholeset\n");
break;
}
if (VERBOSE_MED){
- printf("start[]=(%ld,%ld), count[]=(%lu,%lu), stride[]=(%lu,%lu), block[]=(%lu,%lu), total datapoints=%lu\n",
- (long)start[0], (long)start[1], (unsigned long)count[0], (unsigned long)count[1],
+ printf("start[]=(%lu,%lu), count[]=(%lu,%lu), stride[]=(%lu,%lu), block[]=(%lu,%lu), total datapoints=%lu\n",
+ (unsigned long)start[0], (unsigned long)start[1], (unsigned long)count[0], (unsigned long)count[1],
(unsigned long)stride[0], (unsigned long)stride[1], (unsigned long)block[0], (unsigned long)block[1],
(unsigned long)(block[0]*block[1]*count[0]*count[1]));
}
@@ -387,7 +387,7 @@ if (VERBOSE_MED){
* Assume dimension rank is 2 and data is stored contiguous.
*/
static void
-ccdataset_fill(hssize_t start[], hsize_t stride[], hsize_t count[], hsize_t block[], DATATYPE * dataset)
+ccdataset_fill(hsize_t start[], hsize_t stride[], hsize_t count[], hsize_t block[], DATATYPE * dataset)
{
DATATYPE *dataptr = dataset;
DATATYPE *tmptr;
@@ -418,7 +418,7 @@ ccdataset_fill(hssize_t start[], hsize_t stride[], hsize_t count[], hsize_t bloc
* Print the first block of the content of the dataset.
*/
static void
-ccdataset_print(hssize_t start[], hsize_t block[], DATATYPE * dataset)
+ccdataset_print(hsize_t start[], hsize_t block[], DATATYPE * dataset)
{
DATATYPE *dataptr = dataset;
hsize_t i, j;
@@ -427,13 +427,13 @@ ccdataset_print(hssize_t start[], hsize_t block[], DATATYPE * dataset)
printf("Print only the first block of the dataset\n");
printf("%-8s", "Cols:");
for (j=0; j < block[1]; j++){
- printf("%3ld ", (long)(start[1]+j));
+ printf("%3lu ", (unsigned long)(start[1]+j));
}
printf("\n");
/* print the slab data */
for (i=0; i < block[0]; i++){
- printf("Row %2ld: ", (long)(i+start[0]));
+ printf("Row %2lu: ", (unsigned long)(i+start[0]));
for (j=0; j < block[1]; j++){
printf("%03d ", *dataptr++);
}
@@ -446,7 +446,7 @@ ccdataset_print(hssize_t start[], hsize_t block[], DATATYPE * dataset)
* Print the content of the dataset.
*/
static int
-ccdataset_vrfy(hssize_t start[], hsize_t count[], hsize_t stride[], hsize_t block[], DATATYPE *dataset, DATATYPE *original)
+ccdataset_vrfy(hsize_t start[], hsize_t count[], hsize_t stride[], hsize_t block[], DATATYPE *dataset, DATATYPE *original)
{
hsize_t i, j,k1,k2;
int vrfyerrs;
@@ -455,8 +455,8 @@ ccdataset_vrfy(hssize_t start[], hsize_t count[], hsize_t stride[], hsize_t bloc
/* print it if VERBOSE_MED */
if (VERBOSE_MED) {
printf("dataset_vrfy dumping:::\n");
- printf("start(%ld, %ld), count(%lu, %lu), stride(%lu, %lu), block(%lu, %lu)\n",
- (long)start[0], (long)start[1], (unsigned long)count[0], (unsigned long)count[1],
+ printf("start(%lu, %lu), count(%lu, %lu), stride(%lu, %lu), block(%lu, %lu)\n",
+ (unsigned long)start[0], (unsigned long)start[1], (unsigned long)count[0], (unsigned long)count[1],
(unsigned long)stride[0], (unsigned long)stride[1], (unsigned long)block[0], (unsigned long)block[1]);
printf("original values:\n");
ccdataset_print(start, block, original);
@@ -478,8 +478,8 @@ ccdataset_vrfy(hssize_t start[], hsize_t count[], hsize_t stride[], hsize_t bloc
if (*dataptr != *oriptr){
if (vrfyerrs++ < MAX_ERR_REPORT || VERBOSE_MED){
- printf("Dataset Verify failed at [%ld][%ld]: expect %d, got %d\n",
- (long)i, (long)j,
+ printf("Dataset Verify failed at [%lu][%lu]: expect %d, got %d\n",
+ (unsigned long)i, (unsigned long)j,
*(original), *(dataset));
}
}
diff --git a/testpar/t_dset.c b/testpar/t_dset.c
index 77cfdc4..dff3ec3 100644
--- a/testpar/t_dset.c
+++ b/testpar/t_dset.c
@@ -43,7 +43,7 @@
* ZCOL same as BYCOL except process 0 gets 0 columns
*/
static void
-slab_set(int mpi_rank, int mpi_size, hssize_t start[], hsize_t count[],
+slab_set(int mpi_rank, int mpi_size, hsize_t start[], hsize_t count[],
hsize_t stride[], hsize_t block[], int mode)
{
switch (mode){
@@ -110,8 +110,8 @@ if (VERBOSE_MED) printf("slab_set wholeset\n");
break;
}
if (VERBOSE_MED){
- printf("start[]=(%ld,%ld), count[]=(%lu,%lu), stride[]=(%lu,%lu), block[]=(%lu,%lu), total datapoints=%lu\n",
- (long)start[0], (long)start[1], (unsigned long)count[0], (unsigned long)count[1],
+ printf("start[]=(%lu,%lu), count[]=(%lu,%lu), stride[]=(%lu,%lu), block[]=(%lu,%lu), total datapoints=%lu\n",
+ (unsigned long)start[0], (unsigned long)start[1], (unsigned long)count[0], (unsigned long)count[1],
(unsigned long)stride[0], (unsigned long)stride[1], (unsigned long)block[0], (unsigned long)block[1],
(unsigned long)(block[0]*block[1]*count[0]*count[1]));
}
@@ -123,7 +123,7 @@ if (VERBOSE_MED){
* Assume dimension rank is 2 and data is stored contiguous.
*/
static void
-dataset_fill(hssize_t start[], hsize_t block[], DATATYPE * dataset)
+dataset_fill(hsize_t start[], hsize_t block[], DATATYPE * dataset)
{
DATATYPE *dataptr = dataset;
hsize_t i, j;
@@ -142,7 +142,7 @@ dataset_fill(hssize_t start[], hsize_t block[], DATATYPE * dataset)
* Print the content of the dataset.
*/
static void
-dataset_print(hssize_t start[], hsize_t block[], DATATYPE * dataset)
+dataset_print(hsize_t start[], hsize_t block[], DATATYPE * dataset)
{
DATATYPE *dataptr = dataset;
hsize_t i, j;
@@ -150,13 +150,13 @@ dataset_print(hssize_t start[], hsize_t block[], DATATYPE * dataset)
/* print the column heading */
printf("%-8s", "Cols:");
for (j=0; j < block[1]; j++){
- printf("%3ld ", (long)(start[1]+j));
+ printf("%3lu ", (unsigned long)(start[1]+j));
}
printf("\n");
/* print the slab data */
for (i=0; i < block[0]; i++){
- printf("Row %2ld: ", (long)(i+start[0]));
+ printf("Row %2lu: ", (unsigned long)(i+start[0]));
for (j=0; j < block[1]; j++){
printf("%03d ", *dataptr++);
}
@@ -168,7 +168,8 @@ dataset_print(hssize_t start[], hsize_t block[], DATATYPE * dataset)
/*
* Print the content of the dataset.
*/
-int dataset_vrfy(hssize_t start[], hsize_t count[], hsize_t stride[], hsize_t block[], DATATYPE *dataset, DATATYPE *original)
+int
+dataset_vrfy(hsize_t start[], hsize_t count[], hsize_t stride[], hsize_t block[], DATATYPE *dataset, DATATYPE *original)
{
hsize_t i, j;
int vrfyerrs;
@@ -176,8 +177,8 @@ int dataset_vrfy(hssize_t start[], hsize_t count[], hsize_t stride[], hsize_t bl
/* print it if VERBOSE_MED */
if (VERBOSE_MED) {
printf("dataset_vrfy dumping:::\n");
- printf("start(%ld, %ld), count(%lu, %lu), stride(%lu, %lu), block(%lu, %lu)\n",
- (long)start[0], (long)start[1], (unsigned long)count[0], (unsigned long)count[1],
+ printf("start(%lu, %lu), count(%lu, %lu), stride(%lu, %lu), block(%lu, %lu)\n",
+ (unsigned long)start[0], (unsigned long)start[1], (unsigned long)count[0], (unsigned long)count[1],
(unsigned long)stride[0], (unsigned long)stride[1], (unsigned long)block[0], (unsigned long)block[1]);
printf("original values:\n");
dataset_print(start, block, original);
@@ -190,9 +191,9 @@ int dataset_vrfy(hssize_t start[], hsize_t count[], hsize_t stride[], hsize_t bl
for (j=0; j < block[1]; j++){
if (*dataset != *original){
if (vrfyerrs++ < MAX_ERR_REPORT || VERBOSE_MED){
- printf("Dataset Verify failed at [%ld][%ld](row %ld, col %ld): expect %d, got %d\n",
- (long)i, (long)j,
- (long)(i+start[0]), (long)(j+start[1]),
+ printf("Dataset Verify failed at [%lu][%lu](row %lu, col %lu): expect %d, got %d\n",
+ (unsigned long)i, (unsigned long)j,
+ (unsigned long)(i+start[0]), (unsigned long)(j+start[1]),
*(original), *(dataset));
}
dataset++;
@@ -234,7 +235,7 @@ dataset_writeInd(void)
DATATYPE *data_array1 = NULL; /* data buffer */
const char *filename;
- hssize_t start[RANK]; /* for hyperslab setting */
+ hsize_t start[RANK]; /* for hyperslab setting */
hsize_t count[RANK], stride[RANK]; /* for hyperslab setting */
hsize_t block[RANK]; /* for hyperslab setting */
@@ -380,7 +381,7 @@ dataset_readInd(void)
DATATYPE *data_origin1 = NULL; /* expected data buffer */
const char *filename;
- hssize_t start[RANK]; /* for hyperslab setting */
+ hsize_t start[RANK]; /* for hyperslab setting */
hsize_t count[RANK], stride[RANK]; /* for hyperslab setting */
hsize_t block[RANK]; /* for hyperslab setting */
@@ -506,7 +507,7 @@ dataset_writeAll(void)
DATATYPE *data_array1 = NULL; /* data buffer */
const char *filename;
- hssize_t start[RANK]; /* for hyperslab setting */
+ hsize_t start[RANK]; /* for hyperslab setting */
hsize_t count[RANK], stride[RANK]; /* for hyperslab setting */
hsize_t block[RANK]; /* for hyperslab setting */
@@ -865,7 +866,7 @@ dataset_readAll(void)
DATATYPE *data_origin1 = NULL; /* expected data buffer */
const char *filename;
- hssize_t start[RANK]; /* for hyperslab setting */
+ hsize_t start[RANK]; /* for hyperslab setting */
hsize_t count[RANK], stride[RANK]; /* for hyperslab setting */
hsize_t block[RANK]; /* for hyperslab setting */
@@ -1092,7 +1093,7 @@ extend_writeInd(void)
hsize_t chunk_dims[RANK]; /* chunk sizes */
hid_t dataset_pl; /* dataset create prop. list */
- hssize_t start[RANK]; /* for hyperslab setting */
+ hsize_t start[RANK]; /* for hyperslab setting */
hsize_t count[RANK]; /* for hyperslab setting */
hsize_t stride[RANK]; /* for hyperslab setting */
hsize_t block[RANK]; /* for hyperslab setting */
@@ -1434,7 +1435,7 @@ extend_writeInd2(void)
printf("%s%d", i?", ":"", written[i]);
printf("\n");
}
- ret = H5Sselect_hyperslab(fs, H5S_SELECT_SET, (hssize_t *)&orig_size, NULL, &one, &orig_size);
+ ret = H5Sselect_hyperslab(fs, H5S_SELECT_SET, &orig_size, NULL, &one, &orig_size);
VRFY((ret >= 0), "H5Sselect_hyperslab succeeded");
ret = H5Dwrite(dataset, H5T_NATIVE_INT, ms, fs, H5P_DEFAULT, written);
VRFY((ret >= 0), "H5Dwrite succeeded");
@@ -1483,7 +1484,7 @@ extend_readInd(void)
DATATYPE *data_origin1 = NULL; /* expected data buffer */
const char *filename;
- hssize_t start[RANK]; /* for hyperslab setting */
+ hsize_t start[RANK]; /* for hyperslab setting */
hsize_t count[RANK], stride[RANK]; /* for hyperslab setting */
hsize_t block[RANK]; /* for hyperslab setting */
@@ -1666,7 +1667,7 @@ extend_writeAll(void)
hsize_t chunk_dims[RANK]; /* chunk sizes */
hid_t dataset_pl; /* dataset create prop. list */
- hssize_t start[RANK]; /* for hyperslab setting */
+ hsize_t start[RANK]; /* for hyperslab setting */
hsize_t count[RANK]; /* for hyperslab setting */
hsize_t stride[RANK]; /* for hyperslab setting */
hsize_t block[RANK]; /* for hyperslab setting */
@@ -1905,7 +1906,7 @@ extend_readAll(void)
DATATYPE *data_array2 = NULL; /* data buffer */
DATATYPE *data_origin1 = NULL; /* expected data buffer */
- hssize_t start[RANK]; /* for hyperslab setting */
+ hsize_t start[RANK]; /* for hyperslab setting */
hsize_t count[RANK], stride[RANK]; /* for hyperslab setting */
hsize_t block[RANK]; /* for hyperslab setting */
diff --git a/testpar/t_file.c b/testpar/t_file.c
index 6fcde32..7f703a5 100644
--- a/testpar/t_file.c
+++ b/testpar/t_file.c
@@ -41,9 +41,9 @@ test_split_comm_access(void)
hid_t acc_tpl; /* File access properties */
hbool_t use_gpfs = FALSE; /* Use GPFS hints */
herr_t ret; /* generic return value */
- char *filename;
+ const char *filename;
- filename = (char *) GetTestParameters();
+ filename = GetTestParameters();
if (VERBOSE_MED)
printf("Split Communicator access test on file %s\n",
filename);
@@ -82,9 +82,9 @@ test_split_comm_access(void)
ret=H5Fclose(fid);
VRFY((ret >= 0), "");
- /* detele the test file */
+ /* delete the test file */
if (sub_mpi_rank == 0){
- mrc = MPI_File_delete(filename, info);
+ mrc = MPI_File_delete((char *)filename, info);
/*VRFY((mrc==MPI_SUCCESS), ""); */
}
}
diff --git a/testpar/t_fphdf5.c b/testpar/t_fphdf5.c
index 403fa70..5dbc41f 100644
--- a/testpar/t_fphdf5.c
+++ b/testpar/t_fphdf5.c
@@ -39,17 +39,17 @@ static hid_t create_file(const char *filename);
static hid_t create_group(hid_t loc, const char *grp_name, size_t size_hint);
static hid_t create_dset(hid_t loc, const char *dset_name);
static void access_dset(hid_t loc, const char *dset_name);
-static void slab_set(hssize_t start[], hsize_t count[],
+static void slab_set(hsize_t start[], hsize_t count[],
hsize_t stride[], hsize_t block[]);
-static void fill_data(hssize_t start[], hsize_t count[]);
+static void fill_data(void);
static void write_data(hid_t loc, const char *dset_name,
- hssize_t start[], hsize_t count[],
+ hsize_t start[], hsize_t count[],
hsize_t stride[], hsize_t block[]);
static void verify_complete_dataset(hid_t loc, const char *dset_name);
static void verify_partial_dataset(hid_t loc, const char *dset_name,
- hssize_t start[], hsize_t count[],
+ hsize_t start[], hsize_t count[],
hsize_t stride[], hsize_t block[],
- int * buf, int buf_len);
+ int * buf, hsize_t buf_len);
static void test_group_creation(hid_t loc);
static void test_dataset_creation(hid_t loc);
static void test_dataset_access(hid_t loc);
@@ -105,7 +105,7 @@ static int *local_orig_data = NULL; /* data that's written to datasets */
static hsize_t dims[RANK] = {0, 0};
/* Hyperslab settings */
-static hssize_t start[RANK];
+static hsize_t start[RANK];
static hsize_t count[RANK];
static hsize_t stride[RANK];
static hsize_t block[RANK];
@@ -137,7 +137,7 @@ static void
check_globals(char * location_name)
{
static hsize_t local_dims[RANK] = {0,0};
- static hssize_t local_start[RANK] = {0,0};
+ static hsize_t local_start[RANK] = {0,0};
static hsize_t local_count[RANK] = {0,0};
static hsize_t local_stride[RANK] = {0,0};
static hsize_t local_block[RANK] = {0,0};
@@ -241,12 +241,12 @@ create_file(const char *filename)
*-------------------------------------------------------------------------
*/
static hid_t
-create_group(hid_t loc, const char *grp_name, size_t size_hint)
+create_group(hid_t loc, const char *group_name, size_t size_hint)
{
hid_t group;
- VRFY(((group = H5Gcreate(loc, grp_name, size_hint)) >= 0), "H5Gcreate");
- printf("%d: Created group \"%s\"\n", mpi_rank, grp_name);
+ VRFY(((group = H5Gcreate(loc, group_name, size_hint)) >= 0), "H5Gcreate");
+ printf("%d: Created group \"%s\"\n", mpi_rank, group_name);
return group;
}
@@ -265,7 +265,7 @@ create_group(hid_t loc, const char *grp_name, size_t size_hint)
*-------------------------------------------------------------------------
*/
static hid_t
-create_dset(hid_t loc, const char *dset_name)
+create_dset(hid_t loc, const char *dataset_name)
{
hid_t dset, sid;
@@ -274,9 +274,9 @@ create_dset(hid_t loc, const char *dset_name)
VRFY(((sid = H5Screate_simple(RANK, dims, NULL)) >= 0), "H5Screate_simple");
printf("%d: Created simple dataspace\n", mpi_rank);
- dset = H5Dcreate(loc, dset_name, H5T_NATIVE_INT, sid, H5P_DEFAULT);
+ dset = H5Dcreate(loc, dataset_name, H5T_NATIVE_INT, sid, H5P_DEFAULT);
VRFY((dset >= 0), "H5Dcreate");
- printf("%d: Created dataset \"%s\"\n", mpi_rank, dset_name);
+ printf("%d: Created dataset \"%s\"\n", mpi_rank, dataset_name);
VRFY((H5Sclose(sid) >= 0), "H5Sclose");
return dset;
@@ -292,11 +292,11 @@ create_dset(hid_t loc, const char *dset_name)
*-------------------------------------------------------------------------
*/
static void
-access_dset(hid_t loc, const char *dset_name)
+access_dset(hid_t loc, const char *dataset_name)
{
hid_t dataset;
- VRFY(((dataset = H5Dopen(loc, dset_name)) >= 0), "H5Dopen");
+ VRFY(((dataset = H5Dopen(loc, dataset_name)) >= 0), "H5Dopen");
VRFY((H5Dclose(dataset) >= 0), "H5Dclose");
}
@@ -314,24 +314,24 @@ access_dset(hid_t loc, const char *dset_name)
*-------------------------------------------------------------------------
*/
static void
-slab_set(hssize_t start[], hsize_t count[], hsize_t stride[], hsize_t block[])
+slab_set(hsize_t my_start[], hsize_t my_count[], hsize_t my_stride[], hsize_t my_block[])
{
/* initialize dims according to the number of processes: */
dims[0] = DIM0 * mpi_size;
dims[1] = DIM1;
/* Each process takes a slab of rows. */
- block[0] = DIM0;
- block[1] = DIM1;
+ my_block[0] = DIM0;
+ my_block[1] = DIM1;
- stride[0] = block[0];
- stride[1] = block[1];
+ my_stride[0] = my_block[0];
+ my_stride[1] = my_block[1];
- count[0] = 1;
- count[1] = 1;
+ my_count[0] = 1;
+ my_count[1] = 1;
- start[0] = mpi_rank * block[0];
- start[1] = 0;
+ my_start[0] = mpi_rank * my_block[0];
+ my_start[1] = 0;
}
/*-------------------------------------------------------------------------
@@ -356,7 +356,7 @@ slab_set(hssize_t start[], hsize_t count[], hsize_t stride[], hsize_t block[])
*-------------------------------------------------------------------------
*/
static void
-fill_data(hssize_t start[], hsize_t count[])
+fill_data(void)
{
int col;
int row;
@@ -406,36 +406,36 @@ fill_data(hssize_t start[], hsize_t count[])
*-------------------------------------------------------------------------
*/
static void
-write_data(hid_t loc, const char *dset_name, hssize_t start[], hsize_t count[],
- hsize_t stride[], hsize_t block[])
+write_data(hid_t loc, const char *dataset_name, hsize_t my_start[], hsize_t my_count[],
+ hsize_t my_stride[], hsize_t my_block[])
{
herr_t hrc;
hid_t file_dataspace, mem_dataspace;
hid_t dataset;
/* See if dataset is there */
- VRFY(((dataset = H5Dopen(loc, dset_name)) >= 0), "H5Dopen");
+ VRFY(((dataset = H5Dopen(loc, dataset_name)) >= 0), "H5Dopen");
file_dataspace = H5Dget_space(dataset);
VRFY((file_dataspace >= 0), "H5Dget_space");
hrc = H5Sselect_hyperslab(file_dataspace, H5S_SELECT_SET,
- start, stride, count, block);
+ my_start, my_stride, my_count, my_block);
#if 0
/* some debugging code we may want to keep for a time. JRM - 4/13/04 */
if ( hrc < 0 ) { /* dump the parameters */
printf("%d: start=[%d,%d], count=[%d, %d], stride=[%d,%d], block=[%d,%d]\n",
mpi_rank,
- (int)(start[0]), (int)(start[1]),
- (int)(count[0]), (int)(count[1]),
- (int)(stride[0]), (int)(stride[1]),
- (int)(block[0]), (int)(block[1]));
+ (int)(my_start[0]), (int)(my_start[1]),
+ (int)(my_count[0]), (int)(my_count[1]),
+ (int)(my_stride[0]), (int)(my_stride[1]),
+ (int)(my_block[0]), (int)(my_block[1]));
}
#endif
VRFY((hrc >= 0), "H5Sselect_hyperslab in write_data");
/* create a memory dataspace independently */
- mem_dataspace = H5Screate_simple(RANK, block, NULL);
+ mem_dataspace = H5Screate_simple(RANK, my_block, NULL);
VRFY((mem_dataspace >= 0), "H5Screate_simple");
hrc = H5Dwrite(dataset, H5T_NATIVE_INT, mem_dataspace,
@@ -460,18 +460,18 @@ write_data(hid_t loc, const char *dset_name, hssize_t start[], hsize_t count[],
*-------------------------------------------------------------------------
*/
static void
-verify_complete_dataset(hid_t loc, const char *dset_name)
+verify_complete_dataset(hid_t loc, const char *dataset_name)
{
hid_t dataset;
int *data_array = NULL;
size_t data_array_len = 0;
- int col;
- int row;
+ unsigned col;
+ unsigned row;
int offset = 0;
int vrfyerrs = 0;
/* Open the dataset */
- VRFY(((dataset = H5Dopen(loc, dset_name)) >= 0), "H5Dopen");
+ VRFY(((dataset = H5Dopen(loc, dataset_name)) >= 0), "H5Dopen");
/* allocate a buffer to receive the contents of the file dataset */
VRFY((dims[0] != 0), "dims array initialized.");
@@ -490,7 +490,7 @@ verify_complete_dataset(hid_t loc, const char *dset_name)
if ( data_array[offset] != orig_data[offset] ) {
if ( vrfyerrs++ < MAX_ERR_REPORT ) {
fprintf(stdout, "%d: Dataset Verify failed at "
- "row %d, col %d: expect %d, got %d\n", mpi_rank,
+ "row %u, col %u: expect %d, got %d\n", mpi_rank,
row, col, orig_data[offset], data_array[offset]);
}
}
@@ -527,30 +527,30 @@ verify_complete_dataset(hid_t loc, const char *dset_name)
*-------------------------------------------------------------------------
*/
static void
-verify_partial_dataset(hid_t loc, const char *dset_name,
- hssize_t start[], hsize_t count[],
- hsize_t stride[], hsize_t block[],
- int * buf, int buf_len)
+verify_partial_dataset(hid_t loc, const char *dataset_name,
+ hsize_t my_start[], hsize_t my_count[],
+ hsize_t my_stride[], hsize_t my_block[],
+ int * buf, hsize_t buf_len)
{
hid_t dataset, file_dataspace, mem_dataspace;
int *data_array;
- int col;
- int row;
- int offset = 0;
+ unsigned col;
+ unsigned row;
+ hsize_t offset = 0;
int vrfyerrs = 0;
/* Open the dataset */
- VRFY(((dataset = H5Dopen(loc, dset_name)) >= 0), "H5Dopen");
+ VRFY(((dataset = H5Dopen(loc, dataset_name)) >= 0), "H5Dopen");
/* Create a file dataspace */
file_dataspace = H5Dget_space(dataset);
VRFY((file_dataspace >= 0), "H5Dget_space");
VRFY((H5Sselect_hyperslab(file_dataspace, H5S_SELECT_SET,
- start, stride, count, block) >= 0),
+ my_start, my_stride, my_count, my_block) >= 0),
"H5Sselect_hyperslab in verify_partial_dataset");
/* Create a memory dataspace */
- mem_dataspace = H5Screate_simple(RANK, block, NULL);
+ mem_dataspace = H5Screate_simple(RANK, my_block, NULL);
VRFY((mem_dataspace >= 0), "H5Screate_simple");
VRFY(((block[0] * block[1]) == buf_len), "buf_len matches.");
@@ -568,7 +568,7 @@ verify_partial_dataset(hid_t loc, const char *dset_name,
if ( data_array[offset] != buf[offset] ) {
if ( vrfyerrs++ < MAX_ERR_REPORT ) {
fprintf(stdout, "%d: Dataset Verify failed at "
- "row %d, col %d: expected %d, got %d\n", mpi_rank,
+ "row %u, col %u: expected %d, got %d\n", mpi_rank,
row, col, buf[offset], data_array[offset]);
}
}
@@ -837,7 +837,7 @@ usage(const char *prog)
int
main(int argc, char *argv[])
{
- hid_t fid, fapl2;
+ hid_t fid;
herr_t hrc;
int nargs;
@@ -910,7 +910,7 @@ main(int argc, char *argv[])
sizeof(int));
VRFY((orig_data != NULL), "local_orig_data malloc succeeded");
- fill_data(start, count);
+ fill_data();
for (i = 0; i < sizeof(FILENAME) / sizeof(FILENAME[0]) - 1; ++i) {
if (h5_fixname(FILENAME[i], fapl, filenames[i], sizeof(filenames[i])) == NULL) {
@@ -941,7 +941,7 @@ main(int argc, char *argv[])
* Reverify that the data is still "correct"
*===------------------------------------------------------------===
*/
- for (i = 0; i < mpi_size; ++i)
+ for (i = 0; i < (unsigned)mpi_size; ++i)
if (i != SAP_RANK) {
hid_t group;
@@ -1009,7 +1009,6 @@ main(int argc, char *argv[])
fprintf(stderr, "===================================\n");
}
-done:
H5close();
MPI_Finalize();
return nerrors;
diff --git a/testpar/t_mdset.c b/testpar/t_mdset.c
index b23a26e..06aedf3 100644
--- a/testpar/t_mdset.c
+++ b/testpar/t_mdset.c
@@ -30,7 +30,7 @@ void group_dataset_read(hid_t fid, int mpi_rank, int m);
void write_attribute(hid_t, int, int);
int read_attribute(hid_t, int, int);
int check_value(DATATYPE *, DATATYPE *, int);
-void get_slab(hssize_t[], hsize_t[], hsize_t[], hsize_t[], int);
+void get_slab(hsize_t[], hsize_t[], hsize_t[], hsize_t[], int);
/*
@@ -87,18 +87,18 @@ void multiple_dset_write(void)
hid_t iof, plist, dataset, memspace, filespace;
hid_t dcpl; /* Dataset creation property list */
hbool_t use_gpfs = FALSE; /* Use GPFS hints */
- hssize_t chunk_origin [DIM];
+ hsize_t chunk_origin [DIM];
hsize_t chunk_dims [DIM], file_dims [DIM];
hsize_t count[DIM]={1,1};
double * outme = NULL;
double fill=1.0; /* Fill value */
char dname [100];
herr_t ret;
- H5Ptest_param_t *pt;
+ const H5Ptest_param_t *pt;
char *filename;
int ndatasets;
- pt = (H5Ptest_param_t *) GetTestParameters();
+ pt = GetTestParameters();
filename = pt->name;
ndatasets = pt->count;
@@ -180,7 +180,7 @@ void compact_dataset(void)
double * inme;
char dname[]="dataset";
herr_t ret;
- char *filename;
+ const char *filename;
size = get_size();
@@ -198,7 +198,7 @@ void compact_dataset(void)
inme = HDmalloc((size_t)(size * size * sizeof(double)));
VRFY((outme != NULL), "HDmalloc succeeded for inme");
- filename = (char *) GetTestParameters();
+ filename = GetTestParameters();
VRFY((mpi_size <= size), "mpi_size <= size");
plist = create_faccess_plist(MPI_COMM_WORLD, MPI_INFO_NULL, facc_type, use_gpfs);
@@ -293,12 +293,12 @@ void null_dataset(void)
char dname[]="dataset";
char attr_name[]="attribute";
herr_t ret;
- char *filename;
+ const char *filename;
MPI_Comm_rank (MPI_COMM_WORLD, &mpi_rank);
MPI_Comm_size (MPI_COMM_WORLD, &mpi_size);
- filename = (char *) GetTestParameters();
+ filename = GetTestParameters();
plist = create_faccess_plist(MPI_COMM_WORLD, MPI_INFO_NULL,
facc_type, use_gpfs);
@@ -398,7 +398,7 @@ void big_dataset(void)
char dname[]="dataset"; /* Name of dataset */
MPI_Offset file_size; /* Size of file on disk */
herr_t ret; /* Generic return value */
- char *filename;
+ const char *filename;
MPI_Comm_rank (MPI_COMM_WORLD, &mpi_rank);
MPI_Comm_size (MPI_COMM_WORLD, &mpi_size);
@@ -406,7 +406,7 @@ void big_dataset(void)
/* Verify MPI_Offset can handle larger than 2GB sizes */
VRFY((sizeof(MPI_Offset)>4), "sizeof(MPI_Offset)>4");
- filename = (char *) GetTestParameters();
+ filename = GetTestParameters();
fapl = create_faccess_plist(MPI_COMM_WORLD, MPI_INFO_NULL, facc_type, use_gpfs);
VRFY((fapl >= 0), "create_faccess_plist succeeded");
@@ -530,19 +530,19 @@ void dataset_fillvalue(void)
filespace; /* Dataset's dataspace ID */
char dname[]="dataset"; /* Name of dataset */
hsize_t dset_dims[4] = {0, 6, 7, 8};
- hssize_t req_start[4] = {0, 0, 0, 0};
+ hsize_t req_start[4] = {0, 0, 0, 0};
hsize_t req_count[4] = {1, 6, 7, 8};
hsize_t dset_size; /* Dataset size */
int *rdata, *wdata; /* Buffers for data to read and write */
int *twdata, *trdata; /* Temporary pointer into buffer */
int acc, i, j, k, l; /* Local index variables */
herr_t ret; /* Generic return value */
- char *filename;
+ const char *filename;
MPI_Comm_rank (MPI_COMM_WORLD, &mpi_rank);
MPI_Comm_size (MPI_COMM_WORLD, &mpi_size);
- filename = (char *) GetTestParameters();
+ filename = GetTestParameters();
/* Set the dataset dimension to be one row more than number of processes */
/* and calculate the actual dataset size. */
@@ -710,15 +710,15 @@ void collective_group_write(void)
char gname[64], dname[32];
hid_t fid, gid, did, plist, dcpl, memspace, filespace;
DATATYPE * outme = NULL;
- hssize_t chunk_origin[DIM];
+ hsize_t chunk_origin[DIM];
hsize_t chunk_dims[DIM], file_dims[DIM], count[DIM];
hsize_t chunk_size[2]; /* Chunk dimensions - computed shortly */
herr_t ret1, ret2;
- H5Ptest_param_t *pt;
+ const H5Ptest_param_t *pt;
char *filename;
int ngroups;
- pt = (H5Ptest_param_t *) GetTestParameters();
+ pt = GetTestParameters();
filename = pt->name;
ngroups = pt->count;
@@ -803,11 +803,11 @@ void independent_group_read(void)
int mpi_rank, m;
hid_t plist, fid;
hbool_t use_gpfs = FALSE;
- H5Ptest_param_t *pt;
+ const H5Ptest_param_t *pt;
char *filename;
int ngroups;
- pt = (H5Ptest_param_t *) GetTestParameters();
+ pt = GetTestParameters();
filename = pt->name;
ngroups = pt->count;
@@ -927,14 +927,14 @@ void multiple_group_write(void)
hbool_t use_gpfs = FALSE;
char gname[64];
hid_t fid, gid, plist, memspace, filespace;
- hssize_t chunk_origin[DIM];
+ hsize_t chunk_origin[DIM];
hsize_t chunk_dims[DIM], file_dims[DIM], count[DIM];
herr_t ret;
- H5Ptest_param_t *pt;
+ const H5Ptest_param_t *pt;
char *filename;
int ngroups;
- pt = (H5Ptest_param_t *) GetTestParameters();
+ pt = GetTestParameters();
filename = pt->name;
ngroups = pt->count;
@@ -1098,13 +1098,13 @@ void multiple_group_read(void)
hbool_t use_gpfs = FALSE;
char gname[64];
hid_t plist, fid, gid, memspace, filespace;
- hssize_t chunk_origin[DIM];
+ hsize_t chunk_origin[DIM];
hsize_t chunk_dims[DIM], file_dims[DIM], count[DIM];
- H5Ptest_param_t *pt;
+ const H5Ptest_param_t *pt;
char *filename;
int ngroups;
- pt = (H5Ptest_param_t *) GetTestParameters();
+ pt = GetTestParameters();
filename = pt->name;
ngroups = pt->count;
@@ -1335,7 +1335,7 @@ int check_value(DATATYPE *indata, DATATYPE *outdata, int size)
{
int mpi_rank, mpi_size, err_num=0;
hsize_t i, j;
- hssize_t chunk_origin[DIM];
+ hsize_t chunk_origin[DIM];
hsize_t chunk_dims[DIM], count[DIM];
MPI_Comm_rank(MPI_COMM_WORLD, &mpi_rank);
@@ -1349,7 +1349,7 @@ int check_value(DATATYPE *indata, DATATYPE *outdata, int size)
for(j=chunk_origin[1]; j<(chunk_origin[1]+chunk_dims[1]); j++) {
if( *indata != *outdata )
if(err_num++ < MAX_ERR_REPORT || VERBOSE_MED)
- printf("Dataset Verify failed at [%ld][%ld](row %ld, col%ld): expect %d, got %d\n", (long)i, (long)j, (long)i, (long)j, *outdata, *indata);
+ printf("Dataset Verify failed at [%lu][%lu](row %lu, col%lu): expect %d, got %d\n", (unsigned long)i, (unsigned long)j, (unsigned long)i, (unsigned long)j, *outdata, *indata);
}
if(err_num > MAX_ERR_REPORT && !VERBOSE_MED)
printf("[more errors ...]\n");
@@ -1367,7 +1367,7 @@ int check_value(DATATYPE *indata, DATATYPE *outdata, int size)
* JRM - 8/11/04
*/
-void get_slab(hssize_t chunk_origin[],
+void get_slab(hsize_t chunk_origin[],
hsize_t chunk_dims[],
hsize_t count[],
hsize_t file_dims[],
@@ -1429,13 +1429,12 @@ void io_mode_confusion(void)
/* identifiers */
hsize_t dimsf[1]; /* dataset dimensions */
int data[N] = {1}; /* pointer to data buffer to write */
- hssize_t select[N] = {0L,1L,2L,3L};
- hssize_t start[1];
- hsize_t stride[1];
- hsize_t count[1];
- hsize_t block[1];
+ hsize_t coord[N] = {0L,1L,2L,3L};
+ hsize_t start[1];
+ hsize_t stride[1];
+ hsize_t count[1];
+ hsize_t block[1];
hid_t plist_id; /* property list identifier */
- int i;
herr_t status;
@@ -1450,13 +1449,13 @@ void io_mode_confusion(void)
* test bed related variables
*/
- char * fcn_name = "io_mode_confusion";
+ const char * fcn_name = "io_mode_confusion";
const hbool_t verbose = FALSE;
- H5Ptest_param_t * pt;
+ const H5Ptest_param_t * pt;
char * filename;
- pt = (H5Ptest_param_t *) GetTestParameters();
+ pt = GetTestParameters();
filename = pt->name;
MPI_Comm_rank(MPI_COMM_WORLD, &mpi_rank);
@@ -1592,7 +1591,7 @@ void io_mode_confusion(void)
mpi_rank, fcn_name);
status = H5Sselect_elements(filespace, H5S_SELECT_SET, N,
- (const hssize_t **)&select);
+ (const hsize_t **)&coord);
VRFY(( status >= 0 ), "H5Sselect_elements() failed");
diff --git a/testpar/t_mpi.c b/testpar/t_mpi.c
index 71494d4..7b7a96b 100644
--- a/testpar/t_mpi.c
+++ b/testpar/t_mpi.c
@@ -37,10 +37,11 @@ int nerrors = 0;
hid_t fapl; /* file access property list */
/* protocols */
+static int errors_sum(int nerrs);
#define MPIO_TEST_WRITE_SIZE 1024*1024 /* 1 MB */
-int
+static int
test_mpio_overlap_writes(char *filename)
{
int mpi_size, mpi_rank;
@@ -186,7 +187,7 @@ test_mpio_overlap_writes(char *filename)
* Then reads the file back in by reverse order, that is process 0
* reads the data of process n-1 and vice versa.
*/
-int
+static int
test_mpio_gb_file(char *filename)
{
int mpi_size, mpi_rank;
@@ -407,7 +408,8 @@ finish:
#define USEFSYNC 2 /* request file_sync */
-int test_mpio_1wMr(char *filename, int special_request)
+static int
+test_mpio_1wMr(char *filename, int special_request)
{
char hostname[128];
int mpi_size, mpi_rank;
@@ -593,7 +595,7 @@ if (special_request & USEFSYNC){
/*
* parse the command line options
*/
-int
+static int
parse_options(int argc, char **argv)
{
while (--argc){
@@ -655,7 +657,7 @@ parse_options(int argc, char **argv)
/*
* Show command usage
*/
-void
+static void
usage(void)
{
printf("Usage: t_mpi [-v<verbosity>] [-f <prefix>]\n");
@@ -667,7 +669,8 @@ usage(void)
/*
* return the sum of all errors.
*/
-int errors_sum(nerrs)
+static int
+errors_sum(int nerrs)
{
int temp;
MPI_Allreduce(&nerrs, &temp, 1, MPI_INT, MPI_SUM, MPI_COMM_WORLD);
diff --git a/testpar/t_span_tree.c b/testpar/t_span_tree.c
index 28d95ee..26f25bf 100644
--- a/testpar/t_span_tree.c
+++ b/testpar/t_span_tree.c
@@ -203,7 +203,7 @@ coll_irregular_complex_chunk_read(void)
void coll_write_test(int chunk_factor)
{
- char *filename;
+ const char *filename;
hid_t acc_plist,xfer_plist;
hid_t file, datasetc,dataseti; /* File and dataset identifiers */
hid_t mspaceid1, mspaceid, fspaceid,fspaceid1; /* Dataspace identifiers */
@@ -219,7 +219,7 @@ void coll_write_test(int chunk_factor)
read selection from the
dataset on the disk */
- hssize_t start[2]; /* Start of hyperslab */
+ hsize_t start[2]; /* Start of hyperslab */
hsize_t stride[2]; /* Stride of hyperslab */
hsize_t count[2]; /* Block count */
hsize_t block[2]; /* Block sizes */
@@ -245,7 +245,7 @@ void coll_write_test(int chunk_factor)
/* Obtain file name */
- filename = (char *) GetTestParameters();
+ filename = GetTestParameters();
/*
* Buffers' initialization.
@@ -564,7 +564,7 @@ void coll_write_test(int chunk_factor)
void coll_read_test(int chunk_factor)
{
- char *filename;
+ const char *filename;
hid_t acc_plist,xfer_plist;
hid_t file, dataseti; /* File and dataset identifiers */
hid_t mspaceid, fspaceid1; /* Dataspace identifiers */
@@ -575,7 +575,7 @@ void coll_read_test(int chunk_factor)
read selection from the
dataset on the disk */
- hssize_t start[2]; /* Start of hyperslab */
+ hsize_t start[2]; /* Start of hyperslab */
hsize_t stride[2]; /* Stride of hyperslab */
hsize_t count[2]; /* Block count */
hsize_t block[2]; /* Block sizes */
@@ -598,7 +598,7 @@ void coll_read_test(int chunk_factor)
/* Obtain file name */
- filename = (char *) GetTestParameters();
+ filename = GetTestParameters();
/*
* Buffers' initialization.
diff --git a/testpar/testphdf5.c b/testpar/testphdf5.c
index ce1a4cf..f753919 100644
--- a/testpar/testphdf5.c
+++ b/testpar/testphdf5.c
@@ -434,8 +434,7 @@ int main(int argc, char **argv)
"collective to independent chunk io",PARATESTFILE);
}
- #ifdef KYANG
-
+#ifdef KYANG
AddTest("ccontw",coll_irregular_cont_write,NULL,
"collective irregular contiguous write",PARATESTFILE);
AddTest("ccontr",coll_irregular_cont_read,NULL,
@@ -451,9 +450,8 @@ int main(int argc, char **argv)
AddTest("ccchunkr",coll_irregular_complex_chunk_read,NULL,
"collective irregular complex chunk read",PARATESTFILE);
-
#endif
-
+
AddTest("null", null_dataset, NULL,
"null dataset test", PARATESTFILE);
@@ -463,6 +461,7 @@ int main(int argc, char **argv)
AddTest("I/Omodeconf", io_mode_confusion, NULL,
"I/O mode confusion test -- hangs quickly on failure",
&io_mode_confusion_params);
+
/* Display testing information */
TestInfo(argv[0]);
@@ -473,14 +472,6 @@ int main(int argc, char **argv)
/* Parse command line arguments */
TestParseCmdLine(argc, argv);
- /*
- if (parse_options(argc, argv) != 0){
- if (MAINPROCESS)
- usage();
- goto finish;
- }
- */
-
if (facc_type == FACC_MPIPOSIX && MAINPROCESS){
printf("===================================\n"
" Using MPIPOSIX driver\n"
@@ -490,7 +481,6 @@ int main(int argc, char **argv)
/* Perform requested testing */
PerformTests();
-finish:
/* make sure all processes are finished before final report, cleanup
* and exit.
*/
diff --git a/testpar/testphdf5.h b/testpar/testphdf5.h
index 96384bf..283f916 100644
--- a/testpar/testphdf5.h
+++ b/testpar/testphdf5.h
@@ -271,7 +271,7 @@ void compress_readAll(void);
/* commonly used prototypes */
hid_t create_faccess_plist(MPI_Comm comm, MPI_Info info, int l_facc_type, hbool_t use_gpfs);
MPI_Offset h5_mpi_get_file_size(const char *filename, MPI_Comm comm, MPI_Info info);
-int dataset_vrfy(hssize_t start[], hsize_t count[], hsize_t stride[],
+int dataset_vrfy(hsize_t start[], hsize_t count[], hsize_t stride[],
hsize_t block[], DATATYPE *dataset, DATATYPE *original);
#endif /* PHDF5TEST_H */