summaryrefslogtreecommitdiffstats
path: root/tools/test/perform/pio_engine.c
diff options
context:
space:
mode:
Diffstat (limited to 'tools/test/perform/pio_engine.c')
-rw-r--r--tools/test/perform/pio_engine.c51
1 files changed, 21 insertions, 30 deletions
diff --git a/tools/test/perform/pio_engine.c b/tools/test/perform/pio_engine.c
index 77c04ab..f3cb3ec 100644
--- a/tools/test/perform/pio_engine.c
+++ b/tools/test/perform/pio_engine.c
@@ -54,24 +54,15 @@
/* sizes of various items. these sizes won't change during program execution */
/* The following three must have the same type */
-#define ELMT_SIZE (sizeof(unsigned char)) /* we're doing bytes */
-#define ELMT_MPI_TYPE MPI_BYTE
#define ELMT_H5_TYPE H5T_NATIVE_UCHAR
#define GOTOERROR(errcode) { ret_code = errcode; goto done; }
-#define GOTODONE { goto done; }
#define ERRMSG(mesg) { \
HDfprintf(stderr, "Proc %d: ", pio_mpi_rank_g); \
HDfprintf(stderr, "*** Assertion failed (%s) at line %4d in %s\n", \
mesg, (int)__LINE__, __FILE__); \
}
-#define MSG(mesg) { \
- HDfprintf(stderr, "Proc %d: ", pio_mpi_rank_g); \
- HDfprintf(stderr, "(%s) at line %4d in %s\n", \
- mesg, (int)__LINE__, __FILE__); \
-}
-
/* verify: if val is false (0), print mesg. */
#define VRFY(val, mesg) do { \
if (!val) { \
@@ -208,7 +199,7 @@ do_pio(parameters param)
bsize = buf_size; /* Actual buffer size */
}
else {
- snbytes = (off_t)sqrt(nbytes); /* General dataset size */
+ snbytes = (off_t)sqrt((double)nbytes); /* General dataset size */
bsize = buf_size * blk_size; /* Actual buffer size */
}
@@ -557,16 +548,16 @@ do_write(results *res, file_descr *fd, parameters *parms, long ndsets,
/* HDF5 variables */
herr_t hrc; /*HDF5 return code */
hsize_t h5dims[2]; /*dataset dim sizes */
- hid_t h5dset_space_id = -1; /*dataset space ID */
- hid_t h5mem_space_id = -1; /*memory dataspace ID */
- hid_t h5ds_id = -1; /*dataset handle */
+ hid_t h5dset_space_id = H5I_INVALID_HID; /*dataset space ID */
+ hid_t h5mem_space_id = H5I_INVALID_HID; /*memory dataspace ID */
+ hid_t h5ds_id = H5I_INVALID_HID; /*dataset handle */
hsize_t h5block[2]; /*dataspace selection */
hsize_t h5stride[2];
hsize_t h5count[2];
hsize_t h5start[2];
hssize_t h5offset[2]; /* Selection offset within dataspace */
- hid_t h5dcpl = -1; /* Dataset creation property list */
- hid_t h5dxpl = -1; /* Dataset transfer property list */
+ hid_t h5dcpl = H5I_INVALID_HID; /* Dataset creation property list */
+ hid_t h5dxpl = H5I_INVALID_HID; /* Dataset transfer property list */
/* Get the parameters from the parameter block */
blk_size=parms->blk_size;
@@ -601,7 +592,7 @@ do_write(results *res, file_descr *fd, parameters *parms, long ndsets,
/* nbytes is always the number of bytes per dataset (1D or 2D). If the
dataspace is 2D, snbytes is the size of a side of the dataset square.
*/
- snbytes = (off_t)sqrt(nbytes);
+ snbytes = (off_t)sqrt((double)nbytes);
/* Contiguous Pattern: */
if (!parms->interleaved) {
@@ -1402,7 +1393,7 @@ do_write(results *res, file_descr *fd, parameters *parms, long ndsets,
GOTOERROR(FAIL);
}
- h5ds_id = -1;
+ h5ds_id = H5I_INVALID_HID;
} /* end if */
} /* end for */
@@ -1458,7 +1449,7 @@ done:
HDfprintf(stderr, "HDF5 Dataset Space Close failed\n");
ret_code = FAIL;
} else {
- h5dset_space_id = -1;
+ h5dset_space_id = H5I_INVALID_HID;
}
}
@@ -1468,7 +1459,7 @@ done:
HDfprintf(stderr, "HDF5 Memory Space Close failed\n");
ret_code = FAIL;
} else {
- h5mem_space_id = -1;
+ h5mem_space_id = H5I_INVALID_HID;
}
}
@@ -1478,7 +1469,7 @@ done:
HDfprintf(stderr, "HDF5 Dataset Transfer Property List Close failed\n");
ret_code = FAIL;
} else {
- h5dxpl = -1;
+ h5dxpl = H5I_INVALID_HID;
}
}
@@ -1537,15 +1528,15 @@ do_read(results *res, file_descr *fd, parameters *parms, long ndsets,
/* HDF5 variables */
herr_t hrc; /*HDF5 return code */
hsize_t h5dims[2]; /*dataset dim sizes */
- hid_t h5dset_space_id = -1; /*dataset space ID */
- hid_t h5mem_space_id = -1; /*memory dataspace ID */
- hid_t h5ds_id = -1; /*dataset handle */
+ hid_t h5dset_space_id = H5I_INVALID_HID; /*dataset space ID */
+ hid_t h5mem_space_id = H5I_INVALID_HID; /*memory dataspace ID */
+ hid_t h5ds_id = H5I_INVALID_HID; /*dataset handle */
hsize_t h5block[2]; /*dataspace selection */
hsize_t h5stride[2];
hsize_t h5count[2];
hsize_t h5start[2];
hssize_t h5offset[2]; /* Selection offset within dataspace */
- hid_t h5dxpl = -1; /* Dataset transfer property list */
+ hid_t h5dxpl = H5I_INVALID_HID; /* Dataset transfer property list */
/* Get the parameters from the parameter block */
blk_size=parms->blk_size;
@@ -1577,7 +1568,7 @@ do_read(results *res, file_descr *fd, parameters *parms, long ndsets,
/* nbytes is always the number of bytes per dataset (1D or 2D). If the
dataspace is 2D, snbytes is the size of a side of the 'dataset square'.
*/
- snbytes = (off_t)sqrt(nbytes);
+ snbytes = (off_t)sqrt((double)nbytes);
bsize = buf_size * blk_size;
@@ -2357,7 +2348,7 @@ do_read(results *res, file_descr *fd, parameters *parms, long ndsets,
GOTOERROR(FAIL);
}
- h5ds_id = -1;
+ h5ds_id = H5I_INVALID_HID;
} /* end if */
} /* end for */
@@ -2413,7 +2404,7 @@ done:
HDfprintf(stderr, "HDF5 Dataset Space Close failed\n");
ret_code = FAIL;
} else {
- h5dset_space_id = -1;
+ h5dset_space_id = H5I_INVALID_HID;
}
}
@@ -2423,7 +2414,7 @@ done:
HDfprintf(stderr, "HDF5 Memory Space Close failed\n");
ret_code = FAIL;
} else {
- h5mem_space_id = -1;
+ h5mem_space_id = H5I_INVALID_HID;
}
}
@@ -2433,7 +2424,7 @@ done:
HDfprintf(stderr, "HDF5 Dataset Transfer Property List Close failed\n");
ret_code = FAIL;
} else {
- h5dxpl = -1;
+ h5dxpl = H5I_INVALID_HID;
}
}
@@ -2451,7 +2442,7 @@ done:
do_fopen(parameters *param, char *fname, file_descr *fd /*out*/, int flags)
{
int ret_code = SUCCESS, mrc;
- hid_t acc_tpl = -1; /* file access templates */
+ hid_t acc_tpl = H5I_INVALID_HID; /* file access templates */
switch (param->io_type) {
case POSIXIO: