summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAllen Byrne <byrn@hdfgroup.org>2018-08-28 20:09:31 (GMT)
committerAllen Byrne <byrn@hdfgroup.org>2018-08-28 20:09:31 (GMT)
commit80c9c77d2e0115b1e5d19599267d9309410dd5f8 (patch)
treed98c4c33920bf9fe44da8c0339a27fe36bc24ea9
parent553b1a01f89265fc2f01c15687ddae40e6d1d81d (diff)
parentff13ed67a9ce20e5f598bd46cd6dd544b5237e22 (diff)
downloadhdf5-80c9c77d2e0115b1e5d19599267d9309410dd5f8.zip
hdf5-80c9c77d2e0115b1e5d19599267d9309410dd5f8.tar.gz
hdf5-80c9c77d2e0115b1e5d19599267d9309410dd5f8.tar.bz2
Merge pull request #1226 in HDFFV/hdf5 from ~BYRN/hdf5_adb:develop to develop
* commit 'ff13ed67a9ce20e5f598bd46cd6dd544b5237e22': Fix typo HD prefix and whitespace
-rw-r--r--hl/src/H5DS.c106
-rw-r--r--hl/test/test_ds.c112
-rw-r--r--hl/test/test_lite.c86
-rw-r--r--java/examples/groups/JavaGroupExample.sh.in29
-rw-r--r--java/src/jni/h5dImp.c2
-rw-r--r--java/src/jni/h5pImp.c4
-rw-r--r--java/src/jni/h5sImp.c6
-rw-r--r--java/src/jni/h5util.c10
-rw-r--r--test/Makefile.am10
-rw-r--r--test/cache_logging.c12
-rw-r--r--test/genall5.c3208
-rw-r--r--test/ohdr.c4
-rw-r--r--test/tmisc.c2
-rw-r--r--test/tunicode.c6
-rw-r--r--test/tvltypes.c22
-rw-r--r--test/vfd.c22
-rw-r--r--testpar/t_cache.c2
-rw-r--r--testpar/t_dset.c1050
-rw-r--r--tools/lib/h5tools_utils.h2
-rw-r--r--tools/src/h5diff/h5diff_common.c6
-rw-r--r--tools/src/h5import/h5import.c302
-rw-r--r--tools/src/h5stat/h5stat.c88
-rw-r--r--tools/test/h5import/h5importtest.c4
-rw-r--r--tools/test/perform/perf.c70
24 files changed, 2331 insertions, 2834 deletions
diff --git a/hl/src/H5DS.c b/hl/src/H5DS.c
index d86cc98..067992f 100644
--- a/hl/src/H5DS.c
+++ b/hl/src/H5DS.c
@@ -241,7 +241,7 @@ herr_t H5DSattach_scale(hid_t did,
if (has_dimlist == 0)
{
- dims[0] = (hsize_t)rank;
+ dims[0] = (hsize_t)rank;
/* space for the attribute */
if((sid = H5Screate_simple(1, dims, NULL)) < 0)
@@ -556,9 +556,9 @@ out:
*
* Date: December 20, 2004
*
-* Comments:
+* Comments:
*
-* Modifications: Function didn't delete DIMENSION_LIST attribute, when
+* Modifications: Function didn't delete DIMENSION_LIST attribute, when
* all dimension scales were detached from a dataset; added.
* 2010/05/13 EIP
*
@@ -706,24 +706,24 @@ herr_t H5DSdetach_scale(hid_t did,
/* same object, reset */
if(dsid_oi.fileno == tmp_oi.fileno && dsid_oi.addr == tmp_oi.addr)
{
- /* If there are more than one reference in the VL element
+ /* If there are more than one reference in the VL element
and the reference we found is not the last one,
copy the last one to replace the found one since the order
- of the references doesn't matter according to the spec;
- reduce the size of the VL element by 1;
- if the length of the element becomes 0, free the pointer
+ of the references doesn't matter according to the spec;
+ reduce the size of the VL element by 1;
+ if the length of the element becomes 0, free the pointer
and reset to NULL */
size_t len = buf[idx].len;
- if(j < len - 1)
- ((hobj_ref_t *)buf[idx].p)[j] = ((hobj_ref_t *)buf[idx].p)[len-1];
+ if(j < len - 1)
+ ((hobj_ref_t *)buf[idx].p)[j] = ((hobj_ref_t *)buf[idx].p)[len-1];
len = --buf[idx].len;
if(len == 0) {
- HDfree(buf[idx].p);
+ HDfree(buf[idx].p);
buf[idx].p = NULL;
}
- /* Since a reference to a dim. scale can be inserted only once,
+ /* Since a reference to a dim. scale can be inserted only once,
we do not need to continue the search if it is found */
found_ds = 1;
break;
@@ -736,16 +736,16 @@ herr_t H5DSdetach_scale(hid_t did,
goto out;
/* Write the attribute, but check first, if we have any scales left,
- because if not, we should delete the attribute according to the spec */
+ because if not, we should delete the attribute according to the spec */
for(i = 0; i < rank; i++) {
if(buf[i].len > 0) {
have_ds = 1;
- break;
+ break;
}
}
- if(have_ds) {
+ if(have_ds) {
if(H5Awrite(aid, tid, buf) < 0)
- goto out;
+ goto out;
}
else {
if(H5Adelete(did, DIMENSION_LIST) < 0)
@@ -1123,7 +1123,7 @@ htri_t H5DSis_attached(hid_t did,
if (dsbuf == NULL)
goto out;
- if (H5Aread(aid,ntid,dsbuf) < 0)
+ if (H5Aread(aid,ntid,dsbuf) < 0)
goto out;
/*-------------------------------------------------------------------------
@@ -1445,7 +1445,7 @@ herr_t H5DSset_label(hid_t did, unsigned int idx, const char *label)
if (H5I_DATASET != it)
return FAIL;
- if (label == NULL)
+ if (label == NULL)
return FAIL;
/* get dataset space */
@@ -1502,7 +1502,7 @@ herr_t H5DSset_label(hid_t did, unsigned int idx, const char *label)
goto out;
for (i = 0; i < (unsigned int) rank; i++)
- u.const_buf[i] = NULL;
+ u.const_buf[i] = NULL;
/* store the label information in the required index */
u.const_buf[idx] = label;
@@ -1532,7 +1532,7 @@ herr_t H5DSset_label(hid_t did, unsigned int idx, const char *label)
else
{
-
+
if ((aid = H5Aopen(did, DIMENSION_LABELS, H5P_DEFAULT)) < 0)
goto out;
@@ -1541,7 +1541,7 @@ herr_t H5DSset_label(hid_t did, unsigned int idx, const char *label)
/* allocate and initialize */
u.buf = (char **) HDmalloc((size_t) rank * sizeof(char *));
-
+
if (u.buf == NULL)
goto out;
@@ -1626,7 +1626,7 @@ out:
* Comments:
*
* Modifications:
-* JIRA HDFFV-7673: Added a check to see if the label name exists,
+* JIRA HDFFV-7673: Added a check to see if the label name exists,
* if not then returns zero. July 30, 2011. MSB
*
*-------------------------------------------------------------------------
@@ -1714,26 +1714,26 @@ ssize_t H5DSget_label(hid_t did, unsigned int idx, char *label, size_t size)
if (buf[idx] != NULL)
{
/* get the real string length */
- nbytes = strlen(buf[idx]);
+ nbytes = HDstrlen(buf[idx]);
- /* compute the string length which will fit into the user's buffer */
- copy_len = MIN(size-1, nbytes);
+ /* compute the string length which will fit into the user's buffer */
+ copy_len = MIN(size-1, nbytes);
- /* copy all/some of the name */
- if (label)
- {
- memcpy(label, buf[idx], copy_len);
-
- /* terminate the string */
- label[copy_len] = '\0';
- }
+ /* copy all/some of the name */
+ if (label)
+ {
+ HDmemcpy(label, buf[idx], copy_len);
+
+ /* terminate the string */
+ label[copy_len] = '\0';
+ }
}
/* free all the ptr's from the H5Aread() */
for (i = 0; i < rank; i++)
{
if (buf[i])
- HDfree(buf[i]);
+ HDfree(buf[i]);
}
/* close */
@@ -1867,7 +1867,7 @@ ssize_t H5DSget_scale_name(hid_t did,
/* copy all/some of the name */
if (name) {
- memcpy(name, buf, copy_len);
+ HDmemcpy(name, buf, copy_len);
/* terminate the string */
name[copy_len]='\0';
@@ -1951,33 +1951,33 @@ htri_t H5DSis_scale(hid_t did)
if((tid = H5Aget_type(aid)) < 0)
goto out;
- /* check to make sure attribute is a string */
- if(H5T_STRING != H5Tget_class(tid))
- goto out;
+ /* check to make sure attribute is a string */
+ if(H5T_STRING != H5Tget_class(tid))
+ goto out;
- /* check to make sure string is null-terminated */
- if(H5T_STR_NULLTERM != H5Tget_strpad(tid))
- goto out;
+ /* check to make sure string is null-terminated */
+ if(H5T_STR_NULLTERM != H5Tget_strpad(tid))
+ goto out;
- /* allocate buffer large enough to hold string */
- if((storage_size = H5Aget_storage_size(aid)) == 0)
- goto out;
+ /* allocate buffer large enough to hold string */
+ if((storage_size = H5Aget_storage_size(aid)) == 0)
+ goto out;
- buf = (char*)HDmalloc( (size_t)storage_size * sizeof(char) + 1);
- if(buf == NULL)
- goto out;
+ buf = (char*)HDmalloc( (size_t)storage_size * sizeof(char) + 1);
+ if(buf == NULL)
+ goto out;
- /* Read the attribute */
+ /* Read the attribute */
if(H5Aread(aid, tid, buf) < 0)
- goto out;
+ goto out;
- /* compare strings */
+ /* compare strings */
if(HDstrncmp(buf, DIMENSION_SCALE_CLASS, MIN(HDstrlen(DIMENSION_SCALE_CLASS),HDstrlen(buf)))==0)
is_ds = 1;
else
is_ds = 0;
- HDfree(buf);
+ HDfree(buf);
if(H5Tclose(tid) < 0)
goto out;
@@ -2236,8 +2236,8 @@ out:
static
hid_t H5DS_get_REFLIST_type(void)
{
- hid_t ntid_t = -1;
-
+ hid_t ntid_t = -1;
+
/* Build native type that corresponds to compound datatype
used to store ds_list_t structure in the REFERENCE_LIST
attribute */
@@ -2257,5 +2257,5 @@ out:
H5Tclose(ntid_t);
} H5E_END_TRY;
return FAIL;
-}
+}
diff --git a/hl/test/test_ds.c b/hl/test/test_ds.c
index 49dc72f..95178fc 100644
--- a/hl/test/test_ds.c
+++ b/hl/test/test_ds.c
@@ -186,11 +186,11 @@ int main(void)
if(nerrors) goto error;
- printf("All dimension scales tests passed.\n");
+ HDprintf("All dimension scales tests passed.\n");
return 0;
error:
- printf("***** %d DIMENSION SCALES TEST%s FAILED! *****\n",nerrors, 1 == nerrors ? "" : "S");
+ HDprintf("***** %d DIMENSION SCALES TEST%s FAILED! *****\n",nerrors, 1 == nerrors ? "" : "S");
return 1;
}
@@ -1110,7 +1110,7 @@ herr_t test_cmp_scalename(hid_t fid, hid_t did, const char *name, const char *sc
if((dsid = H5Dopen2(fid, name, H5P_DEFAULT)) >= 0) {
if(H5DSis_attached(did, dsid, idx) == 1) {
if((name_len=H5DSget_scale_name(dsid,NULL,(size_t)0)) > 0) {
- name_out = (char*)HDmalloc(((size_t)name_len+1) * sizeof (char));
+ name_out = (char*)HDmalloc(((size_t)name_len+1) * sizeof (char));
if(name_out != NULL) {
if(H5DSget_scale_name(dsid, name_out, (size_t)name_len+1) >= 0) {
if(HDstrncmp(scalename, name_out, (size_t)name_len)==0) {
@@ -1156,7 +1156,7 @@ static int test_detachscales(void)
sprintf(dname,"D%d", i);
if(H5LTmake_dataset_int(fid, dname, rank3, dims, buf) < 0)
goto out;
- }
+ }
/* create datasets and make them dim. scales */
for (i=0; i < 4; i++) {
@@ -1164,11 +1164,11 @@ static int test_detachscales(void)
if(H5LTmake_dataset_int(fid, dname, rank1, dims, buf) < 0)
goto out;
}
- /* attach scales to the first dataset; first dimension will have
+ /* attach scales to the first dataset; first dimension will have
two scales attached */
if((did = H5Dopen2(fid, "D0", H5P_DEFAULT)) >= 0) {
for (i=0; i<4; i++) {
- sprintf(dname, "DS%d", i);
+ HDsprintf(dname, "DS%d", i);
if((dsid = H5Dopen2(fid, dname, H5P_DEFAULT)) < 0)
goto out;
if(H5DSattach_scale(did, dsid, (unsigned int) i%3) < 0)
@@ -1185,7 +1185,7 @@ static int test_detachscales(void)
/* attach scales to the second dataset */
if((did = H5Dopen2(fid, "D1", H5P_DEFAULT)) >= 0) {
for (i=0; i<3; i++) {
- sprintf(dname, "DS%d", i);
+ HDsprintf(dname, "DS%d", i);
if((dsid = H5Dopen2(fid, dname, H5P_DEFAULT)) < 0)
goto out;
if(H5DSattach_scale(did, dsid, (unsigned int) i) < 0)
@@ -1206,20 +1206,20 @@ static int test_detachscales(void)
goto out;
for (i=0; i<2; i++) {
- sprintf(dname, "D%d", i);
+ HDsprintf(dname, "D%d", i);
if((did = H5Dopen2(fid, dname, H5P_DEFAULT)) < 0)
goto out;
if(H5DSdetach_scale(did, dsid, (unsigned int)0) < 0)
goto out;
if(H5Dclose(did) < 0)
goto out;
- }
+ }
/* Check that attribute "REFERENCE_LIST" doesn't exist anymore */
if(H5Aexists(dsid, REFERENCE_LIST)!= 0)
goto out;
if(H5Dclose(dsid) < 0)
goto out;
- /* Check that DS3 is the only dim. scale attached to the first
+ /* Check that DS3 is the only dim. scale attached to the first
dimension of D0 */
if((did = H5Dopen2(fid, "D0", H5P_DEFAULT)) < 0)
goto out;
@@ -1232,11 +1232,11 @@ static int test_detachscales(void)
if(H5Dclose(dsid) < 0)
goto out;
- /* Detach the rest of the scales DS3, DS1, DS2 from D0 and make
+ /* Detach the rest of the scales DS3, DS1, DS2 from D0 and make
sure that attribute "DIMENSION_LIST" doesn't exist anymore */
if((did = H5Dopen2(fid, "D0", H5P_DEFAULT)) >= 0) {
for (i=1; i<4; i++) {
- sprintf(dname, "DS%d", i);
+ HDsprintf(dname, "DS%d", i);
if((dsid = H5Dopen2(fid, dname, H5P_DEFAULT)) < 0)
goto out;
if(H5DSdetach_scale(did, dsid, (unsigned int) i%3) < 0)
@@ -1253,7 +1253,7 @@ static int test_detachscales(void)
else
goto out;
-
+
PASSED();
H5Fclose(fid);
@@ -2873,10 +2873,10 @@ static int test_simple(void)
if((sid = H5Screate_simple(rank,dims,NULL)) < 0)
goto out;
for(i = 0; i < 5; i++) {
- sprintf(dname,"dset_%d",i);
+ HDsprintf(dname,"dset_%d",i);
if((did = H5Dcreate2(gid, dname, H5T_NATIVE_INT, sid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0)
goto out;
- sprintf(sname,"ds_%d",i);
+ HDsprintf(sname,"ds_%d",i);
if((dsid = H5Dcreate2(gid, sname, H5T_NATIVE_INT, sid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0)
goto out;
if(H5DSset_scale(dsid,"scale") < 0)
@@ -2893,11 +2893,11 @@ static int test_simple(void)
*/
for(i = 0; i < 5; i++) {
- sprintf(dname, "dset_%d", i);
+ HDsprintf(dname, "dset_%d", i);
if((did = H5Dopen2(gid, dname, H5P_DEFAULT)) < 0)
goto out;
for(j = 0; j < 5; j++) {
- sprintf(sname, "ds_%d", j);
+ HDsprintf(sname, "ds_%d", j);
if((dsid = H5Dopen2(gid, sname, H5P_DEFAULT)) < 0)
goto out;
if(H5DSattach_scale(did, dsid, DIM0) < 0)
@@ -2915,7 +2915,7 @@ static int test_simple(void)
*/
for(i = 0; i < 5; i++) {
- sprintf(dname, "dset_%d", i);
+ HDsprintf(dname, "dset_%d", i);
if((did = H5Dopen2(gid, dname, H5P_DEFAULT)) < 0)
goto out;
for(j = 0; j < 5; j++) {
@@ -2938,7 +2938,7 @@ static int test_simple(void)
*/
for(i=0; i<5; i++) {
- sprintf(dname,"dset_%d",i);
+ HDsprintf(dname,"dset_%d",i);
if((did = H5Dopen2(gid,dname, H5P_DEFAULT)) < 0)
goto out;
for(j=0; j<5; j++) {
@@ -3541,7 +3541,7 @@ static herr_t read_scale(hid_t dset, unsigned dim, hid_t scale_id, void *visitor
for(i=0; i<nelmts; i++) {
if(buf[i] != data[i]) {
- printf("read and write buffers differ\n");
+ HDprintf("read and write buffers differ\n");
goto out;
}
}
@@ -5014,7 +5014,7 @@ static int test_errors2(void)
goto out;
if ((label_len=H5DSget_label(did,0,NULL,0)) < 0)
goto out;
- if ( label_len != strlen("label") )
+ if ( label_len != HDstrlen("label") )
goto out;
if (H5DSget_label(did,0,lbuf,sizeof(lbuf)) < 0)
goto out;
@@ -5134,83 +5134,83 @@ static int test_attach_detach(void)
if((dcpl_id = H5Pcreate(H5P_DATASET_CREATE)) < 0)
goto out;
-
- if((sid = H5Screate_simple(1, dims, dims)) < 0)
+
+ if((sid = H5Screate_simple(1, dims, dims)) < 0)
goto out;
if((dsid = H5Dcreate2(gid, DS_3_NAME, H5T_IEEE_F32BE, sid,
H5P_DEFAULT, dcpl_id, H5P_DEFAULT)) < 0)
goto out;
- if(H5Sclose(sid) < 0)
+ if(H5Sclose(sid) < 0)
goto out;
- if(H5Pclose(dcpl_id) < 0)
+ if(H5Pclose(dcpl_id) < 0)
goto out;
- if(H5DSset_scale(dsid, DS_3_NAME) < 0)
+ if(H5DSset_scale(dsid, DS_3_NAME) < 0)
goto out;
/* Create a variable that uses this dimension scale. */
- if((sid = H5Screate_simple(DIM1, dims, dims)) < 0)
+ if((sid = H5Screate_simple(DIM1, dims, dims)) < 0)
goto out;
if((var1_id = H5Dcreate2(gid, DS_31_NAME, H5T_NATIVE_FLOAT, sid,
- H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0)
+ H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0)
goto out;
- if(H5Sclose(sid) < 0)
+ if(H5Sclose(sid) < 0)
goto out;
- if(H5DSattach_scale(var1_id, dsid, 0) < 0)
+ if(H5DSattach_scale(var1_id, dsid, 0) < 0)
goto out;
/* Create another variable that uses this dimension scale. */
- if((dcpl_id = H5Pcreate(H5P_DATASET_CREATE)) < 0)
+ if((dcpl_id = H5Pcreate(H5P_DATASET_CREATE)) < 0)
goto out;
- if(H5Pset_attr_creation_order(dcpl_id, H5P_CRT_ORDER_TRACKED | H5P_CRT_ORDER_INDEXED) < 0)
+ if(H5Pset_attr_creation_order(dcpl_id, H5P_CRT_ORDER_TRACKED | H5P_CRT_ORDER_INDEXED) < 0)
goto out;
- if((sid = H5Screate_simple(DIM1, dims, dims)) < 0)
+ if((sid = H5Screate_simple(DIM1, dims, dims)) < 0)
goto out;
if((var2_id = H5Dcreate2(gid, DS_32_NAME, H5T_NATIVE_FLOAT, sid,
- H5P_DEFAULT, H5P_DEFAULT,H5P_DEFAULT)) < 0)
+ H5P_DEFAULT, H5P_DEFAULT,H5P_DEFAULT)) < 0)
goto out;
- if(H5Pclose(dcpl_id) < 0)
+ if(H5Pclose(dcpl_id) < 0)
goto out;
- if(H5Sclose(sid) < 0)
+ if(H5Sclose(sid) < 0)
goto out;
/* Create 3rd variable that uses this dimension scale. */
- if((dcpl_id = H5Pcreate(H5P_DATASET_CREATE)) < 0)
+ if((dcpl_id = H5Pcreate(H5P_DATASET_CREATE)) < 0)
goto out;
- if(H5Pset_attr_creation_order(dcpl_id, H5P_CRT_ORDER_TRACKED | H5P_CRT_ORDER_INDEXED) < 0)
+ if(H5Pset_attr_creation_order(dcpl_id, H5P_CRT_ORDER_TRACKED | H5P_CRT_ORDER_INDEXED) < 0)
goto out;
- if((sid = H5Screate_simple(DIM1, dims, dims)) < 0)
+ if((sid = H5Screate_simple(DIM1, dims, dims)) < 0)
goto out;
if((var3_id = H5Dcreate2(gid, DS_33_NAME, H5T_NATIVE_FLOAT, sid,
- H5P_DEFAULT, H5P_DEFAULT,H5P_DEFAULT)) < 0)
+ H5P_DEFAULT, H5P_DEFAULT,H5P_DEFAULT)) < 0)
goto out;
- if(H5Pclose(dcpl_id) < 0)
+ if(H5Pclose(dcpl_id) < 0)
goto out;
- if(H5Sclose(sid) < 0)
+ if(H5Sclose(sid) < 0)
goto out;
-
+
/* Attached var2 scale */
- if(H5DSattach_scale(var2_id, dsid, 0) < 0)
+ if(H5DSattach_scale(var2_id, dsid, 0) < 0)
goto out;
/* Detach the var2 scale */
- if(H5DSdetach_scale(var2_id, dsid, 0) < 0)
+ if(H5DSdetach_scale(var2_id, dsid, 0) < 0)
goto out;
/* Check if in correct state of detached and attached */
@@ -5220,7 +5220,7 @@ static int test_attach_detach(void)
goto out;
/* Detach the var1 scale */
- if(H5DSdetach_scale(var1_id, dsid, 0) < 0)
+ if(H5DSdetach_scale(var1_id, dsid, 0) < 0)
goto out;
/* Check if in correct state of detached and attached */
@@ -5231,10 +5231,10 @@ static int test_attach_detach(void)
/* Attach the DS again and remove them in the opposite order */
- if(H5DSattach_scale(var1_id, dsid, 0) < 0)
+ if(H5DSattach_scale(var1_id, dsid, 0) < 0)
goto out;
- if(H5DSattach_scale(var2_id, dsid, 0) < 0)
+ if(H5DSattach_scale(var2_id, dsid, 0) < 0)
goto out;
/* Detach the var1 scale */
@@ -5262,13 +5262,13 @@ static int test_attach_detach(void)
* Attach Three DS and remove the middle one first
*****************************************************/
- if(H5DSattach_scale(var1_id, dsid, 0) < 0)
+ if(H5DSattach_scale(var1_id, dsid, 0) < 0)
goto out;
- if(H5DSattach_scale(var2_id, dsid, 0) < 0)
+ if(H5DSattach_scale(var2_id, dsid, 0) < 0)
goto out;
- if(H5DSattach_scale(var3_id, dsid, 0) < 0)
+ if(H5DSattach_scale(var3_id, dsid, 0) < 0)
goto out;
@@ -5314,15 +5314,15 @@ static int test_attach_detach(void)
*-------------------------------------------------------------------------
*/
- if(H5Dclose(var1_id) < 0)
+ if(H5Dclose(var1_id) < 0)
goto out;
- if(H5Dclose(var2_id) < 0)
+ if(H5Dclose(var2_id) < 0)
goto out;
- if(H5Dclose(var3_id) < 0)
+ if(H5Dclose(var3_id) < 0)
goto out;
- if(H5Dclose(dsid) < 0)
+ if(H5Dclose(dsid) < 0)
goto out;
- if(H5Gclose(gid) < 0)
+ if(H5Gclose(gid) < 0)
goto out;
if(H5Fclose(fid) < 0)
goto out;
diff --git a/hl/test/test_lite.c b/hl/test/test_lite.c
index 763fdb5..51ab72b 100644
--- a/hl/test/test_lite.c
+++ b/hl/test/test_lite.c
@@ -1050,7 +1050,7 @@ static herr_t make_attributes( hid_t loc_id, const char* obj_name )
HDfree( dims_out );
return -1;
}
-
+
for (i = 0; i < rank_out; i++) {
if ( dims_out[i] != 5 ) {
HDfree( dims_out );
@@ -1152,7 +1152,7 @@ static int test_fps(void)
if(H5LTdtype_to_text(dtype, NULL, H5LT_DDL, &str_len)<0)
goto out;
-
+
if(NULL==(dt_str = (char*)HDcalloc(str_len, sizeof(char))))
goto out;
if(H5LTdtype_to_text(dtype, dt_str, H5LT_DDL, &str_len)<0) {
@@ -1228,7 +1228,7 @@ static int test_strings(void)
goto out;
}
if(HDstrcmp(dt_str, "H5T_STRING {\n STRSIZE 13;\n STRPAD H5T_STR_NULLTERM;\n CSET H5T_CSET_ASCII;\n CTYPE H5T_C_S1;\n }")) {
- printf("dt=\n%s\n", dt_str);
+ HDprintf("dt=\n%s\n", dt_str);
HDfree(dt_str);
goto out;
}
@@ -1260,7 +1260,7 @@ static int test_strings(void)
goto out;
}
if(HDstrcmp(dt_str, "H5T_STRING {\n STRSIZE H5T_VARIABLE;\n STRPAD H5T_STR_NULLPAD;\n CSET H5T_CSET_ASCII;\n CTYPE H5T_C_S1;\n }")) {
- printf("dt=\n%s\n", dt_str);
+ HDprintf("dt=\n%s\n", dt_str);
HDfree(dt_str);
goto out;
}
@@ -1270,13 +1270,13 @@ static int test_strings(void)
str_len = str_len + 10;
if(NULL==(dt_str = (char*)HDcalloc(str_len, sizeof(char))))
goto out;
-
+
if(H5LTdtype_to_text(dtype, dt_str, H5LT_DDL, &str_len)<0) {
HDfree(dt_str);
goto out;
}
if(HDstrncmp(dt_str, "H5T_STRING {\n STRSIZE H5T_VARIABLE;\n STRPAD H5T_STR_NULLPAD;\n CSET H5T_CSET_ASCII;\n CTYPE H5T_C_S1;\n }", str_len-1)) {
- printf("dt=\n%s\n", dt_str);
+ HDprintf("dt=\n%s\n", dt_str);
HDfree(dt_str);
goto out;
}
@@ -1292,10 +1292,10 @@ static int test_strings(void)
goto out;
}
/* check the truncated string */
- if(strlen(dt_str) != str_len-1) goto out;
- str_len = strlen(dt_str);
+ if(HDstrlen(dt_str) != str_len-1) goto out;
+ str_len = HDstrlen(dt_str);
if(HDstrncmp(dt_str, "H5T_STRING {\n STRSIZE H5T_VARIABLE;\n STRPAD H5T_STR_NULLPAD;\n CSET H5T_CSET_ASCII;\n CTYPE H5T_C_S1;\n }", str_len)) {
- printf("dt=\n%s\n", dt_str);
+ HDprintf("dt=\n%s\n", dt_str);
HDfree(dt_str);
goto out;
}
@@ -1352,7 +1352,7 @@ static int test_opaques(void)
goto out;
}
if(HDstrcmp(dt_str, "H5T_OPAQUE {\n OPQ_SIZE 19;\n OPQ_TAG \"This is a tag for opaque type\";\n }")) {
- printf("dt=\n%s\n", dt_str);
+ HDprintf("dt=\n%s\n", dt_str);
HDfree(dt_str);
goto out;
}
@@ -1428,7 +1428,7 @@ static int test_enums(void)
}
if(HDstrcmp(dt_str, "H5T_ENUM {\n H5T_STD_I32LE;\n \"RED\" 5;\n \"GREEN\" 6;\n \"BLUE\" 7;\n \"WHITE\" 8;\n }")) {
- printf("dt=\n%s\n", dt_str);
+ HDprintf("dt=\n%s\n", dt_str);
HDfree(dt_str);
goto out;
}
@@ -1469,16 +1469,16 @@ static int test_variables(void)
if(H5Tis_variable_str(dtype))
goto out;
-
+
if(H5Tclose(dtype)<0)
goto out;
-
+
if((dtype = H5LTtext_to_dtype("H5T_VLEN { H5T_VLEN { H5T_STD_I32BE } }", H5LT_DDL))<0)
goto out;
-
+
if(H5Tis_variable_str(dtype))
goto out;
-
+
if(H5LTdtype_to_text(dtype, NULL, H5LT_DDL, &str_len)<0)
goto out;
if(NULL==(dt_str = (char*)HDcalloc(str_len, sizeof(char))))
@@ -1488,15 +1488,15 @@ static int test_variables(void)
goto out;
}
if(HDstrcmp(dt_str, "H5T_VLEN {\n H5T_VLEN {\n H5T_STD_I32BE\n }\n }")) {
- printf("dt=\n%s\n", dt_str);
+ HDprintf("dt=\n%s\n", dt_str);
HDfree(dt_str);
goto out;
}
HDfree(dt_str);
-
+
if(H5Tclose(dtype)<0)
goto out;
-
+
PASSED();
return 0;
@@ -1547,7 +1547,7 @@ static int test_arrays(void)
goto out;
}
if(HDstrcmp(dt_str, "H5T_ARRAY {\n [5][7][13] H5T_ARRAY {\n [17][19] H5T_COMPOUND {\n H5T_STD_I8BE \"arr_compound_1\" : 0;\n H5T_STD_I32BE \"arr_compound_2\" : 1;\n }\n }\n }")) {
- printf("dt=\n%s\n", dt_str);
+ HDprintf("dt=\n%s\n", dt_str);
HDfree(dt_str);
goto out;
}
@@ -1603,7 +1603,7 @@ static int test_compounds(void)
goto out;
}
if(HDstrcmp(dt_str, "H5T_COMPOUND {\n H5T_STD_I16BE \"one_field\" : 2;\n H5T_STD_U8LE \"two_field\" : 6;\n }")) {
- printf("dt=\n%s\n", dt_str);
+ HDprintf("dt=\n%s\n", dt_str);
HDfree(dt_str);
goto out;
}
@@ -1637,7 +1637,7 @@ out:
}
/*-------------------------------------------------------------------------
-* subroutine for test_text_dtype(): test_compound_bug(). Test case for
+* subroutine for test_text_dtype(): test_compound_bug(). Test case for
* issue 7701.
*-------------------------------------------------------------------------
*/
@@ -1770,7 +1770,7 @@ static int test_complicated_compound(void)
/* Open input file */
fp = HDfopen(filename, "r");
if(fp == NULL) {
- printf( "Could not find file %s. Try set $srcdir \n", filename);
+ HDprintf( "Could not find file %s. Try set $srcdir \n", filename);
goto out;
}
@@ -1881,9 +1881,9 @@ static int test_valid_path(void)
hid_t file_id, group;
htri_t path_valid;
const char *data_string_in = "test";
-
+
TESTING("H5LTpath_valid");
-
+
/* Create a new file using default properties. */
/**************************************************************
@@ -1908,11 +1908,11 @@ static int test_valid_path(void)
* |
* |
* | --- Gcyc (soft link to /G1)
- * / \
- * / \
- * G5 \
+ * / \
+ * / \
+ * G5 \
* (soft link G6 (external link /G1 in FILENAME4)
- * to /G2)
+ * to /G2)
*
****************************************************************/
@@ -1941,7 +1941,7 @@ static int test_valid_path(void)
*/
if(H5LTmake_dataset_string(group, "/G2/DS4", data_string_in)<0)
goto out;
-
+
/*
* Create a soft link
*/
@@ -2023,9 +2023,9 @@ static int test_valid_path(void)
* |
* |
* |
- * G1
+ * G1
* / \
- * / \
+ * / \
* DS1 G2
* (dangled soft link to /G1/G20)
*
@@ -2056,13 +2056,13 @@ static int test_valid_path(void)
goto out;
H5Fclose(file_id);
-
+
/* Open input file */
if((file_id = H5Fopen(FILE_NAME3,H5F_ACC_RDONLY, H5P_DEFAULT))<0)
goto out;
/**************************************
- * CHECK ABSOLUTE PATHS
+ * CHECK ABSOLUTE PATHS
**************************************/
if( (path_valid = H5LTpath_valid(file_id, "/", TRUE)) != TRUE) {
@@ -2076,7 +2076,7 @@ static int test_valid_path(void)
if( (path_valid = H5LTpath_valid(file_id, "/G1", TRUE)) != TRUE) {
goto out;
}
-
+
if((path_valid = H5LTpath_valid(file_id, "/G1/DS1", TRUE)) != TRUE)
goto out;
@@ -2094,7 +2094,7 @@ static int test_valid_path(void)
if( (path_valid = H5LTpath_valid(file_id, "/G1/G2/Gcyc/DS1", TRUE)) != TRUE)
goto out;
-
+
if( (path_valid = H5LTpath_valid(file_id, "/G2", TRUE)) != TRUE)
goto out;
@@ -2114,14 +2114,14 @@ static int test_valid_path(void)
/* check soft links */
if( (path_valid = H5LTpath_valid(file_id, "/G1/G2/G5/DS4", TRUE)) != TRUE)
goto out;
-
+
/**************************************
- * CHECK RELATIVE PATHS
+ * CHECK RELATIVE PATHS
***************************************/
if( (group = H5Gopen2(file_id, "/", H5P_DEFAULT)) < 0)
goto out;
-
+
if( (path_valid = H5LTpath_valid(group, "/", TRUE)) != TRUE) {
goto out;
}
@@ -2156,22 +2156,22 @@ static int test_valid_path(void)
goto out;
if( (path_valid = H5LTpath_valid(group, "G2/G5", TRUE)) != TRUE)
- goto out;
+ goto out;
/* Check the "./" case */
if( (path_valid = H5LTpath_valid(group, "./DS3", TRUE)) != TRUE)
goto out;
if( (path_valid = H5LTpath_valid(group, "./G2/G5", TRUE)) != TRUE)
- goto out;
+ goto out;
/* Should fail, does not exist */
if( (path_valid = H5LTpath_valid(group, "./G2/G20", FALSE)) == TRUE)
- goto out;
+ goto out;
/* Should fail, does not exist */
if( (path_valid = H5LTpath_valid(group, "./G2/G20", TRUE)) == TRUE)
- goto out;
+ goto out;
if(H5Gclose(group)<0)
goto out;
@@ -2220,7 +2220,7 @@ static int test_valid_path(void)
PASSED();
return 0;
- out:
+ out:
H5_FAILED();
return -1;
}
diff --git a/java/examples/groups/JavaGroupExample.sh.in b/java/examples/groups/JavaGroupExample.sh.in
index b4e21bd..0e2d002 100644
--- a/java/examples/groups/JavaGroupExample.sh.in
+++ b/java/examples/groups/JavaGroupExample.sh.in
@@ -34,13 +34,13 @@ nerrors=0
# where the libs exist
HDFLIB_HOME="$top_srcdir/java/lib"
BLDLIBDIR="$top_builddir/hdf5/lib"
-BLDREFDIR="./groups"
+BLDITERDIR="./groups"
BLDDIR="."
HDFTEST_HOME="$top_srcdir/java/examples/groups"
JARFILE=jar@PACKAGE_TARNAME@-@PACKAGE_VERSION@.jar
TESTJARFILE=jar@PACKAGE_TARNAME@groups.jar
test -d $BLDLIBDIR || mkdir -p $BLDLIBDIR
-test -d $BLDREFDIR || mkdir -p $BLDREFDIR
+test -d $BLDITERDIR || mkdir -p $BLDITERDIR
######################################################################
# library files
@@ -59,9 +59,11 @@ LIST_JAR_TESTFILES="
$HDFLIB_HOME/slf4j-api-1.7.25.jar
$HDFLIB_HOME/ext/slf4j-simple-1.7.25.jar
"
-LIST_DATA_FILES="
+LIST_ITER_FILES="
$HDFTEST_HOME/h5ex_g_iterate.h5
$HDFTEST_HOME/h5ex_g_visit.h5
+"
+LIST_DATA_FILES="
$HDFTEST_HOME/../testfiles/examples.groups.H5Ex_G_Create.txt
$HDFTEST_HOME/../testfiles/examples.groups.H5Ex_G_Iterate.txt
$HDFTEST_HOME/../testfiles/examples.groups.H5Ex_G_Compact.txt
@@ -146,6 +148,7 @@ CLEAN_LIBFILES_AND_BLDLIBDIR()
}
COPY_DATAFILES="$LIST_DATA_FILES"
+COPY_ITERFILES="$LIST_ITER_FILES"
COPY_DATAFILES_TO_BLDDIR()
{
@@ -190,12 +193,12 @@ CLEAN_DATAFILES_AND_BLDDIR()
fi
}
-COPY_REFFILES="$LIST_REF_FILES"
+COPY_ITERFILES="$LIST_ITER_FILES"
-COPY_REFFILES_TO_BLDREFDIR()
+COPY_ITERFILES_TO_BLDITERDIR()
{
# copy test files. Used -f to make sure get a new copy
- for tstfile in $COPY_REFFILES
+ for tstfile in $COPY_ITERFILES
do
# ignore '#' comment
echo $tstfile | tr -d ' ' | grep '^#' > /dev/null
@@ -206,9 +209,9 @@ COPY_REFFILES_TO_BLDREFDIR()
# make cp fail
SDIR=`$DIRNAME $tstfile`
INODE_SDIR=`$LS -i -d $SDIR | $AWK -F' ' '{print $1}'`
- INODE_DDIR=`$LS -i -d $BLDREFDIR | $AWK -F' ' '{print $1}'`
+ INODE_DDIR=`$LS -i -d $BLDITERDIR | $AWK -F' ' '{print $1}'`
if [ "$INODE_SDIR" != "$INODE_DDIR" ]; then
- $CP -f $tstfile $BLDREFDIR
+ $CP -f $tstfile $BLDITERDIR
if [ $? -ne 0 ]; then
echo "Error: FAILED to copy $tstfile ."
@@ -220,16 +223,16 @@ COPY_REFFILES_TO_BLDREFDIR()
done
}
-CLEAN_REFFILES_AND_BLDREFDIR()
+CLEAN_ITERFILES_AND_BLDITERDIR()
{
# skip rm if srcdir is same as destdir
# this occurs when build/test performed in source dir and
# make cp fail
SDIR=`$DIRNAME $HDFTEST_HOME/h5ex_g_iterate.h5`
INODE_SDIR=`$LS -i -d $SDIR | $AWK -F' ' '{print $1}'`
- INODE_DDIR=`$LS -i -d $BLDREFDIR | $AWK -F' ' '{print $1}'`
+ INODE_DDIR=`$LS -i -d $BLDITERDIR | $AWK -F' ' '{print $1}'`
if [ "$INODE_SDIR" != "$INODE_DDIR" ]; then
- $RM $BLDREFDIR
+ $RM $BLDITERDIR
fi
}
@@ -252,7 +255,7 @@ JAVAEXEFLAGS=@H5_JAVAFLAGS@
# prepare for test
COPY_LIBFILES_TO_BLDLIBDIR
COPY_DATAFILES_TO_BLDDIR
-COPY_REFFILES_TO_BLDREFDIR
+COPY_REFFILES_TO_BLDITERDIR
CPATH=".:"$BLDLIBDIR"/"$JARFILE":"$BLDLIBDIR"/slf4j-api-1.7.25.jar:"$BLDLIBDIR"/slf4j-simple-1.7.25.jar:"$TESTJARFILE""
@@ -366,7 +369,7 @@ fi
# Clean up temporary files/directories
CLEAN_LIBFILES_AND_BLDLIBDIR
CLEAN_DATAFILES_AND_BLDDIR
-CLEAN_REFFILES_AND_BLDREFDIR
+CLEAN_ITERFILES_AND_BLDITERDIR
# Report test results and exit
if test $nerrors -eq 0 ; then
diff --git a/java/src/jni/h5dImp.c b/java/src/jni/h5dImp.c
index f984948..652c873 100644
--- a/java/src/jni/h5dImp.c
+++ b/java/src/jni/h5dImp.c
@@ -1109,7 +1109,7 @@ Java_hdf_hdf5lib_H5_H5Dwrite_1string
const char *utf8 = ENVPTR->GetStringUTFChars(ENVPAR obj, 0);
if (utf8) {
- strncpy(&c_buf[i * str_len], utf8, str_len);
+ HDstrncpy(&c_buf[i * str_len], utf8, str_len);
} /* end if */
ENVPTR->ReleaseStringUTFChars(ENVPAR obj, utf8);
diff --git a/java/src/jni/h5pImp.c b/java/src/jni/h5pImp.c
index e6d1be8..52008ce 100644
--- a/java/src/jni/h5pImp.c
+++ b/java/src/jni/h5pImp.c
@@ -3881,7 +3881,7 @@ Java_hdf_hdf5lib_H5_H5Pset_1fapl_1multi
const char *utf8 = ENVPTR->GetStringUTFChars(ENVPAR obj, 0);
if (utf8) {
- member_name[i] = (char*)HDmalloc(strlen(utf8) + 1);
+ member_name[i] = (char*)HDmalloc(HDstrlen(utf8) + 1);
if (member_name[i]) {
strcpy(member_name[i], utf8);
} /* end if */
@@ -4189,7 +4189,7 @@ Java_hdf_hdf5lib_H5_H5Pset_1mdc_1config
h5JNIFatalError(env, "H5Pset_mdc_config: out of memory trace_file_name");
return;
} /* end if */
- strncpy(cacheinfo.trace_file_name, str, 1025);
+ HDstrncpy(cacheinfo.trace_file_name, str, 1025);
ENVPTR->ReleaseStringUTFChars(ENVPAR j_str, str);
if(ENVPTR->ExceptionOccurred(ENVONLY)) {
h5JNIFatalError(env, "H5Pset_mdc_config: loading trace_file_name failed");
diff --git a/java/src/jni/h5sImp.c b/java/src/jni/h5sImp.c
index a4b4848..65cdd7b 100644
--- a/java/src/jni/h5sImp.c
+++ b/java/src/jni/h5sImp.c
@@ -571,7 +571,7 @@ Java_hdf_hdf5lib_H5_H5Sset_1extent_1simple
h5JNIFatalError(env, "H5Pset_simple_extent: dims not pinned");
return -1;
} /* end if */
- sa = lp = (hsize_t *) malloc((size_t)rank * sizeof(hsize_t));
+ sa = lp = (hsize_t *) HDmalloc((size_t)rank * sizeof(hsize_t));
if (sa == NULL) {
ENVPTR->ReleaseLongArrayElements(ENVPAR dims, dimsP, JNI_ABORT);
h5JNIFatalError(env, "H5Sset_simple_extent: dims not converted to hsize_t");
@@ -1017,7 +1017,7 @@ Java_hdf_hdf5lib_H5_H5Sget_1select_1hyper_1blocklist
h5JNIFatalError(env, "H5Sget_select_hyper_blocklist: buf not pinned");
} /* end if */
else {
- ba = (hsize_t *) malloc((size_t)nb * 2 * (size_t)rank * sizeof(hsize_t));
+ ba = (hsize_t *) HDmalloc((size_t)nb * 2 * (size_t)rank * sizeof(hsize_t));
if (ba == NULL) {
ENVPTR->ReleaseLongArrayElements(ENVPAR buf, bufP, JNI_ABORT);
h5JNIFatalError(env, "H5Screate-simple: buffer not converted to hsize_t");
@@ -1135,7 +1135,7 @@ Java_hdf_hdf5lib_H5_H5Sget_1select_1bounds
return -1;
} /* end if */
rank = (int) ENVPTR->GetArrayLength(ENVPAR start);
- strt = (hsize_t *)malloc((size_t)rank * sizeof(hsize_t));
+ strt = (hsize_t *)HDmalloc((size_t)rank * sizeof(hsize_t));
if (strt == NULL) {
ENVPTR->ReleaseLongArrayElements(ENVPAR start, startP, JNI_ABORT);
h5JNIFatalError(env, "H5Sget_select_bounds: start not converted to hsize_t");
diff --git a/java/src/jni/h5util.c b/java/src/jni/h5util.c
index 42f8a5c..fd34ba1 100644
--- a/java/src/jni/h5util.c
+++ b/java/src/jni/h5util.c
@@ -1768,7 +1768,7 @@ h5str_render_bin_output
if (H5Tis_variable_str(tid)) {
s = *(char**) mem;
if (s != NULL)
- size = strlen(s);
+ size = HDstrlen(s);
}
else {
s = (char *) mem;
@@ -2129,11 +2129,11 @@ render_bin_output_region_data_points
ret_value = -1;
HDfree(dims1);
- } /* end if((dims1 = (hsize_t *) malloc(sizeof(hsize_t) * ndims)) != NULL) */
+ } /* end if((dims1 = (hsize_t *) HDmalloc(sizeof(hsize_t) * ndims)) != NULL) */
else
ret_value = -1;
HDfree(region_buf);
- } /* end if((region_buf = malloc(type_size * (size_t)npoints)) != NULL) */
+ } /* end if((region_buf = HDmalloc(type_size * (size_t)npoints)) != NULL) */
else
ret_value = -1;
@@ -2436,7 +2436,7 @@ Java_hdf_hdf5lib_H5_H5AreadComplex
H5Tclose(p_type);
n = ENVPTR->GetArrayLength(ENVPAR buf);
- rdata = (char *)malloc((size_t)n * size);
+ rdata = (char *)HDmalloc((size_t)n * size);
if (rdata == NULL) {
h5JNIFatalError(env, "H5AreadComplex: failed to allocate buff for read");
} /* end if */
@@ -2952,7 +2952,7 @@ obj_info_all
if (retVal < 0) {
*(datainfo->otype+datainfo->count) = -1;
*(datainfo->ltype+datainfo->count) = -1;
- *(datainfo->objname+datainfo->count) = (char *)HDmalloc(strlen(name)+1);
+ *(datainfo->objname+datainfo->count) = (char *)HDmalloc(HDstrlen(name)+1);
HDstrcpy(*(datainfo->objname+datainfo->count), name);
*(datainfo->objno+datainfo->count) = (unsigned long)-1;
} /* end if */
diff --git a/test/Makefile.am b/test/Makefile.am
index b9aa3fb..d4db6d0 100644
--- a/test/Makefile.am
+++ b/test/Makefile.am
@@ -56,11 +56,11 @@ TEST_PROG= testhdf5 \
evict_on_close farray earray btree2 fheap \
pool accum hyperslab istore bittests dt_arith page_buffer \
dtypes dsets cmpd_dset filter_fail extend direct_chunk external efc \
- objcopy links unlink twriteorder big mtime fillval mount \
- flush1 flush2 app_ref enum set_extent ttsafe enc_dec_plist \
- enc_dec_plist_cross_platform getname vfd ntypes dangle dtransform \
- reserved cross_read freespace mf vds file_image unregister \
- cache_logging cork swmr
+ objcopy links unlink twriteorder big mtime fillval mount \
+ flush1 flush2 app_ref enum set_extent ttsafe enc_dec_plist \
+ enc_dec_plist_cross_platform getname vfd ntypes dangle dtransform \
+ reserved cross_read freespace mf vds file_image unregister \
+ cache_logging cork swmr
# List programs to be built when testing here.
# error_test and err_compat are built at the same time as the other tests, but executed by testerror.sh.
diff --git a/test/cache_logging.c b/test/cache_logging.c
index b4ed53b..1eb9d41 100644
--- a/test/cache_logging.c
+++ b/test/cache_logging.c
@@ -65,16 +65,16 @@ test_logging_api(void)
start_on_access_out = TRUE;
location = NULL;
size = 999;
- if(H5Pget_mdc_log_options(fapl, &is_enabled_out, location, &size,
+ if(H5Pget_mdc_log_options(fapl, &is_enabled_out, location, &size,
&start_on_access_out) < 0)
TEST_ERROR;
- if(size != strlen(LOG_LOCATION) + 1)
+ if(size != HDstrlen(LOG_LOCATION) + 1)
TEST_ERROR;
/* Check to make sure that the property list getter works */
if(NULL == (location = (char *)HDcalloc(size, sizeof(char))))
TEST_ERROR;
- if(H5Pget_mdc_log_options(fapl, &is_enabled_out, location, &size,
+ if(H5Pget_mdc_log_options(fapl, &is_enabled_out, location, &size,
&start_on_access_out) < 0)
TEST_ERROR;
if((is_enabled != is_enabled_out)
@@ -159,17 +159,17 @@ main(void)
/* Reset library */
h5_reset();
- printf("Testing basic metadata cache logging functionality.\n");
+ HDprintf("Testing basic metadata cache logging functionality.\n");
nerrors += test_logging_api();
if(nerrors) {
- printf("***** %d Metadata cache logging TEST%s FAILED! *****\n",
+ HDprintf("***** %d Metadata cache logging TEST%s FAILED! *****\n",
nerrors, nerrors > 1 ? "S" : "");
return 1;
}
- printf("All Metadata Cache Logging tests passed.\n");
+ HDprintf("All Metadata Cache Logging tests passed.\n");
return 0;
}
diff --git a/test/genall5.c b/test/genall5.c
index 37bab7a..4cc0a2d 100644
--- a/test/genall5.c
+++ b/test/genall5.c
@@ -12,11 +12,11 @@
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
/* Programmer: John Mainzer
- * 9/23/15
+ * 9/23/15
*
- * This file contains a heavily edited and functionaly reduce
- * version of the test code first written by Quincey in a file
- * of the same name.
+ * This file contains a heavily edited and functionaly reduce
+ * version of the test code first written by Quincey in a file
+ * of the same name.
*/
#include "cache_common.h"
@@ -32,7 +32,7 @@
* Function: ns_grp_0
*
* Purpose: Create an empty "new style" group at the specified location
- * in the specified file.
+ * in the specified file.
*
* If pass is false on entry, do nothing.
*
@@ -48,70 +48,59 @@
*/
void
-ns_grp_0(hid_t fid, const char *group_name)
-{
+ns_grp_0(hid_t fid, const char *group_name) {
hid_t gid = -1;
hid_t gcpl = -1;
herr_t ret;
- if ( pass ) {
-
+ if (pass) {
gcpl = H5Pcreate(H5P_GROUP_CREATE);
- if ( gcpl <= 0 ) {
-
- pass = FALSE;
- failure_mssg = "ns_grp_0: H5Pcreate() failed";
- }
- assert(gcpl > 0);
+ if (gcpl <= 0) {
+ pass = FALSE;
+ failure_mssg = "ns_grp_0: H5Pcreate() failed";
+ }
+ HDassert(gcpl > 0);
}
- if ( pass ) {
-
+ if (pass) {
ret = H5Pset_link_creation_order(gcpl, H5P_CRT_ORDER_TRACKED);
- if ( ret < 0 ) {
-
- pass = FALSE;
- failure_mssg = "ns_grp_0: H5Pset_link_creation_order() failed";
- }
- assert(ret >= 0);
+ if (ret < 0) {
+ pass = FALSE;
+ failure_mssg = "ns_grp_0: H5Pset_link_creation_order() failed";
+ }
+ HDassert(ret >= 0);
}
- if ( pass ) {
-
+ if (pass) {
gid = H5Gcreate2(fid, group_name, H5P_DEFAULT, gcpl, H5P_DEFAULT);
- if ( gid <= 0 ) {
-
- pass = FALSE;
- failure_mssg = "ns_grp_0: H5Gcreate2() failed";
+ if (gid <= 0) {
+ pass = FALSE;
+ failure_mssg = "ns_grp_0: H5Gcreate2() failed";
}
- assert(gid > 0);
+ HDassert(gid > 0);
}
- if ( pass ) {
-
+ if (pass) {
ret = H5Pclose(gcpl);
- if ( ret < 0 ) {
-
- pass = FALSE;
- failure_mssg = "ns_grp_0: H5Pclose(gcpl) failed";
+ if (ret < 0) {
+ pass = FALSE;
+ failure_mssg = "ns_grp_0: H5Pclose(gcpl) failed";
}
- assert(ret >= 0);
+ HDassert(ret >= 0);
}
- if ( pass ) {
-
+ if (pass) {
ret = H5Gclose(gid);
- if ( ret < 0 ) {
-
- pass = FALSE;
- failure_mssg = "ns_grp_0: H5Gclose(gid) failed";
+ if (ret < 0) {
+ pass = FALSE;
+ failure_mssg = "ns_grp_0: H5Gclose(gid) failed";
}
- assert(ret >= 0);
+ HDassert(ret >= 0);
}
return;
@@ -138,97 +127,81 @@ ns_grp_0(hid_t fid, const char *group_name)
*-------------------------------------------------------------------------
*/
-void vrfy_ns_grp_0(hid_t fid, const char *group_name)
-{
+void vrfy_ns_grp_0(hid_t fid, const char *group_name) {
hid_t gid = -1;
hid_t gcpl = -1;
H5G_info_t grp_info;
unsigned crt_order_flags = 0;
herr_t ret;
- if ( pass ) {
-
+ if (pass) {
gid = H5Gopen2(fid, group_name, H5P_DEFAULT);
- if ( gid <= 0 ) {
-
- pass = FALSE;
- failure_mssg = "vrfy_ns_grp_0: H5Gopen2() failed";
+ if (gid <= 0) {
+ pass = FALSE;
+ failure_mssg = "vrfy_ns_grp_0: H5Gopen2() failed";
}
HDassert(gid > 0);
}
- if ( pass ) {
-
+ if (pass) {
gcpl = H5Gget_create_plist(gid);
- if ( gcpl <= 0 ) {
-
- pass = FALSE;
- failure_mssg = "vrfy_ns_grp_0: H5Gget_create_plist() failed";
+ if (gcpl <= 0) {
+ pass = FALSE;
+ failure_mssg = "vrfy_ns_grp_0: H5Gget_create_plist() failed";
}
HDassert(gcpl > 0);
}
- if ( pass ) {
-
+ if (pass) {
ret = H5Pget_link_creation_order(gcpl, &crt_order_flags);
- if ( gcpl <= 0 ) {
-
- pass = FALSE;
- failure_mssg = "vrfy_ns_grp_0: H5Pget_link_creation_order() failed";
+ if (gcpl <= 0) {
+ pass = FALSE;
+ failure_mssg = "vrfy_ns_grp_0: H5Pget_link_creation_order() failed";
}
- else if ( H5P_CRT_ORDER_TRACKED != crt_order_flags ) {
-
- pass = FALSE;
- failure_mssg =
- "vrfy_ns_grp_0: H5P_CRT_ORDER_TRACKED != crt_order_flags";
+ else if ( H5P_CRT_ORDER_TRACKED != crt_order_flags) {
+ pass = FALSE;
+ failure_mssg =
+ "vrfy_ns_grp_0: H5P_CRT_ORDER_TRACKED != crt_order_flags";
}
HDassert(ret >= 0);
HDassert(H5P_CRT_ORDER_TRACKED == crt_order_flags);
}
- if ( pass ) {
-
+ if (pass) {
ret = H5Pclose(gcpl);
- if ( ret < 0 ) {
-
- pass = FALSE;
- failure_mssg = "vrfy_ns_grp_0: H5Pclose() failed";
+ if (ret < 0) {
+ pass = FALSE;
+ failure_mssg = "vrfy_ns_grp_0: H5Pclose() failed";
}
HDassert(ret >= 0);
}
- if ( pass ) {
-
- memset(&grp_info, 0, sizeof(grp_info));
+ if (pass) {
+ HDmemset(&grp_info, 0, sizeof(grp_info));
ret = H5Gget_info(gid, &grp_info);
- if ( ret < 0 ) {
-
+ if (ret < 0) {
pass = FALSE;
failure_mssg = "vrfy_ns_grp_0: H5Gget_info() failed";
}
- else if ( H5G_STORAGE_TYPE_COMPACT != grp_info.storage_type ) {
-
+ else if (H5G_STORAGE_TYPE_COMPACT != grp_info.storage_type) {
pass = FALSE;
- failure_mssg =
- "vrfy_ns_grp_0: H5G_STORAGE_TYPE_COMPACT != grp_info.storage_type";
+ failure_mssg =
+ "vrfy_ns_grp_0: H5G_STORAGE_TYPE_COMPACT != grp_info.storage_type";
}
- else if ( 0 != grp_info.nlinks ) {
-
+ else if (0 != grp_info.nlinks) {
pass = FALSE;
failure_mssg = "vrfy_ns_grp_0: 0 != grp_info.nlinks";
}
- else if ( 0 != grp_info.max_corder ) {
-
+ else if (0 != grp_info.max_corder) {
pass = FALSE;
failure_mssg = "vrfy_ns_grp_0: 0 != grp_info.max_corder";
}
- else if ( FALSE != grp_info.mounted ) {
-
+ else if ( FALSE != grp_info.mounted) {
pass = FALSE;
failure_mssg = "vrfy_ns_grp_0: FALSE != grp_info.mounted";
}
@@ -240,12 +213,10 @@ void vrfy_ns_grp_0(hid_t fid, const char *group_name)
HDassert(false == grp_info.mounted);
}
- if ( pass ) {
-
+ if (pass) {
ret = H5Gclose(gid);
- if ( ret < 0 ) {
-
+ if (ret < 0) {
pass = FALSE;
failure_mssg = "vrfy_ns_grp_0: H5Gclose() failed";
}
@@ -253,15 +224,14 @@ void vrfy_ns_grp_0(hid_t fid, const char *group_name)
}
return;
-
} /* vrfy_ns_grp_0() */
/*-------------------------------------------------------------------------
* Function: ns_grp_c
*
- * Purpose: Create a compact "new style" group, with 'nlinks'
- * soft/hard/external links in it in the specified file.
+ * Purpose: Create a compact "new style" group, with 'nlinks'
+ * soft/hard/external links in it in the specified file.
*
* If pass is false on entry, do nothing.
*
@@ -276,68 +246,57 @@ void vrfy_ns_grp_0(hid_t fid, const char *group_name)
*-------------------------------------------------------------------------
*/
-void
-ns_grp_c(hid_t fid, const char *group_name, unsigned nlinks)
-{
+void
+ns_grp_c(hid_t fid, const char *group_name, unsigned nlinks) {
hid_t gid = -1;
hid_t gcpl = -1;
unsigned max_compact;
unsigned u;
herr_t ret;
- if ( pass ) {
-
+ if (pass) {
gcpl = H5Pcreate(H5P_GROUP_CREATE);
- if ( gcpl <= 0 ) {
-
+ if (gcpl <= 0) {
pass = FALSE;
failure_mssg = "ns_grp_c: H5Pcreate(H5P_GROUP_CREATE) failed";
}
HDassert(gcpl > 0);
}
- if ( pass ) {
-
+ if (pass) {
ret = H5Pset_link_creation_order(gcpl, H5P_CRT_ORDER_TRACKED);
- if ( ret < 0 ) {
-
+ if (ret < 0) {
pass = FALSE;
failure_mssg = "ns_grp_c: H5Pset_link_creation_order() failed";
}
HDassert(ret >= 0);
}
- if ( pass ) {
-
+ if (pass) {
gid = H5Gcreate2(fid, group_name, H5P_DEFAULT, gcpl, H5P_DEFAULT);
- if ( gid <= 0 ) {
-
+ if (gid <= 0) {
pass = FALSE;
failure_mssg = "ns_grp_c: H5Gcreate2() failed";
}
HDassert(gid > 0);
}
- if ( pass ) {
-
+ if (pass) {
max_compact = 0;
ret = H5Pget_link_phase_change(gcpl, &max_compact, NULL);
- if ( ret < 0 ) {
-
+ if (ret < 0) {
pass = FALSE;
failure_mssg = "ns_grp_c: H5Pget_link_phase_change() failed";
}
- else if ( nlinks <= 0 ) {
-
+ else if (nlinks <= 0) {
pass = FALSE;
failure_mssg = "ns_grp_c: nlinks <= 0";
}
- else if ( nlinks >= max_compact ) {
-
+ else if (nlinks >= max_compact) {
pass = FALSE;
failure_mssg = "ns_grp_c: nlinks >= max_compact";
}
@@ -348,72 +307,59 @@ ns_grp_c(hid_t fid, const char *group_name, unsigned nlinks)
}
u = 0;
- while ( ( pass ) && ( u < nlinks ) ) {
-
+ while ((pass) && (u < nlinks)) {
char linkname[16];
- sprintf(linkname, "%u", u);
-
- if(0 == (u % 3)) {
-
- ret = H5Lcreate_soft(group_name, gid, linkname, H5P_DEFAULT,
- H5P_DEFAULT);
+ HDsprintf(linkname, "%u", u);
- if ( ret < 0 ) {
+ if (0 == (u % 3)) {
+ ret = H5Lcreate_soft(group_name, gid, linkname, H5P_DEFAULT, H5P_DEFAULT);
+ if (ret < 0) {
pass = FALSE;
failure_mssg = "ns_grp_c: H5Lcreate_soft() failed";
}
HDassert(ret >= 0);
} /* end if */
- else if(1 == (u % 3)) {
-
- ret = H5Lcreate_hard(fid, "/", gid, linkname, H5P_DEFAULT,
- H5P_DEFAULT);
-
- if ( ret < 0 ) {
+ else if (1 == (u % 3)) {
+ ret = H5Lcreate_hard(fid, "/", gid, linkname, H5P_DEFAULT,
+ H5P_DEFAULT);
+ if (ret < 0) {
pass = FALSE;
failure_mssg = "ns_grp_c: H5Lcreate_hard() failed";
}
HDassert(ret >= 0);
} /* end else-if */
else {
-
HDassert(2 == (u % 3));
- ret = H5Lcreate_external("external.h5", "/ext", gid, linkname,
- H5P_DEFAULT, H5P_DEFAULT);
-
- if ( ret < 0 ) {
+ ret = H5Lcreate_external("external.h5", "/ext", gid, linkname,
+ H5P_DEFAULT, H5P_DEFAULT);
+ if (ret < 0) {
pass = FALSE;
failure_mssg = "ns_grp_c: H5Lcreate_external() failed";
}
HDassert(ret >= 0);
} /* end else */
- u++;
-
+ u++;
} /* end while() */
- if ( pass ) {
-
+ if (pass) {
ret = H5Pclose(gcpl);
- if ( ret < 0 ) {
-
+ if (ret < 0) {
pass = FALSE;
failure_mssg = "ns_grp_c: H5Pclose(gcpl) failed";
}
HDassert(ret >= 0);
}
- if ( pass ) {
-
+ if (pass) {
ret = H5Gclose(gid);
- if ( ret < 0 ) {
-
+ if (ret < 0) {
pass = FALSE;
failure_mssg = "ns_grp_c: H5Gclose(gid) failed";
}
@@ -428,8 +374,8 @@ ns_grp_c(hid_t fid, const char *group_name, unsigned nlinks)
/*-------------------------------------------------------------------------
* Function: vrfy_ns_grp_c
*
- * Purpose: Verify a compact "new style" group, with 'nlinks'
- * soft/hard/external links in it in the specified file.
+ * Purpose: Verify a compact "new style" group, with 'nlinks'
+ * soft/hard/external links in it in the specified file.
*
* If pass is false on entry, do nothing.
*
@@ -445,8 +391,7 @@ ns_grp_c(hid_t fid, const char *group_name, unsigned nlinks)
*/
void
-vrfy_ns_grp_c(hid_t fid, const char *group_name, unsigned nlinks)
-{
+vrfy_ns_grp_c(hid_t fid, const char *group_name, unsigned nlinks) {
hid_t gid = -1;
hid_t gcpl = -1;
H5G_info_t grp_info;
@@ -454,89 +399,73 @@ vrfy_ns_grp_c(hid_t fid, const char *group_name, unsigned nlinks)
unsigned u;
herr_t ret;
- if ( pass ) {
-
+ if (pass) {
gid = H5Gopen2(fid, group_name, H5P_DEFAULT);
- if ( gid <= 0 ) {
-
+ if (gid <= 0) {
pass = FALSE;
failure_mssg = "vrfy_ns_grp_c: H5Gopen2() failed";
}
HDassert(gid > 0);
}
- if ( pass ) {
-
+ if (pass) {
gcpl = H5Gget_create_plist(gid);
- if ( gcpl <= 0 ) {
-
+ if (gcpl <= 0) {
pass = FALSE;
failure_mssg = "vrfy_ns_grp_c: H5Gget_create_plist(gid) failed";
}
- assert(gcpl > 0);
+ HDassert(gcpl > 0);
}
- if ( pass ) {
-
+ if (pass) {
ret = H5Pget_link_creation_order(gcpl, &crt_order_flags);
- if ( ret < 0 ) {
-
+ if (ret < 0) {
pass = FALSE;
failure_mssg = "vrfy_ns_grp_c: H5Pget_link_creation_order() failed";
}
- else if ( H5P_CRT_ORDER_TRACKED != crt_order_flags ) {
-
+ else if ( H5P_CRT_ORDER_TRACKED != crt_order_flags) {
pass = FALSE;
- failure_mssg =
- "vrfy_ns_grp_c: H5P_CRT_ORDER_TRACKED != crt_order_flags";
+ failure_mssg = "vrfy_ns_grp_c: H5P_CRT_ORDER_TRACKED != crt_order_flags";
}
HDassert(ret >= 0);
HDassert(H5P_CRT_ORDER_TRACKED == crt_order_flags);
}
- if ( pass ) {
-
+ if (pass) {
ret = H5Pclose(gcpl);
- if ( ret < 0 ) {
-
+ if (ret < 0) {
pass = FALSE;
failure_mssg = "vrfy_ns_grp_c: H5Pclose() failed";
}
HDassert(ret >= 0);
}
- if ( pass ) {
-
- memset(&grp_info, 0, sizeof(grp_info));
+ if (pass) {
+ HDmemset(&grp_info, 0, sizeof(grp_info));
ret = H5Gget_info(gid, &grp_info);
- if ( ret < 0 ) {
-
+ if (ret < 0) {
pass = FALSE;
failure_mssg = "vrfy_ns_grp_c: H5Gget_info() failed";
}
- else if ( H5G_STORAGE_TYPE_COMPACT != grp_info.storage_type ) {
-
+ else if (H5G_STORAGE_TYPE_COMPACT != grp_info.storage_type) {
pass = FALSE;
- failure_mssg =
- "vrfy_ns_grp_c: H5G_STORAGE_TYPE_COMPACT != grp_info.storage_type";
+ failure_mssg =
+ "vrfy_ns_grp_c: H5G_STORAGE_TYPE_COMPACT != grp_info.storage_type";
}
- else if ( nlinks != grp_info.nlinks ) {
-
+ else if (nlinks != grp_info.nlinks) {
pass = FALSE;
failure_mssg = "vrfy_ns_grp_c: nlinks != grp_info.nlinks";
}
- else if ( nlinks != grp_info.max_corder ) {
-
+ else if (nlinks != grp_info.max_corder) {
pass = FALSE;
failure_mssg = "vrfy_ns_grp_c: nlinks != grp_info.max_corder";
}
- else if ( FALSE != grp_info.mounted ) {
-
+ else if ( FALSE != grp_info.mounted) {
pass = FALSE;
failure_mssg = "vrfy_ns_grp_c: FALSE != grp_info.mounted";
}
@@ -549,42 +478,36 @@ vrfy_ns_grp_c(hid_t fid, const char *group_name, unsigned nlinks)
}
u = 0;
- while ( ( pass ) && ( u < nlinks ) ) {
-
+ while ((pass) && (u < nlinks)) {
H5L_info_t lnk_info;
char linkname[16];
htri_t link_exists;
- sprintf(linkname, "%u", u);
+ HDsprintf(linkname, "%u", u);
link_exists = H5Lexists(gid, linkname, H5P_DEFAULT);
- if ( link_exists < 0 ) {
-
+ if (link_exists < 0) {
pass = FALSE;
failure_mssg = "vrfy_ns_grp_c: H5Lexists() failed";
}
HDassert(link_exists >= 0);
- memset(&lnk_info, 0, sizeof(grp_info));
+ HDmemset(&lnk_info, 0, sizeof(grp_info));
ret = H5Lget_info(gid, linkname, &lnk_info, H5P_DEFAULT);
- if ( ret < 0 ) {
-
+ if (ret < 0) {
pass = FALSE;
failure_mssg = "vrfy_ns_grp_c: H5Lget_info() failed";
}
- else if ( TRUE != lnk_info.corder_valid ) {
-
+ else if ( TRUE != lnk_info.corder_valid) {
pass = FALSE;
failure_mssg = "vrfy_ns_grp_c: TRUE != lnk_info.corder_valid";
}
- else if ( u != lnk_info.corder ) {
-
+ else if (u != lnk_info.corder) {
pass = FALSE;
failure_mssg = "vrfy_ns_grp_c: u != lnk_info.corder";
}
- else if ( H5T_CSET_ASCII != lnk_info.cset ) {
-
+ else if (H5T_CSET_ASCII != lnk_info.cset) {
pass = FALSE;
failure_mssg = "vrfy_ns_grp_c: H5T_CSET_ASCII != lnk_info.cset";
}
@@ -593,75 +516,62 @@ vrfy_ns_grp_c(hid_t fid, const char *group_name, unsigned nlinks)
HDassert(u == lnk_info.corder);
HDassert(H5T_CSET_ASCII == lnk_info.cset);
- if ( 0 == (u % 3) ) {
-
+ if (0 == (u % 3)) {
char *slinkval;
- if ( H5L_TYPE_SOFT != lnk_info.type ) {
-
+ if (H5L_TYPE_SOFT != lnk_info.type) {
pass = FALSE;
failure_mssg = "vrfy_ns_grp_c: H5L_TYPE_SOFT != lnk_info.type";
}
- else if ( (strlen(group_name) + 1) != lnk_info.u.val_size ) {
-
+ else if ((HDstrlen(group_name) + 1) != lnk_info.u.val_size) {
pass = FALSE;
- failure_mssg =
- "vrfy_ns_grp_c: (strlen(group_name) + 1) != lnk_info.u.val_size";
+ failure_mssg = "vrfy_ns_grp_c: (HDstrlen(group_name) + 1) != lnk_info.u.val_size";
}
HDassert(H5L_TYPE_SOFT == lnk_info.type);
- HDassert((strlen(group_name) + 1) == lnk_info.u.val_size);
+ HDassert((HDstrlen(group_name) + 1) == lnk_info.u.val_size);
- slinkval = (char *)malloc(lnk_info.u.val_size);
-
- if ( ! slinkval ) {
+ slinkval = (char *) HDmalloc(lnk_info.u.val_size);
+ if (!slinkval) {
pass = FALSE;
- failure_mssg = "vrfy_ns_grp_c: malloc of slinkval failed";
+ failure_mssg = "vrfy_ns_grp_c: HDmalloc of slinkval failed";
}
HDassert(slinkval);
- ret = H5Lget_val(gid, linkname, slinkval, lnk_info.u.val_size,
- H5P_DEFAULT);
- if ( ret < 0 ) {
-
+ ret = H5Lget_val(gid, linkname, slinkval, lnk_info.u.val_size,
+ H5P_DEFAULT);
+ if (ret < 0) {
pass = FALSE;
failure_mssg = "vrfy_ns_grp_c: H5Lget_val() failed";
}
- else if ( 0 != strcmp(slinkval, group_name) ) {
-
+ else if (0 != HDstrcmp(slinkval, group_name)) {
pass = FALSE;
- failure_mssg =
- "vrfy_ns_grp_c: 0 != strcmp(slinkval, group_name)";
+ failure_mssg = "vrfy_ns_grp_c: 0 != HDstrcmp(slinkval, group_name)";
}
HDassert(ret >= 0);
- HDassert(0 == strcmp(slinkval, group_name));
+ HDassert(0 == HDstrcmp(slinkval, group_name));
- free(slinkval);
+ HDfree(slinkval);
} /* end if */
- else if(1 == (u % 3)) {
-
+ else if (1 == (u % 3)) {
H5O_info_t root_oinfo;
- if ( H5L_TYPE_HARD != lnk_info.type ) {
-
+ if (H5L_TYPE_HARD != lnk_info.type) {
pass = FALSE;
failure_mssg = "vrfy_ns_grp_c: H5L_TYPE_HARD != lnk_info.type";
}
HDassert(H5L_TYPE_HARD == lnk_info.type);
- memset(&root_oinfo, 0, sizeof(root_oinfo));
+ HDmemset(&root_oinfo, 0, sizeof(root_oinfo));
ret = H5Oget_info2(fid, &root_oinfo, H5O_INFO_BASIC);
- if ( ret < 0 ) {
-
+ if (ret < 0) {
pass = FALSE;
failure_mssg = "vrfy_ns_grp_c: H5Oget_info() failed.";
}
- else if ( root_oinfo.addr != lnk_info.u.address ) {
-
+ else if (root_oinfo.addr != lnk_info.u.address) {
pass = FALSE;
- failure_mssg =
- "vrfy_ns_grp_c: root_oinfo.addr != lnk_info.u.address";
+ failure_mssg = "vrfy_ns_grp_c: root_oinfo.addr != lnk_info.u.address";
}
HDassert(ret >= 0);
HDassert(root_oinfo.addr == lnk_info.u.address);
@@ -673,83 +583,70 @@ vrfy_ns_grp_c(hid_t fid, const char *group_name, unsigned nlinks)
HDassert(2 == (u % 3));
- if ( H5L_TYPE_EXTERNAL != lnk_info.type ) {
-
+ if (H5L_TYPE_EXTERNAL != lnk_info.type) {
pass = FALSE;
- failure_mssg =
- "vrfy_ns_grp_c: H5L_TYPE_EXTERNAL != lnk_info.type";
+ failure_mssg = "vrfy_ns_grp_c: H5L_TYPE_EXTERNAL != lnk_info.type";
}
HDassert(H5L_TYPE_EXTERNAL == lnk_info.type);
- elinkval = malloc(lnk_info.u.val_size);
-
- if ( ! elinkval ) {
+ elinkval = HDmalloc(lnk_info.u.val_size);
+ if (!elinkval) {
pass = FALSE;
- failure_mssg = "vrfy_ns_grp_c: malloc of elinkval failed.";
+ failure_mssg = "vrfy_ns_grp_c: HDmalloc of elinkval failed.";
}
HDassert(elinkval);
- ret = H5Lget_val(gid, linkname, elinkval, lnk_info.u.val_size,
- H5P_DEFAULT);
- if ( ret < 0 ) {
-
+ ret = H5Lget_val(gid, linkname, elinkval, lnk_info.u.val_size,
+ H5P_DEFAULT);
+ if (ret < 0) {
pass = FALSE;
failure_mssg = "vrfy_ns_grp_c: H5Lget_val() failed.";
}
HDassert(ret >= 0);
- ret = H5Lunpack_elink_val(elinkval, lnk_info.u.val_size,
- NULL, &file, &path);
- if ( ret < 0 ) {
-
+ ret = H5Lunpack_elink_val(elinkval, lnk_info.u.val_size, NULL, &file, &path);
+ if (ret < 0) {
pass = FALSE;
failure_mssg = "vrfy_ns_grp_c: H5Lunpack_elink_val() failed.";
}
- else if ( 0 != strcmp(file, "external.h5") ) {
-
+ else if (0 != HDstrcmp(file, "external.h5")) {
pass = FALSE;
- failure_mssg =
- "vrfy_ns_grp_c: 0 != strcmp(file, \"external.h5\")";
+ failure_mssg = "vrfy_ns_grp_c: 0 != HDstrcmp(file, \"external.h5\")";
}
- else if ( 0 != strcmp(path, "/ext") ) {
-
+ else if (0 != HDstrcmp(path, "/ext")) {
pass = FALSE;
- failure_mssg = "vrfy_ns_grp_c: 0 != strcmp(path, \"/ext\")";
+ failure_mssg = "vrfy_ns_grp_c: 0 != HDstrcmp(path, \"/ext\")";
}
HDassert(ret >= 0);
- HDassert(0 == strcmp(file, "external.h5"));
- HDassert(0 == strcmp(path, "/ext"));
+ HDassert(0 == HDstrcmp(file, "external.h5"));
+ HDassert(0 == HDstrcmp(path, "/ext"));
- free(elinkval);
+ HDfree(elinkval);
} /* end else */
- u++;
-
+ u++;
} /* end while */
- if ( pass ) {
-
+ if (pass) {
ret = H5Gclose(gid);
- if ( ret < 0 ) {
-
+ if (ret < 0) {
pass = FALSE;
failure_mssg = "vrfy_ns_grp_c: H5Gclose() failed.";
}
- assert(ret >= 0);
+ HDassert(ret >= 0);
}
return;
-
} /* vrfy_ns_grp_c() */
/*-------------------------------------------------------------------------
* Function: ns_grp_d
*
- * Purpose: Create a dense "new style" group, with 'nlinks'
- * (soft/hard/external) links in it in the specified file.
+ * Purpose: Create a dense "new style" group, with 'nlinks'
+ * (soft/hard/external) links in it in the specified file.
*
* If pass is false on entry, do nothing.
*
@@ -765,153 +662,130 @@ vrfy_ns_grp_c(hid_t fid, const char *group_name, unsigned nlinks)
*/
void
-ns_grp_d(hid_t fid, const char *group_name, unsigned nlinks)
-{
+ns_grp_d(hid_t fid, const char *group_name, unsigned nlinks) {
hid_t gid = -1;
hid_t gcpl = -1;
unsigned max_compact;
unsigned u;
herr_t ret;
- if ( pass ) {
-
+ if (pass) {
gcpl = H5Pcreate(H5P_GROUP_CREATE);
- if ( gcpl <= 0 ) {
-
- pass = FALSE;
- failure_mssg = "ns_grp_d: H5Pcreate() failed.";
- }
+ if (gcpl <= 0) {
+ pass = FALSE;
+ failure_mssg = "ns_grp_d: H5Pcreate() failed.";
+ }
HDassert(gcpl > 0);
}
- if ( pass ) {
-
+ if (pass) {
ret = H5Pset_link_creation_order(gcpl, H5P_CRT_ORDER_TRACKED);
- if ( ret < 0 ) {
-
- pass = FALSE;
- failure_mssg = "ns_grp_d: H5Pset_link_creation_order() failed.";
- }
+ if (ret < 0) {
+ pass = FALSE;
+ failure_mssg = "ns_grp_d: H5Pset_link_creation_order() failed.";
+ }
HDassert(ret >= 0);
}
- if ( pass ) {
-
+ if (pass) {
gid = H5Gcreate2(fid, group_name, H5P_DEFAULT, gcpl, H5P_DEFAULT);
- if ( gid <= 0 ) {
-
- pass = FALSE;
- failure_mssg = "ns_grp_d: H5Gcreate2() failed.";
- }
+ if (gid <= 0) {
+ pass = FALSE;
+ failure_mssg = "ns_grp_d: H5Gcreate2() failed.";
+ }
HDassert(gid > 0);
}
- if ( pass ) {
-
+ if (pass) {
max_compact = 0;
ret = H5Pget_link_phase_change(gcpl, &max_compact, NULL);
- if ( ret < 0 ) {
-
- pass = FALSE;
- failure_mssg = "ns_grp_d: H5Pget_link_phase_change() failed.";
- }
- else if ( nlinks <= max_compact ) {
-
- pass = FALSE;
- failure_mssg = "ns_grp_d: nlinks <= max_compact";
- }
+ if (ret < 0) {
+ pass = FALSE;
+ failure_mssg = "ns_grp_d: H5Pget_link_phase_change() failed.";
+ }
+ else if (nlinks <= max_compact) {
+ pass = FALSE;
+ failure_mssg = "ns_grp_d: nlinks <= max_compact";
+ }
HDassert(ret >= 0);
HDassert(nlinks > max_compact);
}
u = 0;
- while ( ( pass ) && ( u < nlinks ) ) {
-
+ while ((pass) && (u < nlinks)) {
char linkname[16];
- sprintf(linkname, "%u", u);
-
- if(0 == (u % 3)) {
+ HDsprintf(linkname, "%u", u);
- ret = H5Lcreate_soft(group_name, gid, linkname,
- H5P_DEFAULT, H5P_DEFAULT);
+ if (0 == (u % 3)) {
+ ret = H5Lcreate_soft(group_name, gid, linkname,
+ H5P_DEFAULT, H5P_DEFAULT);
- if ( ret < 0 ) {
-
- pass = FALSE;
- failure_mssg = "ns_grp_d: H5Lcreate_soft() failed.";
- }
+ if (ret < 0) {
+ pass = FALSE;
+ failure_mssg = "ns_grp_d: H5Lcreate_soft() failed.";
+ }
HDassert(ret >= 0);
} /* end if */
- else if(1 == (u % 3)) {
-
- ret = H5Lcreate_hard(fid, "/", gid, linkname,
- H5P_DEFAULT, H5P_DEFAULT);
+ else if (1 == (u % 3)) {
+ ret = H5Lcreate_hard(fid, "/", gid, linkname,
+ H5P_DEFAULT, H5P_DEFAULT);
- if ( ret < 0 ) {
-
- pass = FALSE;
- failure_mssg = "ns_grp_d: H5Lcreate_hard() failed.";
- }
+ if (ret < 0) {
+ pass = FALSE;
+ failure_mssg = "ns_grp_d: H5Lcreate_hard() failed.";
+ }
HDassert(ret >= 0);
} /* end else-if */
else {
-
HDassert(2 == (u % 3));
- ret = H5Lcreate_external("external.h5", "/ext", gid, linkname,
- H5P_DEFAULT, H5P_DEFAULT);
+ ret = H5Lcreate_external("external.h5", "/ext", gid, linkname,
+ H5P_DEFAULT, H5P_DEFAULT);
- if ( ret < 0 ) {
-
- pass = FALSE;
- failure_mssg = "ns_grp_d: H5Lcreate_external() failed.";
- }
+ if (ret < 0) {
+ pass = FALSE;
+ failure_mssg = "ns_grp_d: H5Lcreate_external() failed.";
+ }
HDassert(ret >= 0);
} /* end else */
u++;
-
} /* end while */
- if ( pass ) {
-
+ if (pass) {
ret = H5Pclose(gcpl);
- if ( ret < 0 ) {
-
- pass = FALSE;
- failure_mssg = "ns_grp_d: H5Pclose() failed.";
- }
+ if (ret < 0) {
+ pass = FALSE;
+ failure_mssg = "ns_grp_d: H5Pclose() failed.";
+ }
HDassert(ret >= 0);
}
- if ( pass ) {
-
+ if (pass) {
ret = H5Gclose(gid);
- if ( ret < 0 ) {
-
- pass = FALSE;
- failure_mssg = "ns_grp_d: H5Gclose() failed.";
- }
+ if (ret < 0) {
+ pass = FALSE;
+ failure_mssg = "ns_grp_d: H5Gclose() failed.";
+ }
HDassert(ret >= 0);
}
return;
-
} /* ns_grp_d() */
/*-------------------------------------------------------------------------
* Function: vrfy_ns_grp_d
*
- * Purpose: Verify a dense "new style" group, with 'nlinks'
- * soft/hard/external links in it in the specified file.
+ * Purpose: Verify a dense "new style" group, with 'nlinks'
+ * soft/hard/external links in it in the specified file.
*
* If pass is false on entry, do nothing.
*
@@ -928,8 +802,7 @@ ns_grp_d(hid_t fid, const char *group_name, unsigned nlinks)
void
-vrfy_ns_grp_d(hid_t fid, const char *group_name, unsigned nlinks)
-{
+vrfy_ns_grp_d(hid_t fid, const char *group_name, unsigned nlinks) {
hid_t gid = -1;
hid_t gcpl = -1;
H5G_info_t grp_info;
@@ -937,93 +810,75 @@ vrfy_ns_grp_d(hid_t fid, const char *group_name, unsigned nlinks)
unsigned u;
herr_t ret;
- if ( pass ) {
-
+ if (pass) {
gid = H5Gopen2(fid, group_name, H5P_DEFAULT);
- if ( gid <= 0 ) {
-
- pass = FALSE;
- failure_mssg = "vrfy_ns_grp_d: H5Gopen2() failed.";
+ if (gid <= 0) {
+ pass = FALSE;
+ failure_mssg = "vrfy_ns_grp_d: H5Gopen2() failed.";
}
HDassert(gid > 0);
}
- if ( pass ) {
-
+ if (pass) {
gcpl = H5Gget_create_plist(gid);
- if ( gcpl <= 0 ) {
-
- pass = FALSE;
- failure_mssg = "vrfy_ns_grp_d: H5Gget_create_plist() failed.";
+ if (gcpl <= 0) {
+ pass = FALSE;
+ failure_mssg = "vrfy_ns_grp_d: H5Gget_create_plist() failed.";
}
- assert(gcpl > 0);
+ HDassert(gcpl > 0);
}
- if ( pass ) {
-
+ if (pass) {
ret = H5Pget_link_creation_order(gcpl, &crt_order_flags);
- if ( ret < 0 ) {
-
- pass = FALSE;
- failure_mssg =
- "vrfy_ns_grp_d: H5Pget_link_creation_order() failed.";
+ if (ret < 0) {
+ pass = FALSE;
+ failure_mssg = "vrfy_ns_grp_d: H5Pget_link_creation_order() failed.";
}
- else if ( H5P_CRT_ORDER_TRACKED != crt_order_flags ) {
-
- pass = FALSE;
- failure_mssg =
- "vrfy_ns_grp_d: H5P_CRT_ORDER_TRACKED != crt_order_flags";
+ else if (H5P_CRT_ORDER_TRACKED != crt_order_flags) {
+ pass = FALSE;
+ failure_mssg = "vrfy_ns_grp_d: H5P_CRT_ORDER_TRACKED != crt_order_flags";
}
HDassert(ret >= 0);
HDassert(H5P_CRT_ORDER_TRACKED == crt_order_flags);
}
- if ( pass ) {
-
+ if (pass) {
ret = H5Pclose(gcpl);
- if ( ret < 0 ) {
-
- pass = FALSE;
- failure_mssg = "vrfy_ns_grp_d: H5Pclose() failed.";
- }
+ if (ret < 0) {
+ pass = FALSE;
+ failure_mssg = "vrfy_ns_grp_d: H5Pclose() failed.";
+ }
HDassert(ret >= 0);
}
- if ( pass ) {
-
- memset(&grp_info, 0, sizeof(grp_info));
+ if (pass) {
+ HDmemset(&grp_info, 0, sizeof(grp_info));
ret = H5Gget_info(gid, &grp_info);
- if ( ret < 0 ) {
-
- pass = FALSE;
- failure_mssg = "vrfy_ns_grp_d: H5Gget_info() failed.";
- }
- else if ( H5G_STORAGE_TYPE_DENSE != grp_info.storage_type ) {
-
- pass = FALSE;
- failure_mssg =
- "vrfy_ns_grp_d: H5G_STORAGE_TYPE_DENSE != grp_info.storage_type";
- }
- else if ( nlinks != grp_info.nlinks ) {
-
- pass = FALSE;
- failure_mssg = "vrfy_ns_grp_d: nlinks != grp_info.nlinks";
- }
- else if ( nlinks != grp_info.max_corder ) {
-
- pass = FALSE;
- failure_mssg = "vrfy_ns_grp_d: nlinks != grp_info.max_corder";
- }
- else if ( FALSE != grp_info.mounted ) {
-
- pass = FALSE;
- failure_mssg = "vrfy_ns_grp_d: FALSE != grp_info.mounted";
- }
+ if (ret < 0) {
+ pass = FALSE;
+ failure_mssg = "vrfy_ns_grp_d: H5Gget_info() failed.";
+ }
+ else if (H5G_STORAGE_TYPE_DENSE != grp_info.storage_type) {
+ pass = FALSE;
+ failure_mssg = "vrfy_ns_grp_d: H5G_STORAGE_TYPE_DENSE != grp_info.storage_type";
+ }
+ else if (nlinks != grp_info.nlinks) {
+ pass = FALSE;
+ failure_mssg = "vrfy_ns_grp_d: nlinks != grp_info.nlinks";
+ }
+ else if (nlinks != grp_info.max_corder) {
+ pass = FALSE;
+ failure_mssg = "vrfy_ns_grp_d: nlinks != grp_info.max_corder";
+ }
+ else if ( FALSE != grp_info.mounted) {
+ pass = FALSE;
+ failure_mssg = "vrfy_ns_grp_d: FALSE != grp_info.mounted";
+ }
HDassert(ret >= 0);
HDassert(H5G_STORAGE_TYPE_DENSE == grp_info.storage_type);
HDassert(nlinks == grp_info.nlinks);
@@ -1032,116 +887,100 @@ vrfy_ns_grp_d(hid_t fid, const char *group_name, unsigned nlinks)
}
u = 0;
- while ( ( pass ) && ( u < nlinks ) ) {
-
+ while ((pass) && (u < nlinks)) {
H5L_info_t lnk_info;
char linkname[16];
htri_t link_exists;
- sprintf(linkname, "%u", u);
+ HDsprintf(linkname, "%u", u);
link_exists = H5Lexists(gid, linkname, H5P_DEFAULT);
- if ( link_exists < 0 ) {
-
- pass = FALSE;
- failure_mssg = "vrfy_ns_grp_d: H5Lexists() failed.";
- }
+ if (link_exists < 0) {
+ pass = FALSE;
+ failure_mssg = "vrfy_ns_grp_d: H5Lexists() failed.";
+ }
HDassert(link_exists >= 0);
- memset(&lnk_info, 0, sizeof(grp_info));
+ HDmemset(&lnk_info, 0, sizeof(grp_info));
ret = H5Lget_info(gid, linkname, &lnk_info, H5P_DEFAULT);
- if ( ret < 0 ) {
-
- pass = FALSE;
- failure_mssg = "vrfy_ns_grp_d: H5Lget_info() failed.";
- }
- else if ( TRUE != lnk_info.corder_valid ) {
-
- pass = FALSE;
- failure_mssg = "vrfy_ns_grp_d: TRUE != lnk_info.corder_valid";
- }
- else if ( u != lnk_info.corder ) {
-
- pass = FALSE;
- failure_mssg = "vrfy_ns_grp_d: u != lnk_info.corder";
- }
- else if ( H5T_CSET_ASCII != lnk_info.cset ) {
-
- pass = FALSE;
- failure_mssg = "vrfy_ns_grp_d: H5T_CSET_ASCII != lnk_info.cset";
- }
+ if (ret < 0) {
+ pass = FALSE;
+ failure_mssg = "vrfy_ns_grp_d: H5Lget_info() failed.";
+ }
+ else if (TRUE != lnk_info.corder_valid) {
+ pass = FALSE;
+ failure_mssg = "vrfy_ns_grp_d: TRUE != lnk_info.corder_valid";
+ }
+ else if (u != lnk_info.corder) {
+ pass = FALSE;
+ failure_mssg = "vrfy_ns_grp_d: u != lnk_info.corder";
+ }
+ else if (H5T_CSET_ASCII != lnk_info.cset) {
+ pass = FALSE;
+ failure_mssg = "vrfy_ns_grp_d: H5T_CSET_ASCII != lnk_info.cset";
+ }
HDassert(ret >= 0);
HDassert(true == lnk_info.corder_valid);
HDassert(u == lnk_info.corder);
HDassert(H5T_CSET_ASCII == lnk_info.cset);
- if(0 == (u % 3)) {
+ if (0 == (u % 3)) {
char *slinkval;
- if ( H5L_TYPE_SOFT != lnk_info.type ) {
-
- pass = FALSE;
- failure_mssg = "vrfy_ns_grp_d: H5L_TYPE_SOFT != lnk_info.type";
- }
- else if ( (strlen(group_name) + 1) != lnk_info.u.val_size ) {
-
- pass = FALSE;
- failure_mssg = "vrfy_ns_grp_d: H5L_TYPE_SOFT != lnk_info.type";
- }
+ if (H5L_TYPE_SOFT != lnk_info.type) {
+ pass = FALSE;
+ failure_mssg = "vrfy_ns_grp_d: H5L_TYPE_SOFT != lnk_info.type";
+ }
+ else if ((HDstrlen(group_name) + 1) != lnk_info.u.val_size) {
+ pass = FALSE;
+ failure_mssg = "vrfy_ns_grp_d: H5L_TYPE_SOFT != lnk_info.type";
+ }
HDassert(H5L_TYPE_SOFT == lnk_info.type);
- HDassert((strlen(group_name) + 1) == lnk_info.u.val_size);
-
- slinkval = (char *)malloc(lnk_info.u.val_size);
+ HDassert((HDstrlen(group_name) + 1) == lnk_info.u.val_size);
- if ( ! slinkval ) {
+ slinkval = (char *) HDmalloc(lnk_info.u.val_size);
- pass = FALSE;
- failure_mssg = "vrfy_ns_grp_d: malloc of slinkval failed";
- }
+ if (!slinkval) {
+ pass = FALSE;
+ failure_mssg = "vrfy_ns_grp_d: HDmalloc of slinkval failed";
+ }
HDassert(slinkval);
- ret = H5Lget_val(gid, linkname, slinkval, lnk_info.u.val_size,
- H5P_DEFAULT);
- if ( ret < 0 ) {
-
- pass = FALSE;
- failure_mssg = "vrfy_ns_grp_d: H5Lget_val() failed";
- }
- else if ( 0 != strcmp(slinkval, group_name) ) {
-
- pass = FALSE;
- failure_mssg =
- "vrfy_ns_grp_d: 0 != strcmp(slinkval, group_name)";
- }
+ ret = H5Lget_val(gid, linkname, slinkval, lnk_info.u.val_size,
+ H5P_DEFAULT);
+ if (ret < 0) {
+ pass = FALSE;
+ failure_mssg = "vrfy_ns_grp_d: H5Lget_val() failed";
+ }
+ else if (0 != HDstrcmp(slinkval, group_name)) {
+ pass = FALSE;
+ failure_mssg = "vrfy_ns_grp_d: 0 != HDstrcmp(slinkval, group_name)";
+ }
HDassert(ret >= 0);
- HDassert(0 == strcmp(slinkval, group_name));
+ HDassert(0 == HDstrcmp(slinkval, group_name));
- free(slinkval);
+ HDfree(slinkval);
} /* end if */
- else if(1 == (u % 3)) {
+ else if (1 == (u % 3)) {
H5O_info_t root_oinfo;
- if ( H5L_TYPE_HARD != lnk_info.type ) {
-
- pass = FALSE;
- failure_mssg = "vrfy_ns_grp_d: H5L_TYPE_HARD != lnk_info.type";
- }
+ if (H5L_TYPE_HARD != lnk_info.type) {
+ pass = FALSE;
+ failure_mssg = "vrfy_ns_grp_d: H5L_TYPE_HARD != lnk_info.type";
+ }
HDassert(H5L_TYPE_HARD == lnk_info.type);
- memset(&root_oinfo, 0, sizeof(root_oinfo));
+ HDmemset(&root_oinfo, 0, sizeof(root_oinfo));
ret = H5Oget_info2(fid, &root_oinfo, H5O_INFO_BASIC);
- if ( ret < 0 ) {
-
- pass = FALSE;
- failure_mssg = "vrfy_ns_grp_d: H5Oget_info() failed.";
- }
- else if ( root_oinfo.addr != lnk_info.u.address ) {
-
- pass = FALSE;
- failure_mssg =
- "vrfy_ns_grp_d: root_oinfo.addr != lnk_info.u.address";
- }
+ if (ret < 0) {
+ pass = FALSE;
+ failure_mssg = "vrfy_ns_grp_d: H5Oget_info() failed.";
+ }
+ else if (root_oinfo.addr != lnk_info.u.address) {
+ pass = FALSE;
+ failure_mssg = "vrfy_ns_grp_d: root_oinfo.addr != lnk_info.u.address";
+ }
HDassert(ret >= 0);
HDassert(root_oinfo.addr == lnk_info.u.address);
} /* end else-if */
@@ -1152,72 +991,58 @@ vrfy_ns_grp_d(hid_t fid, const char *group_name, unsigned nlinks)
HDassert(2 == (u % 3));
- if ( H5L_TYPE_EXTERNAL != lnk_info.type ) {
-
- pass = FALSE;
- failure_mssg =
- "vrfy_ns_grp_d: H5L_TYPE_EXTERNAL != lnk_info.type";
- }
+ if (H5L_TYPE_EXTERNAL != lnk_info.type) {
+ pass = FALSE;
+ failure_mssg = "vrfy_ns_grp_d: H5L_TYPE_EXTERNAL != lnk_info.type";
+ }
HDassert(H5L_TYPE_EXTERNAL == lnk_info.type);
- elinkval = malloc(lnk_info.u.val_size);
+ elinkval = HDmalloc(lnk_info.u.val_size);
- if ( ! elinkval ) {
-
- pass = FALSE;
- failure_mssg = "vrfy_ns_grp_d: malloc of elinkval failed.";
- }
+ if (!elinkval) {
+ pass = FALSE;
+ failure_mssg = "vrfy_ns_grp_d: HDmalloc of elinkval failed.";
+ }
HDassert(elinkval);
- ret = H5Lget_val(gid, linkname, elinkval, lnk_info.u.val_size,
- H5P_DEFAULT);
- if ( ret < 0 ) {
-
- pass = FALSE;
+ ret = H5Lget_val(gid, linkname, elinkval, lnk_info.u.val_size,
+ H5P_DEFAULT);
+ if (ret < 0) {
+ pass = FALSE;
failure_mssg = "vrfy_ns_grp_d: H5Lget_val failed.";
}
HDassert(ret >= 0);
- ret = H5Lunpack_elink_val(elinkval, lnk_info.u.val_size, NULL,
- &file, &path);
- if ( ret < 0 ) {
-
- pass = FALSE;
+ ret = H5Lunpack_elink_val(elinkval, lnk_info.u.val_size, NULL, &file, &path);
+ if (ret < 0) {
+ pass = FALSE;
failure_mssg = "vrfy_ns_grp_d: H5Lunpack_elink_val failed.";
}
- else if ( 0 != strcmp(file, "external.h5") ) {
-
- pass = FALSE;
- failure_mssg =
- "vrfy_ns_grp_d: 0 != strcmp(file, \"external.h5\").";
+ else if (0 != HDstrcmp(file, "external.h5")) {
+ pass = FALSE;
+ failure_mssg = "vrfy_ns_grp_d: 0 != HDstrcmp(file, \"external.h5\").";
+ }
+ else if (0 != HDstrcmp(path, "/ext")) {
+ pass = FALSE;
+ failure_mssg = "vrfy_ns_grp_d: 0 != HDstrcmp(path, \"/ext\")";
}
- else if ( 0 != strcmp(path, "/ext") ) {
-
- pass = FALSE;
- failure_mssg =
- "vrfy_ns_grp_d: 0 != strcmp(path, \"/ext\")";
- }
HDassert(ret >= 0);
- HDassert(0 == strcmp(file, "external.h5"));
- HDassert(0 == strcmp(path, "/ext"));
-
- free(elinkval);
+ HDassert(0 == HDstrcmp(file, "external.h5"));
+ HDassert(0 == HDstrcmp(path, "/ext"));
+ HDfree(elinkval);
} /* end else */
- u++;
-
+ u++;
} /* end while() */
- if ( pass ) {
-
+ if (pass) {
ret = H5Gclose(gid);
- if ( ret < 0 ) {
-
- pass = FALSE;
- failure_mssg = "vrfy_ns_grp_d: H5Gclose() failed.";
- }
+ if (ret < 0) {
+ pass = FALSE;
+ failure_mssg = "vrfy_ns_grp_d: H5Gclose() failed.";
+ }
HDassert(ret >= 0);
}
@@ -1254,21 +1079,17 @@ os_grp_0(hid_t fid, const char *group_name)
herr_t ret;
if ( pass ) { /* get the file's file access property list */
-
fapl = H5Fget_access_plist(fid);
if ( fapl <= 0 ) {
-
pass = FALSE;
failure_mssg = "os_grp_0: H5Fget_access_plist() failed.";
}
HDassert(fapl > 0);
}
-
- if ( pass ) { /* get low and high bounds from fapl */
+ if ( pass ) { /* get low and high bounds from fapl */
ret = H5Pget_libver_bounds(fapl, &low, &high);
if ( ret < 0 ) {
-
pass = FALSE;
failure_mssg = "os_grp_0: H5Pget_libver_bounds() failed(1).";
}
@@ -1276,11 +1097,9 @@ os_grp_0(hid_t fid, const char *group_name)
}
if ( pass ) { /* turn file format latest off */
-
if(low >= H5F_LIBVER_V18) {
ret = H5Fset_libver_bounds(fid, H5F_LIBVER_EARLIEST, high);
if ( ret < 0 ) {
-
pass = FALSE;
failure_mssg = "os_grp_0: H5Fset_libver_bounds() failed(1).";
}
@@ -1289,11 +1108,8 @@ os_grp_0(hid_t fid, const char *group_name)
}
if ( pass ) {
-
- gid = H5Gcreate2(fid, group_name, H5P_DEFAULT, H5P_DEFAULT,
- H5P_DEFAULT);
+ gid = H5Gcreate2(fid, group_name, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
if ( gid <= 0 ) {
-
pass = FALSE;
failure_mssg = "os_grp_0: H5Gcreate2() failed.";
}
@@ -1301,11 +1117,9 @@ os_grp_0(hid_t fid, const char *group_name)
}
if ( pass ) {
-
ret = H5Gclose(gid);
if ( ret < 0 ) {
-
pass = FALSE;
failure_mssg = "os_grp_0: H5Gclose() failed.";
}
@@ -1313,11 +1127,9 @@ os_grp_0(hid_t fid, const char *group_name)
}
if ( pass ) { /* restore low and high bounds */
-
if(low >= H5F_LIBVER_V18) {
ret = H5Fset_libver_bounds(fid, low, high);
if ( ret < 0 ) {
-
pass = FALSE;
failure_mssg = "os_grp_0: H5Fset_libver_bounds() failed(1).";
}
@@ -1326,7 +1138,6 @@ os_grp_0(hid_t fid, const char *group_name)
}
return;
-
} /* os_grp_0() */
@@ -1349,98 +1160,83 @@ os_grp_0(hid_t fid, const char *group_name)
*/
void
-vrfy_os_grp_0(hid_t fid, const char *group_name)
-{
+vrfy_os_grp_0(hid_t fid, const char *group_name) {
hid_t gid = -1;
hid_t gcpl = -1;
H5G_info_t grp_info;
unsigned crt_order_flags = 0;
herr_t ret;
- if ( pass ) {
-
+ if (pass) {
gid = H5Gopen2(fid, group_name, H5P_DEFAULT);
- if ( gid <= 0 ) {
-
- pass = FALSE;
- failure_mssg = "vrfy_os_grp_0: H5Gopen2() failed.";
- }
+ if (gid <= 0) {
+ pass = FALSE;
+ failure_mssg = "vrfy_os_grp_0: H5Gopen2() failed.";
+ }
HDassert(gid > 0);
}
- if ( pass ) {
-
+ if (pass) {
gcpl = H5Gget_create_plist(gid);
- if ( gcpl <= 0 ) {
-
- pass = FALSE;
- failure_mssg = "vrfy_os_grp_0: H5Gget_create_plist() failed.";
- }
+ if (gcpl <= 0) {
+ pass = FALSE;
+ failure_mssg = "vrfy_os_grp_0: H5Gget_create_plist() failed.";
+ }
HDassert(gcpl > 0);
}
- if ( pass ) {
+ if (pass) {
ret = H5Pget_link_creation_order(gcpl, &crt_order_flags);
- if ( ret < 0 ) {
-
- pass = FALSE;
- failure_mssg = "vrfy_os_grp_0: H5Pget_link_creation_order() failed";
- }
- else if ( 0 != crt_order_flags ) {
-
- pass = FALSE;
- failure_mssg = "vrfy_os_grp_0: 0 != crt_order_flags";
- }
+ if (ret < 0) {
+ pass = FALSE;
+ failure_mssg = "vrfy_os_grp_0: H5Pget_link_creation_order() failed";
+ }
+ else if (0 != crt_order_flags) {
+ pass = FALSE;
+ failure_mssg = "vrfy_os_grp_0: 0 != crt_order_flags";
+ }
HDassert(ret >= 0);
HDassert(0 == crt_order_flags);
}
- if ( pass ) {
-
+ if (pass) {
ret = H5Pclose(gcpl);
- if ( ret < 0 ) {
-
- pass = FALSE;
- failure_mssg = "vrfy_os_grp_0: H5Pclose() failed.";
- }
+ if (ret < 0) {
+ pass = FALSE;
+ failure_mssg = "vrfy_os_grp_0: H5Pclose() failed.";
+ }
HDassert(ret >= 0);
}
- if ( pass ) {
-
- memset(&grp_info, 0, sizeof(grp_info));
+ if (pass) {
+ HDmemset(&grp_info, 0, sizeof(grp_info));
ret = H5Gget_info(gid, &grp_info);
- if ( ret < 0 ) {
-
- pass = FALSE;
- failure_mssg = "vrfy_os_grp_0: H5Gget_info() failed.";
- }
- else if ( H5G_STORAGE_TYPE_SYMBOL_TABLE != grp_info.storage_type ) {
-
- pass = FALSE;
- failure_mssg = "vrfy_os_grp_0: H5G_STORAGE_TYPE_SYMBOL_TABLE != grp_info.storage_type";
- }
- else if ( 0 != grp_info.nlinks ) {
-
- pass = FALSE;
- failure_mssg = "vrfy_os_grp_0: 0 != grp_info.nlinks";
- }
- else if ( 0 != grp_info.max_corder ) {
-
- pass = FALSE;
- failure_mssg = "vrfy_os_grp_0: 0 != grp_info.max_corder";
- }
- else if ( FALSE != grp_info.mounted ) {
-
- pass = FALSE;
- failure_mssg = "vrfy_os_grp_0: FALSE != grp_info.mounted";
- }
+ if (ret < 0) {
+ pass = FALSE;
+ failure_mssg = "vrfy_os_grp_0: H5Gget_info() failed.";
+ }
+ else if (H5G_STORAGE_TYPE_SYMBOL_TABLE != grp_info.storage_type) {
+ pass = FALSE;
+ failure_mssg = "vrfy_os_grp_0: H5G_STORAGE_TYPE_SYMBOL_TABLE != grp_info.storage_type";
+ }
+ else if (0 != grp_info.nlinks) {
+ pass = FALSE;
+ failure_mssg = "vrfy_os_grp_0: 0 != grp_info.nlinks";
+ }
+ else if (0 != grp_info.max_corder) {
+ pass = FALSE;
+ failure_mssg = "vrfy_os_grp_0: 0 != grp_info.max_corder";
+ }
+ else if ( FALSE != grp_info.mounted) {
+ pass = FALSE;
+ failure_mssg = "vrfy_os_grp_0: FALSE != grp_info.mounted";
+ }
HDassert(ret >= 0);
HDassert(H5G_STORAGE_TYPE_SYMBOL_TABLE == grp_info.storage_type);
HDassert(0 == grp_info.nlinks);
@@ -1448,28 +1244,25 @@ vrfy_os_grp_0(hid_t fid, const char *group_name)
HDassert(false == grp_info.mounted);
}
- if ( pass ) {
-
+ if (pass) {
ret = H5Gclose(gid);
- if ( ret < 0 ) {
-
- pass = FALSE;
- failure_mssg = "vrfy_os_grp_0: H5Gclose() failed.";
- }
+ if (ret < 0) {
+ pass = FALSE;
+ failure_mssg = "vrfy_os_grp_0: H5Gclose() failed.";
+ }
HDassert(ret >= 0);
}
return;
-
} /* vrfy_os_grp_0() */
/*-------------------------------------------------------------------------
* Function: os_grp_n
*
- * Purpose: Create an "old style" group, with 'nlinks' soft/hard
- * links in it.
+ * Purpose: Create an "old style" group, with 'nlinks' soft/hard
+ * links in it.
*
* If pass is false on entry, do nothing.
*
@@ -1484,7 +1277,7 @@ vrfy_os_grp_0(hid_t fid, const char *group_name)
*-------------------------------------------------------------------------
*/
-void
+void
os_grp_n(hid_t fid, const char *group_name, int proc_num, unsigned nlinks)
{
hid_t gid = -1;
@@ -1494,10 +1287,8 @@ os_grp_n(hid_t fid, const char *group_name, int proc_num, unsigned nlinks)
herr_t ret;
if ( pass ) { /* get the file's file access property list */
-
fapl = H5Fget_access_plist(fid);
if ( fapl <= 0 ) {
-
pass = FALSE;
failure_mssg = "os_grp_n: H5Fget_access_plist() failed.";
}
@@ -1505,10 +1296,8 @@ os_grp_n(hid_t fid, const char *group_name, int proc_num, unsigned nlinks)
}
if ( pass ) { /* get low and high bounds from fapl */
-
ret = H5Pget_libver_bounds(fapl, &low, &high);
if ( ret < 0 ) {
-
pass = FALSE;
failure_mssg = "os_grp_0: H5Pget_libver_bounds() failed(1).";
}
@@ -1516,11 +1305,9 @@ os_grp_n(hid_t fid, const char *group_name, int proc_num, unsigned nlinks)
}
if ( pass ) { /* turn file format latest off */
-
if(low >= H5F_LIBVER_V18) {
ret = H5Fset_libver_bounds(fid, H5F_LIBVER_EARLIEST, high);
if ( ret < 0 ) {
-
pass = FALSE;
failure_mssg = "os_grp_0: H5Fset_libver_bounds() failed(1).";
}
@@ -1529,11 +1316,8 @@ os_grp_n(hid_t fid, const char *group_name, int proc_num, unsigned nlinks)
}
if ( pass ) {
-
- gid = H5Gcreate2(fid, group_name, H5P_DEFAULT, H5P_DEFAULT,
- H5P_DEFAULT);
+ gid = H5Gcreate2(fid, group_name, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
if ( gid <= 0 ) {
-
pass = FALSE;
failure_mssg = "os_grp_n: H5Gcreate2() failed.";
}
@@ -1544,58 +1328,46 @@ os_grp_n(hid_t fid, const char *group_name, int proc_num, unsigned nlinks)
u = 0;
while ( ( pass ) && ( u < nlinks ) ) {
-
char linkname[32];
- sprintf(linkname, "ln%d_%u", proc_num, u);
+ HDsprintf(linkname, "ln%d_%u", proc_num, u);
if(0 == (u % 2)) {
-
- ret = H5Lcreate_soft(group_name, gid, linkname, H5P_DEFAULT,
- H5P_DEFAULT);
+ ret = H5Lcreate_soft(group_name, gid, linkname, H5P_DEFAULT, H5P_DEFAULT);
if ( ret < 0 ) {
-
- pass = FALSE;
- failure_mssg = "os_grp_n: H5Lcreate_soft() failed.";
+ pass = FALSE;
+ failure_mssg = "os_grp_n: H5Lcreate_soft() failed.";
}
HDassert(ret >= 0);
} /* end if */
else {
-
HDassert(1 == (u % 2));
- ret = H5Lcreate_hard(fid, "/", gid, linkname, H5P_DEFAULT,
- H5P_DEFAULT);
+ ret = H5Lcreate_hard(fid, "/", gid, linkname, H5P_DEFAULT, H5P_DEFAULT);
if ( ret < 0 ) {
-
- pass = FALSE;
- failure_mssg = "os_grp_n: H5Lcreate_hard() failed.";
+ pass = FALSE;
+ failure_mssg = "os_grp_n: H5Lcreate_hard() failed.";
}
HDassert(ret >= 0);
} /* end else */
- u++;
-
+ u++;
} /* end while */
if ( pass ) {
-
ret = H5Gclose(gid);
if ( ret < 0 ) {
-
- pass = FALSE;
- failure_mssg = "os_grp_n: H5Gclose() failed.";
+ pass = FALSE;
+ failure_mssg = "os_grp_n: H5Gclose() failed.";
}
- assert(ret >= 0);
+ HDassert(ret >= 0);
}
if ( pass ) { /* restore low and high bounds */
-
if(low >= H5F_LIBVER_V18) {
ret = H5Fset_libver_bounds(fid, low, high);
if ( ret < 0 ) {
-
pass = FALSE;
failure_mssg = "os_grp_n: H5Fset_libver_bounds() failed(2).";
}
@@ -1626,8 +1398,8 @@ os_grp_n(hid_t fid, const char *group_name, int proc_num, unsigned nlinks)
*-------------------------------------------------------------------------
*/
void
-vrfy_os_grp_n(hid_t fid, const char *group_name, int proc_num, unsigned nlinks)
-{
+vrfy_os_grp_n(hid_t fid, const char *group_name, int proc_num,
+ unsigned nlinks) {
hid_t gid = -1;
hid_t gcpl = -1;
H5G_info_t grp_info;
@@ -1635,92 +1407,76 @@ vrfy_os_grp_n(hid_t fid, const char *group_name, int proc_num, unsigned nlinks)
unsigned u;
herr_t ret;
- if ( pass ) {
-
+ if (pass) {
gid = H5Gopen2(fid, group_name, H5P_DEFAULT);
- if ( gid <= 0 ) {
-
- pass = FALSE;
- failure_mssg = "vrfy_os_grp_n: H5Gopen2() failed";
- }
+ if (gid <= 0) {
+ pass = FALSE;
+ failure_mssg = "vrfy_os_grp_n: H5Gopen2() failed";
+ }
HDassert(gid > 0);
}
- if ( pass ) {
-
+ if (pass) {
gcpl = H5Gget_create_plist(gid);
- if ( gcpl <= 0 ) {
-
- pass = FALSE;
- failure_mssg = "vrfy_os_grp_n: H5Gget_create_plist() failed";
- }
+ if (gcpl <= 0) {
+ pass = FALSE;
+ failure_mssg = "vrfy_os_grp_n: H5Gget_create_plist() failed";
+ }
HDassert(gcpl > 0);
}
- if ( pass ) {
-
+ if (pass) {
ret = H5Pget_link_creation_order(gcpl, &crt_order_flags);
- if ( ret < 0 ) {
-
- pass = FALSE;
- failure_mssg = "vrfy_os_grp_n: H5Pget_link_creation_order";
- }
- else if ( 0 != crt_order_flags ) {
-
- pass = FALSE;
- failure_mssg = "vrfy_os_grp_n: 0 != crt_order_flags";
- }
+ if (ret < 0) {
+ pass = FALSE;
+ failure_mssg = "vrfy_os_grp_n: H5Pget_link_creation_order";
+ }
+ else if (0 != crt_order_flags) {
+ pass = FALSE;
+ failure_mssg = "vrfy_os_grp_n: 0 != crt_order_flags";
+ }
HDassert(ret >= 0);
HDassert(0 == crt_order_flags);
}
- if ( pass ) {
-
+ if (pass) {
ret = H5Pclose(gcpl);
- if ( ret < 0 ) {
-
- pass = FALSE;
- failure_mssg = "vrfy_os_grp_n: H5Pclose() failed";
- }
+ if (ret < 0) {
+ pass = FALSE;
+ failure_mssg = "vrfy_os_grp_n: H5Pclose() failed";
+ }
HDassert(ret >= 0);
}
- if ( pass ) {
-
- memset(&grp_info, 0, sizeof(grp_info));
+ if (pass) {
+ HDmemset(&grp_info, 0, sizeof(grp_info));
ret = H5Gget_info(gid, &grp_info);
- if ( ret < 0 ) {
-
- pass = FALSE;
- failure_mssg = "vrfy_os_grp_n: H5Gget_info() failed";
- }
- else if ( H5G_STORAGE_TYPE_SYMBOL_TABLE != grp_info.storage_type ) {
-
- pass = FALSE;
- failure_mssg =
- "vrfy_os_grp_n: H5G_STORAGE_TYPE_SYMBOL_TABLE != grp_info.storage_type";
- }
- else if ( nlinks != grp_info.nlinks ) {
-
- pass = FALSE;
- failure_mssg = "vrfy_os_grp_n: nlinks != grp_info.nlinks";
- }
- else if ( 0 != grp_info.max_corder ) {
-
- pass = FALSE;
- failure_mssg = "vrfy_os_grp_n: 0 != grp_info.max_corder";
- }
- else if ( FALSE != grp_info.mounted ) {
-
- pass = FALSE;
- failure_mssg = "vrfy_os_grp_n: FALSE != grp_info.mounted";
- }
+ if (ret < 0) {
+ pass = FALSE;
+ failure_mssg = "vrfy_os_grp_n: H5Gget_info() failed";
+ }
+ else if (H5G_STORAGE_TYPE_SYMBOL_TABLE != grp_info.storage_type) {
+ pass = FALSE;
+ failure_mssg = "vrfy_os_grp_n: H5G_STORAGE_TYPE_SYMBOL_TABLE != grp_info.storage_type";
+ }
+ else if (nlinks != grp_info.nlinks) {
+ pass = FALSE;
+ failure_mssg = "vrfy_os_grp_n: nlinks != grp_info.nlinks";
+ }
+ else if (0 != grp_info.max_corder) {
+ pass = FALSE;
+ failure_mssg = "vrfy_os_grp_n: 0 != grp_info.max_corder";
+ }
+ else if ( FALSE != grp_info.mounted) {
+ pass = FALSE;
+ failure_mssg = "vrfy_os_grp_n: FALSE != grp_info.mounted";
+ }
HDassert(ret >= 0);
HDassert(H5G_STORAGE_TYPE_SYMBOL_TABLE == grp_info.storage_type);
HDassert(nlinks == grp_info.nlinks);
@@ -1729,137 +1485,117 @@ vrfy_os_grp_n(hid_t fid, const char *group_name, int proc_num, unsigned nlinks)
}
u = 0;
- while ( ( pass ) && ( u < nlinks ) ) {
-
+ while ((pass) && (u < nlinks)) {
H5L_info_t lnk_info;
char linkname[32];
htri_t link_exists;
- sprintf(linkname, "ln%d_%u", proc_num, u);
+ HDsprintf(linkname, "ln%d_%u", proc_num, u);
link_exists = H5Lexists(gid, linkname, H5P_DEFAULT);
- if ( link_exists < 0 ) {
-
- pass = FALSE;
- failure_mssg = "vrfy_os_grp_n: H5Lexists() failed";
+ if (link_exists < 0) {
+ pass = FALSE;
+ failure_mssg = "vrfy_os_grp_n: H5Lexists() failed";
}
HDassert(link_exists >= 0);
- memset(&lnk_info, 0, sizeof(grp_info));
+ HDmemset(&lnk_info, 0, sizeof(grp_info));
ret = H5Lget_info(gid, linkname, &lnk_info, H5P_DEFAULT);
- if ( ret < 0 ) {
-
- pass = FALSE;
- failure_mssg = "vrfy_os_grp_n: H5Lget_info() failed";
+ if (ret < 0) {
+ pass = FALSE;
+ failure_mssg = "vrfy_os_grp_n: H5Lget_info() failed";
}
- else if ( FALSE != lnk_info.corder_valid ) {
-
- pass = FALSE;
- failure_mssg = "vrfy_os_grp_n: FALSE != lnk_info.corder_valid";
+ else if ( FALSE != lnk_info.corder_valid) {
+ pass = FALSE;
+ failure_mssg = "vrfy_os_grp_n: FALSE != lnk_info.corder_valid";
}
- else if ( H5T_CSET_ASCII != lnk_info.cset ) {
-
- pass = FALSE;
- failure_mssg = "vrfy_os_grp_n: H5T_CSET_ASCII != lnk_info.cset";
+ else if (H5T_CSET_ASCII != lnk_info.cset) {
+ pass = FALSE;
+ failure_mssg = "vrfy_os_grp_n: H5T_CSET_ASCII != lnk_info.cset";
}
HDassert(ret >= 0);
HDassert(false == lnk_info.corder_valid);
HDassert(H5T_CSET_ASCII == lnk_info.cset);
- if(0 == (u % 2)) {
+ if (0 == (u % 2)) {
char *slinkval;
- if ( H5L_TYPE_SOFT != lnk_info.type ) {
-
- pass = FALSE;
- failure_mssg = "vrfy_os_grp_n: H5L_TYPE_SOFT != lnk_info.type";
+ if (H5L_TYPE_SOFT != lnk_info.type) {
+ pass = FALSE;
+ failure_mssg = "vrfy_os_grp_n: H5L_TYPE_SOFT != lnk_info.type";
}
- else if ( (strlen(group_name) + 1) != lnk_info.u.val_size ) {
-
- pass = FALSE;
- failure_mssg =
- "vrfy_os_grp_n: (strlen(group_name) + 1) != lnk_info.u.val_size";
+ else if ((HDstrlen(group_name) + 1) != lnk_info.u.val_size) {
+ pass = FALSE;
+ failure_mssg = "vrfy_os_grp_n: (HDstrlen(group_name) + 1) != lnk_info.u.val_size";
}
HDassert(H5L_TYPE_SOFT == lnk_info.type);
- HDassert((strlen(group_name) + 1) == lnk_info.u.val_size);
-
- slinkval = (char *)malloc(lnk_info.u.val_size);
+ HDassert((HDstrlen(group_name) + 1) == lnk_info.u.val_size);
- if ( ! slinkval ) {
+ slinkval = (char *) HDmalloc(lnk_info.u.val_size);
- pass = FALSE;
- failure_mssg = "vrfy_os_grp_n: malloc of slinkval failed";
+ if (!slinkval) {
+ pass = FALSE;
+ failure_mssg = "vrfy_os_grp_n: HDmalloc of slinkval failed";
}
HDassert(slinkval);
- ret = H5Lget_val(gid, linkname, slinkval, lnk_info.u.val_size,
- H5P_DEFAULT);
-
- if ( ret < 0 ) {
+ ret = H5Lget_val(gid, linkname, slinkval, lnk_info.u.val_size,
+ H5P_DEFAULT);
- pass = FALSE;
- failure_mssg = "vrfy_os_grp_n: H5Lget_val() failed";
+ if (ret < 0) {
+ pass = FALSE;
+ failure_mssg = "vrfy_os_grp_n: H5Lget_val() failed";
}
- else if ( 0 != strcmp(slinkval, group_name) ) {
-
- pass = FALSE;
- failure_mssg =
- "vrfy_os_grp_n: 0 != strcmp(slinkval, group_name)";
+ else if (0 != HDstrcmp(slinkval, group_name)) {
+ pass = FALSE;
+ failure_mssg = "vrfy_os_grp_n: 0 != HDstrcmp(slinkval, group_name)";
}
HDassert(ret >= 0);
- HDassert(0 == strcmp(slinkval, group_name));
+ HDassert(0 == HDstrcmp(slinkval, group_name));
- free(slinkval);
+ HDfree(slinkval);
} /* end if */
else {
H5O_info_t root_oinfo;
HDassert(1 == (u % 2));
- if ( H5L_TYPE_HARD != lnk_info.type ) {
-
- pass = FALSE;
- failure_mssg = "vrfy_os_grp_n: H5L_TYPE_HARD != lnk_info.type";
+ if (H5L_TYPE_HARD != lnk_info.type) {
+ pass = FALSE;
+ failure_mssg = "vrfy_os_grp_n: H5L_TYPE_HARD != lnk_info.type";
}
HDassert(H5L_TYPE_HARD == lnk_info.type);
- memset(&root_oinfo, 0, sizeof(root_oinfo));
+ HDmemset(&root_oinfo, 0, sizeof(root_oinfo));
ret = H5Oget_info2(fid, &root_oinfo, H5O_INFO_BASIC);
- if ( ret < 0 ) {
-
- pass = FALSE;
- failure_mssg = "vrfy_os_grp_n: H5Oget_info() failed.";
+ if (ret < 0) {
+ pass = FALSE;
+ failure_mssg = "vrfy_os_grp_n: H5Oget_info() failed.";
}
- else if ( root_oinfo.addr != lnk_info.u.address ) {
-
- pass = FALSE;
- failure_mssg =
- "vrfy_os_grp_n: root_oinfo.addr != lnk_info.u.address";
+ else if (root_oinfo.addr != lnk_info.u.address) {
+ pass = FALSE;
+ failure_mssg = "vrfy_os_grp_n: root_oinfo.addr != lnk_info.u.address";
}
HDassert(ret >= 0);
HDassert(root_oinfo.addr == lnk_info.u.address);
} /* end else */
- u++;
-
+ u++;
} /* end while */
- if ( pass ) {
-
+ if (pass) {
ret = H5Gclose(gid);
- if ( ret < 0 ) {
-
- pass = FALSE;
- failure_mssg = "vrfy_os_grp_n: H5Gclose() failed.";
+ if (ret < 0) {
+ pass = FALSE;
+ failure_mssg = "vrfy_os_grp_n: H5Gclose() failed.";
}
HDassert(ret >= 0);
}
return;
-
} /* vrfy_os_grp_n() */
@@ -1867,8 +1603,8 @@ vrfy_os_grp_n(hid_t fid, const char *group_name, int proc_num, unsigned nlinks)
* Function: ds_ctg_i
*
* Purpose: Create a contiguous dataset w/int datatype. Write data
- * to the data set or not as indicated by the write_data
- * parameter.
+ * to the data set or not as indicated by the write_data
+ * parameter.
*
* If pass is false on entry, do nothing.
*
@@ -1882,106 +1618,91 @@ vrfy_os_grp_n(hid_t fid, const char *group_name, int proc_num, unsigned nlinks)
*
*-------------------------------------------------------------------------
*/
-void
-ds_ctg_i(hid_t fid, const char *dset_name, hbool_t write_data)
-{
+void
+ds_ctg_i(hid_t fid, const char *dset_name, hbool_t write_data) {
int *wdata = NULL;
unsigned u;
hid_t dsid = -1;
hid_t sid = -1;
- hsize_t dims[1] = {DSET_DIMS};
+ hsize_t dims[1] = { DSET_DIMS };
herr_t ret;
- if ( pass ) {
-
+ if (pass) {
sid = H5Screate_simple(1, dims, NULL);
- if ( sid <= 0 ) {
-
- pass = FALSE;
- failure_mssg = "ds_ctg_i: H5Screate_simple() failed";
+ if (sid <= 0) {
+ pass = FALSE;
+ failure_mssg = "ds_ctg_i: H5Screate_simple() failed";
}
HDassert(sid > 0);
}
- if ( pass ) {
-
- dsid = H5Dcreate2(fid, dset_name, H5T_NATIVE_INT, sid, H5P_DEFAULT,
- H5P_DEFAULT, H5P_DEFAULT);
+ if (pass) {
+ dsid = H5Dcreate2(fid, dset_name, H5T_NATIVE_INT, sid, H5P_DEFAULT,
+ H5P_DEFAULT, H5P_DEFAULT);
- if ( dsid <= 0 ) {
-
- pass = FALSE;
- failure_mssg = "ds_ctg_i: H5Dcreate2() failed";
+ if (dsid <= 0) {
+ pass = FALSE;
+ failure_mssg = "ds_ctg_i: H5Dcreate2() failed";
}
HDassert(dsid > 0);
}
- if ( pass ) {
-
+ if (pass) {
ret = H5Sclose(sid);
- if ( ret < 0 ) {
-
- pass = FALSE;
- failure_mssg = "ds_ctg_i: H5Sclose() failed";
+ if (ret < 0) {
+ pass = FALSE;
+ failure_mssg = "ds_ctg_i: H5Sclose() failed";
}
HDassert(ret >= 0);
}
- if ( ( pass ) && ( write_data ) ) {
-
- wdata = (int *)malloc(sizeof(int) * DSET_DIMS);
-
- if ( ! wdata ) {
+ if ((pass) && (write_data)) {
+ wdata = (int *) HDmalloc(sizeof(int) * DSET_DIMS);
- pass = FALSE;
- failure_mssg = "ds_ctg_i: malloc of wdata failed.";
+ if (!wdata) {
+ pass = FALSE;
+ failure_mssg = "ds_ctg_i: HDmalloc of wdata failed.";
}
HDassert(wdata);
}
- if ( ( pass ) && ( write_data ) ) {
-
- for(u = 0; u < DSET_DIMS; u++)
-
- wdata[u] = (int)u;
-
- ret = H5Dwrite(dsid, H5T_NATIVE_INT, H5S_ALL, H5S_ALL,
- H5P_DEFAULT, wdata);
+ if ((pass) && (write_data)) {
+ for (u = 0; u < DSET_DIMS; u++)
+ wdata[u] = (int) u;
- if ( ret < 0 ) {
+ ret = H5Dwrite(dsid, H5T_NATIVE_INT, H5S_ALL, H5S_ALL,
+ H5P_DEFAULT, wdata);
- pass = FALSE;
- failure_mssg = "ds_ctg_i: H5Dwrite() failed.";
+ if (ret < 0) {
+ pass = FALSE;
+ failure_mssg = "ds_ctg_i: H5Dwrite() failed.";
}
HDassert(ret >= 0);
- free(wdata);
- }
-
- if ( pass ) {
+ HDfree(wdata);
+ }
+ if (pass) {
ret = H5Dclose(dsid);
- if ( ret < 0 ) {
-
- pass = FALSE;
- failure_mssg = "ds_ctg_i: H5Dclose() failed";
+ if (ret < 0) {
+ pass = FALSE;
+ failure_mssg = "ds_ctg_i: H5Dclose() failed";
}
HDassert(ret >= 0);
}
return;
-
} /* ds_ctg_i */
/*-------------------------------------------------------------------------
* Function: vrfy_ds_ctg_i
*
- * Purpose: Validate a contiguous datasets w/int datatypes. Validate
- * data if indicated via the write_data parameter.
+ * Purpose: Validate a contiguous datasets w/int datatypes. Validate
+ * data if indicated via the write_data parameter.
*
* If pass is false on entry, do nothing.
*
@@ -1995,9 +1716,8 @@ ds_ctg_i(hid_t fid, const char *dset_name, hbool_t write_data)
*
*-------------------------------------------------------------------------
*/
-void
-vrfy_ds_ctg_i(hid_t fid, const char *dset_name, hbool_t write_data)
-{
+void
+vrfy_ds_ctg_i(hid_t fid, const char *dset_name, hbool_t write_data) {
int *rdata = NULL;
unsigned u;
hid_t dsid = -1;
@@ -2011,225 +1731,187 @@ vrfy_ds_ctg_i(hid_t fid, const char *dset_name, hbool_t write_data)
htri_t type_equal;
herr_t ret;
- if ( pass ) {
-
+ if (pass) {
dsid = H5Dopen2(fid, dset_name, H5P_DEFAULT);
- if ( dsid <= 0 ) {
-
- pass = FALSE;
- failure_mssg = "vrfy_ds_ctg_i: H5Dopen2() failed.";
- }
+ if (dsid <= 0) {
+ pass = FALSE;
+ failure_mssg = "vrfy_ds_ctg_i: H5Dopen2() failed.";
+ }
HDassert(dsid > 0);
}
- if ( pass ) {
-
+ if (pass) {
sid = H5Dget_space(dsid);
- if ( sid <= 0 ) {
-
- pass = FALSE;
- failure_mssg = "vrfy_ds_ctg_i: H5Dget_space() failed.";
- }
+ if (sid <= 0) {
+ pass = FALSE;
+ failure_mssg = "vrfy_ds_ctg_i: H5Dget_space() failed.";
+ }
HDassert(sid > 0);
}
- if ( pass ) {
-
+ if (pass) {
ndims = H5Sget_simple_extent_ndims(sid);
- if ( 1 != ndims ) {
-
- pass = FALSE;
- failure_mssg = "vrfy_ds_ctg_i: 1 != ndims";
- }
+ if (1 != ndims) {
+ pass = FALSE;
+ failure_mssg = "vrfy_ds_ctg_i: 1 != ndims";
+ }
HDassert(1 == ndims);
}
- if ( pass ) {
-
+ if (pass) {
ret = H5Sget_simple_extent_dims(sid, dims, max_dims);
- if ( ret < 0 ) {
-
- pass = FALSE;
- failure_mssg = "vrfy_ds_ctg_i: H5Sget_simple_extent_dims() failed";
- }
- else if ( DSET_DIMS != dims[0] ) {
-
- pass = FALSE;
- failure_mssg = "vrfy_ds_ctg_i: DSET_DIMS != dims[0]";
- }
- else if ( DSET_DIMS != max_dims[0] ) {
-
- pass = FALSE;
- failure_mssg = "vrfy_ds_ctg_i: DSET_DIMS != max_dims[0]";
- }
+ if (ret < 0) {
+ pass = FALSE;
+ failure_mssg = "vrfy_ds_ctg_i: H5Sget_simple_extent_dims() failed";
+ }
+ else if ( DSET_DIMS != dims[0]) {
+ pass = FALSE;
+ failure_mssg = "vrfy_ds_ctg_i: DSET_DIMS != dims[0]";
+ }
+ else if ( DSET_DIMS != max_dims[0]) {
+ pass = FALSE;
+ failure_mssg = "vrfy_ds_ctg_i: DSET_DIMS != max_dims[0]";
+ }
HDassert(ret >= 0);
HDassert(DSET_DIMS == dims[0]);
HDassert(DSET_DIMS == max_dims[0]);
}
- if ( pass ) {
-
+ if (pass) {
ret = H5Sclose(sid);
- if ( ret < 0 ) {
-
- pass = FALSE;
- failure_mssg = "vrfy_ds_ctg_i: H5Sclose() failed.";
- }
+ if (ret < 0) {
+ pass = FALSE;
+ failure_mssg = "vrfy_ds_ctg_i: H5Sclose() failed.";
+ }
HDassert(ret >= 0);
}
- if ( pass ) {
-
+ if (pass) {
tid = H5Dget_type(dsid);
- if ( tid <= 0 ) {
-
- pass = FALSE;
- failure_mssg = "vrfy_ds_ctg_i: H5Dget_type() failed.";
- }
+ if (tid <= 0) {
+ pass = FALSE;
+ failure_mssg = "vrfy_ds_ctg_i: H5Dget_type() failed.";
+ }
HDassert(tid > 0);
}
- if ( pass ) {
-
+ if (pass) {
type_equal = H5Tequal(tid, H5T_NATIVE_INT);
- if ( 1 != type_equal ) {
-
- pass = FALSE;
- failure_mssg = "vrfy_ds_ctg_i: type not H5T_NATIVE_INT";
- }
+ if (1 != type_equal) {
+ pass = FALSE;
+ failure_mssg = "vrfy_ds_ctg_i: type not H5T_NATIVE_INT";
+ }
HDassert(1 == type_equal);
}
- if ( pass ) {
-
+ if (pass) {
ret = H5Tclose(tid);
- if ( ret < 0 ) {
-
- pass = FALSE;
- failure_mssg = "vrfy_ds_ctg_i: H5Tclose() failed.";
- }
- assert(ret >= 0);
+ if (ret < 0) {
+ pass = FALSE;
+ failure_mssg = "vrfy_ds_ctg_i: H5Tclose() failed.";
+ }
+ HDassert(ret >= 0);
}
- if ( pass ) {
-
+ if (pass) {
ret = H5Dget_space_status(dsid, &allocation);
- if ( ret < 0 ) {
-
- pass = FALSE;
- failure_mssg = "vrfy_ds_ctg_i: H5Dget_space_status() failed.";
- }
- else if ( write_data && ( allocation != H5D_SPACE_STATUS_ALLOCATED ) ) {
-
- pass = FALSE;
- failure_mssg =
- "vrfy_ds_ctg_i: write_data && allocation != H5D_SPACE_STATUS_ALLOCATED";
- }
- else if ( !write_data &&
- ( allocation != H5D_SPACE_STATUS_NOT_ALLOCATED ) ) {
-
- pass = FALSE;
- failure_mssg = "vrfy_ds_ctg_i: !write_data && allocation != H5D_SPACE_STATUS_NOT_ALLOCATED";
- }
+ if (ret < 0) {
+ pass = FALSE;
+ failure_mssg = "vrfy_ds_ctg_i: H5Dget_space_status() failed.";
+ }
+ else if (write_data && (allocation != H5D_SPACE_STATUS_ALLOCATED)) {
+ pass = FALSE;
+ failure_mssg = "vrfy_ds_ctg_i: write_data && allocation != H5D_SPACE_STATUS_ALLOCATED";
+ }
+ else if (!write_data
+ && (allocation != H5D_SPACE_STATUS_NOT_ALLOCATED)) {
+ pass = FALSE;
+ failure_mssg = "vrfy_ds_ctg_i: !write_data && allocation != H5D_SPACE_STATUS_NOT_ALLOCATED";
+ }
HDassert(ret >= 0);
- HDassert((write_data && allocation == H5D_SPACE_STATUS_ALLOCATED) ||
- (!write_data && allocation == H5D_SPACE_STATUS_NOT_ALLOCATED));
+ HDassert((write_data && allocation == H5D_SPACE_STATUS_ALLOCATED)
+ || (!write_data && allocation == H5D_SPACE_STATUS_NOT_ALLOCATED));
}
- if ( pass ) {
-
+ if (pass) {
dcpl = H5Dget_create_plist(dsid);
- if ( dcpl <= 0 ) {
-
- pass = FALSE;
- failure_mssg = "vrfy_ds_ctg_i: H5Dget_create_plist() failed.";
- }
+ if (dcpl <= 0) {
+ pass = FALSE;
+ failure_mssg = "vrfy_ds_ctg_i: H5Dget_create_plist() failed.";
+ }
HDassert(dcpl > 0);
}
- if ( pass ) {
-
+ if (pass) {
layout = H5Pget_layout(dcpl);
- if ( H5D_CONTIGUOUS != layout ) {
-
- pass = FALSE;
- failure_mssg = "vrfy_ds_ctg_i: H5D_CONTIGUOUS != layout";
- }
+ if (H5D_CONTIGUOUS != layout) {
+ pass = FALSE;
+ failure_mssg = "vrfy_ds_ctg_i: H5D_CONTIGUOUS != layout";
+ }
HDassert(H5D_CONTIGUOUS == layout);
}
- if ( pass ) {
-
+ if (pass) {
ret = H5Pclose(dcpl);
- if ( ret < 0 ) {
-
- pass = FALSE;
- failure_mssg = "vrfy_ds_ctg_i: H5Pclose() failed.";
- }
+ if (ret < 0) {
+ pass = FALSE;
+ failure_mssg = "vrfy_ds_ctg_i: H5Pclose() failed.";
+ }
HDassert(ret >= 0);
}
- if ( ( pass ) && ( write_data ) ) {
-
- rdata = (int *)malloc(sizeof(int) * DSET_DIMS);
+ if ((pass) && (write_data)) {
+ rdata = (int *) HDmalloc(sizeof(int) * DSET_DIMS);
- if ( ! rdata ) {
-
- pass = FALSE;
- failure_mssg = "vrfy_ds_ctg_i: malloc of rdata failed.";
- }
+ if (!rdata) {
+ pass = FALSE;
+ failure_mssg = "vrfy_ds_ctg_i: HDmalloc of rdata failed.";
+ }
HDassert(rdata);
}
- if ( ( pass ) && ( write_data ) ) {
-
- ret = H5Dread(dsid, H5T_NATIVE_INT, H5S_ALL, H5S_ALL,
- H5P_DEFAULT, rdata);
- if ( ret < 0 ) {
-
- pass = FALSE;
- failure_mssg = "vrfy_ds_ctg_i: H5Dread() failed.";
- }
+ if ((pass) && (write_data)) {
+ ret = H5Dread(dsid, H5T_NATIVE_INT, H5S_ALL, H5S_ALL,
+ H5P_DEFAULT, rdata);
+ if (ret < 0) {
+ pass = FALSE;
+ failure_mssg = "vrfy_ds_ctg_i: H5Dread() failed.";
+ }
HDassert(ret >= 0);
}
- if ( ( pass ) && ( write_data ) ) {
-
- for(u = 0; u < DSET_DIMS; u++) {
-
- if ( (int)u != rdata[u] ) {
-
- pass = FALSE;
- failure_mssg = "vrfy_ds_ctg_i: u != rdata[u].";
- break;
- }
- HDassert((int)u == rdata[u]);
- }
+ if ((pass) && (write_data)) {
+ for (u = 0; u < DSET_DIMS; u++) {
+ if ((int) u != rdata[u]) {
+ pass = FALSE;
+ failure_mssg = "vrfy_ds_ctg_i: u != rdata[u].";
+ break;
+ }
+ HDassert((int )u == rdata[u]);
+ }
- free(rdata);
+ HDfree(rdata);
} /* end if */
- if ( pass ) {
-
+ if (pass) {
ret = H5Dclose(dsid);
- if ( ret < 0 ) {
-
- pass = FALSE;
- failure_mssg = "vrfy_ds_ctg_i: H5Dclose() failed";
- }
+ if (ret < 0) {
+ pass = FALSE;
+ failure_mssg = "vrfy_ds_ctg_i: H5Dclose() failed";
+ }
HDassert(ret >= 0);
}
@@ -2242,8 +1924,8 @@ vrfy_ds_ctg_i(hid_t fid, const char *dset_name, hbool_t write_data)
* Function: ds_chk_i
*
* Purpose: Create a chunked dataset w/int datatype. Write data
- * to the data set or not as indicated by the write_data
- * parameter.
+ * to the data set or not as indicated by the write_data
+ * parameter.
*
* If pass is false on entry, do nothing.
*
@@ -2257,142 +1939,121 @@ vrfy_ds_ctg_i(hid_t fid, const char *dset_name, hbool_t write_data)
*
*-------------------------------------------------------------------------
*/
-void
-ds_chk_i(hid_t fid, const char *dset_name, hbool_t write_data)
-{
+void
+ds_chk_i(hid_t fid, const char *dset_name, hbool_t write_data) {
int *wdata = NULL;
unsigned u;
hid_t dsid = -1;
hid_t dcpl = -1;
hid_t sid = -1;
- hsize_t dims[1] = {DSET_DIMS};
- hsize_t chunk_dims[1] = {DSET_CHUNK_DIMS};
+ hsize_t dims[1] = { DSET_DIMS };
+ hsize_t chunk_dims[1] = { DSET_CHUNK_DIMS };
herr_t ret;
- if ( pass ) {
-
+ if (pass) {
sid = H5Screate_simple(1, dims, NULL);
- if ( sid <= 0 ) {
-
- pass = FALSE;
- failure_mssg = "ds_chk_i: H5Screate_simple() failed.";
- }
+ if (sid <= 0) {
+ pass = FALSE;
+ failure_mssg = "ds_chk_i: H5Screate_simple() failed.";
+ }
HDassert(sid > 0);
}
- if ( pass ) {
-
+ if (pass) {
dcpl = H5Pcreate(H5P_DATASET_CREATE);
- if ( dcpl <= 0 ) {
-
- pass = FALSE;
- failure_mssg = "ds_chk_i: H5Pcreate() failed.";
- }
+ if (dcpl <= 0) {
+ pass = FALSE;
+ failure_mssg = "ds_chk_i: H5Pcreate() failed.";
+ }
HDassert(dcpl > 0);
}
- if ( pass ) {
-
+ if (pass) {
ret = H5Pset_chunk(dcpl, 1, chunk_dims);
- if ( ret < 0 ) {
-
- pass = FALSE;
- failure_mssg = "ds_chk_i: H5Pset_chunk() failed.";
- }
+ if (ret < 0) {
+ pass = FALSE;
+ failure_mssg = "ds_chk_i: H5Pset_chunk() failed.";
+ }
HDassert(ret >= 0);
}
- if ( pass ) {
-
- dsid = H5Dcreate2(fid, dset_name, H5T_NATIVE_INT, sid,
- H5P_DEFAULT, dcpl, H5P_DEFAULT);
+ if (pass) {
+ dsid = H5Dcreate2(fid, dset_name, H5T_NATIVE_INT, sid,
+ H5P_DEFAULT, dcpl, H5P_DEFAULT);
- if ( dsid <= 0 ) {
-
- pass = FALSE;
- failure_mssg = "ds_chk_i: H5Dcreate2() failed";
- }
+ if (dsid <= 0) {
+ pass = FALSE;
+ failure_mssg = "ds_chk_i: H5Dcreate2() failed";
+ }
HDassert(dsid > 0);
}
- if ( pass ) {
-
+ if (pass) {
ret = H5Pclose(dcpl);
- if ( ret < 0 ) {
-
- pass = FALSE;
- failure_mssg = "ds_chk_i: H5Pclose() failed.";
- }
+ if (ret < 0) {
+ pass = FALSE;
+ failure_mssg = "ds_chk_i: H5Pclose() failed.";
+ }
HDassert(ret >= 0);
}
- if ( pass ) {
-
+ if (pass) {
ret = H5Sclose(sid);
- if ( ret < 0 ) {
-
- pass = FALSE;
- failure_mssg = "ds_chk_i: H5Sclose() failed.";
- }
+ if (ret < 0) {
+ pass = FALSE;
+ failure_mssg = "ds_chk_i: H5Sclose() failed.";
+ }
HDassert(ret >= 0);
}
- if ( ( pass ) && ( write_data ) ) {
-
- wdata = (int *)malloc(sizeof(int) * DSET_DIMS);
+ if ((pass) && (write_data)) {
+ wdata = (int *) HDmalloc(sizeof(int) * DSET_DIMS);
- if ( ! wdata ) {
-
- pass = FALSE;
- failure_mssg = "ds_chk_i: malloc of wdata failed.";
- }
+ if (!wdata) {
+ pass = FALSE;
+ failure_mssg = "ds_chk_i: HDmalloc of wdata failed.";
+ }
HDassert(wdata);
}
- if ( ( pass ) && ( write_data ) ) {
-
- for(u = 0; u < DSET_DIMS; u++)
- wdata[u] = (int)u;
+ if ((pass) && (write_data)) {
+ for (u = 0; u < DSET_DIMS; u++)
+ wdata[u] = (int) u;
- ret = H5Dwrite(dsid, H5T_NATIVE_INT, H5S_ALL, H5S_ALL,
- H5P_DEFAULT, wdata);
- if ( ret < 0 ) {
-
- pass = FALSE;
- failure_mssg = "ds_chk_i: H5Dwrite() failed.";
- }
+ ret = H5Dwrite(dsid, H5T_NATIVE_INT, H5S_ALL, H5S_ALL,
+ H5P_DEFAULT, wdata);
+ if (ret < 0) {
+ pass = FALSE;
+ failure_mssg = "ds_chk_i: H5Dwrite() failed.";
+ }
HDassert(ret >= 0);
-
- free(wdata);
+ HDfree(wdata);
} /* end if */
- if ( pass ) {
-
+ if (pass) {
ret = H5Dclose(dsid);
- if ( ret < 0 ) {
-
- pass = FALSE;
- failure_mssg = "ds_chk_i: H5Dclose() failed.";
- }
+ if (ret < 0) {
+ pass = FALSE;
+ failure_mssg = "ds_chk_i: H5Dclose() failed.";
+ }
HDassert(ret >= 0);
}
return;
-
} /* ds_chk_i */
/*-------------------------------------------------------------------------
* Function: vrfy_ds_chk_i
*
- * Purpose: Validate a chunked datasets w/int datatypes. Validate
- * data if indicated via the write_data parameter.
+ * Purpose: Validate a chunked datasets w/int datatypes. Validate
+ * data if indicated via the write_data parameter.
*
* If pass is false on entry, do nothing.
*
@@ -2406,9 +2067,8 @@ ds_chk_i(hid_t fid, const char *dset_name, hbool_t write_data)
*
*-------------------------------------------------------------------------
*/
-void
-vrfy_ds_chk_i(hid_t fid, const char *dset_name, hbool_t write_data)
-{
+void
+vrfy_ds_chk_i(hid_t fid, const char *dset_name, hbool_t write_data) {
int *rdata = NULL;
unsigned u;
hid_t dsid = -1;
@@ -2422,249 +2082,204 @@ vrfy_ds_chk_i(hid_t fid, const char *dset_name, hbool_t write_data)
htri_t type_equal;
herr_t ret;
- if ( pass ) {
-
+ if (pass) {
dsid = H5Dopen2(fid, dset_name, H5P_DEFAULT);
- if ( dsid <= 0 ) {
-
- pass = FALSE;
- failure_mssg = "vrfy_ds_chk_i: H5Dopen2() failed.";
- }
+ if (dsid <= 0) {
+ pass = FALSE;
+ failure_mssg = "vrfy_ds_chk_i: H5Dopen2() failed.";
+ }
HDassert(dsid > 0);
}
- if ( pass ) {
-
+ if (pass) {
sid = H5Dget_space(dsid);
- if ( sid <= 0 ) {
-
- pass = FALSE;
- failure_mssg = "vrfy_ds_chk_i: H5Dget_space() failed.";
- }
+ if (sid <= 0) {
+ pass = FALSE;
+ failure_mssg = "vrfy_ds_chk_i: H5Dget_space() failed.";
+ }
HDassert(sid > 0);
}
- if ( pass ) {
-
+ if (pass) {
ndims = H5Sget_simple_extent_ndims(sid);
- if ( 1 != ndims ) {
-
- pass = FALSE;
- failure_mssg = "vrfy_ds_chk_i: 1 != ndims";
- }
+ if (1 != ndims) {
+ pass = FALSE;
+ failure_mssg = "vrfy_ds_chk_i: 1 != ndims";
+ }
HDassert(1 == ndims);
}
- if ( pass ) {
-
+ if (pass) {
ret = H5Sget_simple_extent_dims(sid, dims, max_dims);
- if ( ret < 0 ) {
-
- pass = FALSE;
- failure_mssg = "vrfy_ds_chk_i: H5Sget_simple_extent_dims() failed";
- }
- else if ( DSET_DIMS != dims[0] ) {
-
- pass = FALSE;
- failure_mssg = "vrfy_ds_chk_i: DSET_DIMS != dims[0]";
- }
- else if ( DSET_DIMS != max_dims[0] ) {
-
- pass = FALSE;
- failure_mssg = "vrfy_ds_chk_i: DSET_DIMS != max_dims[0]";
- }
+ if (ret < 0) {
+ pass = FALSE;
+ failure_mssg = "vrfy_ds_chk_i: H5Sget_simple_extent_dims() failed";
+ }
+ else if ( DSET_DIMS != dims[0]) {
+ pass = FALSE;
+ failure_mssg = "vrfy_ds_chk_i: DSET_DIMS != dims[0]";
+ }
+ else if ( DSET_DIMS != max_dims[0]) {
+ pass = FALSE;
+ failure_mssg = "vrfy_ds_chk_i: DSET_DIMS != max_dims[0]";
+ }
HDassert(ret >= 0);
HDassert(DSET_DIMS == dims[0]);
HDassert(DSET_DIMS == max_dims[0]);
}
- if ( pass ) {
-
+ if (pass) {
ret = H5Sclose(sid);
- if ( ret < 0 ) {
-
- pass = FALSE;
- failure_mssg = "vrfy_ds_chk_i: H5Sclose() failed.";
- }
+ if (ret < 0) {
+ pass = FALSE;
+ failure_mssg = "vrfy_ds_chk_i: H5Sclose() failed.";
+ }
HDassert(ret >= 0);
}
- if ( pass ) {
-
+ if (pass) {
tid = H5Dget_type(dsid);
- if ( tid <= 0 ) {
-
- pass = FALSE;
- failure_mssg = "vrfy_ds_chk_i: H5Dget_type() failed.";
- }
+ if (tid <= 0) {
+ pass = FALSE;
+ failure_mssg = "vrfy_ds_chk_i: H5Dget_type() failed.";
+ }
HDassert(tid > 0);
}
- if ( pass ) {
-
+ if (pass) {
type_equal = H5Tequal(tid, H5T_NATIVE_INT);
- if ( 1 != type_equal ) {
-
- pass = FALSE;
- failure_mssg = "vrfy_ds_chk_i: tid != H5T_NATIVE_INT";
- }
+ if (1 != type_equal) {
+ pass = FALSE;
+ failure_mssg = "vrfy_ds_chk_i: tid != H5T_NATIVE_INT";
+ }
HDassert(1 == type_equal);
}
- if ( pass ) {
-
+ if (pass) {
ret = H5Tclose(tid);
- if ( ret < 0 ) {
-
- pass = FALSE;
- failure_mssg = "vrfy_ds_chk_i: H5Tclose() failed.";
- }
+ if (ret < 0) {
+ pass = FALSE;
+ failure_mssg = "vrfy_ds_chk_i: H5Tclose() failed.";
+ }
HDassert(ret >= 0);
}
- if ( pass ) {
-
+ if (pass) {
ret = H5Dget_space_status(dsid, &allocation);
- if ( ret < 0 ) {
-
- pass = FALSE;
- failure_mssg = "vrfy_ds_chk_i: H5Dget_space_status() failed.";
- }
- else if ( write_data && ( allocation != H5D_SPACE_STATUS_ALLOCATED ) ) {
-
- pass = FALSE;
- failure_mssg =
- "vrfy_ds_chk_i: write_data && allocation != H5D_SPACE_STATUS_ALLOCATED";
- }
- else if ( !write_data &&
- ( allocation != H5D_SPACE_STATUS_NOT_ALLOCATED ) ) {
-
- pass = FALSE;
- failure_mssg = "vrfy_ds_chk_i: !write_data && allocation != H5D_SPACE_STATUS_NOT_ALLOCATED";
- }
+ if (ret < 0) {
+ pass = FALSE;
+ failure_mssg = "vrfy_ds_chk_i: H5Dget_space_status() failed.";
+ }
+ else if (write_data && (allocation != H5D_SPACE_STATUS_ALLOCATED)) {
+ pass = FALSE;
+ failure_mssg = "vrfy_ds_chk_i: write_data && allocation != H5D_SPACE_STATUS_ALLOCATED";
+ }
+ else if (!write_data && (allocation != H5D_SPACE_STATUS_NOT_ALLOCATED)) {
+ pass = FALSE;
+ failure_mssg = "vrfy_ds_chk_i: !write_data && allocation != H5D_SPACE_STATUS_NOT_ALLOCATED";
+ }
HDassert(ret >= 0);
- HDassert((write_data && allocation == H5D_SPACE_STATUS_ALLOCATED) ||
- (!write_data && allocation == H5D_SPACE_STATUS_NOT_ALLOCATED));
+ HDassert((write_data && allocation == H5D_SPACE_STATUS_ALLOCATED)
+ || (!write_data && allocation == H5D_SPACE_STATUS_NOT_ALLOCATED));
}
- if ( pass ) {
-
+ if (pass) {
dcpl = H5Dget_create_plist(dsid);
- if ( dcpl <= 0 ) {
-
- pass = FALSE;
- failure_mssg = "vrfy_ds_chk_i: H5Dget_create_plist() failed.";
- }
+ if (dcpl <= 0) {
+ pass = FALSE;
+ failure_mssg = "vrfy_ds_chk_i: H5Dget_create_plist() failed.";
+ }
HDassert(dcpl > 0);
}
- if ( pass ) {
-
+ if (pass) {
layout = H5Pget_layout(dcpl);
- if ( H5D_CHUNKED != layout ) {
-
- pass = FALSE;
- failure_mssg = "vrfy_ds_chk_i: H5D_CHUNKED != layout";
- }
+ if (H5D_CHUNKED != layout) {
+ pass = FALSE;
+ failure_mssg = "vrfy_ds_chk_i: H5D_CHUNKED != layout";
+ }
HDassert(H5D_CHUNKED == layout);
}
- if ( pass ) {
-
+ if (pass) {
ret = H5Pget_chunk(dcpl, 1, chunk_dims);
- if ( ret < 0 ) {
-
- pass = FALSE;
- failure_mssg = "vrfy_ds_chk_i: H5Pget_chunk";
- }
- else if ( DSET_CHUNK_DIMS != chunk_dims[0] ) {
-
- pass = FALSE;
- failure_mssg = "vrfy_ds_chk_i: ";
- }
+ if (ret < 0) {
+ pass = FALSE;
+ failure_mssg = "vrfy_ds_chk_i: H5Pget_chunk";
+ }
+ else if ( DSET_CHUNK_DIMS != chunk_dims[0]) {
+ pass = FALSE;
+ failure_mssg = "vrfy_ds_chk_i: ";
+ }
HDassert(ret >= 0);
HDassert(DSET_CHUNK_DIMS == chunk_dims[0]);
}
- if ( pass ) {
-
+ if (pass) {
ret = H5Pclose(dcpl);
- if ( ret < 0 ) {
-
- pass = FALSE;
- failure_mssg = "vrfy_ds_chk_i: H5Pclose() failed.";
- }
+ if (ret < 0) {
+ pass = FALSE;
+ failure_mssg = "vrfy_ds_chk_i: H5Pclose() failed.";
+ }
HDassert(ret >= 0);
}
- if ( ( pass ) && ( write_data ) ) {
-
- rdata = (int *)malloc(sizeof(int) * DSET_DIMS);
+ if ((pass) && (write_data)) {
+ rdata = (int *) HDmalloc(sizeof(int) * DSET_DIMS);
- if ( ! rdata ) {
-
- pass = FALSE;
- failure_mssg = "vrfy_ds_chk_i: malloc of rdata failed.";
- }
+ if (!rdata) {
+ pass = FALSE;
+ failure_mssg = "vrfy_ds_chk_i: HDmalloc of rdata failed.";
+ }
HDassert(rdata);
}
- if ( ( pass ) && ( write_data ) ) {
-
- ret = H5Dread(dsid, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT,
- rdata);
- if ( ret < 0 ) {
-
- pass = FALSE;
- failure_mssg = "vrfy_ds_chk_i: H5Dread() failed.";
- }
+ if ((pass) && (write_data)) {
+ ret = H5Dread(dsid, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, rdata);
+ if (ret < 0) {
+ pass = FALSE;
+ failure_mssg = "vrfy_ds_chk_i: H5Dread() failed.";
+ }
HDassert(ret >= 0);
}
- if ( ( pass ) && ( write_data ) ) {
-
- for(u = 0; u < DSET_DIMS; u++) {
-
- if ( (int)u != rdata[u] ) {
-
- pass = FALSE;
- failure_mssg = "vrfy_ds_chk_i: u != rdata[u]";
- break;
- }
- HDassert((int)u == rdata[u]);
+ if ((pass) && (write_data)) {
+ for (u = 0; u < DSET_DIMS; u++) {
+ if ((int) u != rdata[u]) {
+ pass = FALSE;
+ failure_mssg = "vrfy_ds_chk_i: u != rdata[u]";
+ break;
+ }
+ HDassert((int )u == rdata[u]);
}
- free(rdata);
+ HDfree(rdata);
} /* end if */
-
- if ( pass ) {
-
+ if (pass) {
ret = H5Dclose(dsid);
- if ( ret < 0 ) {
-
- pass = FALSE;
- failure_mssg = "vrfy_ds_chk_i: H5Dclose() failed.";
- }
+ if (ret < 0) {
+ pass = FALSE;
+ failure_mssg = "vrfy_ds_chk_i: H5Dclose() failed.";
+ }
HDassert(ret >= 0);
}
return;
-
} /* vrfy_ds_chk_i() */
@@ -2672,8 +2287,8 @@ vrfy_ds_chk_i(hid_t fid, const char *dset_name, hbool_t write_data)
* Function: ds_cpt_i
*
* Purpose: Create a compact dataset w/int datatype. Write data
- * to the data set or not as indicated by the write_data
- * parameter.
+ * to the data set or not as indicated by the write_data
+ * parameter.
*
* If pass is false on entry, do nothing.
*
@@ -2687,129 +2302,110 @@ vrfy_ds_chk_i(hid_t fid, const char *dset_name, hbool_t write_data)
*
*-------------------------------------------------------------------------
*/
-void
-ds_cpt_i(hid_t fid, const char *dset_name, hbool_t write_data)
-{
+void
+ds_cpt_i(hid_t fid, const char *dset_name, hbool_t write_data) {
int *wdata = NULL;
unsigned u;
hid_t dsid = -1;
hid_t dcpl = -1;
hid_t sid = -1;
- hsize_t dims[1] = {DSET_COMPACT_DIMS};
+ hsize_t dims[1] = { DSET_COMPACT_DIMS };
herr_t ret;
- if ( pass ) {
-
+ if (pass) {
sid = H5Screate_simple(1, dims, NULL);
- if ( sid <= 0 ) {
-
- pass = FALSE;
- failure_mssg = "ds_cpt_i: H5Screate_simple() failed.";
- }
+ if (sid <= 0) {
+ pass = FALSE;
+ failure_mssg = "ds_cpt_i: H5Screate_simple() failed.";
+ }
HDassert(sid > 0);
}
- if ( pass ) {
-
+ if (pass) {
dcpl = H5Pcreate(H5P_DATASET_CREATE);
- if ( dcpl <= 0 ) {
-
- pass = FALSE;
- failure_mssg = "ds_cpt_i: H5Pcreate() failed.";
- }
+ if (dcpl <= 0) {
+ pass = FALSE;
+ failure_mssg = "ds_cpt_i: H5Pcreate() failed.";
+ }
HDassert(dcpl > 0);
}
- if ( pass ) {
-
+ if (pass) {
ret = H5Pset_layout(dcpl, H5D_COMPACT);
- if ( ret < 0 ) {
-
- pass = FALSE;
- failure_mssg = "ds_cpt_i: H5Pset_layout() failed.";
- }
+ if (ret < 0) {
+ pass = FALSE;
+ failure_mssg = "ds_cpt_i: H5Pset_layout() failed.";
+ }
HDassert(ret >= 0);
}
- if ( pass ) {
-
- dsid = H5Dcreate2(fid, dset_name, H5T_NATIVE_INT, sid,
- H5P_DEFAULT, dcpl, H5P_DEFAULT);
+ if (pass) {
+ dsid = H5Dcreate2(fid, dset_name, H5T_NATIVE_INT, sid,
+ H5P_DEFAULT, dcpl, H5P_DEFAULT);
- if ( dsid <= 0 ) {
-
- pass = FALSE;
- failure_mssg = "ds_cpt_i: H5Dcreate2() failed.";
- }
+ if (dsid <= 0) {
+ pass = FALSE;
+ failure_mssg = "ds_cpt_i: H5Dcreate2() failed.";
+ }
HDassert(dsid > 0);
}
- if ( pass ) {
-
+ if (pass) {
ret = H5Pclose(dcpl);
- if ( ret < 0 ) {
-
- pass = FALSE;
- failure_mssg = "ds_cpt_i: H5Pclose() failed.";
- }
+ if (ret < 0) {
+ pass = FALSE;
+ failure_mssg = "ds_cpt_i: H5Pclose() failed.";
+ }
HDassert(ret >= 0);
}
- if ( pass ) {
-
+ if (pass) {
ret = H5Sclose(sid);
- if ( ret < 0 ) {
-
- pass = FALSE;
- failure_mssg = "ds_cpt_i: H5Sclose() failed.";
- }
+ if (ret < 0) {
+ pass = FALSE;
+ failure_mssg = "ds_cpt_i: H5Sclose() failed.";
+ }
HDassert(ret >= 0);
}
- if ( ( pass ) && ( write_data ) ) {
-
- wdata = (int *)malloc(sizeof(int) * DSET_COMPACT_DIMS);
+ if ((pass) && (write_data)) {
+ wdata = (int *) HDmalloc(sizeof(int) * DSET_COMPACT_DIMS);
- if ( ! wdata ) {
-
- pass = FALSE;
- failure_mssg = "ds_cpt_i: malloc of wdata failed.";
- }
+ if (!wdata) {
+ pass = FALSE;
+ failure_mssg = "ds_cpt_i: HDmalloc of wdata failed.";
+ }
HDassert(wdata);
}
- if ( ( pass ) && ( write_data ) ) {
-
- for(u = 0; u < DSET_COMPACT_DIMS; u++)
- wdata[u] = (int)u;
+ if ((pass) && (write_data)) {
+ for (u = 0; u < DSET_COMPACT_DIMS; u++)
+ wdata[u] = (int) u;
- ret = H5Dwrite(dsid, H5T_NATIVE_INT, H5S_ALL, H5S_ALL,
- H5P_DEFAULT, wdata);
+ ret = H5Dwrite(dsid, H5T_NATIVE_INT, H5S_ALL, H5S_ALL,
+ H5P_DEFAULT, wdata);
- if ( ret < 0 ) {
-
- pass = FALSE;
- failure_mssg = "ds_cpt_i: H5Dwrite() failed.";
- }
+ if (ret < 0) {
+ pass = FALSE;
+ failure_mssg = "ds_cpt_i: H5Dwrite() failed.";
+ }
HDassert(ret >= 0);
- free(wdata);
+ HDfree(wdata);
} /* end if */
- if ( pass ) {
-
+ if (pass) {
ret = H5Dclose(dsid);
- if ( ret < 0 ) {
-
- pass = FALSE;
- failure_mssg = "ds_cpt_i: H5Dclose() failed.";
- }
+ if (ret < 0) {
+ pass = FALSE;
+ failure_mssg = "ds_cpt_i: H5Dclose() failed.";
+ }
HDassert(ret >= 0);
}
@@ -2821,8 +2417,8 @@ ds_cpt_i(hid_t fid, const char *dset_name, hbool_t write_data)
/*-------------------------------------------------------------------------
* Function: vrfy_ds_cpt_i
*
- * Purpose: Validate a compact datasets w/int datatypes. Validate
- * data if indicated via the write_data parameter.
+ * Purpose: Validate a compact datasets w/int datatypes. Validate
+ * data if indicated via the write_data parameter.
*
* If pass is false on entry, do nothing.
*
@@ -2836,9 +2432,8 @@ ds_cpt_i(hid_t fid, const char *dset_name, hbool_t write_data)
*
*-------------------------------------------------------------------------
*/
-void
-vrfy_ds_cpt_i(hid_t fid, const char *dset_name, hbool_t write_data)
-{
+void
+vrfy_ds_cpt_i(hid_t fid, const char *dset_name, hbool_t write_data) {
int *rdata = NULL;
unsigned u;
hid_t dsid = -1;
@@ -2852,232 +2447,195 @@ vrfy_ds_cpt_i(hid_t fid, const char *dset_name, hbool_t write_data)
htri_t type_equal;
herr_t ret;
- if ( pass ) {
-
+ if (pass) {
dsid = H5Dopen2(fid, dset_name, H5P_DEFAULT);
- if ( dsid <= 0 ) {
-
- pass = FALSE;
- failure_mssg = "vrfy_ds_cpt_i: H5Dopen2() failed.";
- }
+ if (dsid <= 0) {
+ pass = FALSE;
+ failure_mssg = "vrfy_ds_cpt_i: H5Dopen2() failed.";
+ }
HDassert(dsid > 0);
}
- if ( pass ) {
-
+ if (pass) {
sid = H5Dget_space(dsid);
- if ( sid <= 0 ) {
-
- pass = FALSE;
- failure_mssg = "vrfy_ds_cpt_i: H5Dget_space() failed.";
- }
+ if (sid <= 0) {
+ pass = FALSE;
+ failure_mssg = "vrfy_ds_cpt_i: H5Dget_space() failed.";
+ }
HDassert(sid > 0);
}
- if ( pass ) {
-
+ if (pass) {
ndims = H5Sget_simple_extent_ndims(sid);
- if ( 1 != ndims ) {
-
- pass = FALSE;
- failure_mssg = "vrfy_ds_cpt_i: 1 != ndims";
- }
+ if (1 != ndims) {
+ pass = FALSE;
+ failure_mssg = "vrfy_ds_cpt_i: 1 != ndims";
+ }
HDassert(1 == ndims);
}
- if ( pass ) {
-
+ if (pass) {
ret = H5Sget_simple_extent_dims(sid, dims, max_dims);
- if ( ret < 0 ) {
-
- pass = FALSE;
- failure_mssg = "vrfy_ds_cpt_i: H5Sget_simple_extent_dims() failed";
- }
- else if ( DSET_COMPACT_DIMS != dims[0] ) {
-
- pass = FALSE;
- failure_mssg = "vrfy_ds_cpt_i: DSET_COMPACT_DIMS != dims[0]";
- }
- else if ( DSET_COMPACT_DIMS != max_dims[0] ) {
-
- pass = FALSE;
- failure_mssg = "vrfy_ds_cpt_i: DSET_COMPACT_DIMS != max_dims[0]";
- }
+ if (ret < 0) {
+ pass = FALSE;
+ failure_mssg = "vrfy_ds_cpt_i: H5Sget_simple_extent_dims() failed";
+ }
+ else if ( DSET_COMPACT_DIMS != dims[0]) {
+ pass = FALSE;
+ failure_mssg = "vrfy_ds_cpt_i: DSET_COMPACT_DIMS != dims[0]";
+ }
+ else if ( DSET_COMPACT_DIMS != max_dims[0]) {
+ pass = FALSE;
+ failure_mssg = "vrfy_ds_cpt_i: DSET_COMPACT_DIMS != max_dims[0]";
+ }
HDassert(ret >= 0);
HDassert(DSET_COMPACT_DIMS == dims[0]);
HDassert(DSET_COMPACT_DIMS == max_dims[0]);
}
- if ( pass ) {
-
+ if (pass) {
ret = H5Sclose(sid);
- if ( ret < 0 ) {
-
- pass = FALSE;
- failure_mssg = "vrfy_ds_cpt_i: H5Sclose() failed.";
- }
+ if (ret < 0) {
+ pass = FALSE;
+ failure_mssg = "vrfy_ds_cpt_i: H5Sclose() failed.";
+ }
HDassert(ret >= 0);
}
- if ( pass ) {
-
+ if (pass) {
tid = H5Dget_type(dsid);
- if ( tid <= 0 ) {
-
- pass = FALSE;
- failure_mssg = "vrfy_ds_cpt_i: H5Dget_type() failed.";
- }
+ if (tid <= 0) {
+ pass = FALSE;
+ failure_mssg = "vrfy_ds_cpt_i: H5Dget_type() failed.";
+ }
HDassert(tid > 0);
}
- if ( pass ) {
-
+ if (pass) {
type_equal = H5Tequal(tid, H5T_NATIVE_INT);
- if ( 1 != type_equal ) {
-
- pass = FALSE;
- failure_mssg = "vrfy_ds_cpt_i: type != H5T_NATIVE_INT";
- }
+ if (1 != type_equal) {
+ pass = FALSE;
+ failure_mssg = "vrfy_ds_cpt_i: type != H5T_NATIVE_INT";
+ }
HDassert(1 == type_equal);
}
- if ( pass ) {
-
+ if (pass) {
ret = H5Tclose(tid);
- if ( ret < 0 ) {
-
- pass = FALSE;
- failure_mssg = "vrfy_ds_cpt_i: H5Tclose() failed.";
- }
+ if (ret < 0) {
+ pass = FALSE;
+ failure_mssg = "vrfy_ds_cpt_i: H5Tclose() failed.";
+ }
HDassert(ret >= 0);
}
- if ( pass ) {
-
+ if (pass) {
ret = H5Dget_space_status(dsid, &allocation);
- if ( ret < 0 ) {
-
- pass = FALSE;
- failure_mssg = "vrfy_ds_cpt_i: H5Dget_space_status() failed.";
- }
- else if ( H5D_SPACE_STATUS_ALLOCATED != allocation ) {
-
- pass = FALSE;
- failure_mssg =
- "vrfy_ds_cpt_i: H5D_SPACE_STATUS_ALLOCATED != allocation";
- }
+ if (ret < 0) {
+ pass = FALSE;
+ failure_mssg = "vrfy_ds_cpt_i: H5Dget_space_status() failed.";
+ }
+ else if (H5D_SPACE_STATUS_ALLOCATED != allocation) {
+ pass = FALSE;
+ failure_mssg =
+ "vrfy_ds_cpt_i: H5D_SPACE_STATUS_ALLOCATED != allocation";
+ }
HDassert(ret >= 0);
HDassert(H5D_SPACE_STATUS_ALLOCATED == allocation);
}
- if ( pass ) {
-
+ if (pass) {
dcpl = H5Dget_create_plist(dsid);
- if ( dcpl <= 0 ) {
-
- pass = FALSE;
- failure_mssg = "vrfy_ds_cpt_i: H5Dget_create_plist() failed.";
- }
+ if (dcpl <= 0) {
+ pass = FALSE;
+ failure_mssg = "vrfy_ds_cpt_i: H5Dget_create_plist() failed.";
+ }
HDassert(dcpl > 0);
}
- if ( pass ) {
-
+ if (pass) {
layout = H5Pget_layout(dcpl);
- if ( H5D_COMPACT != layout ) {
-
- pass = FALSE;
- failure_mssg = "vrfy_ds_cpt_i: H5D_COMPACT != layout";
- }
+ if (H5D_COMPACT != layout) {
+ pass = FALSE;
+ failure_mssg = "vrfy_ds_cpt_i: H5D_COMPACT != layout";
+ }
HDassert(H5D_COMPACT == layout);
}
- if ( pass ) {
-
+ if (pass) {
ret = H5Pclose(dcpl);
- if ( ret < 0 ) {
-
- pass = FALSE;
- failure_mssg = "vrfy_ds_cpt_i: H5Pclose() failed.";
- }
+ if (ret < 0) {
+ pass = FALSE;
+ failure_mssg = "vrfy_ds_cpt_i: H5Pclose() failed.";
+ }
HDassert(ret >= 0);
- }
-
- if ( ( pass ) && ( write_data ) ) {
-
- rdata = (int *)malloc(sizeof(int) * DSET_COMPACT_DIMS);
+ }
- if ( ! rdata ) {
+ if ((pass) && (write_data)) {
+ rdata = (int *) HDmalloc(sizeof(int) * DSET_COMPACT_DIMS);
- pass = FALSE;
- failure_mssg = "vrfy_ds_cpt_i: malloc of rdata failed.";
- }
+ if (!rdata) {
+ pass = FALSE;
+ failure_mssg = "vrfy_ds_cpt_i: HDmalloc of rdata failed.";
+ }
HDassert(rdata);
}
- if ( ( pass ) && ( write_data ) ) {
-
- ret = H5Dread(dsid, H5T_NATIVE_INT, H5S_ALL, H5S_ALL,
- H5P_DEFAULT, rdata);
- if ( ret < 0 ) {
-
- pass = FALSE;
- failure_mssg = "vrfy_ds_cpt_i: H5Dread() failed.";
- }
+ if ((pass) && (write_data)) {
+ ret = H5Dread(dsid, H5T_NATIVE_INT, H5S_ALL, H5S_ALL,
+ H5P_DEFAULT, rdata);
+ if (ret < 0) {
+ pass = FALSE;
+ failure_mssg = "vrfy_ds_cpt_i: H5Dread() failed.";
+ }
HDassert(ret >= 0);
}
- if ( ( pass ) && ( write_data ) ) {
-
- for(u = 0; u < DSET_COMPACT_DIMS; u++) {
-
- if ( (int)u != rdata[u] ) {
-
- pass = FALSE;
- failure_mssg = "vrfy_ds_cpt_i: (int)u != rdata[u]";
- break;
- }
- HDassert((int)u == rdata[u]);
+ if ((pass) && (write_data)) {
+ for (u = 0; u < DSET_COMPACT_DIMS; u++) {
+ if ((int) u != rdata[u]) {
+ pass = FALSE;
+ failure_mssg = "vrfy_ds_cpt_i: (int)u != rdata[u]";
+ break;
+ }
+ HDassert((int )u == rdata[u]);
}
- free(rdata);
+ HDfree(rdata);
} /* end if */
- if ( pass ) {
-
+ if (pass) {
ret = H5Dclose(dsid);
- if ( ret < 0 ) {
-
- pass = FALSE;
- failure_mssg = "vrfy_ds_cpt_i: H5Dclose() failed.";
- }
+ if (ret < 0) {
+ pass = FALSE;
+ failure_mssg = "vrfy_ds_cpt_i: H5Dclose() failed.";
+ }
HDassert(ret >= 0);
}
return;
-
} /* vrfy_ds_cpt_i() */
/*-------------------------------------------------------------------------
* Function: ds_ctg_v
*
- * Purpose: Create a contiguous dataset w/variable-length datatype.
- * Write data to the data set or not as indicated by the
- * write_data parameter.
+ * Purpose: Create a contiguous dataset w/variable-length datatype.
+ * Write data to the data set or not as indicated by the
+ * write_data parameter.
*
* If pass is false on entry, do nothing.
*
@@ -3091,166 +2649,142 @@ vrfy_ds_cpt_i(hid_t fid, const char *dset_name, hbool_t write_data)
*
*-------------------------------------------------------------------------
*/
-void
-ds_ctg_v(hid_t fid, const char *dset_name, hbool_t write_data)
-{
+void
+ds_ctg_v(hid_t fid, const char *dset_name, hbool_t write_data) {
hid_t dsid = -1;
hid_t sid = -1;
hid_t tid = -1;
- hsize_t dims[1] = {DSET_SMALL_DIMS};
+ hsize_t dims[1] = { DSET_SMALL_DIMS };
herr_t ret;
hvl_t *wdata = NULL;
unsigned u;
- if ( pass ) {
-
+ if (pass) {
sid = H5Screate_simple(1, dims, NULL);
- if ( sid <= 0 ) {
-
- pass = FALSE;
- failure_mssg = "ds_ctg_v: H5Screate_simple";
- }
+ if (sid <= 0) {
+ pass = FALSE;
+ failure_mssg = "ds_ctg_v: H5Screate_simple";
+ }
HDassert(sid > 0);
}
- if ( pass ) {
-
+ if (pass) {
tid = H5Tvlen_create(H5T_NATIVE_INT);
- if ( tid <= 0 ) {
-
- pass = FALSE;
- failure_mssg = "ds_ctg_v: H5Tvlen_create() failed.";
- }
+ if (tid <= 0) {
+ pass = FALSE;
+ failure_mssg = "ds_ctg_v: H5Tvlen_create() failed.";
+ }
HDassert(tid > 0);
}
- if ( pass ) {
-
- dsid = H5Dcreate2(fid, dset_name, tid, sid, H5P_DEFAULT,
- H5P_DEFAULT, H5P_DEFAULT);
+ if (pass) {
+ dsid = H5Dcreate2(fid, dset_name, tid, sid, H5P_DEFAULT,
+ H5P_DEFAULT, H5P_DEFAULT);
- if ( dsid <= 0 ) {
-
- pass = FALSE;
- failure_mssg = "ds_ctg_v: H5Dcreate2() failed.";
- }
+ if (dsid <= 0) {
+ pass = FALSE;
+ failure_mssg = "ds_ctg_v: H5Dcreate2() failed.";
+ }
HDassert(dsid > 0);
}
- if ( ( pass ) && ( write_data ) ) {
-
- wdata = (hvl_t *)malloc(sizeof(hvl_t) * DSET_SMALL_DIMS);
+ if ((pass) && (write_data)) {
+ wdata = (hvl_t *) HDmalloc(sizeof(hvl_t) * DSET_SMALL_DIMS);
- if ( ! wdata ) {
-
- pass = FALSE;
- failure_mssg = "ds_ctg_v: malloc of wdata failed.";
- }
+ if (!wdata) {
+ pass = FALSE;
+ failure_mssg = "ds_ctg_v: HDmalloc of wdata failed.";
+ }
HDassert(wdata);
}
- if ( ( pass ) && ( write_data ) ) {
-
- for(u = 0; u < DSET_SMALL_DIMS; u++) {
-
+ if ((pass) && (write_data)) {
+ for (u = 0; u < DSET_SMALL_DIMS; u++) {
int *tdata;
unsigned len;
unsigned v;
len = (u % 10) + 1;
- tdata = (int *)malloc(sizeof(int) * len);
-
- if ( !tdata ) {
+ tdata = (int *) HDmalloc(sizeof(int) * len);
- pass = FALSE;
- failure_mssg = "ds_ctg_v: malloc of tdata failed.";
- break;
- }
+ if (!tdata) {
+ pass = FALSE;
+ failure_mssg = "ds_ctg_v: HDmalloc of tdata failed.";
+ break;
+ }
HDassert(tdata);
- for(v = 0; v < len; v++)
- tdata[v] = (int)(u + v);
+ for (v = 0; v < len; v++)
+ tdata[v] = (int) (u + v);
- wdata[u].len = len;
- wdata[u].p = tdata;
+ wdata[u].len = len;
+ wdata[u].p = tdata;
} /* end for */
}
- if ( ( pass ) && ( write_data ) ) {
-
+ if ((pass) && (write_data)) {
ret = H5Dwrite(dsid, tid, H5S_ALL, H5S_ALL, H5P_DEFAULT, wdata);
- if ( ret < 0 ) {
-
- pass = FALSE;
- failure_mssg = "ds_ctg_v: H5Dwrite() failed.";
- }
+ if (ret < 0) {
+ pass = FALSE;
+ failure_mssg = "ds_ctg_v: H5Dwrite() failed.";
+ }
HDassert(ret >= 0);
}
- if ( ( pass ) && ( write_data ) ) {
-
+ if ((pass) && (write_data)) {
ret = H5Dvlen_reclaim(tid, sid, H5P_DEFAULT, wdata);
- if ( ret < 0 ) {
-
- pass = FALSE;
- failure_mssg = "ds_ctg_v: H5Dvlen_reclaim() failed.";
- }
+ if (ret < 0) {
+ pass = FALSE;
+ failure_mssg = "ds_ctg_v: H5Dvlen_reclaim() failed.";
+ }
HDassert(ret >= 0);
- free(wdata);
-
+ HDfree(wdata);
} /* end if */
- if ( pass ) {
-
+ if (pass) {
ret = H5Sclose(sid);
- if ( sid < 0 ) {
-
- pass = FALSE;
- failure_mssg = "ds_ctg_v: H5Sclose() failed.";
- }
+ if (sid < 0) {
+ pass = FALSE;
+ failure_mssg = "ds_ctg_v: H5Sclose() failed.";
+ }
HDassert(ret >= 0);
}
- if ( pass ) {
-
+ if (pass) {
ret = H5Tclose(tid);
- if ( tid < 0 ) {
-
- pass = FALSE;
- failure_mssg = "ds_ctg_v: H5Tclose() failed.";
- }
+ if (tid < 0) {
+ pass = FALSE;
+ failure_mssg = "ds_ctg_v: H5Tclose() failed.";
+ }
HDassert(ret >= 0);
}
- if ( pass ) {
-
+ if (pass) {
ret = H5Dclose(dsid);
- if ( ret < 0 ) {
-
- pass = FALSE;
- failure_mssg = "ds_ctg_v: H5Dclose() failed.";
- }
+ if (ret < 0) {
+ pass = FALSE;
+ failure_mssg = "ds_ctg_v: H5Dclose() failed.";
+ }
HDassert(ret >= 0);
}
return;
-
} /* ds_ctg_v() */
/*-------------------------------------------------------------------------
* Function: vrfy_ds_ctg_v
*
- * Purpose: Validate a contiguous datasets w/variable-length datatypes.
- * Validate data if indicated via the write_data parameter.
+ * Purpose: Validate a contiguous datasets w/variable-length datatypes.
+ * Validate data if indicated via the write_data parameter.
*
* If pass is false on entry, do nothing.
*
@@ -3264,9 +2798,8 @@ ds_ctg_v(hid_t fid, const char *dset_name, hbool_t write_data)
*
*-------------------------------------------------------------------------
*/
-void
-vrfy_ds_ctg_v(hid_t fid, const char *dset_name, hbool_t write_data)
-{
+void
+vrfy_ds_ctg_v(hid_t fid, const char *dset_name, hbool_t write_data) {
hid_t dsid = -1;
hid_t sid = -1;
hid_t tid = -1;
@@ -3281,283 +2814,240 @@ vrfy_ds_ctg_v(hid_t fid, const char *dset_name, hbool_t write_data)
unsigned u;
herr_t ret;
- if ( pass ) {
-
+ if (pass) {
dsid = H5Dopen2(fid, dset_name, H5P_DEFAULT);
- if ( dsid <= 0 ) {
-
- pass = FALSE;
- failure_mssg = "vrfy_ds_ctg_v: H5Dopen2() failed.";
- }
+ if (dsid <= 0) {
+ pass = FALSE;
+ failure_mssg = "vrfy_ds_ctg_v: H5Dopen2() failed.";
+ }
HDassert(dsid > 0);
}
- if ( pass ) {
-
+ if (pass) {
sid = H5Dget_space(dsid);
- if ( sid <= 0 ) {
-
- pass = FALSE;
- failure_mssg = "vrfy_ds_ctg_v: H5Dget_space() failed";
- }
+ if (sid <= 0) {
+ pass = FALSE;
+ failure_mssg = "vrfy_ds_ctg_v: H5Dget_space() failed";
+ }
HDassert(sid > 0);
}
- if ( pass ) {
-
+ if (pass) {
ndims = H5Sget_simple_extent_ndims(sid);
- if ( 1 != ndims ) {
-
- pass = FALSE;
- failure_mssg = "vrfy_ds_ctg_v: 1 != ndims";
- }
+ if (1 != ndims) {
+ pass = FALSE;
+ failure_mssg = "vrfy_ds_ctg_v: 1 != ndims";
+ }
HDassert(1 == ndims);
}
- if ( pass ) {
-
+ if (pass) {
ret = H5Sget_simple_extent_dims(sid, dims, max_dims);
- if ( ret < 0 ) {
-
- pass = FALSE;
- failure_mssg = "vrfy_ds_ctg_v: H5Sget_simple_extent_dims() failed.";
- }
- else if ( DSET_SMALL_DIMS != dims[0] ) {
-
- pass = FALSE;
- failure_mssg = "vrfy_ds_ctg_v: DSET_SMALL_DIMS != dims[0]";
- }
- else if ( DSET_SMALL_DIMS != max_dims[0] ) {
-
- pass = FALSE;
- failure_mssg = "vrfy_ds_ctg_v: DSET_SMALL_DIMS != max_dims[0]";
- }
+ if (ret < 0) {
+ pass = FALSE;
+ failure_mssg = "vrfy_ds_ctg_v: H5Sget_simple_extent_dims() failed.";
+ }
+ else if ( DSET_SMALL_DIMS != dims[0]) {
+ pass = FALSE;
+ failure_mssg = "vrfy_ds_ctg_v: DSET_SMALL_DIMS != dims[0]";
+ }
+ else if ( DSET_SMALL_DIMS != max_dims[0]) {
+ pass = FALSE;
+ failure_mssg = "vrfy_ds_ctg_v: DSET_SMALL_DIMS != max_dims[0]";
+ }
HDassert(ret >= 0);
HDassert(DSET_SMALL_DIMS == dims[0]);
HDassert(DSET_SMALL_DIMS == max_dims[0]);
}
- if ( pass ) {
-
+ if (pass) {
tid = H5Dget_type(dsid);
- if ( tid <= 0 ) {
-
- pass = FALSE;
- failure_mssg = "vrfy_ds_ctg_v: H5Dget_type() failed.";
- }
+ if (tid <= 0) {
+ pass = FALSE;
+ failure_mssg = "vrfy_ds_ctg_v: H5Dget_type() failed.";
+ }
HDassert(tid > 0);
}
- if ( pass ) {
-
+ if (pass) {
tmp_tid = H5Tvlen_create(H5T_NATIVE_INT);
- if ( tmp_tid <= 0 ) {
-
- pass = FALSE;
- failure_mssg = "vrfy_ds_ctg_v: H5Tvlen_create() failed.";
- }
+ if (tmp_tid <= 0) {
+ pass = FALSE;
+ failure_mssg = "vrfy_ds_ctg_v: H5Tvlen_create() failed.";
+ }
HDassert(tmp_tid > 0);
}
- if ( pass ) {
-
+ if (pass) {
type_equal = H5Tequal(tid, tmp_tid);
- if ( 1 != type_equal ) {
-
- pass = FALSE;
- failure_mssg = "vrfy_ds_ctg_v: type != vlen H5T_NATIVE_INT";
- }
+ if (1 != type_equal) {
+ pass = FALSE;
+ failure_mssg = "vrfy_ds_ctg_v: type != vlen H5T_NATIVE_INT";
+ }
HDassert(1 == type_equal);
}
- if ( pass ) {
-
+ if (pass) {
ret = H5Tclose(tmp_tid);
- if ( ret < 0 ) {
-
- pass = FALSE;
- failure_mssg = "vrfy_ds_ctg_v: H5Tclose() failed.";
- }
+ if (ret < 0) {
+ pass = FALSE;
+ failure_mssg = "vrfy_ds_ctg_v: H5Tclose() failed.";
+ }
HDassert(ret >= 0);
}
- if ( pass ) {
-
+ if (pass) {
ret = H5Dget_space_status(dsid, &allocation);
- if ( ret < 0 ) {
-
- pass = FALSE;
- failure_mssg = "vrfy_ds_ctg_v: H5Dget_space_status() failed";
- }
- else if ( write_data && (allocation != H5D_SPACE_STATUS_ALLOCATED) ) {
-
- pass = FALSE;
- failure_mssg =
- "vrfy_ds_ctg_v: write_data && allocation != H5D_SPACE_STATUS_ALLOCATED";
- }
- else if ( !write_data &&
- ( allocation != H5D_SPACE_STATUS_NOT_ALLOCATED ) ) {
-
- pass = FALSE;
- failure_mssg = "vrfy_ds_ctg_v: !write_data && allocation != H5D_SPACE_STATUS_NOT_ALLOCATED";
- }
+ if (ret < 0) {
+ pass = FALSE;
+ failure_mssg = "vrfy_ds_ctg_v: H5Dget_space_status() failed";
+ }
+ else if (write_data && (allocation != H5D_SPACE_STATUS_ALLOCATED)) {
+ pass = FALSE;
+ failure_mssg =
+ "vrfy_ds_ctg_v: write_data && allocation != H5D_SPACE_STATUS_ALLOCATED";
+ }
+ else if (!write_data
+ && (allocation != H5D_SPACE_STATUS_NOT_ALLOCATED)) {
+ pass = FALSE;
+ failure_mssg =
+ "vrfy_ds_ctg_v: !write_data && allocation != H5D_SPACE_STATUS_NOT_ALLOCATED";
+ }
HDassert(ret >= 0);
- HDassert((write_data && allocation == H5D_SPACE_STATUS_ALLOCATED) ||
- (!write_data && allocation == H5D_SPACE_STATUS_NOT_ALLOCATED));
+ HDassert((write_data && allocation == H5D_SPACE_STATUS_ALLOCATED)
+ || (!write_data && allocation == H5D_SPACE_STATUS_NOT_ALLOCATED));
}
- if ( pass ) {
-
+ if (pass) {
dcpl = H5Dget_create_plist(dsid);
- if ( dcpl <= 0 ) {
-
- pass = FALSE;
- failure_mssg = "vrfy_ds_ctg_v: H5Dget_create_plist() failed.";
- }
+ if (dcpl <= 0) {
+ pass = FALSE;
+ failure_mssg = "vrfy_ds_ctg_v: H5Dget_create_plist() failed.";
+ }
HDassert(dcpl > 0);
}
- if ( pass ) {
-
+ if (pass) {
layout = H5Pget_layout(dcpl);
- if ( H5D_CONTIGUOUS != layout ) {
-
- pass = FALSE;
- failure_mssg = "vrfy_ds_ctg_v: H5D_CONTIGUOUS != layout";
- }
+ if (H5D_CONTIGUOUS != layout) {
+ pass = FALSE;
+ failure_mssg = "vrfy_ds_ctg_v: H5D_CONTIGUOUS != layout";
+ }
HDassert(H5D_CONTIGUOUS == layout);
}
- if ( pass ) {
-
+ if (pass) {
ret = H5Pclose(dcpl);
- if ( ret < 0 ) {
-
- pass = FALSE;
- failure_mssg = "vrfy_ds_ctg_v: H5Pclose() failed.";
- }
+ if (ret < 0) {
+ pass = FALSE;
+ failure_mssg = "vrfy_ds_ctg_v: H5Pclose() failed.";
+ }
HDassert(ret >= 0);
}
- if ( ( pass ) && ( write_data ) ) {
+ if ((pass) && (write_data)) {
+ rdata = (hvl_t *) HDmalloc(sizeof(hvl_t) * DSET_SMALL_DIMS);
- rdata = (hvl_t *)malloc(sizeof(hvl_t) * DSET_SMALL_DIMS);
-
- if ( !rdata ) {
-
- pass = FALSE;
- failure_mssg = "vrfy_ds_ctg_v: malloc of rdata failed.";
- }
+ if (!rdata) {
+ pass = FALSE;
+ failure_mssg = "vrfy_ds_ctg_v: HDmalloc of rdata failed.";
+ }
HDassert(rdata);
}
- if ( ( pass ) && ( write_data ) ) {
-
+ if ((pass) && (write_data)) {
ret = H5Dread(dsid, tid, H5S_ALL, H5S_ALL, H5P_DEFAULT, rdata);
- if ( ret < 0 ) {
-
- pass = FALSE;
- failure_mssg = "vrfy_ds_ctg_v: H5Dread() failed.";
- }
+ if (ret < 0) {
+ pass = FALSE;
+ failure_mssg = "vrfy_ds_ctg_v: H5Dread() failed.";
+ }
HDassert(ret >= 0);
}
- if ( ( pass ) && ( write_data ) ) {
-
- for(u = 0; u < DSET_SMALL_DIMS; u++) {
+ if ((pass) && (write_data)) {
+ for (u = 0; u < DSET_SMALL_DIMS; u++) {
unsigned len;
unsigned v;
- len = (unsigned)rdata[u].len;
- for(v = 0; v < len; v++) {
- int *tdata = (int *)rdata[u].p;
-
- if ( !tdata ) {
-
- pass = FALSE;
- failure_mssg = "vrfy_ds_ctg_v: !tdata";
- break;
- }
- else if ( (int)(u + v) != tdata[v] ) {
-
- pass = FALSE;
- failure_mssg = "vrfy_ds_ctg_v: (int)(u + v) != tdata[v]";
- break;
- }
+ len = (unsigned) rdata[u].len;
+ for (v = 0; v < len; v++) {
+ int *tdata = (int *) rdata[u].p;
+
+ if (!tdata) {
+ pass = FALSE;
+ failure_mssg = "vrfy_ds_ctg_v: !tdata";
+ break;
+ }
+ else if ((int) (u + v) != tdata[v]) {
+ pass = FALSE;
+ failure_mssg = "vrfy_ds_ctg_v: (int)(u + v) != tdata[v]";
+ break;
+ }
HDassert(tdata);
- HDassert((int)(u + v) == tdata[v]);
+ HDassert((int )(u + v) == tdata[v]);
} /* end for */
} /* end for */
}
- if ( ( pass ) && ( write_data ) ) {
-
+ if ((pass) && (write_data)) {
ret = H5Dvlen_reclaim(tid, sid, H5P_DEFAULT, rdata);
- if ( ret < 0 ) {
-
- pass = FALSE;
- failure_mssg = "vrfy_ds_ctg_v: H5Dvlen_reclaim() failed.";
- }
+ if (ret < 0) {
+ pass = FALSE;
+ failure_mssg = "vrfy_ds_ctg_v: H5Dvlen_reclaim() failed.";
+ }
HDassert(ret >= 0);
- free(rdata);
+ HDfree(rdata);
} /* end if */
- if ( pass ) {
-
+ if (pass) {
ret = H5Sclose(sid);
- if ( ret < 0 ) {
-
- pass = FALSE;
- failure_mssg = "vrfy_ds_ctg_v: H5Sclose() failed.";
- }
+ if (ret < 0) {
+ pass = FALSE;
+ failure_mssg = "vrfy_ds_ctg_v: H5Sclose() failed.";
+ }
HDassert(ret >= 0);
}
- if ( pass ) {
-
+ if (pass) {
ret = H5Tclose(tid);
- if ( ret < 0 ) {
-
- pass = FALSE;
- failure_mssg = "vrfy_ds_ctg_v: H5Tclose() failed.";
- }
+ if (ret < 0) {
+ pass = FALSE;
+ failure_mssg = "vrfy_ds_ctg_v: H5Tclose() failed.";
+ }
HDassert(ret >= 0);
}
- if ( pass ) {
-
+ if (pass) {
ret = H5Dclose(dsid);
- if ( ret < 0 ) {
-
- pass = FALSE;
- failure_mssg = "vrfy_ds_ctg_v: H5Dclose() failed.";
- }
+ if (ret < 0) {
+ pass = FALSE;
+ failure_mssg = "vrfy_ds_ctg_v: H5Dclose() failed.";
+ }
HDassert(ret >= 0);
}
return;
-
} /* vrfy_ds_ctg_v() */
-
+
/*-------------------------------------------------------------------------
* Function: create_zoo
*
@@ -3596,203 +3086,202 @@ create_zoo(hid_t fid, const char *base_path, int proc_num)
/* Add & verify an empty "new style" group */
if ( pass ) {
- sprintf(full_path, "%s/A", base_path);
- HDassert(strlen(full_path) < 1024);
+ HDsprintf(full_path, "%s/A", base_path);
+ HDassert(HDstrlen(full_path) < 1024);
ns_grp_0(fid, full_path);
}
if ( pass ) {
- sprintf(full_path, "%s/A", base_path);
- HDassert(strlen(full_path) < 1024);
+ HDsprintf(full_path, "%s/A", base_path);
+ HDassert(HDstrlen(full_path) < 1024);
vrfy_ns_grp_0(fid, full_path);
}
/* Add & verify a compact "new style" group (3 link messages) */
if ( pass ) {
- sprintf(full_path, "%s/B", base_path);
- HDassert(strlen(full_path) < 1024);
+ HDsprintf(full_path, "%s/B", base_path);
+ HDassert(HDstrlen(full_path) < 1024);
ns_grp_c(fid, full_path, 3);
}
if ( pass ) {
- sprintf(full_path, "%s/B", base_path);
- HDassert(strlen(full_path) < 1024);
+ HDsprintf(full_path, "%s/B", base_path);
+ HDassert(HDstrlen(full_path) < 1024);
vrfy_ns_grp_c(fid, full_path, 3);
}
- /* Add & verify a dense "new style" group (w/300 links, in v2 B-tree &
+ /* Add & verify a dense "new style" group (w/300 links, in v2 B-tree &
* fractal heap)
*/
if ( pass ) {
- sprintf(full_path, "%s/C", base_path);
- HDassert(strlen(full_path) < 1024);
+ HDsprintf(full_path, "%s/C", base_path);
+ HDassert(HDstrlen(full_path) < 1024);
ns_grp_d(fid, full_path, 300);
}
if ( pass ) {
- sprintf(full_path, "%s/C", base_path);
- HDassert(strlen(full_path) < 1024);
+ HDsprintf(full_path, "%s/C", base_path);
+ HDassert(HDstrlen(full_path) < 1024);
vrfy_ns_grp_d(fid, full_path, 300);
}
/* Add & verify an empty "old style" group to file */
if ( pass ) {
- sprintf(full_path, "%s/D", base_path);
- HDassert(strlen(full_path) < 1024);
+ HDsprintf(full_path, "%s/D", base_path);
+ HDassert(HDstrlen(full_path) < 1024);
os_grp_0(fid, full_path);
}
if ( pass ) {
- sprintf(full_path, "%s/D", base_path);
- HDassert(strlen(full_path) < 1024);
+ HDsprintf(full_path, "%s/D", base_path);
+ HDassert(HDstrlen(full_path) < 1024);
vrfy_os_grp_0(fid, full_path);
}
- /* Add & verify an "old style" group (w/300 links, in v1 B-tree &
- * local heap) to file
+ /* Add & verify an "old style" group (w/300 links, in v1 B-tree &
+ * local heap) to file
*/
if ( pass ) {
- sprintf(full_path, "%s/E", base_path);
- HDassert(strlen(full_path) < 1024);
+ HDsprintf(full_path, "%s/E", base_path);
+ HDassert(HDstrlen(full_path) < 1024);
os_grp_n(fid, full_path, proc_num, 300);
}
if ( pass ) {
- sprintf(full_path, "%s/E", base_path);
- HDassert(strlen(full_path) < 1024);
+ HDsprintf(full_path, "%s/E", base_path);
+ HDassert(HDstrlen(full_path) < 1024);
vrfy_os_grp_n(fid, full_path, proc_num, 300);
}
- /* Add & verify a contiguous dataset w/integer datatype (but no data)
- * to file
+ /* Add & verify a contiguous dataset w/integer datatype (but no data)
+ * to file
*/
if ( pass ) {
- sprintf(full_path, "%s/F", base_path);
- HDassert(strlen(full_path) < 1024);
+ HDsprintf(full_path, "%s/F", base_path);
+ HDassert(HDstrlen(full_path) < 1024);
ds_ctg_i(fid, full_path, FALSE);
}
if ( pass ) {
- sprintf(full_path, "%s/F", base_path);
- HDassert(strlen(full_path) < 1024);
+ HDsprintf(full_path, "%s/F", base_path);
+ HDassert(HDstrlen(full_path) < 1024);
vrfy_ds_ctg_i(fid, full_path, FALSE);
}
- /* Add & verify a contiguous dataset w/integer datatype (with data)
- * to file
+ /* Add & verify a contiguous dataset w/integer datatype (with data)
+ * to file
*/
if ( pass ) {
- sprintf(full_path, "%s/G", base_path);
- HDassert(strlen(full_path) < 1024);
+ HDsprintf(full_path, "%s/G", base_path);
+ HDassert(HDstrlen(full_path) < 1024);
ds_ctg_i(fid, full_path, TRUE);
}
if ( pass ) {
- sprintf(full_path, "%s/G", base_path);
- HDassert(strlen(full_path) < 1024);
+ HDsprintf(full_path, "%s/G", base_path);
+ HDassert(HDstrlen(full_path) < 1024);
vrfy_ds_ctg_i(fid, full_path, TRUE);
}
- /* Add & verify a chunked dataset w/integer datatype (but no data)
- * to file
+ /* Add & verify a chunked dataset w/integer datatype (but no data)
+ * to file
*/
if ( pass ) {
- sprintf(full_path, "%s/H", base_path);
- HDassert(strlen(full_path) < 1024);
+ HDsprintf(full_path, "%s/H", base_path);
+ HDassert(HDstrlen(full_path) < 1024);
ds_chk_i(fid, full_path, FALSE);
}
if ( pass ) {
- sprintf(full_path, "%s/H", base_path);
- HDassert(strlen(full_path) < 1024);
+ HDsprintf(full_path, "%s/H", base_path);
+ HDassert(HDstrlen(full_path) < 1024);
vrfy_ds_chk_i(fid, full_path, FALSE);
}
- /* Add & verify a chunked dataset w/integer datatype (and data)
- * to file
+ /* Add & verify a chunked dataset w/integer datatype (and data)
+ * to file
*/
if ( pass ) {
- sprintf(full_path, "%s/I", base_path);
- HDassert(strlen(full_path) < 1024);
+ HDsprintf(full_path, "%s/I", base_path);
+ HDassert(HDstrlen(full_path) < 1024);
ds_chk_i(fid, full_path, TRUE);
}
if ( pass ) {
- sprintf(full_path, "%s/I", base_path);
- HDassert(strlen(full_path) < 1024);
+ HDsprintf(full_path, "%s/I", base_path);
+ HDassert(HDstrlen(full_path) < 1024);
vrfy_ds_chk_i(fid, full_path, TRUE);
}
- /* Add & verify a compact dataset w/integer datatype (but no data)
- * to file
+ /* Add & verify a compact dataset w/integer datatype (but no data)
+ * to file
*/
if ( pass ) {
- sprintf(full_path, "%s/J", base_path);
- HDassert(strlen(full_path) < 1024);
+ HDsprintf(full_path, "%s/J", base_path);
+ HDassert(HDstrlen(full_path) < 1024);
ds_cpt_i(fid, full_path, FALSE);
}
if ( pass ) {
- sprintf(full_path, "%s/J", base_path);
- HDassert(strlen(full_path) < 1024);
+ HDsprintf(full_path, "%s/J", base_path);
+ HDassert(HDstrlen(full_path) < 1024);
vrfy_ds_cpt_i(fid, full_path, FALSE);
}
- /* Add & verify a compact dataset w/integer datatype (and data)
- * to file
+ /* Add & verify a compact dataset w/integer datatype (and data)
+ * to file
*/
if ( pass ) {
- sprintf(full_path, "%s/K", base_path);
- HDassert(strlen(full_path) < 1024);
+ HDsprintf(full_path, "%s/K", base_path);
+ HDassert(HDstrlen(full_path) < 1024);
ds_cpt_i(fid, full_path, TRUE);
}
if ( pass ) {
- sprintf(full_path, "%s/K", base_path);
- HDassert(strlen(full_path) < 1024);
+ HDsprintf(full_path, "%s/K", base_path);
+ HDassert(HDstrlen(full_path) < 1024);
vrfy_ds_cpt_i(fid, full_path, TRUE);
}
- /* Add & verify a contiguous dataset w/variable-length datatype
- * (but no data) to file
+ /* Add & verify a contiguous dataset w/variable-length datatype
+ * (but no data) to file
*/
if ( pass ) {
- sprintf(full_path, "%s/L", base_path);
- HDassert(strlen(full_path) < 1024);
+ HDsprintf(full_path, "%s/L", base_path);
+ HDassert(HDstrlen(full_path) < 1024);
ds_ctg_v(fid, full_path, FALSE);
}
if ( pass ) {
- sprintf(full_path, "%s/L", base_path);
- HDassert(strlen(full_path) < 1024);
+ HDsprintf(full_path, "%s/L", base_path);
+ HDassert(HDstrlen(full_path) < 1024);
vrfy_ds_ctg_v(fid, full_path, FALSE);
}
- /* Add & verify a contiguous dataset w/variable-length datatype
- * (and data) to file
+ /* Add & verify a contiguous dataset w/variable-length datatype
+ * (and data) to file
*/
if ( pass ) {
- sprintf(full_path, "%s/M", base_path);
- HDassert(strlen(full_path) < 1024);
+ HDsprintf(full_path, "%s/M", base_path);
+ HDassert(HDstrlen(full_path) < 1024);
ds_ctg_v(fid, full_path, TRUE);
}
if ( pass ) {
- sprintf(full_path, "%s/M", base_path);
- HDassert(strlen(full_path) < 1024);
+ HDsprintf(full_path, "%s/M", base_path);
+ HDassert(HDstrlen(full_path) < 1024);
vrfy_ds_ctg_v(fid, full_path, TRUE);
}
return;
-
} /* create_zoo() */
-
+
/*-------------------------------------------------------------------------
* Function: validate_zoo
*
- * Purpose: Given the path to a group in which a "zoo" has been
- * constructed, validate the objects in the "zoo".
+ * Purpose: Given the path to a group in which a "zoo" has been
+ * constructed, validate the objects in the "zoo".
*
* If pass is false on entry, do nothing.
*
@@ -3824,116 +3313,115 @@ validate_zoo(hid_t fid, const char *base_path, int proc_num)
/* validate an empty "new style" group */
if ( pass ) {
- sprintf(full_path, "%s/A", base_path);
- HDassert(strlen(full_path) < 1024);
+ HDsprintf(full_path, "%s/A", base_path);
+ HDassert(HDstrlen(full_path) < 1024);
vrfy_ns_grp_0(fid, full_path);
}
/* validate a compact "new style" group (3 link messages) */
if ( pass ) {
- sprintf(full_path, "%s/B", base_path);
- HDassert(strlen(full_path) < 1024);
+ HDsprintf(full_path, "%s/B", base_path);
+ HDassert(HDstrlen(full_path) < 1024);
vrfy_ns_grp_c(fid, full_path, 3);
}
- /* validate a dense "new style" group (w/300 links, in v2 B-tree &
+ /* validate a dense "new style" group (w/300 links, in v2 B-tree &
* fractal heap)
*/
if ( pass ) {
- sprintf(full_path, "%s/C", base_path);
- HDassert(strlen(full_path) < 1024);
+ HDsprintf(full_path, "%s/C", base_path);
+ HDassert(HDstrlen(full_path) < 1024);
vrfy_ns_grp_d(fid, full_path, 300);
}
/* validate an empty "old style" group in file */
if ( pass ) {
- sprintf(full_path, "%s/D", base_path);
- HDassert(strlen(full_path) < 1024);
+ HDsprintf(full_path, "%s/D", base_path);
+ HDassert(HDstrlen(full_path) < 1024);
vrfy_os_grp_0(fid, full_path);
}
- /* validate an "old style" group (w/300 links, in v1 B-tree &
+ /* validate an "old style" group (w/300 links, in v1 B-tree &
* local heap)
*/
if ( pass ) {
- sprintf(full_path, "%s/E", base_path);
- HDassert(strlen(full_path) < 1024);
+ HDsprintf(full_path, "%s/E", base_path);
+ HDassert(HDstrlen(full_path) < 1024);
vrfy_os_grp_n(fid, full_path, proc_num, 300);
}
- /* validate a contiguous dataset w/integer datatype (but no data)
- * in file.
+ /* validate a contiguous dataset w/integer datatype (but no data)
+ * in file.
*/
if ( pass ) {
- sprintf(full_path, "%s/F", base_path);
- HDassert(strlen(full_path) < 1024);
+ HDsprintf(full_path, "%s/F", base_path);
+ HDassert(HDstrlen(full_path) < 1024);
vrfy_ds_ctg_i(fid, full_path, FALSE);
}
- /* validate a contiguous dataset w/integer datatype (with data)
- * in file.
+ /* validate a contiguous dataset w/integer datatype (with data)
+ * in file.
*/
if ( pass ) {
- sprintf(full_path, "%s/G", base_path);
- HDassert(strlen(full_path) < 1024);
+ HDsprintf(full_path, "%s/G", base_path);
+ HDassert(HDstrlen(full_path) < 1024);
vrfy_ds_ctg_i(fid, full_path, TRUE);
}
- /* validate a chunked dataset w/integer datatype (but no data)
- * in file
+ /* validate a chunked dataset w/integer datatype (but no data)
+ * in file
*/
if ( pass ) {
- sprintf(full_path, "%s/H", base_path);
- HDassert(strlen(full_path) < 1024);
+ HDsprintf(full_path, "%s/H", base_path);
+ HDassert(HDstrlen(full_path) < 1024);
vrfy_ds_chk_i(fid, full_path, FALSE);
}
- /* validate a chunked dataset w/integer datatype (and data)
- * in file
+ /* validate a chunked dataset w/integer datatype (and data)
+ * in file
*/
if ( pass ) {
- sprintf(full_path, "%s/I", base_path);
- HDassert(strlen(full_path) < 1024);
+ HDsprintf(full_path, "%s/I", base_path);
+ HDassert(HDstrlen(full_path) < 1024);
vrfy_ds_chk_i(fid, full_path, TRUE);
}
- /* Validate a compact dataset w/integer datatype (but no data)
- * in file
+ /* Validate a compact dataset w/integer datatype (but no data)
+ * in file
*/
if ( pass ) {
- sprintf(full_path, "%s/J", base_path);
- HDassert(strlen(full_path) < 1024);
+ HDsprintf(full_path, "%s/J", base_path);
+ HDassert(HDstrlen(full_path) < 1024);
vrfy_ds_cpt_i(fid, full_path, FALSE);
}
- /* validate a compact dataset w/integer datatype (and data)
- * in file
+ /* validate a compact dataset w/integer datatype (and data)
+ * in file
*/
if ( pass ) {
- sprintf(full_path, "%s/K", base_path);
- HDassert(strlen(full_path) < 1024);
+ HDsprintf(full_path, "%s/K", base_path);
+ HDassert(HDstrlen(full_path) < 1024);
vrfy_ds_cpt_i(fid, full_path, TRUE);
}
- /* validate a contiguous dataset w/variable-length datatype
- * (but no data) to file
+ /* validate a contiguous dataset w/variable-length datatype
+ * (but no data) to file
*/
if ( pass ) {
- sprintf(full_path, "%s/L", base_path);
- HDassert(strlen(full_path) < 1024);
+ HDsprintf(full_path, "%s/L", base_path);
+ HDassert(HDstrlen(full_path) < 1024);
vrfy_ds_ctg_v(fid, full_path, FALSE);
}
- /* validate a contiguous dataset w/variable-length datatype
- * (and data) to file
+ /* validate a contiguous dataset w/variable-length datatype
+ * (and data) to file
*/
if ( pass ) {
- sprintf(full_path, "%s/M", base_path);
- HDassert(strlen(full_path) < 1024);
+ HDsprintf(full_path, "%s/M", base_path);
+ HDassert(HDstrlen(full_path) < 1024);
vrfy_ds_ctg_v(fid, full_path, TRUE);
}
return;
-
} /* validate_zoo() */
diff --git a/test/ohdr.c b/test/ohdr.c
index 146245f..669b1e0 100644
--- a/test/ohdr.c
+++ b/test/ohdr.c
@@ -470,8 +470,8 @@ test_unknown(unsigned bogus_id, char *filename, hid_t fapl)
/* create a different name for a local copy of the data file to be
opened with rd/wr file permissions in case build and test are
done in the source directory. */
- HDstrncpy(testfile, FILE_BOGUS, strlen(FILE_BOGUS));
- testfile[strlen(FILE_BOGUS)]='\0';
+ HDstrncpy(testfile, FILE_BOGUS, HDstrlen(FILE_BOGUS));
+ testfile[HDstrlen(FILE_BOGUS)]='\0';
HDstrncat(testfile, ".copy", 5);
/* Make a copy of the data file from svn. */
diff --git a/test/tmisc.c b/test/tmisc.c
index 1e62302..22e1aad 100644
--- a/test/tmisc.c
+++ b/test/tmisc.c
@@ -2272,7 +2272,7 @@ misc13_insert_user_block(const char *old_name, const char *new_name, const char
CHECK_PTR(user_block, "HDcalloc");
/* Copy in the user block data */
- HDmemcpy(user_block, str, strlen(str));
+ HDmemcpy(user_block, str, HDstrlen(str));
/* Open the new file */
new_fp = HDfopen(new_name,"wb");
diff --git a/test/tunicode.c b/test/tunicode.c
index 85f5af0..e0e1f24 100644
--- a/test/tunicode.c
+++ b/test/tunicode.c
@@ -164,7 +164,7 @@ void test_strpad(hid_t H5_ATTR_UNUSED fid, const char *string)
/* Fill the buffer with two copies of the UTF-8 string, each with a
* terminating NULL. It will look like "abcdefg\0abcdefg\0". */
strncpy(buf, new_string, big_len);
- strncpy(&buf[big_len], new_string, big_len);
+ HDstrncpy(&buf[big_len], new_string, big_len);
ret = H5Tconvert(src_type, dst_type, (size_t)2, buf, NULL, H5P_DEFAULT);
CHECK(ret, FAIL, "H5Tconvert");
@@ -226,8 +226,8 @@ void test_strpad(hid_t H5_ATTR_UNUSED fid, const char *string)
/* Fill the buffer with two copies of the UTF-8 string.
* It will look like "abcdefghabcdefgh". */
- strncpy(buf, new_string, big_len);
- strncpy(&buf[big_len], new_string, big_len);
+ HDstrncpy(buf, new_string, big_len);
+ HDstrncpy(&buf[big_len], new_string, big_len);
ret = H5Tconvert(src_type, dst_type, (size_t)2, buf, NULL, H5P_DEFAULT);
CHECK(ret, FAIL, "H5Tconvert");
diff --git a/test/tvltypes.c b/test/tvltypes.c
index e5a3d34..91ef0c2 100644
--- a/test/tvltypes.c
+++ b/test/tvltypes.c
@@ -467,7 +467,7 @@ test_vltypes_vlen_atomic(void)
/* Try to call H5Dvlen_get_buf with bad dataspace */
H5E_BEGIN_TRY {
- ret = H5Dvlen_get_buf_size(dataset, tid1, sid2, &size);
+ ret = H5Dvlen_get_buf_size(dataset, tid1, sid2, &size);
} H5E_END_TRY
VERIFY(ret, FAIL, "H5Dvlen_get_buf_size");
@@ -499,7 +499,7 @@ test_vltypes_vlen_atomic(void)
/* Try to reclaim read data using "bad" dataspace with no extent
* Should fail */
H5E_BEGIN_TRY {
- ret=H5Dvlen_reclaim(tid1,sid2,xfer_pid,rdata);
+ ret=H5Dvlen_reclaim(tid1,sid2,xfer_pid,rdata);
} H5E_END_TRY
VERIFY(ret, FAIL, "H5Dvlen_reclaim");
@@ -1205,9 +1205,9 @@ test_vltypes_compound_vlstr(void)
wdata[i].v.p=(s2*)HDmalloc((i+L3_INCM)*sizeof(s2));
wdata[i].v.len=i+L3_INCM;
for(t1=(s2 *)((wdata[i].v).p), j=0; j<(i+L3_INCM); j++, t1++) {
- strcat(str, "m");
- t1->string = (char*)HDmalloc(strlen(str)*sizeof(char)+1);
- strcpy(t1->string, str);
+ HDstrcat(str, "m");
+ t1->string = (char*)HDmalloc(HDstrlen(str)*sizeof(char)+1);
+ HDstrcpy(t1->string, str);
/*t1->color = red;*/
t1->color = blue;
}
@@ -1348,7 +1348,7 @@ test_vltypes_compound_vlstr(void)
} /* end if */
for(t1=(s2 *)(wdata[i].v.p), t2=(s2 *)(rdata[i].v.p), j=0; j<rdata[i].v.len; j++, t1++, t2++) {
- if( strcmp(t1->string, t2->string) ) {
+ if( HDstrcmp(t1->string, t2->string) ) {
TestErrPrintf("VL data values don't match!, t1->string=%s, t2->string=%s\n",t1->string, t2->string);
continue;
} /* end if */
@@ -1368,14 +1368,14 @@ test_vltypes_compound_vlstr(void)
CHECK(ret, FAIL, "H5Dvlen_reclaim");
/* Use this part for new data */
- strcpy(str, "bbbbbbbb\0");
+ HDstrcpy(str, "bbbbbbbb\0");
for(i=0; i<SPACE1_DIM1; i++) {
wdata2[i].v.p=(s2*)HDmalloc((i+1)*sizeof(s2));
wdata2[i].v.len=i+1;
for(t1=(s2*)(wdata2[i].v).p, j=0; j<i+1; j++, t1++) {
- strcat(str, "pp");
- t1->string = (char*)HDmalloc(strlen(str)*sizeof(char)+1);
- strcpy(t1->string, str);
+ HDstrcat(str, "pp");
+ t1->string = (char*)HDmalloc(HDstrlen(str)*sizeof(char)+1);
+ HDstrcpy(t1->string, str);
t1->color = green;
}
} /* end for */
@@ -1406,7 +1406,7 @@ test_vltypes_compound_vlstr(void)
} /* end if */
for(t1=(s2 *)(wdata2[i].v.p), t2=(s2 *)(rdata2[i].v.p), j=0; j<rdata2[i].v.len; j++, t1++, t2++) {
- if( strcmp(t1->string, t2->string) ) {
+ if( HDstrcmp(t1->string, t2->string) ) {
TestErrPrintf("VL data values don't match!, t1->string=%s, t2->string=%s\n",t1->string, t2->string);
continue;
} /* end if */
diff --git a/test/vfd.c b/test/vfd.c
index 5d5ebfc..dfc5047 100644
--- a/test/vfd.c
+++ b/test/vfd.c
@@ -149,7 +149,7 @@ test_sec2(void)
/* There is no garantee the size of metadata in file is constant.
* Just try to check if it's reasonable.
- *
+ *
* Currently it should be around 2 KB.
*/
if(H5Fget_filesize(fid, &file_size) < 0)
@@ -258,7 +258,7 @@ test_core(void)
| H5FD_FEAT_ACCUMULATE_METADATA
| H5FD_FEAT_DATA_SIEVE
| H5FD_FEAT_AGGREGATE_SMALLDATA
- | H5FD_FEAT_ALLOW_FILE_IMAGE
+ | H5FD_FEAT_ALLOW_FILE_IMAGE
| H5FD_FEAT_CAN_USE_FILE_IMAGE_CALLBACKS))
TEST_ERROR
@@ -341,7 +341,7 @@ test_core(void)
/* There is no garantee the size of metadata in file is constant.
* Just try to check if it's reasonable.
- *
+ *
* TODO: Needs justification of why is this is a reasonable size.
*/
if(H5Fget_filesize(fid, &file_size) < 0)
@@ -379,7 +379,7 @@ test_core(void)
for(i = 0; i < CORE_DSET_DIM1; i++)
for(j = 0; j < CORE_DSET_DIM2; j++)
*pw++ = val++;
- HDmemset(data_r, 0, DSET1_DIM1 * DSET1_DIM2 * sizeof(int));
+ HDmemset(data_r, 0, DSET1_DIM1 * DSET1_DIM2 * sizeof(int));
/* Create the dataspace */
dims[0] = CORE_DSET_DIM1;
@@ -469,7 +469,7 @@ test_core(void)
TEST_ERROR;
/* Read the data back from the dataset */
- HDmemset(data_r, 0, DSET1_DIM1 * DSET1_DIM2 * sizeof(int));
+ HDmemset(data_r, 0, DSET1_DIM1 * DSET1_DIM2 * sizeof(int));
if(H5Dread(did, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, data_r) < 0)
TEST_ERROR;
@@ -488,7 +488,7 @@ test_core(void)
/* Check file size API.
* There is no garantee the size of metadata in file is constant.
* Just try to check if it's reasonable.
- *
+ *
* TODO: Needs justification of why is this is a reasonable size.
*/
if(H5Fget_filesize(fid, &file_size) < 0)
@@ -1330,7 +1330,7 @@ test_multi(void)
if((atype = H5Tcopy(H5T_C_S1)) < 0)
TEST_ERROR;
- if(H5Tset_size(atype, strlen(meta) + 1) < 0)
+ if(H5Tset_size(atype, HDstrlen(meta) + 1) < 0)
TEST_ERROR;
if(H5Tset_strpad(atype, H5T_STR_NULLTERM) < 0)
@@ -1385,7 +1385,7 @@ error:
* Purpose: Tests the backward compatibility for MULTI driver.
* See if we can open files created with v1.6 library.
* The source file was created by the test/file_handle.c
- * of the v1.6 library. This test verifies the fix for
+ * of the v1.6 library. This test verifies the fix for
* Issue 2598. In v1.6 library, there was EOA for the whole
* MULTI file saved in the super block. We took it out in
* v1.8 library because it's meaningless for the MULTI file.
@@ -1446,7 +1446,7 @@ test_multi_compat(void)
h5_fixname(FILENAME[9], fapl, newname, sizeof newname);
- /* Make copy for the data file in the build directory, to protect the
+ /* Make copy for the data file in the build directory, to protect the
* original file in the source directory */
sprintf(filename_s, "%s-%c.h5", MULTI_COMPAT_BASENAME, 's');
sprintf(newname_s, "%s-%c.h5", FILENAME[9], 's');
@@ -1483,7 +1483,7 @@ test_multi_compat(void)
if(H5Fclose(file) < 0)
TEST_ERROR;
- /* Reopen the file for adding another dataset. The new EOA for metadata file
+ /* Reopen the file for adding another dataset. The new EOA for metadata file
* should be written to the file */
if((file=H5Fopen(newname, H5F_ACC_RDWR, fapl)) < 0)
TEST_ERROR;
@@ -1510,7 +1510,7 @@ test_multi_compat(void)
if(H5Fclose(file) < 0)
TEST_ERROR;
- /* Reopen the file for read only again. Verify the library can handle
+ /* Reopen the file for read only again. Verify the library can handle
* the EOA correctly */
if((file=H5Fopen(newname, H5F_ACC_RDONLY, fapl)) < 0)
TEST_ERROR;
diff --git a/testpar/t_cache.c b/testpar/t_cache.c
index caa578e..c27fc23 100644
--- a/testpar/t_cache.c
+++ b/testpar/t_cache.c
@@ -7134,7 +7134,7 @@ trace_file_check(int metadata_write_strategy)
if ( HDfgets(buffer, 255, trace_file_ptr) != NULL ) {
- actual_line_len = strlen(buffer);
+ actual_line_len = HDstrlen(buffer);
} else {
diff --git a/testpar/t_dset.c b/testpar/t_dset.c
index b315772..281d027 100644
--- a/testpar/t_dset.c
+++ b/testpar/t_dset.c
@@ -36,83 +36,91 @@
* Setup the dimensions of the hyperslab.
* Two modes--by rows or by columns.
* Assume dimension rank is 2.
- * BYROW divide into slabs of rows
- * BYCOL divide into blocks of columns
- * ZROW same as BYROW except process 0 gets 0 rows
- * ZCOL same as BYCOL except process 0 gets 0 columns
+ * BYROW divide into slabs of rows
+ * BYCOL divide into blocks of columns
+ * ZROW same as BYROW except process 0 gets 0 rows
+ * ZCOL same as BYCOL except process 0 gets 0 columns
*/
static void
slab_set(int mpi_rank, int mpi_size, hsize_t start[], hsize_t count[],
- hsize_t stride[], hsize_t block[], int mode)
+ hsize_t stride[], hsize_t block[], int mode)
{
- switch (mode){
+ switch (mode) {
case BYROW:
- /* Each process takes a slabs of rows. */
- block[0] = dim0/mpi_size;
- block[1] = dim1;
- stride[0] = block[0];
- stride[1] = block[1];
- count[0] = 1;
- count[1] = 1;
- start[0] = mpi_rank*block[0];
- start[1] = 0;
-if(VERBOSE_MED) printf("slab_set BYROW\n");
- break;
+ /* Each process takes a slabs of rows. */
+ block[0] = dim0 / mpi_size;
+ block[1] = dim1;
+ stride[0] = block[0];
+ stride[1] = block[1];
+ count[0] = 1;
+ count[1] = 1;
+ start[0] = mpi_rank * block[0];
+ start[1] = 0;
+ if (VERBOSE_MED)
+ HDprintf("slab_set BYROW\n");
+ break;
case BYCOL:
- /* Each process takes a block of columns. */
- block[0] = dim0;
- block[1] = dim1/mpi_size;
- stride[0] = block[0];
- stride[1] = block[1];
- count[0] = 1;
- count[1] = 1;
- start[0] = 0;
- start[1] = mpi_rank*block[1];
-if(VERBOSE_MED) printf("slab_set BYCOL\n");
- break;
+ /* Each process takes a block of columns. */
+ block[0] = dim0;
+ block[1] = dim1 / mpi_size;
+ stride[0] = block[0];
+ stride[1] = block[1];
+ count[0] = 1;
+ count[1] = 1;
+ start[0] = 0;
+ start[1] = mpi_rank * block[1];
+ if (VERBOSE_MED)
+ HDprintf("slab_set BYCOL\n");
+ break;
case ZROW:
- /* Similar to BYROW except process 0 gets 0 row */
- block[0] = (mpi_rank ? dim0/mpi_size : 0);
- block[1] = dim1;
- stride[0] = (mpi_rank ? block[0] : 1); /* avoid setting stride to 0 */
- stride[1] = block[1];
- count[0] = 1;
- count[1] = 1;
- start[0] = (mpi_rank? mpi_rank*block[0] : 0);
- start[1] = 0;
-if(VERBOSE_MED) printf("slab_set ZROW\n");
- break;
+ /* Similar to BYROW except process 0 gets 0 row */
+ block[0] = (mpi_rank ? dim0 / mpi_size : 0);
+ block[1] = dim1;
+ stride[0] = (mpi_rank ? block[0] : 1); /* avoid setting stride to 0 */
+ stride[1] = block[1];
+ count[0] = 1;
+ count[1] = 1;
+ start[0] = (mpi_rank ? mpi_rank * block[0] : 0);
+ start[1] = 0;
+ if (VERBOSE_MED)
+ HDprintf("slab_set ZROW\n");
+ break;
case ZCOL:
- /* Similar to BYCOL except process 0 gets 0 column */
- block[0] = dim0;
- block[1] = (mpi_rank ? dim1/mpi_size : 0);
- stride[0] = block[0];
- stride[1] = (mpi_rank ? block[1] : 1); /* avoid setting stride to 0 */
- count[0] = 1;
- count[1] = 1;
- start[0] = 0;
- start[1] = (mpi_rank? mpi_rank*block[1] : 0);
-if(VERBOSE_MED) printf("slab_set ZCOL\n");
- break;
+ /* Similar to BYCOL except process 0 gets 0 column */
+ block[0] = dim0;
+ block[1] = (mpi_rank ? dim1 / mpi_size : 0);
+ stride[0] = block[0];
+ stride[1] = (mpi_rank ? block[1] : 1); /* avoid setting stride to 0 */
+ count[0] = 1;
+ count[1] = 1;
+ start[0] = 0;
+ start[1] = (mpi_rank ? mpi_rank * block[1] : 0);
+ if (VERBOSE_MED)
+ HDprintf("slab_set ZCOL\n");
+ break;
default:
- /* Unknown mode. Set it to cover the whole dataset. */
- printf("unknown slab_set mode (%d)\n", mode);
- block[0] = dim0;
- block[1] = dim1;
- stride[0] = block[0];
- stride[1] = block[1];
- count[0] = 1;
- count[1] = 1;
- start[0] = 0;
- start[1] = 0;
-if(VERBOSE_MED) printf("slab_set wholeset\n");
- break;
+ /* Unknown mode. Set it to cover the whole dataset. */
+ HDprintf("unknown slab_set mode (%d)\n", mode);
+ block[0] = dim0;
+ block[1] = dim1;
+ stride[0] = block[0];
+ stride[1] = block[1];
+ count[0] = 1;
+ count[1] = 1;
+ start[0] = 0;
+ start[1] = 0;
+ if (VERBOSE_MED)
+ HDprintf("slab_set wholeset\n");
+ break;
}
-if(VERBOSE_MED){
- 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]));
+ if (VERBOSE_MED) {
+ HDprintf(
+ "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 +131,7 @@ void point_set(hsize_t start[],
hsize_t count[],
hsize_t stride[],
hsize_t block[],
- size_t num_points,
+ size_t num_points,
hsize_t coords[],
int order)
{
@@ -153,13 +161,13 @@ void point_set(hsize_t start[],
}
if(VERBOSE_MED) {
- printf("start[]=(%lu, %lu), count[]=(%lu, %lu), stride[]=(%lu, %lu), block[]=(%lu, %lu), total datapoints=%lu\n",
+ HDprintf("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]));
k = 0;
for(i = 0; i < num_points ; i++) {
- printf("(%d, %d)\n", (int)coords[k], (int)coords[k + 1]);
+ HDprintf("(%d, %d)\n", (int)coords[k], (int)coords[k + 1]);
k += 2;
}
}
@@ -177,10 +185,10 @@ dataset_fill(hsize_t start[], hsize_t block[], DATATYPE * dataset)
/* put some trivial data in the data_array */
for (i=0; i < block[0]; i++){
- for (j=0; j < block[1]; j++){
- *dataptr = (DATATYPE)((i+start[0])*100 + (j+start[1]+1));
- dataptr++;
- }
+ for (j=0; j < block[1]; j++){
+ *dataptr = (DATATYPE)((i+start[0])*100 + (j+start[1]+1));
+ dataptr++;
+ }
}
}
@@ -195,19 +203,19 @@ dataset_print(hsize_t start[], hsize_t block[], DATATYPE * dataset)
hsize_t i, j;
/* print the column heading */
- printf("%-8s", "Cols:");
+ HDprintf("%-8s", "Cols:");
for (j=0; j < block[1]; j++){
- printf("%3lu ", (unsigned long)(start[1]+j));
+ HDprintf("%3lu ", (unsigned long)(start[1]+j));
}
- printf("\n");
+ HDprintf("\n");
/* print the slab data */
for (i=0; i < block[0]; i++){
- printf("Row %2lu: ", (unsigned long)(i+start[0]));
- for (j=0; j < block[1]; j++){
- printf("%03d ", *dataptr++);
- }
- printf("\n");
+ HDprintf("Row %2lu: ", (unsigned long)(i+start[0]));
+ for (j=0; j < block[1]; j++){
+ HDprintf("%03d ", *dataptr++);
+ }
+ HDprintf("\n");
}
}
@@ -223,35 +231,35 @@ dataset_vrfy(hsize_t start[], hsize_t count[], hsize_t stride[], hsize_t block[]
/* print it if VERBOSE_MED */
if(VERBOSE_MED) {
- printf("dataset_vrfy dumping:::\n");
- 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);
- printf("compared values:\n");
- dataset_print(start, block, dataset);
+ HDprintf("dataset_vrfy dumping:::\n");
+ HDprintf("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]);
+ HDprintf("original values:\n");
+ dataset_print(start, block, original);
+ HDprintf("compared values:\n");
+ dataset_print(start, block, dataset);
}
vrfyerrs = 0;
for (i=0; i < block[0]; i++){
- for (j=0; j < block[1]; j++){
- if(*dataset != *original){
- if(vrfyerrs++ < MAX_ERR_REPORT || VERBOSE_MED){
- 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++;
- original++;
- }
- }
+ for (j=0; j < block[1]; j++){
+ if(*dataset != *original){
+ if(vrfyerrs++ < MAX_ERR_REPORT || VERBOSE_MED){
+ HDprintf("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++;
+ original++;
+ }
+ }
}
if(vrfyerrs > MAX_ERR_REPORT && !VERBOSE_MED)
- printf("[more errors ...]\n");
+ HDprintf("[more errors ...]\n");
if(vrfyerrs)
- printf("%d errors found in dataset_vrfy\n", vrfyerrs);
+ HDprintf("%d errors found in dataset_vrfy\n", vrfyerrs);
return(vrfyerrs);
}
@@ -272,20 +280,20 @@ void
dataset_writeInd(void)
{
hid_t fid; /* HDF5 file ID */
- hid_t acc_tpl; /* File access templates */
- hid_t sid; /* Dataspace ID */
- hid_t file_dataspace; /* File dataspace ID */
- hid_t mem_dataspace; /* memory dataspace ID */
- hid_t dataset1, dataset2; /* Dataset ID */
- hsize_t dims[RANK]; /* dataset dim sizes */
- DATATYPE *data_array1 = NULL; /* data buffer */
+ hid_t acc_tpl; /* File access templates */
+ hid_t sid; /* Dataspace ID */
+ hid_t file_dataspace; /* File dataspace ID */
+ hid_t mem_dataspace; /* memory dataspace ID */
+ hid_t dataset1, dataset2; /* Dataset ID */
+ hsize_t dims[RANK]; /* dataset dim sizes */
+ DATATYPE *data_array1 = NULL; /* data buffer */
const char *filename;
- hsize_t start[RANK]; /* for hyperslab setting */
- hsize_t count[RANK], stride[RANK]; /* for hyperslab setting */
- hsize_t block[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 */
- herr_t ret; /* Generic return value */
+ herr_t ret; /* Generic return value */
int mpi_size, mpi_rank;
MPI_Comm comm = MPI_COMM_WORLD;
@@ -293,7 +301,7 @@ dataset_writeInd(void)
filename = GetTestParameters();
if(VERBOSE_MED)
- printf("Independent write test on file %s\n", filename);
+ HDprintf("Independent write test on file %s\n", filename);
/* set up MPI parameters */
MPI_Comm_size(MPI_COMM_WORLD,&mpi_size);
@@ -332,12 +340,12 @@ dataset_writeInd(void)
/* create a dataset collectively */
dataset1 = H5Dcreate2(fid, DATASETNAME1, H5T_NATIVE_INT, sid,
- H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
+ H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
VRFY((dataset1 >= 0), "H5Dcreate2 succeeded");
/* create another dataset collectively */
dataset2 = H5Dcreate2(fid, DATASETNAME2, H5T_NATIVE_INT, sid,
- H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
+ H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
VRFY((dataset2 >= 0), "H5Dcreate2 succeeded");
@@ -366,28 +374,28 @@ dataset_writeInd(void)
/* write data independently */
ret = H5Dwrite(dataset1, H5T_NATIVE_INT, mem_dataspace, file_dataspace,
- H5P_DEFAULT, data_array1);
+ H5P_DEFAULT, data_array1);
VRFY((ret >= 0), "H5Dwrite dataset1 succeeded");
/* write data independently */
ret = H5Dwrite(dataset2, H5T_NATIVE_INT, mem_dataspace, file_dataspace,
- H5P_DEFAULT, data_array1);
+ H5P_DEFAULT, data_array1);
VRFY((ret >= 0), "H5Dwrite dataset2 succeeded");
/* setup dimensions again to write with zero rows for process 0 */
if(VERBOSE_MED)
- printf("writeInd by some with zero row\n");
+ HDprintf("writeInd by some with zero row\n");
slab_set(mpi_rank, mpi_size, start, count, stride, block, ZROW);
ret = H5Sselect_hyperslab(file_dataspace, H5S_SELECT_SET, start, stride, count, block);
VRFY((ret >= 0), "H5Sset_hyperslab succeeded");
/* need to make mem_dataspace to match for process 0 */
if(MAINPROCESS){
- ret = H5Sselect_hyperslab(mem_dataspace, H5S_SELECT_SET, start, stride, count, block);
- VRFY((ret >= 0), "H5Sset_hyperslab mem_dataspace succeeded");
+ ret = H5Sselect_hyperslab(mem_dataspace, H5S_SELECT_SET, start, stride, count, block);
+ VRFY((ret >= 0), "H5Sset_hyperslab mem_dataspace succeeded");
}
MESG("writeInd by some with zero row");
if((mpi_rank/2)*2 != mpi_rank){
ret = H5Dwrite(dataset1, H5T_NATIVE_INT, mem_dataspace, file_dataspace,
- H5P_DEFAULT, data_array1);
+ H5P_DEFAULT, data_array1);
VRFY((ret >= 0), "H5Dwrite dataset1 by ZROW succeeded");
}
#ifdef BARRIER_CHECKS
@@ -418,19 +426,19 @@ void
dataset_readInd(void)
{
hid_t fid; /* HDF5 file ID */
- hid_t acc_tpl; /* File access templates */
- hid_t file_dataspace; /* File dataspace ID */
- hid_t mem_dataspace; /* memory dataspace ID */
- hid_t dataset1, dataset2; /* Dataset ID */
- DATATYPE *data_array1 = NULL; /* data buffer */
- DATATYPE *data_origin1 = NULL; /* expected data buffer */
+ hid_t acc_tpl; /* File access templates */
+ hid_t file_dataspace; /* File dataspace ID */
+ hid_t mem_dataspace; /* memory dataspace ID */
+ hid_t dataset1, dataset2; /* Dataset ID */
+ DATATYPE *data_array1 = NULL; /* data buffer */
+ DATATYPE *data_origin1 = NULL; /* expected data buffer */
const char *filename;
- hsize_t start[RANK]; /* for hyperslab setting */
- hsize_t count[RANK], stride[RANK]; /* for hyperslab setting */
- hsize_t block[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 */
- herr_t ret; /* Generic return value */
+ herr_t ret; /* Generic return value */
int mpi_size, mpi_rank;
MPI_Comm comm = MPI_COMM_WORLD;
@@ -438,7 +446,7 @@ dataset_readInd(void)
filename = GetTestParameters();
if(VERBOSE_MED)
- printf("Independent read test on file %s\n", filename);
+ HDprintf("Independent read test on file %s\n", filename);
/* set up MPI parameters */
MPI_Comm_size(MPI_COMM_WORLD,&mpi_size);
@@ -489,7 +497,7 @@ dataset_readInd(void)
/* read data independently */
ret = H5Dread(dataset1, H5T_NATIVE_INT, mem_dataspace, file_dataspace,
- H5P_DEFAULT, data_array1);
+ H5P_DEFAULT, data_array1);
VRFY((ret >= 0), "");
/* verify the read data with original expected data */
@@ -498,7 +506,7 @@ dataset_readInd(void)
/* read data independently */
ret = H5Dread(dataset2, H5T_NATIVE_INT, mem_dataspace, file_dataspace,
- H5P_DEFAULT, data_array1);
+ H5P_DEFAULT, data_array1);
VRFY((ret >= 0), "");
/* verify the read data with original expected data */
@@ -540,28 +548,28 @@ void
dataset_writeAll(void)
{
hid_t fid; /* HDF5 file ID */
- hid_t acc_tpl; /* File access templates */
- hid_t xfer_plist; /* Dataset transfer properties list */
- hid_t sid; /* Dataspace ID */
- hid_t file_dataspace; /* File dataspace ID */
- hid_t mem_dataspace; /* memory dataspace ID */
+ hid_t acc_tpl; /* File access templates */
+ hid_t xfer_plist; /* Dataset transfer properties list */
+ hid_t sid; /* Dataspace ID */
+ hid_t file_dataspace; /* File dataspace ID */
+ hid_t mem_dataspace; /* memory dataspace ID */
hid_t dataset1, dataset2, dataset3, dataset4; /* Dataset ID */
hid_t dataset5, dataset6, dataset7; /* Dataset ID */
- hid_t datatype; /* Datatype ID */
- hsize_t dims[RANK]; /* dataset dim sizes */
- DATATYPE *data_array1 = NULL; /* data buffer */
+ hid_t datatype; /* Datatype ID */
+ hsize_t dims[RANK]; /* dataset dim sizes */
+ DATATYPE *data_array1 = NULL; /* data buffer */
const char *filename;
- hsize_t start[RANK]; /* for hyperslab setting */
- hsize_t count[RANK], stride[RANK]; /* for hyperslab setting */
- hsize_t block[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 */
size_t num_points; /* for point selection */
hsize_t *coords = NULL; /* for point selection */
hsize_t current_dims; /* for point selection */
int i;
- herr_t ret; /* Generic return value */
+ herr_t ret; /* Generic return value */
int mpi_size, mpi_rank;
MPI_Comm comm = MPI_COMM_WORLD;
@@ -569,7 +577,7 @@ dataset_writeAll(void)
filename = GetTestParameters();
if(VERBOSE_MED)
- printf("Collective write test on file %s\n", filename);
+ HDprintf("Collective write test on file %s\n", filename);
/* set up MPI parameters */
MPI_Comm_size(MPI_COMM_WORLD,&mpi_size);
@@ -669,8 +677,8 @@ dataset_writeAll(void)
dataset_fill(start, block, data_array1);
MESG("data_array initialized");
if(VERBOSE_MED){
- MESG("data_array created");
- dataset_print(start, block, data_array1);
+ MESG("data_array created");
+ dataset_print(start, block, data_array1);
}
/* set up the collective transfer properties list */
@@ -687,23 +695,23 @@ dataset_writeAll(void)
/* write data collectively */
MESG("writeAll by Row");
ret = H5Dwrite(dataset1, H5T_NATIVE_INT, mem_dataspace, file_dataspace,
- xfer_plist, data_array1);
+ xfer_plist, data_array1);
VRFY((ret >= 0), "H5Dwrite dataset1 succeeded");
/* setup dimensions again to writeAll with zero rows for process 0 */
if(VERBOSE_MED)
- printf("writeAll by some with zero row\n");
+ HDprintf("writeAll by some with zero row\n");
slab_set(mpi_rank, mpi_size, start, count, stride, block, ZROW);
ret = H5Sselect_hyperslab(file_dataspace, H5S_SELECT_SET, start, stride, count, block);
VRFY((ret >= 0), "H5Sset_hyperslab succeeded");
/* need to make mem_dataspace to match for process 0 */
if(MAINPROCESS){
- ret = H5Sselect_hyperslab(mem_dataspace, H5S_SELECT_SET, start, stride, count, block);
- VRFY((ret >= 0), "H5Sset_hyperslab mem_dataspace succeeded");
+ ret = H5Sselect_hyperslab(mem_dataspace, H5S_SELECT_SET, start, stride, count, block);
+ VRFY((ret >= 0), "H5Sset_hyperslab mem_dataspace succeeded");
}
MESG("writeAll by some with zero row");
ret = H5Dwrite(dataset1, H5T_NATIVE_INT, mem_dataspace, file_dataspace,
- xfer_plist, data_array1);
+ xfer_plist, data_array1);
VRFY((ret >= 0), "H5Dwrite dataset1 by ZROW succeeded");
/* release all temporary handles. */
@@ -720,8 +728,8 @@ dataset_writeAll(void)
dataset_fill(start, block, data_array1);
MESG("data_array initialized");
if(VERBOSE_MED){
- MESG("data_array created");
- dataset_print(start, block, data_array1);
+ MESG("data_array created");
+ dataset_print(start, block, data_array1);
}
/* create a file dataspace independently */
@@ -738,8 +746,8 @@ dataset_writeAll(void)
dataset_fill(start, block, data_array1);
MESG("data_array initialized");
if(VERBOSE_MED){
- MESG("data_array created");
- dataset_print(start, block, data_array1);
+ MESG("data_array created");
+ dataset_print(start, block, data_array1);
}
/* set up the collective transfer properties list */
@@ -755,23 +763,23 @@ dataset_writeAll(void)
/* write data independently */
ret = H5Dwrite(dataset2, H5T_NATIVE_INT, mem_dataspace, file_dataspace,
- xfer_plist, data_array1);
+ xfer_plist, data_array1);
VRFY((ret >= 0), "H5Dwrite dataset2 succeeded");
/* setup dimensions again to writeAll with zero columns for process 0 */
if(VERBOSE_MED)
- printf("writeAll by some with zero col\n");
+ HDprintf("writeAll by some with zero col\n");
slab_set(mpi_rank, mpi_size, start, count, stride, block, ZCOL);
ret = H5Sselect_hyperslab(file_dataspace, H5S_SELECT_SET, start, stride, count, block);
VRFY((ret >= 0), "H5Sset_hyperslab succeeded");
/* need to make mem_dataspace to match for process 0 */
if(MAINPROCESS){
- ret = H5Sselect_hyperslab(mem_dataspace, H5S_SELECT_SET, start, stride, count, block);
- VRFY((ret >= 0), "H5Sset_hyperslab mem_dataspace succeeded");
+ ret = H5Sselect_hyperslab(mem_dataspace, H5S_SELECT_SET, start, stride, count, block);
+ VRFY((ret >= 0), "H5Sset_hyperslab mem_dataspace succeeded");
}
MESG("writeAll by some with zero col");
ret = H5Dwrite(dataset1, H5T_NATIVE_INT, mem_dataspace, file_dataspace,
- xfer_plist, data_array1);
+ xfer_plist, data_array1);
VRFY((ret >= 0), "H5Dwrite dataset1 by ZCOL succeeded");
/* release all temporary handles. */
@@ -789,8 +797,8 @@ dataset_writeAll(void)
file_dataspace = H5Dget_space (dataset3);
VRFY((file_dataspace >= 0), "H5Dget_space succeeded");
if(MAINPROCESS) {
- ret = H5Sselect_none(file_dataspace);
- VRFY((ret >= 0), "H5Sselect_none file_dataspace succeeded");
+ ret = H5Sselect_none(file_dataspace);
+ VRFY((ret >= 0), "H5Sselect_none file_dataspace succeeded");
} /* end if */
else {
ret = H5Sselect_hyperslab(file_dataspace, H5S_SELECT_SET, start, stride, count, block);
@@ -801,16 +809,16 @@ dataset_writeAll(void)
mem_dataspace = H5Screate_simple (RANK, block, NULL);
VRFY((mem_dataspace >= 0), "");
if(MAINPROCESS) {
- ret = H5Sselect_none(mem_dataspace);
- VRFY((ret >= 0), "H5Sselect_none mem_dataspace succeeded");
+ ret = H5Sselect_none(mem_dataspace);
+ VRFY((ret >= 0), "H5Sselect_none mem_dataspace succeeded");
} /* end if */
/* fill the local slab with some trivial data */
dataset_fill(start, block, data_array1);
MESG("data_array initialized");
if(VERBOSE_MED) {
- MESG("data_array created");
- dataset_print(start, block, data_array1);
+ MESG("data_array created");
+ dataset_print(start, block, data_array1);
} /* end if */
/* set up the collective transfer properties list */
@@ -827,13 +835,13 @@ dataset_writeAll(void)
/* write data collectively */
MESG("writeAll with none");
ret = H5Dwrite(dataset3, H5T_NATIVE_INT, mem_dataspace, file_dataspace,
- xfer_plist, data_array1);
+ xfer_plist, data_array1);
VRFY((ret >= 0), "H5Dwrite dataset3 succeeded");
/* write data collectively (with datatype conversion) */
MESG("writeAll with none");
ret = H5Dwrite(dataset3, H5T_NATIVE_UCHAR, mem_dataspace, file_dataspace,
- xfer_plist, data_array1);
+ xfer_plist, data_array1);
VRFY((ret >= 0), "H5Dwrite dataset3 succeeded");
/* release all temporary handles. */
@@ -850,8 +858,8 @@ dataset_writeAll(void)
file_dataspace = H5Dget_space (dataset4);
VRFY((file_dataspace >= 0), "H5Dget_space succeeded");
if(MAINPROCESS) {
- ret = H5Sselect_none(file_dataspace);
- VRFY((ret >= 0), "H5Sselect_all file_dataspace succeeded");
+ ret = H5Sselect_none(file_dataspace);
+ VRFY((ret >= 0), "H5Sselect_all file_dataspace succeeded");
} /* end if */
else {
ret = H5Sselect_all(file_dataspace);
@@ -862,8 +870,8 @@ dataset_writeAll(void)
mem_dataspace = H5Screate(H5S_SCALAR);
VRFY((mem_dataspace >= 0), "");
if(MAINPROCESS) {
- ret = H5Sselect_none(mem_dataspace);
- VRFY((ret >= 0), "H5Sselect_all mem_dataspace succeeded");
+ ret = H5Sselect_none(mem_dataspace);
+ VRFY((ret >= 0), "H5Sselect_all mem_dataspace succeeded");
} /* end if */
else {
ret = H5Sselect_all(mem_dataspace);
@@ -874,8 +882,8 @@ dataset_writeAll(void)
dataset_fill(start, block, data_array1);
MESG("data_array initialized");
if(VERBOSE_MED) {
- MESG("data_array created");
- dataset_print(start, block, data_array1);
+ MESG("data_array created");
+ dataset_print(start, block, data_array1);
} /* end if */
/* set up the collective transfer properties list */
@@ -891,13 +899,13 @@ dataset_writeAll(void)
/* write data collectively */
MESG("writeAll with scalar dataspace");
ret = H5Dwrite(dataset4, H5T_NATIVE_INT, mem_dataspace, file_dataspace,
- xfer_plist, data_array1);
+ xfer_plist, data_array1);
VRFY((ret >= 0), "H5Dwrite dataset4 succeeded");
/* write data collectively (with datatype conversion) */
MESG("writeAll with scalar dataspace");
ret = H5Dwrite(dataset4, H5T_NATIVE_UCHAR, mem_dataspace, file_dataspace,
- xfer_plist, data_array1);
+ xfer_plist, data_array1);
VRFY((ret >= 0), "H5Dwrite dataset4 succeeded");
/* release all temporary handles. */
@@ -907,7 +915,7 @@ dataset_writeAll(void)
if(data_array1) free(data_array1);
- data_array1 = (DATATYPE *)malloc(dim0*dim1*sizeof(DATATYPE));
+ data_array1 = (DATATYPE *)HDmalloc(dim0*dim1*sizeof(DATATYPE));
VRFY((data_array1 != NULL), "data_array1 malloc succeeded");
block[0] = 1;
@@ -922,15 +930,15 @@ dataset_writeAll(void)
dataset_fill(start, block, data_array1);
MESG("data_array initialized");
if(VERBOSE_MED){
- MESG("data_array created");
- dataset_print(start, block, data_array1);
+ MESG("data_array created");
+ dataset_print(start, block, data_array1);
}
/* Dataset5: point selection in File - Hyperslab selection in Memory*/
/* create a file dataspace independently */
point_set (start, count, stride, block, num_points, coords, OUT_OF_ORDER);
file_dataspace = H5Dget_space (dataset5);
- VRFY((file_dataspace >= 0), "H5Dget_space succeeded");
+ VRFY((file_dataspace >= 0), "H5Dget_space succeeded");
ret = H5Sselect_elements(file_dataspace, H5S_SELECT_SET, num_points, coords);
VRFY((ret >= 0), "H5Sselect_elements succeeded");
@@ -1005,7 +1013,7 @@ dataset_writeAll(void)
start[1] = 0;
point_set (start, count, stride, block, num_points, coords, IN_ORDER);
file_dataspace = H5Dget_space (dataset7);
- VRFY((file_dataspace >= 0), "H5Dget_space succeeded");
+ VRFY((file_dataspace >= 0), "H5Dget_space succeeded");
ret = H5Sselect_elements(file_dataspace, H5S_SELECT_SET, num_points, coords);
VRFY((ret >= 0), "H5Sselect_elements succeeded");
@@ -1075,25 +1083,25 @@ void
dataset_readAll(void)
{
hid_t fid; /* HDF5 file ID */
- hid_t acc_tpl; /* File access templates */
- hid_t xfer_plist; /* Dataset transfer properties list */
- hid_t file_dataspace; /* File dataspace ID */
- hid_t mem_dataspace; /* memory dataspace ID */
+ hid_t acc_tpl; /* File access templates */
+ hid_t xfer_plist; /* Dataset transfer properties list */
+ hid_t file_dataspace; /* File dataspace ID */
+ hid_t mem_dataspace; /* memory dataspace ID */
hid_t dataset1, dataset2, dataset5, dataset6, dataset7; /* Dataset ID */
- DATATYPE *data_array1 = NULL; /* data buffer */
- DATATYPE *data_origin1 = NULL; /* expected data buffer */
+ DATATYPE *data_array1 = NULL; /* data buffer */
+ DATATYPE *data_origin1 = NULL; /* expected data buffer */
const char *filename;
- hsize_t start[RANK]; /* for hyperslab setting */
- hsize_t count[RANK], stride[RANK]; /* for hyperslab setting */
- hsize_t block[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 */
size_t num_points; /* for point selection */
hsize_t *coords = NULL; /* for point selection */
hsize_t current_dims; /* for point selection */
int i,j,k;
- herr_t ret; /* Generic return value */
+ herr_t ret; /* Generic return value */
int mpi_size, mpi_rank;
MPI_Comm comm = MPI_COMM_WORLD;
@@ -1101,7 +1109,7 @@ dataset_readAll(void)
filename = GetTestParameters();
if(VERBOSE_MED)
- printf("Collective read test on file %s\n", filename);
+ HDprintf("Collective read test on file %s\n", filename);
/* set up MPI parameters */
MPI_Comm_size(MPI_COMM_WORLD,&mpi_size);
@@ -1174,8 +1182,8 @@ dataset_readAll(void)
dataset_fill(start, block, data_origin1);
MESG("data_array initialized");
if(VERBOSE_MED){
- MESG("data_array created");
- dataset_print(start, block, data_origin1);
+ MESG("data_array created");
+ dataset_print(start, block, data_origin1);
}
/* set up the collective transfer properties list */
@@ -1191,7 +1199,7 @@ dataset_readAll(void)
/* read data collectively */
ret = H5Dread(dataset1, H5T_NATIVE_INT, mem_dataspace, file_dataspace,
- xfer_plist, data_array1);
+ xfer_plist, data_array1);
VRFY((ret >= 0), "H5Dread dataset1 succeeded");
/* verify the read data with original expected data */
@@ -1200,18 +1208,18 @@ dataset_readAll(void)
/* setup dimensions again to readAll with zero columns for process 0 */
if(VERBOSE_MED)
- printf("readAll by some with zero col\n");
+ HDprintf("readAll by some with zero col\n");
slab_set(mpi_rank, mpi_size, start, count, stride, block, ZCOL);
ret = H5Sselect_hyperslab(file_dataspace, H5S_SELECT_SET, start, stride, count, block);
VRFY((ret >= 0), "H5Sset_hyperslab succeeded");
/* need to make mem_dataspace to match for process 0 */
if(MAINPROCESS){
- ret = H5Sselect_hyperslab(mem_dataspace, H5S_SELECT_SET, start, stride, count, block);
- VRFY((ret >= 0), "H5Sset_hyperslab mem_dataspace succeeded");
+ ret = H5Sselect_hyperslab(mem_dataspace, H5S_SELECT_SET, start, stride, count, block);
+ VRFY((ret >= 0), "H5Sset_hyperslab mem_dataspace succeeded");
}
MESG("readAll by some with zero col");
ret = H5Dread(dataset1, H5T_NATIVE_INT, mem_dataspace, file_dataspace,
- xfer_plist, data_array1);
+ xfer_plist, data_array1);
VRFY((ret >= 0), "H5Dread dataset1 by ZCOL succeeded");
/* verify the read data with original expected data */
@@ -1242,8 +1250,8 @@ dataset_readAll(void)
dataset_fill(start, block, data_origin1);
MESG("data_array initialized");
if(VERBOSE_MED){
- MESG("data_array created");
- dataset_print(start, block, data_origin1);
+ MESG("data_array created");
+ dataset_print(start, block, data_origin1);
}
/* set up the collective transfer properties list */
@@ -1259,7 +1267,7 @@ dataset_readAll(void)
/* read data collectively */
ret = H5Dread(dataset2, H5T_NATIVE_INT, mem_dataspace, file_dataspace,
- xfer_plist, data_array1);
+ xfer_plist, data_array1);
VRFY((ret >= 0), "H5Dread dataset2 succeeded");
/* verify the read data with original expected data */
@@ -1268,18 +1276,18 @@ dataset_readAll(void)
/* setup dimensions again to readAll with zero rows for process 0 */
if(VERBOSE_MED)
- printf("readAll by some with zero row\n");
+ HDprintf("readAll by some with zero row\n");
slab_set(mpi_rank, mpi_size, start, count, stride, block, ZROW);
ret = H5Sselect_hyperslab(file_dataspace, H5S_SELECT_SET, start, stride, count, block);
VRFY((ret >= 0), "H5Sset_hyperslab succeeded");
/* need to make mem_dataspace to match for process 0 */
if(MAINPROCESS){
- ret = H5Sselect_hyperslab(mem_dataspace, H5S_SELECT_SET, start, stride, count, block);
- VRFY((ret >= 0), "H5Sset_hyperslab mem_dataspace succeeded");
+ ret = H5Sselect_hyperslab(mem_dataspace, H5S_SELECT_SET, start, stride, count, block);
+ VRFY((ret >= 0), "H5Sset_hyperslab mem_dataspace succeeded");
}
MESG("readAll by some with zero row");
ret = H5Dread(dataset1, H5T_NATIVE_INT, mem_dataspace, file_dataspace,
- xfer_plist, data_array1);
+ xfer_plist, data_array1);
VRFY((ret >= 0), "H5Dread dataset1 by ZROW succeeded");
/* verify the read data with original expected data */
@@ -1293,9 +1301,9 @@ dataset_readAll(void)
if(data_array1) free(data_array1);
if(data_origin1) free(data_origin1);
- data_array1 = (DATATYPE *)malloc(dim0*dim1*sizeof(DATATYPE));
+ data_array1 = (DATATYPE *)HDmalloc(dim0*dim1*sizeof(DATATYPE));
VRFY((data_array1 != NULL), "data_array1 malloc succeeded");
- data_origin1 = (DATATYPE *)malloc(dim0*dim1*sizeof(DATATYPE));
+ data_origin1 = (DATATYPE *)HDmalloc(dim0*dim1*sizeof(DATATYPE));
VRFY((data_origin1 != NULL), "data_origin1 malloc succeeded");
block[0] = 1;
@@ -1310,8 +1318,8 @@ dataset_readAll(void)
dataset_fill(start, block, data_origin1);
MESG("data_array initialized");
if(VERBOSE_MED){
- MESG("data_array created");
- dataset_print(start, block, data_origin1);
+ MESG("data_array created");
+ dataset_print(start, block, data_origin1);
}
/* Dataset5: point selection in memory - Hyperslab selection in file*/
@@ -1344,7 +1352,7 @@ dataset_readAll(void)
xfer_plist, data_array1);
VRFY((ret >= 0), "H5Dread dataset5 succeeded");
-
+
ret = dataset_vrfy(start, count, stride, block, data_array1, data_origin1);
if(ret) nerrors++;
@@ -1355,7 +1363,7 @@ dataset_readAll(void)
if(data_array1) free(data_array1);
- data_array1 = (DATATYPE *)malloc(dim0*dim1*sizeof(DATATYPE));
+ data_array1 = (DATATYPE *)HDmalloc(dim0*dim1*sizeof(DATATYPE));
VRFY((data_array1 != NULL), "data_array1 malloc succeeded");
/* Dataset6: point selection in File - Point selection in Memory*/
@@ -1400,7 +1408,7 @@ dataset_readAll(void)
H5Pclose(xfer_plist);
if(data_array1) free(data_array1);
- data_array1 = (DATATYPE *)malloc(dim0*dim1*sizeof(DATATYPE));
+ data_array1 = (DATATYPE *)HDmalloc(dim0*dim1*sizeof(DATATYPE));
VRFY((data_array1 != NULL), "data_array1 malloc succeeded");
/* Dataset7: point selection in memory - All selection in file*/
@@ -1488,25 +1496,25 @@ void
extend_writeInd(void)
{
hid_t fid; /* HDF5 file ID */
- hid_t acc_tpl; /* File access templates */
- hid_t sid; /* Dataspace ID */
- hid_t file_dataspace; /* File dataspace ID */
- hid_t mem_dataspace; /* memory dataspace ID */
- hid_t dataset1, dataset2; /* Dataset ID */
+ hid_t acc_tpl; /* File access templates */
+ hid_t sid; /* Dataspace ID */
+ hid_t file_dataspace; /* File dataspace ID */
+ hid_t mem_dataspace; /* memory dataspace ID */
+ hid_t dataset1, dataset2; /* Dataset ID */
const char *filename;
- hsize_t dims[RANK]; /* dataset dim sizes */
+ hsize_t dims[RANK]; /* dataset dim sizes */
hsize_t max_dims[RANK] =
- {H5S_UNLIMITED, H5S_UNLIMITED}; /* dataset maximum dim sizes */
- DATATYPE *data_array1 = NULL; /* data buffer */
- hsize_t chunk_dims[RANK]; /* chunk sizes */
- hid_t dataset_pl; /* dataset create prop. list */
+ {H5S_UNLIMITED, H5S_UNLIMITED}; /* dataset maximum dim sizes */
+ DATATYPE *data_array1 = NULL; /* data buffer */
+ hsize_t chunk_dims[RANK]; /* chunk sizes */
+ hid_t dataset_pl; /* dataset create prop. list */
- 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 */
+ 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 */
- herr_t ret; /* Generic return value */
+ herr_t ret; /* Generic return value */
int mpi_size, mpi_rank;
MPI_Comm comm = MPI_COMM_WORLD;
@@ -1514,7 +1522,7 @@ extend_writeInd(void)
filename = GetTestParameters();
if(VERBOSE_MED)
- printf("Extend independent write test on file %s\n", filename);
+ HDprintf("Extend independent write test on file %s\n", filename);
/* set up MPI parameters */
MPI_Comm_size(MPI_COMM_WORLD,&mpi_size);
@@ -1567,7 +1575,7 @@ extend_writeInd(void)
/* set up dataset storage chunk sizes and creation property list */
if(VERBOSE_MED)
- printf("chunks[]=%lu,%lu\n", (unsigned long)chunk_dims[0], (unsigned long)chunk_dims[1]);
+ HDprintf("chunks[]=%lu,%lu\n", (unsigned long)chunk_dims[0], (unsigned long)chunk_dims[1]);
dataset_pl = H5Pcreate(H5P_DATASET_CREATE);
VRFY((dataset_pl >= 0), "H5Pcreate succeeded");
ret = H5Pset_chunk(dataset_pl, RANK, chunk_dims);
@@ -1603,8 +1611,8 @@ extend_writeInd(void)
dataset_fill(start, block, data_array1);
MESG("data_array initialized");
if(VERBOSE_MED) {
- MESG("data_array created");
- dataset_print(start, block, data_array1);
+ MESG("data_array created");
+ dataset_print(start, block, data_array1);
}
/* create a memory dataspace independently */
@@ -1625,7 +1633,7 @@ extend_writeInd(void)
/* write data independently */
ret = H5Dwrite(dataset1, H5T_NATIVE_INT, mem_dataspace, file_dataspace,
- H5P_DEFAULT, data_array1);
+ H5P_DEFAULT, data_array1);
VRFY((ret >= 0), "H5Dwrite succeeded");
/* release resource */
@@ -1643,8 +1651,8 @@ extend_writeInd(void)
dataset_fill(start, block, data_array1);
MESG("data_array initialized");
if(VERBOSE_MED){
- MESG("data_array created");
- dataset_print(start, block, data_array1);
+ MESG("data_array created");
+ dataset_print(start, block, data_array1);
}
/* create a memory dataspace independently */
@@ -1664,7 +1672,7 @@ extend_writeInd(void)
/* write data independently. Should fail. */
ret = H5Dwrite(dataset2, H5T_NATIVE_INT, mem_dataspace, file_dataspace,
- H5P_DEFAULT, data_array1);
+ H5P_DEFAULT, data_array1);
VRFY((ret < 0), "H5Dwrite failed as expected");
/* restore auto error reporting */
@@ -1685,7 +1693,7 @@ extend_writeInd(void)
/* write data independently */
ret = H5Dwrite(dataset2, H5T_NATIVE_INT, mem_dataspace, file_dataspace,
- H5P_DEFAULT, data_array1);
+ H5P_DEFAULT, data_array1);
VRFY((ret >= 0), "H5Dwrite succeeded");
/* release resource */
@@ -1719,25 +1727,25 @@ extend_writeInd2(void)
{
const char *filename;
hid_t fid; /* HDF5 file ID */
- hid_t fapl; /* File access templates */
- hid_t fs; /* File dataspace ID */
- hid_t ms; /* Memory dataspace ID */
- hid_t dataset; /* Dataset ID */
- hsize_t orig_size=10; /* Original dataset dim size */
- hsize_t new_size=20; /* Extended dataset dim size */
+ hid_t fapl; /* File access templates */
+ hid_t fs; /* File dataspace ID */
+ hid_t ms; /* Memory dataspace ID */
+ hid_t dataset; /* Dataset ID */
+ hsize_t orig_size=10; /* Original dataset dim size */
+ hsize_t new_size=20; /* Extended dataset dim size */
hsize_t one=1;
- hsize_t max_size = H5S_UNLIMITED; /* dataset maximum dim size */
- hsize_t chunk_size = 16384; /* chunk size */
- hid_t dcpl; /* dataset create prop. list */
+ hsize_t max_size = H5S_UNLIMITED; /* dataset maximum dim size */
+ hsize_t chunk_size = 16384; /* chunk size */
+ hid_t dcpl; /* dataset create prop. list */
int written[10], /* Data to write */
retrieved[10]; /* Data read in */
int mpi_size, mpi_rank; /* MPI settings */
int i; /* Local index variable */
- herr_t ret; /* Generic return value */
+ herr_t ret; /* Generic return value */
filename = GetTestParameters();
if(VERBOSE_MED)
- printf("Extend independent write test #2 on file %s\n", filename);
+ HDprintf("Extend independent write test #2 on file %s\n", filename);
/* set up MPI parameters */
MPI_Comm_size(MPI_COMM_WORLD,&mpi_size);
@@ -1794,10 +1802,10 @@ extend_writeInd2(void)
written[i] = i;
MESG("data array initialized");
if(VERBOSE_MED) {
- MESG("writing at offset zero: ");
+ MESG("writing at offset zero: ");
for(i = 0; i < (int)orig_size; i++)
- printf("%s%d", i?", ":"", written[i]);
- printf("\n");
+ HDprintf("%s%d", i?", ":"", written[i]);
+ HDprintf("\n");
}
ret = H5Dwrite(dataset, H5T_NATIVE_INT, ms, fs, H5P_DEFAULT, written);
VRFY((ret >= 0), "H5Dwrite succeeded");
@@ -1809,15 +1817,15 @@ extend_writeInd2(void)
VRFY((ret >= 0), "H5Dread succeeded");
for (i=0; i<(int)orig_size; i++)
if(written[i]!=retrieved[i]) {
- printf("Line #%d: written!=retrieved: written[%d]=%d, retrieved[%d]=%d\n",__LINE__,
+ HDprintf("Line #%d: written!=retrieved: written[%d]=%d, retrieved[%d]=%d\n",__LINE__,
i,written[i], i,retrieved[i]);
nerrors++;
}
if(VERBOSE_MED){
- MESG("read at offset zero: ");
+ MESG("read at offset zero: ");
for (i=0; i<(int)orig_size; i++)
- printf("%s%d", i?", ":"", retrieved[i]);
- printf("\n");
+ HDprintf("%s%d", i?", ":"", retrieved[i]);
+ HDprintf("\n");
}
/* -------------------------
@@ -1837,10 +1845,10 @@ extend_writeInd2(void)
written[i] = orig_size + i;
MESG("data array re-initialized");
if(VERBOSE_MED) {
- MESG("writing at offset 10: ");
+ MESG("writing at offset 10: ");
for (i=0; i<(int)orig_size; i++)
- printf("%s%d", i?", ":"", written[i]);
- printf("\n");
+ HDprintf("%s%d", i?", ":"", written[i]);
+ HDprintf("\n");
}
ret = H5Sselect_hyperslab(fs, H5S_SELECT_SET, &orig_size, NULL, &one, &orig_size);
VRFY((ret >= 0), "H5Sselect_hyperslab succeeded");
@@ -1854,15 +1862,15 @@ extend_writeInd2(void)
VRFY((ret >= 0), "H5Dread succeeded");
for (i=0; i<(int)orig_size; i++)
if(written[i]!=retrieved[i]) {
- printf("Line #%d: written!=retrieved: written[%d]=%d, retrieved[%d]=%d\n",__LINE__,
+ HDprintf("Line #%d: written!=retrieved: written[%d]=%d, retrieved[%d]=%d\n",__LINE__,
i,written[i], i,retrieved[i]);
nerrors++;
}
if(VERBOSE_MED){
- MESG("read at offset 10: ");
+ MESG("read at offset 10: ");
for (i=0; i<(int)orig_size; i++)
- printf("%s%d", i?", ":"", retrieved[i]);
- printf("\n");
+ HDprintf("%s%d", i?", ":"", retrieved[i]);
+ HDprintf("\n");
}
@@ -1879,22 +1887,22 @@ extend_writeInd2(void)
void
extend_readInd(void)
{
- hid_t fid; /* HDF5 file ID */
- hid_t acc_tpl; /* File access templates */
- hid_t file_dataspace; /* File dataspace ID */
- hid_t mem_dataspace; /* memory dataspace ID */
- hid_t dataset1, dataset2; /* Dataset ID */
- hsize_t dims[RANK]; /* dataset dim sizes */
- DATATYPE *data_array1 = NULL; /* data buffer */
- DATATYPE *data_array2 = NULL; /* data buffer */
- DATATYPE *data_origin1 = NULL; /* expected data buffer */
+ hid_t fid; /* HDF5 file ID */
+ hid_t acc_tpl; /* File access templates */
+ hid_t file_dataspace; /* File dataspace ID */
+ hid_t mem_dataspace; /* memory dataspace ID */
+ hid_t dataset1, dataset2; /* Dataset ID */
+ hsize_t dims[RANK]; /* dataset dim sizes */
+ DATATYPE *data_array1 = NULL; /* data buffer */
+ DATATYPE *data_array2 = NULL; /* data buffer */
+ DATATYPE *data_origin1 = NULL; /* expected data buffer */
const char *filename;
- hsize_t start[RANK]; /* for hyperslab setting */
- hsize_t count[RANK], stride[RANK]; /* for hyperslab setting */
- hsize_t block[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 */
- herr_t ret; /* Generic return value */
+ herr_t ret; /* Generic return value */
int mpi_size, mpi_rank;
MPI_Comm comm = MPI_COMM_WORLD;
@@ -1902,7 +1910,7 @@ extend_readInd(void)
filename = GetTestParameters();
if(VERBOSE_MED)
- printf("Extend independent read test on file %s\n", filename);
+ HDprintf("Extend independent read test on file %s\n", filename);
/* set up MPI parameters */
MPI_Comm_size(MPI_COMM_WORLD,&mpi_size);
@@ -1974,13 +1982,13 @@ extend_readInd(void)
/* fill dataset with test data */
dataset_fill(start, block, data_origin1);
if(VERBOSE_MED){
- MESG("data_array created");
- dataset_print(start, block, data_array1);
+ MESG("data_array created");
+ dataset_print(start, block, data_array1);
}
/* read data independently */
ret = H5Dread(dataset1, H5T_NATIVE_INT, mem_dataspace, file_dataspace,
- H5P_DEFAULT, data_array1);
+ H5P_DEFAULT, data_array1);
VRFY((ret >= 0), "H5Dread succeeded");
/* verify the read data with original expected data */
@@ -2009,13 +2017,13 @@ extend_readInd(void)
/* fill dataset with test data */
dataset_fill(start, block, data_origin1);
if(VERBOSE_MED){
- MESG("data_array created");
- dataset_print(start, block, data_array1);
+ MESG("data_array created");
+ dataset_print(start, block, data_array1);
}
/* read data independently */
ret = H5Dread(dataset2, H5T_NATIVE_INT, mem_dataspace, file_dataspace,
- H5P_DEFAULT, data_array1);
+ H5P_DEFAULT, data_array1);
VRFY((ret >= 0), "H5Dread succeeded");
/* verify the read data with original expected data */
@@ -2058,26 +2066,26 @@ void
extend_writeAll(void)
{
hid_t fid; /* HDF5 file ID */
- hid_t acc_tpl; /* File access templates */
- hid_t xfer_plist; /* Dataset transfer properties list */
- hid_t sid; /* Dataspace ID */
- hid_t file_dataspace; /* File dataspace ID */
- hid_t mem_dataspace; /* memory dataspace ID */
- hid_t dataset1, dataset2; /* Dataset ID */
+ hid_t acc_tpl; /* File access templates */
+ hid_t xfer_plist; /* Dataset transfer properties list */
+ hid_t sid; /* Dataspace ID */
+ hid_t file_dataspace; /* File dataspace ID */
+ hid_t mem_dataspace; /* memory dataspace ID */
+ hid_t dataset1, dataset2; /* Dataset ID */
const char *filename;
- hsize_t dims[RANK]; /* dataset dim sizes */
+ hsize_t dims[RANK]; /* dataset dim sizes */
hsize_t max_dims[RANK] =
- {H5S_UNLIMITED, H5S_UNLIMITED}; /* dataset maximum dim sizes */
- DATATYPE *data_array1 = NULL; /* data buffer */
- hsize_t chunk_dims[RANK]; /* chunk sizes */
- hid_t dataset_pl; /* dataset create prop. list */
+ {H5S_UNLIMITED, H5S_UNLIMITED}; /* dataset maximum dim sizes */
+ DATATYPE *data_array1 = NULL; /* data buffer */
+ hsize_t chunk_dims[RANK]; /* chunk sizes */
+ hid_t dataset_pl; /* dataset create prop. list */
- 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 */
+ 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 */
- herr_t ret; /* Generic return value */
+ herr_t ret; /* Generic return value */
int mpi_size, mpi_rank;
MPI_Comm comm = MPI_COMM_WORLD;
@@ -2085,7 +2093,7 @@ extend_writeAll(void)
filename = GetTestParameters();
if(VERBOSE_MED)
- printf("Extend independent write test on file %s\n", filename);
+ HDprintf("Extend independent write test on file %s\n", filename);
/* set up MPI parameters */
MPI_Comm_size(MPI_COMM_WORLD,&mpi_size);
@@ -2138,7 +2146,7 @@ extend_writeAll(void)
/* set up dataset storage chunk sizes and creation property list */
if(VERBOSE_MED)
- printf("chunks[]=%lu,%lu\n", (unsigned long)chunk_dims[0], (unsigned long)chunk_dims[1]);
+ HDprintf("chunks[]=%lu,%lu\n", (unsigned long)chunk_dims[0], (unsigned long)chunk_dims[1]);
dataset_pl = H5Pcreate(H5P_DATASET_CREATE);
VRFY((dataset_pl >= 0), "H5Pcreate succeeded");
ret = H5Pset_chunk(dataset_pl, RANK, chunk_dims);
@@ -2174,8 +2182,8 @@ extend_writeAll(void)
dataset_fill(start, block, data_array1);
MESG("data_array initialized");
if(VERBOSE_MED) {
- MESG("data_array created");
- dataset_print(start, block, data_array1);
+ MESG("data_array created");
+ dataset_print(start, block, data_array1);
}
/* create a memory dataspace independently */
@@ -2207,7 +2215,7 @@ extend_writeAll(void)
/* write data collectively */
ret = H5Dwrite(dataset1, H5T_NATIVE_INT, mem_dataspace, file_dataspace,
- xfer_plist, data_array1);
+ xfer_plist, data_array1);
VRFY((ret >= 0), "H5Dwrite succeeded");
/* release resource */
@@ -2226,8 +2234,8 @@ extend_writeAll(void)
dataset_fill(start, block, data_array1);
MESG("data_array initialized");
if(VERBOSE_MED){
- MESG("data_array created");
- dataset_print(start, block, data_array1);
+ MESG("data_array created");
+ dataset_print(start, block, data_array1);
}
/* create a memory dataspace independently */
@@ -2258,7 +2266,7 @@ extend_writeAll(void)
/* write data independently. Should fail. */
ret = H5Dwrite(dataset2, H5T_NATIVE_INT, mem_dataspace, file_dataspace,
- xfer_plist, data_array1);
+ xfer_plist, data_array1);
VRFY((ret < 0), "H5Dwrite failed as expected");
/* restore auto error reporting */
@@ -2279,7 +2287,7 @@ extend_writeAll(void)
/* write data independently */
ret = H5Dwrite(dataset2, H5T_NATIVE_INT, mem_dataspace, file_dataspace,
- xfer_plist, data_array1);
+ xfer_plist, data_array1);
VRFY((ret >= 0), "H5Dwrite succeeded");
/* release resource */
@@ -2308,23 +2316,23 @@ extend_writeAll(void)
void
extend_readAll(void)
{
- hid_t fid; /* HDF5 file ID */
- hid_t acc_tpl; /* File access templates */
- hid_t xfer_plist; /* Dataset transfer properties list */
- hid_t file_dataspace; /* File dataspace ID */
- hid_t mem_dataspace; /* memory dataspace ID */
- hid_t dataset1, dataset2; /* Dataset ID */
+ hid_t fid; /* HDF5 file ID */
+ hid_t acc_tpl; /* File access templates */
+ hid_t xfer_plist; /* Dataset transfer properties list */
+ hid_t file_dataspace; /* File dataspace ID */
+ hid_t mem_dataspace; /* memory dataspace ID */
+ hid_t dataset1, dataset2; /* Dataset ID */
const char *filename;
- hsize_t dims[RANK]; /* dataset dim sizes */
- DATATYPE *data_array1 = NULL; /* data buffer */
- DATATYPE *data_array2 = NULL; /* data buffer */
- DATATYPE *data_origin1 = NULL; /* expected data buffer */
+ hsize_t dims[RANK]; /* dataset dim sizes */
+ DATATYPE *data_array1 = NULL; /* data buffer */
+ DATATYPE *data_array2 = NULL; /* data buffer */
+ DATATYPE *data_origin1 = NULL; /* expected data buffer */
- hsize_t start[RANK]; /* for hyperslab setting */
- hsize_t count[RANK], stride[RANK]; /* for hyperslab setting */
- hsize_t block[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 */
- herr_t ret; /* Generic return value */
+ herr_t ret; /* Generic return value */
int mpi_size, mpi_rank;
MPI_Comm comm = MPI_COMM_WORLD;
@@ -2332,7 +2340,7 @@ extend_readAll(void)
filename = GetTestParameters();
if(VERBOSE_MED)
- printf("Extend independent read test on file %s\n", filename);
+ HDprintf("Extend independent read test on file %s\n", filename);
/* set up MPI parameters */
MPI_Comm_size(MPI_COMM_WORLD,&mpi_size);
@@ -2404,8 +2412,8 @@ extend_readAll(void)
/* fill dataset with test data */
dataset_fill(start, block, data_origin1);
if(VERBOSE_MED){
- MESG("data_array created");
- dataset_print(start, block, data_array1);
+ MESG("data_array created");
+ dataset_print(start, block, data_array1);
}
/* set up the collective transfer properties list */
@@ -2421,7 +2429,7 @@ extend_readAll(void)
/* read data collectively */
ret = H5Dread(dataset1, H5T_NATIVE_INT, mem_dataspace, file_dataspace,
- xfer_plist, data_array1);
+ xfer_plist, data_array1);
VRFY((ret >= 0), "H5Dread succeeded");
/* verify the read data with original expected data */
@@ -2451,8 +2459,8 @@ extend_readAll(void)
/* fill dataset with test data */
dataset_fill(start, block, data_origin1);
if(VERBOSE_MED){
- MESG("data_array created");
- dataset_print(start, block, data_array1);
+ MESG("data_array created");
+ dataset_print(start, block, data_array1);
}
/* set up the collective transfer properties list */
@@ -2468,7 +2476,7 @@ extend_readAll(void)
/* read data collectively */
ret = H5Dread(dataset2, H5T_NATIVE_INT, mem_dataspace, file_dataspace,
- xfer_plist, data_array1);
+ xfer_plist, data_array1);
VRFY((ret >= 0), "H5Dread succeeded");
/* verify the read data with original expected data */
@@ -2505,27 +2513,27 @@ void
compress_readAll(void)
{
hid_t fid; /* HDF5 file ID */
- hid_t acc_tpl; /* File access templates */
+ hid_t acc_tpl; /* File access templates */
hid_t dcpl; /* Dataset creation property list */
- hid_t xfer_plist; /* Dataset transfer properties list */
- hid_t dataspace; /* Dataspace ID */
- hid_t dataset; /* Dataset ID */
+ hid_t xfer_plist; /* Dataset transfer properties list */
+ hid_t dataspace; /* Dataspace ID */
+ hid_t dataset; /* Dataset ID */
int rank=1; /* Dataspace rank */
hsize_t dim=dim0; /* Dataspace dimensions */
unsigned u; /* Local index variable */
unsigned chunk_opts; /* Chunk options */
unsigned disable_partial_chunk_filters; /* Whether filters are disabled on partial chunks */
- DATATYPE *data_read = NULL; /* data buffer */
+ DATATYPE *data_read = NULL; /* data buffer */
DATATYPE *data_orig = NULL; /* expected data buffer */
const char *filename;
MPI_Comm comm = MPI_COMM_WORLD;
MPI_Info info = MPI_INFO_NULL;
int mpi_size, mpi_rank;
- herr_t ret; /* Generic return value */
+ herr_t ret; /* Generic return value */
filename = GetTestParameters();
if(VERBOSE_MED)
- printf("Collective chunked dataset read test on file %s\n", filename);
+ HDprintf("Collective chunked dataset read test on file %s\n", filename);
/* Retrieve MPI parameters */
MPI_Comm_size(comm,&mpi_size);
@@ -2646,7 +2654,7 @@ compress_readAll(void)
/* Verify data read */
for(u=0; u<dim; u++)
if(data_orig[u]!=data_read[u]) {
- printf("Line #%d: written!=retrieved: data_orig[%u]=%d, data_read[%u]=%d\n",__LINE__,
+ HDprintf("Line #%d: written!=retrieved: data_orig[%u]=%d, data_read[%u]=%d\n",__LINE__,
(unsigned)u,data_orig[u],(unsigned)u,data_read[u]);
nerrors++;
}
@@ -2687,26 +2695,26 @@ void
none_selection_chunk(void)
{
hid_t fid; /* HDF5 file ID */
- hid_t acc_tpl; /* File access templates */
- hid_t xfer_plist; /* Dataset transfer properties list */
- hid_t sid; /* Dataspace ID */
- hid_t file_dataspace; /* File dataspace ID */
- hid_t mem_dataspace; /* memory dataspace ID */
- hid_t dataset1, dataset2; /* Dataset ID */
+ hid_t acc_tpl; /* File access templates */
+ hid_t xfer_plist; /* Dataset transfer properties list */
+ hid_t sid; /* Dataspace ID */
+ hid_t file_dataspace; /* File dataspace ID */
+ hid_t mem_dataspace; /* memory dataspace ID */
+ hid_t dataset1, dataset2; /* Dataset ID */
const char *filename;
- hsize_t dims[RANK]; /* dataset dim sizes */
- DATATYPE *data_origin = NULL; /* data buffer */
- DATATYPE *data_array = NULL; /* data buffer */
- hsize_t chunk_dims[RANK]; /* chunk sizes */
- hid_t dataset_pl; /* dataset create prop. list */
-
- 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 */
- hsize_t mstart[RANK]; /* for data buffer in memory */
-
- herr_t ret; /* Generic return value */
+ hsize_t dims[RANK]; /* dataset dim sizes */
+ DATATYPE *data_origin = NULL; /* data buffer */
+ DATATYPE *data_array = NULL; /* data buffer */
+ hsize_t chunk_dims[RANK]; /* chunk sizes */
+ hid_t dataset_pl; /* dataset create prop. list */
+
+ 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 */
+ hsize_t mstart[RANK]; /* for data buffer in memory */
+
+ herr_t ret; /* Generic return value */
int mpi_size, mpi_rank;
MPI_Comm comm = MPI_COMM_WORLD;
@@ -2714,7 +2722,7 @@ none_selection_chunk(void)
filename = GetTestParameters();
if(VERBOSE_MED)
- printf("Extend independent write test on file %s\n", filename);
+ HDprintf("Extend independent write test on file %s\n", filename);
/* set up MPI parameters */
MPI_Comm_size(MPI_COMM_WORLD,&mpi_size);
@@ -2745,7 +2753,7 @@ none_selection_chunk(void)
/* set up dataset storage chunk sizes and creation property list */
if(VERBOSE_MED)
- printf("chunks[]=%lu,%lu\n", (unsigned long)chunk_dims[0], (unsigned long)chunk_dims[1]);
+ HDprintf("chunks[]=%lu,%lu\n", (unsigned long)chunk_dims[0], (unsigned long)chunk_dims[1]);
dataset_pl = H5Pcreate(H5P_DATASET_CREATE);
VRFY((dataset_pl >= 0), "H5Pcreate succeeded");
ret = H5Pset_chunk(dataset_pl, RANK, chunk_dims);
@@ -2789,8 +2797,8 @@ none_selection_chunk(void)
dataset_fill(mstart, block, data_origin);
MESG("data_array initialized");
if(VERBOSE_MED){
- MESG("data_array created");
- dataset_print(mstart, block, data_origin);
+ MESG("data_array created");
+ dataset_print(mstart, block, data_origin);
}
}
@@ -2824,12 +2832,12 @@ none_selection_chunk(void)
/* write data collectively */
ret = H5Dwrite(dataset1, H5T_NATIVE_INT, mem_dataspace, file_dataspace,
- xfer_plist, data_origin);
+ xfer_plist, data_origin);
VRFY((ret >= 0), "H5Dwrite succeeded");
/* read data independently */
ret = H5Dread(dataset1, H5T_NATIVE_INT, mem_dataspace, file_dataspace,
- H5P_DEFAULT, data_array);
+ H5P_DEFAULT, data_array);
VRFY((ret >= 0), "");
/* verify the read data with original expected data */
@@ -2846,12 +2854,12 @@ none_selection_chunk(void)
/* write data collectively */
ret = H5Dwrite(dataset2, H5T_NATIVE_INT, mem_dataspace, file_dataspace,
- xfer_plist, data_origin);
+ xfer_plist, data_origin);
VRFY((ret >= 0), "H5Dwrite succeeded");
/* read data independently */
ret = H5Dread(dataset2, H5T_NATIVE_INT, mem_dataspace, file_dataspace,
- H5P_DEFAULT, data_array);
+ H5P_DEFAULT, data_array);
VRFY((ret >= 0), "");
/* verify the read data with original expected data */
@@ -2883,20 +2891,20 @@ none_selection_chunk(void)
if(data_array) HDfree(data_array);
}
-
+
/* Function: test_actual_io_mode
*
- * Purpose: tests one specific case of collective I/O and checks that the
+ * Purpose: tests one specific case of collective I/O and checks that the
* actual_chunk_opt_mode property and the actual_io_mode
* properties in the DXPL have the correct values.
*
* Input: selection_mode: changes the way processes select data from the space, as well
* as some dxpl flags to get collective I/O to break in different ways.
- *
+ *
* The relevant I/O function and expected response for each mode:
* TEST_ACTUAL_IO_MULTI_CHUNK_IND:
* H5D_mpi_chunk_collective_io, each process reports independent I/O
- *
+ *
* TEST_ACTUAL_IO_MULTI_CHUNK_COL:
* H5D_mpi_chunk_collective_io, each process reports collective I/O
*
@@ -2908,7 +2916,7 @@ none_selection_chunk(void)
* collective, the rest report independent I/O
*
* TEST_ACTUAL_IO_DIRECT_MULTI_CHUNK_IND:
- * Same test TEST_ACTUAL_IO_MULTI_CHUNK_IND.
+ * Same test TEST_ACTUAL_IO_MULTI_CHUNK_IND.
* Set directly go to multi-chunk-io without num threshold calc.
* TEST_ACTUAL_IO_DIRECT_MULTI_CHUNK_COL:
* Same test TEST_ACTUAL_IO_MULTI_CHUNK_COL.
@@ -2933,20 +2941,20 @@ none_selection_chunk(void)
*
* Note: DIRECT_MULTI_CHUNK_MIX and DIRECT_MULTI_CHUNK_MIX_DISAGREE
* is not needed as they are covered by DIRECT_CHUNK_MIX and
- * MULTI_CHUNK_MIX_DISAGREE cases. _DIRECT_ cases are only for testing
+ * MULTI_CHUNK_MIX_DISAGREE cases. _DIRECT_ cases are only for testing
* path way to multi-chunk-io by H5FD_MPIO_CHUNK_MULTI_IO insted of num-threshold.
*
* Modification:
- * - Refctore to remove multi-chunk-without-opimization test and update for
- * testing direct to multi-chunk-io
+ * - Refctore to remove multi-chunk-without-opimization test and update for
+ * testing direct to multi-chunk-io
* Programmer: Jonathan Kim
* Date: 2012-10-10
*
- *
+ *
* Programmer: Jacob Gruber
* Date: 2011-04-06
*/
-static void
+static void
test_actual_io_mode(int selection_mode) {
H5D_mpio_actual_chunk_opt_mode_t actual_chunk_opt_mode_write = -1;
H5D_mpio_actual_chunk_opt_mode_t actual_chunk_opt_mode_read = -1;
@@ -2960,7 +2968,7 @@ test_actual_io_mode(int selection_mode) {
hbool_t multi_chunk_io;
hbool_t is_chunked;
hbool_t is_collective;
- int mpi_size = -1;
+ int mpi_size = -1;
int mpi_rank = -1;
int length;
int * buffer;
@@ -2985,12 +2993,12 @@ test_actual_io_mode(int selection_mode) {
hsize_t block[RANK];
char message[256];
herr_t ret;
-
+
/* Set up some flags to make some future if statements slightly more readable */
direct_multi_chunk_io = (
selection_mode == TEST_ACTUAL_IO_DIRECT_MULTI_CHUNK_IND ||
selection_mode == TEST_ACTUAL_IO_DIRECT_MULTI_CHUNK_COL );
-
+
/* Note: RESET performs the same tests as MULTI_CHUNK_MIX_DISAGREE and then
* tests independent I/O
*/
@@ -3000,11 +3008,11 @@ test_actual_io_mode(int selection_mode) {
selection_mode == TEST_ACTUAL_IO_MULTI_CHUNK_MIX ||
selection_mode == TEST_ACTUAL_IO_MULTI_CHUNK_MIX_DISAGREE ||
selection_mode == TEST_ACTUAL_IO_RESET );
-
+
is_chunked = (
selection_mode != TEST_ACTUAL_IO_CONTIGUOUS &&
selection_mode != TEST_ACTUAL_IO_NO_COLLECTIVE);
-
+
is_collective = selection_mode != TEST_ACTUAL_IO_NO_COLLECTIVE;
/* Set up MPI parameters */
@@ -3012,7 +3020,7 @@ test_actual_io_mode(int selection_mode) {
MPI_Comm_rank(MPI_COMM_WORLD, &mpi_rank);
MPI_Barrier(MPI_COMM_WORLD);
-
+
HDassert(mpi_size >= 1);
mpi_comm = MPI_COMM_WORLD;
@@ -3029,7 +3037,7 @@ test_actual_io_mode(int selection_mode) {
fid = H5Fcreate(filename, H5F_ACC_TRUNC, H5P_DEFAULT, fapl);
VRFY((fid >= 0), "H5Fcreate succeeded");
- /* Create the basic Space */
+ /* Create the basic Space */
dims[0] = dim0;
dims[1] = dim1;
sid = H5Screate_simple (RANK, dims, NULL);
@@ -3057,10 +3065,10 @@ test_actual_io_mode(int selection_mode) {
file_space = H5Dget_space(dataset);
VRFY((file_space >= 0), "H5Dget_space succeeded");
- /* Choose a selection method based on the type of I/O we want to occur,
+ /* Choose a selection method based on the type of I/O we want to occur,
* and also set up some selection-dependeent test info. */
switch(selection_mode) {
-
+
/* Independent I/O with optimization */
case TEST_ACTUAL_IO_MULTI_CHUNK_IND:
case TEST_ACTUAL_IO_DIRECT_MULTI_CHUNK_IND:
@@ -3069,7 +3077,7 @@ test_actual_io_mode(int selection_mode) {
* independent.
*/
slab_set(mpi_rank, mpi_size, start, count, stride, block, BYROW);
-
+
test_name = "Multi Chunk - Independent";
actual_chunk_opt_mode_expected = H5D_MPIO_MULTI_CHUNK;
actual_io_mode_expected = H5D_MPIO_CHUNK_INDEPENDENT;
@@ -3083,7 +3091,7 @@ test_actual_io_mode(int selection_mode) {
* selections to each chunk, the operation is purely collective.
*/
slab_set(mpi_rank, mpi_size, start, count, stride, block, BYCOL);
-
+
test_name = "Multi Chunk - Collective";
actual_chunk_opt_mode_expected = H5D_MPIO_MULTI_CHUNK;
if(mpi_size > 1)
@@ -3091,7 +3099,7 @@ test_actual_io_mode(int selection_mode) {
else
actual_io_mode_expected = H5D_MPIO_CHUNK_INDEPENDENT;
break;
-
+
/* Mixed I/O with optimization */
case TEST_ACTUAL_IO_MULTI_CHUNK_MIX:
/* A chunk will be assigned collective I/O only if it is selected by each
@@ -3102,7 +3110,7 @@ test_actual_io_mode(int selection_mode) {
* assigned independent I/O. Each process will access one chunk collectively
* and at least one chunk independently, reporting mixed I/O.
*/
-
+
if(mpi_rank == 0) {
/* Select the first column */
slab_set(mpi_rank, mpi_size, start, count, stride, block, BYCOL);
@@ -3117,7 +3125,7 @@ test_actual_io_mode(int selection_mode) {
start[0] = 0;
start[1] = mpi_rank*block[1];
}
-
+
test_name = "Multi Chunk - Mixed";
actual_chunk_opt_mode_expected = H5D_MPIO_MULTI_CHUNK;
actual_io_mode_expected = H5D_MPIO_CHUNK_MIXED;
@@ -3127,7 +3135,7 @@ test_actual_io_mode(int selection_mode) {
* performed. To acheive this, we have RESET perform collective I/O (which would change
* the values from the defaults) followed by independent I/O (which should report the
* default values). RESET doesn't need to have a unique selection, so we reuse
- * MULTI_CHUMK_MIX_DISAGREE, which was chosen because it is a complex case that works
+ * MULTI_CHUMK_MIX_DISAGREE, which was chosen because it is a complex case that works
* on all builds. The independent section of RESET can be found at the end of this function.
*/
case TEST_ACTUAL_IO_RESET:
@@ -3136,7 +3144,7 @@ test_actual_io_mode(int selection_mode) {
case TEST_ACTUAL_IO_MULTI_CHUNK_MIX_DISAGREE:
/* A chunk will be assigned collective I/O only if it is selected by each
* process. To get mixed I/O with disagreement, assign process n to the
- * first chunk and the nth chunk. The first chunk, selected by all, is
+ * first chunk and the nth chunk. The first chunk, selected by all, is
* assgigned collective I/O, while each other process gets independent I/O.
* Since the root process with only access the first chunk, it will report
* collective I/O. The subsequent processes will access the first chunk
@@ -3158,13 +3166,13 @@ test_actual_io_mode(int selection_mode) {
start[0] = 0;
start[1] = mpi_rank*block[1];
}
-
+
/* If the testname was not already set by the RESET case */
if (selection_mode == TEST_ACTUAL_IO_RESET)
test_name = "RESET";
else
test_name = "Multi Chunk - Mixed (Disagreement)";
-
+
actual_chunk_opt_mode_expected = H5D_MPIO_MULTI_CHUNK;
if(mpi_size > 1) {
if(mpi_rank == 0)
@@ -3174,14 +3182,14 @@ test_actual_io_mode(int selection_mode) {
}
else
actual_io_mode_expected = H5D_MPIO_CHUNK_INDEPENDENT;
-
- break;
+
+ break;
/* Linked Chunk I/O */
- case TEST_ACTUAL_IO_LINK_CHUNK:
+ case TEST_ACTUAL_IO_LINK_CHUNK:
/* Nothing special; link chunk I/O is forced in the dxpl settings. */
slab_set(mpi_rank, mpi_size, start, count, stride, block, BYROW);
-
+
test_name = "Link Chunk";
actual_chunk_opt_mode_expected = H5D_MPIO_LINK_CHUNK;
actual_io_mode_expected = H5D_MPIO_CHUNK_COLLECTIVE;
@@ -3192,7 +3200,7 @@ test_actual_io_mode(int selection_mode) {
/* A non overlapping, regular selection in a contiguous dataset leads to
* collective I/O */
slab_set(mpi_rank, mpi_size, start, count, stride, block, BYROW);
-
+
test_name = "Contiguous";
actual_chunk_opt_mode_expected = H5D_MPIO_NO_CHUNK_OPTIMIZATION;
actual_io_mode_expected = H5D_MPIO_CONTIGUOUS_COLLECTIVE;
@@ -3200,7 +3208,7 @@ test_actual_io_mode(int selection_mode) {
case TEST_ACTUAL_IO_NO_COLLECTIVE:
slab_set(mpi_rank, mpi_size, start, count, stride, block, BYROW);
-
+
test_name = "Independent";
actual_chunk_opt_mode_expected = H5D_MPIO_NO_CHUNK_OPTIMIZATION;
actual_io_mode_expected = H5D_MPIO_NO_COLLECTIVE;
@@ -3215,13 +3223,13 @@ test_actual_io_mode(int selection_mode) {
ret = H5Sselect_hyperslab(file_space, H5S_SELECT_SET, start, stride, count, block);
VRFY((ret >= 0), "H5Sset_hyperslab succeeded");
-
+
/* Create a memory dataspace mirroring the dataset and select the same hyperslab
- * as in the file space.
+ * as in the file space.
*/
mem_space = H5Screate_simple (RANK, dims, NULL);
VRFY((mem_space >= 0), "mem_space created");
-
+
ret = H5Sselect_hyperslab(mem_space, H5S_SELECT_SET, start, stride, count, block);
VRFY((ret >= 0), "H5Sset_hyperslab succeeded");
@@ -3230,22 +3238,22 @@ test_actual_io_mode(int selection_mode) {
/* Allocate and initialize the buffer */
buffer = (int *)HDmalloc(sizeof(int) * length);
- VRFY((buffer != NULL), "HDmalloc of buffer succeeded");
- for(i = 0; i < length; i++)
+ VRFY((buffer != NULL), "HDmalloc of buffer succeeded");
+ for(i = 0; i < length; i++)
buffer[i] = i;
/* Set up the dxpl for the write */
dxpl_write = H5Pcreate(H5P_DATASET_XFER);
VRFY((dxpl_write >= 0), "H5Pcreate(H5P_DATASET_XFER) succeeded");
-
+
/* Set collective I/O properties in the dxpl. */
if(is_collective) {
/* Request collective I/O */
ret = H5Pset_dxpl_mpio(dxpl_write, H5FD_MPIO_COLLECTIVE);
VRFY((ret >= 0), "H5Pset_dxpl_mpio succeeded");
-
- /* Set the threshold number of processes per chunk to twice mpi_size.
- * This will prevent the threshold from ever being met, thus forcing
+
+ /* Set the threshold number of processes per chunk to twice mpi_size.
+ * This will prevent the threshold from ever being met, thus forcing
* multi chunk io instead of link chunk io.
* This is via deault.
*/
@@ -3283,12 +3291,12 @@ test_actual_io_mode(int selection_mode) {
ret = H5Pget_mpio_actual_chunk_opt_mode(dxpl_write, &actual_chunk_opt_mode_write);
VRFY((ret >= 0), "retriving actual chunk opt mode succeeded" );
-
+
/* Read */
ret = H5Dread(dataset, data_type, mem_space, file_space, dxpl_read, buffer);
if(ret < 0) H5Eprint2(H5E_DEFAULT, stdout);
VRFY((ret >= 0), "H5Dread() dataset multichunk read succeeded");
-
+
/* Retreive Actual io values */
ret = H5Pget_mpio_actual_io_mode(dxpl_read, &actual_io_mode_read);
VRFY((ret >= 0), "retriving actual io mode succeeded" );
@@ -3304,9 +3312,9 @@ test_actual_io_mode(int selection_mode) {
/* Test values */
if(actual_chunk_opt_mode_expected != (H5D_mpio_actual_chunk_opt_mode_t) -1 && actual_io_mode_expected != (H5D_mpio_actual_io_mode_t) -1) {
- sprintf(message, "Actual Chunk Opt Mode has the correct value for %s.\n",test_name);
+ HDsprintf(message, "Actual Chunk Opt Mode has the correct value for %s.\n",test_name);
VRFY((actual_chunk_opt_mode_write == actual_chunk_opt_mode_expected), message);
- sprintf(message, "Actual IO Mode has the correct value for %s.\n",test_name);
+ HDsprintf(message, "Actual IO Mode has the correct value for %s.\n",test_name);
VRFY((actual_io_mode_write == actual_io_mode_expected), message);
} else {
HDfprintf(stderr, "%s %d -> (%d,%d)\n", test_name, mpi_rank,
@@ -3338,7 +3346,7 @@ test_actual_io_mode(int selection_mode) {
"actual_chunk_opt_mode has correct value for reset write (independent)");
VRFY(actual_io_mode_write == H5D_MPIO_NO_COLLECTIVE,
"actual_io_mode has correct value for reset write (independent)");
-
+
/* Read */
ret = H5Dread(dataset, data_type, H5S_ALL, H5S_ALL, dxpl_read, buffer);
VRFY((ret >= 0), "H5Dwrite() dataset multichunk write succeeded");
@@ -3348,7 +3356,7 @@ test_actual_io_mode(int selection_mode) {
VRFY( (ret >= 0), "retriving actual io mode succeeded" );
ret = H5Pget_mpio_actual_chunk_opt_mode(dxpl_read, &actual_chunk_opt_mode_read);
VRFY( (ret >= 0), "retriving actual chunk opt mode succeeded" );
-
+
VRFY(actual_chunk_opt_mode_read == H5D_MPIO_NO_CHUNK_OPTIMIZATION,
"actual_chunk_opt_mode has correct value for reset read (independent)");
VRFY(actual_io_mode_read == H5D_MPIO_NO_COLLECTIVE,
@@ -3370,10 +3378,10 @@ test_actual_io_mode(int selection_mode) {
return;
}
-
+
/* Function: actual_io_mode_tests
*
- * Purpose: Tests all possible cases of the actual_io_mode property.
+ * Purpose: Tests all possible cases of the actual_io_mode property.
*
* Programmer: Jacob Gruber
* Date: 2011-04-06
@@ -3384,10 +3392,10 @@ actual_io_mode_tests(void) {
int mpi_rank = -1;
MPI_Comm_size(MPI_COMM_WORLD, &mpi_size);
MPI_Comm_size(MPI_COMM_WORLD, &mpi_rank);
-
+
test_actual_io_mode(TEST_ACTUAL_IO_NO_COLLECTIVE);
-
- /*
+
+ /*
* Test multi-chunk-io via proc_num threshold
*/
test_actual_io_mode(TEST_ACTUAL_IO_MULTI_CHUNK_IND);
@@ -3398,10 +3406,10 @@ actual_io_mode_tests(void) {
test_actual_io_mode(TEST_ACTUAL_IO_MULTI_CHUNK_MIX);
else
HDfprintf(stdout, "Multi Chunk Mixed test requires 3 proceses minimum\n");
-
+
test_actual_io_mode(TEST_ACTUAL_IO_MULTI_CHUNK_MIX_DISAGREE);
- /*
+ /*
* Test multi-chunk-io via setting direct property
*/
test_actual_io_mode(TEST_ACTUAL_IO_DIRECT_MULTI_CHUNK_IND);
@@ -3409,31 +3417,31 @@ actual_io_mode_tests(void) {
test_actual_io_mode(TEST_ACTUAL_IO_LINK_CHUNK);
test_actual_io_mode(TEST_ACTUAL_IO_CONTIGUOUS);
-
+
test_actual_io_mode(TEST_ACTUAL_IO_RESET);
return;
}
-/*
+/*
* Function: test_no_collective_cause_mode
*
- * Purpose:
- * tests cases for broken collective I/O and checks that the
+ * Purpose:
+ * tests cases for broken collective I/O and checks that the
* H5Pget_mpio_no_collective_cause properties in the DXPL have the correct values.
*
- * Input:
+ * Input:
* selection_mode: various mode to cause broken collective I/O
* Note: Originally, each TEST case is supposed to be used alone.
* After some discussion, this is updated to take multiple TEST cases
- * with '|'. However there is no error check for any of combined
+ * with '|'. However there is no error check for any of combined
* test cases, so a tester is responsible to understand and feed
* proper combination of TESTs if needed.
*
- *
+ *
* TEST_COLLECTIVE:
* Test for regular collective I/O without cause of breaking.
* Just to test normal behavior.
- *
+ *
* TEST_SET_INDEPENDENT:
* Test for Independent I/O as the cause of breaking collective I/O.
*
@@ -3445,7 +3453,7 @@ actual_io_mode_tests(void) {
*
* TEST_NOT_SIMPLE_OR_SCALAR_DATASPACES:
* Test for NULL dataspace as the cause of breaking collective I/O.
- *
+ *
* TEST_NOT_CONTIGUOUS_OR_CHUNKED_DATASET_COMPACT:
* Test for Compact layout as the cause of breaking collective I/O.
*
@@ -3454,17 +3462,17 @@ actual_io_mode_tests(void) {
*
* TEST_FILTERS:
* Test for using filter (checksum) as the cause of breaking collective I/O.
- * Note: TEST_FILTERS mode will not work until H5Dcreate and H5write is supported for mpio and filter feature. Use test_no_collective_cause_mode_filter() function instead.
+ * Note: TEST_FILTERS mode will not work until H5Dcreate and H5write is supported for mpio and filter feature. Use test_no_collective_cause_mode_filter() function instead.
+ *
*
- *
* Programmer: Jonathan Kim
* Date: Aug, 2012
*/
#define DSET_NOCOLCAUSE "nocolcause"
#define NELM 2
#define FILE_EXTERNAL "nocolcause_extern.data"
-static void
-test_no_collective_cause_mode(int selection_mode)
+static void
+test_no_collective_cause_mode(int selection_mode)
{
uint32_t no_collective_cause_local_write = 0;
uint32_t no_collective_cause_local_read = 0;
@@ -3478,7 +3486,7 @@ test_no_collective_cause_mode(int selection_mode)
const char * test_name;
hbool_t is_chunked=1;
hbool_t is_independent=0;
- int mpi_size = -1;
+ int mpi_size = -1;
int mpi_rank = -1;
int length;
int * buffer;
@@ -3502,7 +3510,7 @@ test_no_collective_cause_mode(int selection_mode)
H5Z_filter_t filter_info;
#endif /* LATER */
/* set to global value as default */
- int l_facc_type = facc_type;
+ int l_facc_type = facc_type;
char message[256];
/* Set up MPI parameters */
@@ -3564,7 +3572,7 @@ test_no_collective_cause_mode(int selection_mode)
sid = H5Screate_simple (RANK, dims, NULL);
VRFY((sid >= 0), "H5Screate_simple succeeded");
}
-
+
filename = (const char *)GetTestParameters();
HDassert(filename != NULL);
@@ -3589,20 +3597,19 @@ test_no_collective_cause_mode(int selection_mode)
/* Create the dataset */
- dataset = H5Dcreate2(fid, "nocolcause", data_type, sid, H5P_DEFAULT,
- dcpl, H5P_DEFAULT);
+ dataset = H5Dcreate2(fid, "nocolcause", data_type, sid, H5P_DEFAULT, dcpl, H5P_DEFAULT);
VRFY((dataset >= 0), "H5Dcreate2() dataset succeeded");
- /*
- * Set expected causes and some tweaks based on the type of test
+ /*
+ * Set expected causes and some tweaks based on the type of test
*/
if (selection_mode & TEST_DATATYPE_CONVERSION) {
test_name = "Broken Collective I/O - Datatype Conversion";
no_collective_cause_local_expected |= H5D_MPIO_DATATYPE_CONVERSION;
no_collective_cause_global_expected |= H5D_MPIO_DATATYPE_CONVERSION;
/* set different sign to trigger type conversion */
- data_type = H5T_NATIVE_UINT;
+ data_type = H5T_NATIVE_UINT;
}
if (selection_mode & TEST_DATA_TRANSFORMS) {
@@ -3667,14 +3674,14 @@ test_no_collective_cause_mode(int selection_mode)
/* Allocate and initialize the buffer */
buffer = (int *)HDmalloc(sizeof(int) * length);
- VRFY((buffer != NULL), "HDmalloc of buffer succeeded");
- for(i = 0; i < length; i++)
+ VRFY((buffer != NULL), "HDmalloc of buffer succeeded");
+ for(i = 0; i < length; i++)
buffer[i] = i;
/* Set up the dxpl for the write */
dxpl_write = H5Pcreate(H5P_DATASET_XFER);
VRFY((dxpl_write >= 0), "H5Pcreate(H5P_DATASET_XFER) succeeded");
-
+
if(is_independent) {
/* Set Independent I/O */
ret = H5Pset_dxpl_mpio(dxpl_write, H5FD_MPIO_INDEPENDENT);
@@ -3684,17 +3691,17 @@ test_no_collective_cause_mode(int selection_mode)
/* Set Collective I/O */
ret = H5Pset_dxpl_mpio(dxpl_write, H5FD_MPIO_COLLECTIVE);
VRFY((ret >= 0), "H5Pset_dxpl_mpio succeeded");
-
+
}
if (selection_mode & TEST_DATA_TRANSFORMS) {
- ret = H5Pset_data_transform (dxpl_write, "x+1");
+ ret = H5Pset_data_transform (dxpl_write, "x+1");
VRFY((ret >= 0), "H5Pset_data_transform succeeded");
}
/*---------------------
* Test Write access
- *---------------------*/
+ *---------------------*/
/* Write */
ret = H5Dwrite(dataset, data_type, mem_space, file_space, dxpl_write, buffer);
@@ -3709,7 +3716,7 @@ test_no_collective_cause_mode(int selection_mode)
/*---------------------
* Test Read access
- *---------------------*/
+ *---------------------*/
/* Make a copy of the dxpl to test the read operation */
dxpl_read = H5Pcopy(dxpl_write);
@@ -3720,7 +3727,7 @@ test_no_collective_cause_mode(int selection_mode)
if(ret < 0) H5Eprint2(H5E_DEFAULT, stdout);
VRFY((ret >= 0), "H5Dread() dataset multichunk read succeeded");
-
+
/* Get the cause of broken collective I/O */
ret = H5Pget_mpio_no_collective_cause (dxpl_read, &no_collective_cause_local_read, &no_collective_cause_global_read);
VRFY((ret >= 0), "retriving no collective cause succeeded" );
@@ -3730,13 +3737,13 @@ test_no_collective_cause_mode(int selection_mode)
"reading and writing are the same for local cause of Broken Collective I/O");
VRFY((no_collective_cause_global_read == no_collective_cause_global_write),
"reading and writing are the same for global cause of Broken Collective I/O");
-
+
/* Test values */
- memset (message, 0, sizeof (message));
- sprintf(message, "Local cause of Broken Collective I/O has the correct value for %s.\n",test_name);
+ HDmemset (message, 0, sizeof (message));
+ HDsprintf(message, "Local cause of Broken Collective I/O has the correct value for %s.\n",test_name);
VRFY((no_collective_cause_local_write == no_collective_cause_local_expected), message);
- memset (message, 0, sizeof (message));
- sprintf(message, "Global cause of Broken Collective I/O has the correct value for %s.\n",test_name);
+ HDmemset (message, 0, sizeof (message));
+ HDsprintf(message, "Global cause of Broken Collective I/O has the correct value for %s.\n",test_name);
VRFY((no_collective_cause_global_write == no_collective_cause_global_expected), message);
/* Release some resources */
@@ -3768,28 +3775,28 @@ test_no_collective_cause_mode(int selection_mode)
}
-/*
+/*
* Function: test_no_collective_cause_mode_filter
*
- * Purpose:
- * Test specific for using filter as a caus of broken collective I/O and
+ * Purpose:
+ * Test specific for using filter as a caus of broken collective I/O and
* checks that the H5Pget_mpio_no_collective_cause properties in the DXPL
* have the correct values.
*
- * NOTE:
- * This is a temporary function.
+ * NOTE:
+ * This is a temporary function.
* test_no_collective_cause_mode(TEST_FILTERS) will replace this when
* H5Dcreate and H5write support for mpio and filter feature.
*
- * Input:
+ * Input:
* TEST_FILTERS_READ:
* Test for using filter (checksum) as the cause of breaking collective I/O.
- *
+ *
* Programmer: Jonathan Kim
* Date: Aug, 2012
*/
-static void
-test_no_collective_cause_mode_filter(int selection_mode)
+static void
+test_no_collective_cause_mode_filter(int selection_mode)
{
uint32_t no_collective_cause_local_read = 0;
uint32_t no_collective_cause_local_expected = 0;
@@ -3799,7 +3806,7 @@ test_no_collective_cause_mode_filter(int selection_mode)
const char * filename;
const char * test_name;
hbool_t is_chunked=1;
- int mpi_size = -1;
+ int mpi_size = -1;
int mpi_rank = -1;
int length;
int * buffer;
@@ -3829,7 +3836,7 @@ test_no_collective_cause_mode_filter(int selection_mode)
MPI_Comm_rank(MPI_COMM_WORLD, &mpi_rank);
MPI_Barrier(MPI_COMM_WORLD);
-
+
HDassert(mpi_size >= 1);
mpi_comm = MPI_COMM_WORLD;
@@ -3855,12 +3862,12 @@ test_no_collective_cause_mode_filter(int selection_mode)
VRFY(0, "Unexpected mode, only test for TEST_FILTERS_READ.");
}
- /* Create the basic Space */
+ /* Create the basic Space */
dims[0] = dim0;
dims[1] = dim1;
sid = H5Screate_simple (RANK, dims, NULL);
VRFY((sid >= 0), "H5Screate_simple succeeded");
-
+
filename = (const char *)GetTestParameters();
HDassert(filename != NULL);
@@ -3883,8 +3890,7 @@ test_no_collective_cause_mode_filter(int selection_mode)
/* Create the dataset */
- dataset = H5Dcreate2(fid, DSET_NOCOLCAUSE, data_type, sid, H5P_DEFAULT,
- dcpl, H5P_DEFAULT);
+ dataset = H5Dcreate2(fid, DSET_NOCOLCAUSE, data_type, sid, H5P_DEFAULT, dcpl, H5P_DEFAULT);
VRFY((dataset >= 0), "H5Dcreate2() dataset succeeded");
#ifdef LATER /* fletcher32 */
@@ -3907,16 +3913,16 @@ test_no_collective_cause_mode_filter(int selection_mode)
/* Allocate and initialize the buffer */
buffer = (int *)HDmalloc(sizeof(int) * length);
- VRFY((buffer != NULL), "HDmalloc of buffer succeeded");
- for(i = 0; i < length; i++)
+ VRFY((buffer != NULL), "HDmalloc of buffer succeeded");
+ for(i = 0; i < length; i++)
buffer[i] = i;
/* Set up the dxpl for the write */
dxpl = H5Pcreate(H5P_DATASET_XFER);
VRFY((dxpl >= 0), "H5Pcreate(H5P_DATASET_XFER) succeeded");
-
+
if (selection_mode == TEST_FILTERS_READ) {
- /* To test read in collective I/O mode , write in independent mode
+ /* To test read in collective I/O mode , write in independent mode
* because write fails with mpio + filter */
ret = H5Pset_dxpl_mpio(dxpl, H5FD_MPIO_INDEPENDENT);
VRFY((ret >= 0), "H5Pset_dxpl_mpio succeeded");
@@ -3926,7 +3932,7 @@ test_no_collective_cause_mode_filter(int selection_mode)
ret = H5Pset_dxpl_mpio(dxpl, H5FD_MPIO_COLLECTIVE);
VRFY((ret >= 0), "H5Pset_dxpl_mpio succeeded");
}
-
+
/* Write */
ret = H5Dwrite(dataset, data_type, mem_space, file_space, dxpl, buffer);
@@ -3967,17 +3973,17 @@ test_no_collective_cause_mode_filter(int selection_mode)
if(ret < 0) H5Eprint2(H5E_DEFAULT, stdout);
VRFY((ret >= 0), "H5Dread() dataset multichunk read succeeded");
-
+
/* Get the cause of broken collective I/O */
ret = H5Pget_mpio_no_collective_cause (dxpl, &no_collective_cause_local_read, &no_collective_cause_global_read);
VRFY((ret >= 0), "retriving no collective cause succeeded" );
/* Test values */
- memset (message, 0, sizeof (message));
- sprintf(message, "Local cause of Broken Collective I/O has the correct value for %s.\n",test_name);
+ HDmemset (message, 0, sizeof (message));
+ HDsprintf(message, "Local cause of Broken Collective I/O has the correct value for %s.\n",test_name);
VRFY((no_collective_cause_local_read == (uint32_t)no_collective_cause_local_expected), message);
- memset (message, 0, sizeof (message));
- sprintf(message, "Global cause of Broken Collective I/O has the correct value for %s.\n",test_name);
+ HDmemset (message, 0, sizeof (message));
+ HDsprintf(message, "Global cause of Broken Collective I/O has the correct value for %s.\n",test_name);
VRFY((no_collective_cause_global_read == (uint32_t)no_collective_cause_global_expected), message);
/* Release some resources */
@@ -4003,16 +4009,16 @@ test_no_collective_cause_mode_filter(int selection_mode)
/* Function: no_collective_cause_tests
*
- * Purpose: Tests cases for broken collective IO.
+ * Purpose: Tests cases for broken collective IO.
*
* Programmer: Jonathan Kim
* Date: Aug, 2012
*/
-void
-no_collective_cause_tests(void)
+void
+no_collective_cause_tests(void)
{
- /*
- * Test individual cause
+ /*
+ * Test individual cause
*/
test_no_collective_cause_mode (TEST_COLLECTIVE);
test_no_collective_cause_mode (TEST_SET_INDEPENDENT);
@@ -4022,15 +4028,15 @@ no_collective_cause_tests(void)
test_no_collective_cause_mode (TEST_NOT_CONTIGUOUS_OR_CHUNKED_DATASET_COMPACT);
test_no_collective_cause_mode (TEST_NOT_CONTIGUOUS_OR_CHUNKED_DATASET_EXTERNAL);
#ifdef LATER /* fletcher32 */
- /* TODO: use this instead of below TEST_FILTERS_READ when H5Dcreate and
+ /* TODO: use this instead of below TEST_FILTERS_READ when H5Dcreate and
* H5Dwrite is ready for mpio + filter feature.
*/
/* test_no_collective_cause_mode (TEST_FILTERS); */
test_no_collective_cause_mode_filter (TEST_FILTERS_READ);
-#endif /* LATER */
+#endif /* LATER */
- /*
- * Test combined causes
+ /*
+ * Test combined causes
*/
test_no_collective_cause_mode (TEST_NOT_CONTIGUOUS_OR_CHUNKED_DATASET_EXTERNAL | TEST_DATATYPE_CONVERSION);
test_no_collective_cause_mode (TEST_DATATYPE_CONVERSION | TEST_DATA_TRANSFORMS);
@@ -4054,22 +4060,22 @@ void
dataset_atomicity(void)
{
hid_t fid; /* HDF5 file ID */
- hid_t acc_tpl; /* File access templates */
- hid_t sid; /* Dataspace ID */
- hid_t dataset1; /* Dataset IDs */
- hsize_t dims[RANK]; /* dataset dim sizes */
- int *write_buf = NULL; /* data buffer */
- int *read_buf = NULL; /* data buffer */
+ hid_t acc_tpl; /* File access templates */
+ hid_t sid; /* Dataspace ID */
+ hid_t dataset1; /* Dataset IDs */
+ hsize_t dims[RANK]; /* dataset dim sizes */
+ int *write_buf = NULL; /* data buffer */
+ int *read_buf = NULL; /* data buffer */
int buf_size;
hid_t dataset2;
- hid_t file_dataspace; /* File dataspace ID */
- hid_t mem_dataspace; /* Memory dataspace ID */
+ hid_t file_dataspace; /* File dataspace ID */
+ hid_t mem_dataspace; /* Memory dataspace ID */
hsize_t start[RANK];
hsize_t stride[RANK];
hsize_t count[RANK];
hsize_t block[RANK];
const char *filename;
- herr_t ret; /* Generic return value */
+ herr_t ret; /* Generic return value */
int mpi_size, mpi_rank;
int i, j, k;
hbool_t atomicity = FALSE;
@@ -4079,11 +4085,11 @@ dataset_atomicity(void)
dim0 = 64; dim1 = 32;
filename = GetTestParameters();
if (facc_type != FACC_MPIO) {
- printf("Atomicity tests will not work without the MPIO VFD\n");
+ HDprintf("Atomicity tests will not work without the MPIO VFD\n");
return;
}
if(VERBOSE_MED)
- printf("atomic writes to file %s\n", filename);
+ HDprintf("atomic writes to file %s\n", filename);
/* set up MPI parameters */
MPI_Comm_size(MPI_COMM_WORLD,&mpi_size);
@@ -4134,7 +4140,7 @@ dataset_atomicity(void)
H5P_DEFAULT, write_buf);
VRFY((ret >= 0), "H5Dwrite dataset2 succeeded");
}
-
+
ret = H5Dclose(dataset1);
VRFY((ret >= 0), "H5Dclose succeeded");
ret = H5Dclose(dataset2);
@@ -4149,8 +4155,8 @@ dataset_atomicity(void)
/* make sure setting atomicity fails on a serial file ID */
/* file locking allows only one file open (serial) for writing */
if(MAINPROCESS){
- fid=H5Fopen(filename,H5F_ACC_RDWR,H5P_DEFAULT);
- VRFY((fid >= 0), "H5Fopen succeeed");
+ fid=H5Fopen(filename,H5F_ACC_RDWR,H5P_DEFAULT);
+ VRFY((fid >= 0), "H5Fopen succeeed");
}
/* should fail */
@@ -4158,8 +4164,8 @@ dataset_atomicity(void)
VRFY((ret == FAIL), "H5Fset_mpi_atomicity failed");
if(MAINPROCESS){
- ret = H5Fclose(fid);
- VRFY((ret >= 0), "H5Fclose succeeded");
+ ret = H5Fclose(fid);
+ VRFY((ret >= 0), "H5Fclose succeeded");
}
MPI_Barrier (comm);
@@ -4215,23 +4221,23 @@ dataset_atomicity(void)
if(VERBOSE_MED) {
i=0;j=0;k=0;
for (i=0 ; i<dim0 ; i++) {
- printf ("\n");
+ HDprintf ("\n");
for (j=0 ; j<dim1 ; j++)
- printf ("%d ", read_buf[k++]);
+ HDprintf ("%d ", read_buf[k++]);
}
}
/* The processes that read the dataset must either read all values
as 0 (read happened before process 0 wrote to dataset 1), or 5
(read happened after process 0 wrote to dataset 1) */
- if (0 != mpi_rank) {
+ if (0 != mpi_rank) {
int compare = read_buf[0];
- VRFY((compare == 0 || compare == 5),
+ VRFY((compare == 0 || compare == 5),
"Atomicity Test Failed Process %d: Value read should be 0 or 5\n");
for (i=1; i<buf_size; i++) {
if (read_buf[i] != compare) {
- printf("Atomicity Test Failed Process %d: read_buf[%d] is %d, should be %d\n", mpi_rank, i, read_buf[i], compare);
+ HDprintf("Atomicity Test Failed Process %d: read_buf[%d] is %d, should be %d\n", mpi_rank, i, read_buf[i], compare);
nerrors ++;
}
}
@@ -4313,17 +4319,17 @@ dataset_atomicity(void)
if (mpi_rank == 1) {
i=0;j=0;k=0;
for (i=0 ; i<dim0 ; i++) {
- printf ("\n");
+ HDprintf ("\n");
for (j=0 ; j<dim1 ; j++)
- printf ("%d ", read_buf[k++]);
+ HDprintf ("%d ", read_buf[k++]);
}
- printf ("\n");
+ HDprintf ("\n");
}
}
/* The processes that read the dataset must either read all values
as 5 (read happened after process 0 wrote to dataset 1) */
- if (0 != mpi_rank) {
+ if (0 != mpi_rank) {
int compare;
i=0;j=0;k=0;
@@ -4347,7 +4353,7 @@ dataset_atomicity(void)
continue;
}
else if (compare != read_buf[k]) {
- printf("Atomicity Test Failed Process %d: read_buf[%d] is %d, should be %d\n", mpi_rank, k, read_buf[k], compare);
+ HDprintf("Atomicity Test Failed Process %d: read_buf[%d] is %d, should be %d\n", mpi_rank, k, read_buf[k], compare);
nerrors++;
}
k ++;
@@ -4378,8 +4384,8 @@ dataset_atomicity(void)
* Programmer: Quincey Koziol
* Date: April, 2013
*/
-void
-test_dense_attr(void)
+void
+test_dense_attr(void)
{
int mpi_size, mpi_rank;
hid_t fpid, fid;
@@ -4417,7 +4423,7 @@ test_dense_attr(void)
status = H5Pclose(gpid);
VRFY((status >= 0), "H5Pclose succeeded");
- atFileSpace = H5Screate_simple(1, atDims, NULL);
+ atFileSpace = H5Screate_simple(1, atDims, NULL);
VRFY((atFileSpace > 0), "H5Screate_simple succeeded");
atid = H5Acreate2(gid, "bar", H5T_STD_U64LE, atFileSpace, H5P_DEFAULT, H5P_DEFAULT);
VRFY((atid > 0), "H5Acreate succeeded");
diff --git a/tools/lib/h5tools_utils.h b/tools/lib/h5tools_utils.h
index a31ba3a..4c2bf1e 100644
--- a/tools/lib/h5tools_utils.h
+++ b/tools/lib/h5tools_utils.h
@@ -157,7 +157,7 @@ typedef struct {
/* obtain link info from H5tools_get_symlink_info() */
typedef struct {
H5O_type_t trg_type; /* OUT: target type */
- char *trg_path; /* OUT: target obj path. This must be freed
+ char *trg_path; /* OUT: target obj path. This must be freed
* when used with H5tools_get_symlink_info() */
haddr_t objno; /* OUT: target object address */
unsigned long fileno; /* OUT: File number that target object is located in */
diff --git a/tools/src/h5diff/h5diff_common.c b/tools/src/h5diff/h5diff_common.c
index 8f09c81..0c1521e 100644
--- a/tools/src/h5diff/h5diff_common.c
+++ b/tools/src/h5diff/h5diff_common.c
@@ -350,7 +350,7 @@ check_n_input( const char *str )
unsigned i;
char c;
- for (i = 0; i < strlen(str); i++) {
+ for (i = 0; i < HDstrlen(str); i++) {
c = str[i];
if (i == 0) {
if (c < 49 || c > 57) /* ascii values between 1 and 9 */
@@ -387,7 +387,7 @@ check_p_input( const char *str )
the atof return value on a hexadecimal input is different
on some systems; we do a character check for this
*/
- if (strlen(str) > 2 && str[0] == '0' && str[1] == 'x')
+ if (HDstrlen(str) > 2 && str[0] == '0' && str[1] == 'x')
return -1;
x = atof(str);
@@ -421,7 +421,7 @@ check_d_input( const char *str )
the atof return value on a hexadecimal input is different
on some systems; we do a character check for this
*/
- if (strlen(str) > 2 && str[0] == '0' && str[1] == 'x')
+ if (HDstrlen(str) > 2 && str[0] == '0' && str[1] == 'x')
return -1;
x = atof(str);
diff --git a/tools/src/h5import/h5import.c b/tools/src/h5import/h5import.c
index 76e78af..3b64a0e 100644
--- a/tools/src/h5import/h5import.c
+++ b/tools/src/h5import/h5import.c
@@ -494,7 +494,7 @@ static int readIntegerData(FILE *strm, struct Input *in)
return (-1);
}
#ifdef H5DEBUGIMPORT
- printf("readIntegerData %d (0x%.8X)\n", *in08, *in08);
+ HDprintf("readIntegerData %d (0x%.8X)\n", *in08, *in08);
#endif
}
break;
@@ -531,7 +531,7 @@ static int readIntegerData(FILE *strm, struct Input *in)
*/
*in16 = temp16;
#ifdef H5DEBUGIMPORT
- printf("readIntegerData %d (0x%.8X)\n", *in16, temp16);
+ HDprintf("readIntegerData %d (0x%.8X)\n", *in16, temp16);
#endif
}
break;
@@ -567,7 +567,7 @@ static int readIntegerData(FILE *strm, struct Input *in)
*/
*in32 = temp32;
#ifdef H5DEBUGIMPORT
- printf("readIntegerData %d (0x%.8X = 0x%.8X)\n", *in32, *in32, temp32);
+ HDprintf("readIntegerData %d (0x%.8X = 0x%.8X)\n", *in32, *in32, temp32);
#endif
}
break;
@@ -605,7 +605,7 @@ static int readIntegerData(FILE *strm, struct Input *in)
*/
*in64 = temp64;
#ifdef H5DEBUGIMPORT
- printf("readIntegerData %d (0x%.8X)\n", *in64, temp64);
+ HDprintf("readIntegerData %d (0x%.8X)\n", *in64, temp64);
#endif
}
break;
@@ -701,7 +701,7 @@ static int readUIntegerData(FILE *strm, struct Input *in)
*/
*in16 = temp16;
#ifdef H5DEBUGIMPORT
- printf("readUIntegerData %d (0x%.4X = 0x%.4X)\n", *in16, *in16, temp16);
+ HDprintf("readUIntegerData %d (0x%.4X = 0x%.4X)\n", *in16, *in16, temp16);
#endif
}
break;
@@ -737,7 +737,7 @@ static int readUIntegerData(FILE *strm, struct Input *in)
*/
*in32 = temp32;
#ifdef H5DEBUGIMPORT
- printf("readUIntegerData %d (0x%.8X = 0x%.8X)\n", *in32, *in32, temp32);
+ HDprintf("readUIntegerData %d (0x%.8X = 0x%.8X)\n", *in32, *in32, temp32);
#endif
}
break;
@@ -775,7 +775,7 @@ static int readUIntegerData(FILE *strm, struct Input *in)
*/
*in64 = temp64;
#ifdef H5DEBUGIMPORT
- printf("readUIntegerData %ld (0x%.8X = 0x%.8X)\n", *in64, *in64, temp64);
+ HDprintf("readUIntegerData %ld (0x%.8X = 0x%.8X)\n", *in64, *in64, temp64);
#endif
}
break;
@@ -855,7 +855,7 @@ static int readFloatData(FILE *strm, struct Input *in)
*/
*bfp32 = temp32;
#ifdef H5DEBUGIMPORT
- printf("readFloatData %ld (0x%.8X = 0x%.8X)\n", *bfp32, *bfp32, temp32);
+ HDprintf("readFloatData %ld (0x%.8X = 0x%.8X)\n", *bfp32, *bfp32, temp32);
#endif
}
break;
@@ -907,7 +907,7 @@ static int readFloatData(FILE *strm, struct Input *in)
*/
*bfp64 = temp64;
#ifdef H5DEBUGIMPORT
- printf("readFloatData %ld (0x%.16lX)\n", *bfp64, temp64);
+ HDprintf("readFloatData %ld (0x%.16lX)\n", *bfp64, temp64);
#endif
}
break;
@@ -1099,7 +1099,7 @@ static int processStrHDFData(FILE *strm, struct Input *in, hid_t file_id)
*-------------------------------------------------------------------------
*/
#ifdef H5DEBUGIMPORT
- printf("processStrHDFData DATATYPE STRING\n");
+ HDprintf("processStrHDFData DATATYPE STRING\n");
#endif
if ((type_id = H5Tcopy(H5T_C_S1)) < 0)
@@ -1136,7 +1136,7 @@ static int processStrHDFData(FILE *strm, struct Input *in, hid_t file_id)
}
H5E_END_TRY;
#ifdef H5DEBUGIMPORT
- printf("processStrHDFData DATATYPE STRING groups created\n");
+ HDprintf("processStrHDFData DATATYPE STRING groups created\n");
#endif
if ((space_id = H5Screate_simple(in->rank, in->sizeOfDimension, NULL)) < 0)
@@ -1149,7 +1149,7 @@ static int processStrHDFData(FILE *strm, struct Input *in, hid_t file_id)
goto out;
#ifdef H5DEBUGIMPORT
- printf("processStrHDFData DATATYPE STRING ready to process strings\n");
+ HDprintf("processStrHDFData DATATYPE STRING ready to process strings\n");
#endif
line = 0;
j = 0;
@@ -1159,36 +1159,36 @@ static int processStrHDFData(FILE *strm, struct Input *in, hid_t file_id)
str2 = NULL;
str3 = NULL;
#ifdef H5DEBUGIMPORT
- printf("processStrHDFData DATATYPE STRING[%llu]={%s}\n", (unsigned long long)line, str1);
+ HDprintf("processStrHDFData DATATYPE STRING[%llu]={%s}\n", (unsigned long long)line, str1);
#endif
/* process string to remove the first and last quote char */
str2 = strchr(str1, '"');
if (str2 != NULL) {
#ifdef H5DEBUGIMPORT
- printf("processStrHDFData DATATYPE STRING len:%d for {%s}\n", strlen(str2), str2);
+ HDprintf("processStrHDFData DATATYPE STRING len:%d for {%s}\n", HDstrlen(str2), str2);
#endif
str2++;
#ifdef H5DEBUGIMPORT
- printf("processStrHDFData DATATYPE STRING len:%d for {%s}\n", strlen(str2), str2);
+ HDprintf("processStrHDFData DATATYPE STRING len:%d for {%s}\n", HDstrlen(str2), str2);
#endif
str3 = strrchr(str2, '"');
if (str3 != NULL) {
#ifdef H5DEBUGIMPORT
- printf("processStrHDFData DATATYPE STRING len:%d for {%s}\n", strlen(str3), str3);
+ HDprintf("processStrHDFData DATATYPE STRING len:%d for {%s}\n", HDstrlen(str3), str3);
#endif
*str3 = '\0';
#ifdef H5DEBUGIMPORT
- printf("processStrHDFData DATATYPE STRING len:%d for {%s}\n", strlen(str2), str2);
+ HDprintf("processStrHDFData DATATYPE STRING len:%d for {%s}\n", HDstrlen(str2), str2);
#endif
- if(strlen(str2) > 0) {
+ if(HDstrlen(str2) > 0) {
hid_t fspace_id;
hsize_t start[1];
hsize_t count[1] = { 1 };
#ifdef H5DEBUGIMPORT
- printf("processStrHDFData DATATYPE STRING[%llu] store %s\n", (unsigned long long)line, str2);
+ HDprintf("processStrHDFData DATATYPE STRING[%llu] store %s\n", (unsigned long long)line, str2);
#endif
if ((fspace_id = H5Dget_space(dset_id)) < 0)
goto out;
@@ -1210,7 +1210,7 @@ static int processStrHDFData(FILE *strm, struct Input *in, hid_t file_id)
j++;
}
#ifdef H5DEBUGIMPORT
- printf("processStrHDFData DATATYPE STRING eof reached\n");
+ HDprintf("processStrHDFData DATATYPE STRING eof reached\n");
#endif
/* close */
@@ -1223,7 +1223,7 @@ static int processStrHDFData(FILE *strm, struct Input *in, hid_t file_id)
out:
#ifdef H5DEBUGIMPORT
- printf("processStrHDFData DATATYPE STRING error exit\n");
+ HDprintf("processStrHDFData DATATYPE STRING error exit\n");
#endif
/* disable error reporting */
H5E_BEGIN_TRY
@@ -1437,7 +1437,7 @@ static int processConfigurationFile(char *infile, struct Input *in)
}
in->inputByteOrder = kindex;
#ifdef H5DEBUGIMPORT
- printf("h5dump inputByteOrder %d\n", in->inputByteOrder);
+ HDprintf("h5dump inputByteOrder %d\n", in->inputByteOrder);
#endif
in->inputArchitecture = 0; /* default to NATIVE */
@@ -1450,7 +1450,7 @@ static int processConfigurationFile(char *infile, struct Input *in)
if((scanret == 1) && !HDstrcmp("HDF5", key)) {
#ifdef H5DEBUGIMPORT
int pndx;
- printf("\nh5dump file\n");
+ HDprintf("\nh5dump file\n");
#endif
in->h5dumpInput = 1;
scanret = fscanf(strm, "%s", temp); /* filename */
@@ -1459,7 +1459,7 @@ static int processConfigurationFile(char *infile, struct Input *in)
while (scanret == 1) {
if(!HDstrcmp("DATASET", key)) { /* PATH */
#ifdef H5DEBUGIMPORT
- printf("h5dump DATASET key\n");
+ HDprintf("h5dump DATASET key\n");
#endif
if (in->configOptionVector[PATH] == 1) {
(void) HDfprintf(stderr, err3a, infile);
@@ -1470,7 +1470,7 @@ static int processConfigurationFile(char *infile, struct Input *in)
goto error;
}
#ifdef H5DEBUGIMPORT
- printf("h5dump DATASET %s found\n", temp);
+ HDprintf("h5dump DATASET %s found\n", temp);
#endif
if (parsePathInfo(&in->path, temp) == -1) {
(void) HDfprintf(stderr, err3b, infile);
@@ -1479,12 +1479,12 @@ static int processConfigurationFile(char *infile, struct Input *in)
in->configOptionVector[PATH] = 1;
scanret = fscanf(strm, "%s", temp); /* start bracket */
#ifdef H5DEBUGIMPORT
- printf("h5dump DATASET %s found\n", temp);
+ HDprintf("h5dump DATASET %s found\n", temp);
#endif
} /* if(!HDstrcmp("DATASET", key)) PATH */
else if(!HDstrcmp("DATATYPE", key)) { /* INPUT-CLASS */
#ifdef H5DEBUGIMPORT
- printf("h5dump DATATYPE key\n");
+ HDprintf("h5dump DATATYPE key\n");
#endif
if (in->configOptionVector[INPUT_CLASS] == 1) {
(void) HDfprintf(stderr, err4a, infile);
@@ -1496,14 +1496,14 @@ static int processConfigurationFile(char *infile, struct Input *in)
goto error;
}
#ifdef H5DEBUGIMPORT
- printf("h5dump DATATYPE %s found\n", temp);
+ HDprintf("h5dump DATATYPE %s found\n", temp);
#endif
if ((kindex = getInputClassType(in, temp)) == -1) {
(void) HDfprintf(stderr, err4b, infile);
goto error;
}
#ifdef H5DEBUGIMPORT
- printf("h5dump DATATYPE type %d inputClass\n", in->inputClass);
+ HDprintf("h5dump DATATYPE type %d inputClass\n", in->inputClass);
#endif
in->configOptionVector[INPUT_CLASS] = 1;
@@ -1519,21 +1519,21 @@ static int processConfigurationFile(char *infile, struct Input *in)
in->outputClass = 2;
}
#ifdef H5DEBUGIMPORT
- printf("h5dump DATATYPE type %d outputClass\n", in->outputClass);
+ HDprintf("h5dump DATATYPE type %d outputClass\n", in->outputClass);
#endif
if(in->inputClass == 5) { /* STRING */
int get_next_prop = 1;
in->outputClass = -1;
#ifdef H5DEBUGIMPORT
- printf("h5dump DATATYPE STRING found\n");
+ HDprintf("h5dump DATATYPE STRING found\n");
#endif
if (fscanf(strm, "%s", temp) != 1) { /* start bracket */
(void) HDfprintf(stderr, "%s", err18);
goto error;
}
#ifdef H5DEBUGIMPORT
- printf("h5dump DATATYPE STRING %s found\n", temp);
+ HDprintf("h5dump DATATYPE STRING %s found\n", temp);
#endif
if (fscanf(strm, "%s", temp) != 1) { /* string properties */
(void) HDfprintf(stderr, "%s", err18);
@@ -1546,7 +1546,7 @@ static int processConfigurationFile(char *infile, struct Input *in)
goto error;
}
#ifdef H5DEBUGIMPORT
- printf("h5dump DATATYPE STRING STRSIZE %s found\n", temp);
+ HDprintf("h5dump DATATYPE STRING STRSIZE %s found\n", temp);
#endif
if (HDstrcmp("H5T_VARIABLE;", temp)) {
char *more = temp;
@@ -1556,7 +1556,7 @@ static int processConfigurationFile(char *infile, struct Input *in)
goto error;
}
#ifdef H5DEBUGIMPORT
- printf("h5dump DATATYPE STRING %d InputSize\n", in->inputSize);
+ HDprintf("h5dump DATATYPE STRING %d InputSize\n", in->inputSize);
#endif
}
}
@@ -1566,7 +1566,7 @@ static int processConfigurationFile(char *infile, struct Input *in)
goto error;
}
#ifdef H5DEBUGIMPORT
- printf("h5dump DATATYPE STRING STRPAD %s found\n", temp);
+ HDprintf("h5dump DATATYPE STRING STRPAD %s found\n", temp);
#endif
}
else if(!HDstrcmp("CSET", key)) { /* CSET */
@@ -1575,7 +1575,7 @@ static int processConfigurationFile(char *infile, struct Input *in)
goto error;
}
#ifdef H5DEBUGIMPORT
- printf("h5dump DATATYPE STRING CSET %s found\n", temp);
+ HDprintf("h5dump DATATYPE STRING CSET %s found\n", temp);
#endif
}
@@ -1585,7 +1585,7 @@ static int processConfigurationFile(char *infile, struct Input *in)
goto error;
}
#ifdef H5DEBUGIMPORT
- printf("h5dump DATATYPE STRING CTYPE %s found\n", temp);
+ HDprintf("h5dump DATATYPE STRING CTYPE %s found\n", temp);
#endif
} /* if(!HDstrcmp("CSET", key)) */
if (fscanf(strm, "%s", temp) != 1) {
@@ -1593,7 +1593,7 @@ static int processConfigurationFile(char *infile, struct Input *in)
goto error;
}
#ifdef H5DEBUGIMPORT
- printf("h5dump DATATYPE STRING %s found\n", temp);
+ HDprintf("h5dump DATATYPE STRING %s found\n", temp);
#endif
if(!HDstrcmp("}", temp)) { /* end bracket */
get_next_prop = 0;
@@ -1605,7 +1605,7 @@ static int processConfigurationFile(char *infile, struct Input *in)
hsize_t temp_dims[MAX_NUM_DIMENSION];
#ifdef H5DEBUGIMPORT
- printf("h5dump DATASPACE key\n");
+ HDprintf("h5dump DATASPACE key\n");
#endif
if (fscanf(strm, "%s", temp) != 1) {
(void) HDfprintf(stderr, "%s", err18);
@@ -1621,21 +1621,21 @@ static int processConfigurationFile(char *infile, struct Input *in)
else if(!HDstrcmp("SIMPLE", temp)) { /* SIMPLE */
int icount = 0;
#ifdef H5DEBUGIMPORT
- printf("h5dump DATASPACE SIMPLE found\n");
+ HDprintf("h5dump DATASPACE SIMPLE found\n");
#endif
if (fscanf(strm, "%s", temp) != 1) { /* start bracket */
(void) HDfprintf(stderr, err6b, infile);
goto error;
}
#ifdef H5DEBUGIMPORT
- printf("h5dump DATASPACE SIMPLE %s found\n", temp);
+ HDprintf("h5dump DATASPACE SIMPLE %s found\n", temp);
#endif
if (fscanf(strm, "%s", temp) != 1) { /* start paren */
(void) HDfprintf(stderr, err6b, infile);
goto error;
}
#ifdef H5DEBUGIMPORT
- printf("h5dump DATASPACE SIMPLE %s found\n", temp);
+ HDprintf("h5dump DATASPACE SIMPLE %s found\n", temp);
#endif
if(!HDstrcmp("(", temp)) { /* start paren */
int get_next_dim = 1;
@@ -1646,7 +1646,7 @@ static int processConfigurationFile(char *infile, struct Input *in)
goto error;
}
#ifdef H5DEBUGIMPORT
- printf("h5dump DATASPACE SIMPLE %s found\n", temp);
+ HDprintf("h5dump DATASPACE SIMPLE %s found\n", temp);
#endif
while (get_next_dim) {
char *more = temp;
@@ -1656,7 +1656,7 @@ static int processConfigurationFile(char *infile, struct Input *in)
goto error;
}
#ifdef H5DEBUGIMPORT
- printf("h5dump DATASPACE SIMPLE %s found\n", temp);
+ HDprintf("h5dump DATASPACE SIMPLE %s found\n", temp);
#endif
if(!HDstrcmp(")", temp)) { /* end paren */
in->rank = ++icount;
@@ -1676,17 +1676,17 @@ static int processConfigurationFile(char *infile, struct Input *in)
goto error;
}
#ifdef H5DEBUGIMPORT
- printf("h5dump DATASPACE SIMPLE %ld rank\n", in->rank);
+ HDprintf("h5dump DATASPACE SIMPLE %ld rank\n", in->rank);
#endif
for (i = 0; i < in->rank; i++) {
in->sizeOfDimension[i] = temp_dims[i];
}
#ifdef H5DEBUGIMPORT
- printf("h5dump DATASPACE SIMPLE dims[%ld]:", in->rank);
+ HDprintf("h5dump DATASPACE SIMPLE dims[%ld]:", in->rank);
for (pndx = 0; pndx < in->rank; pndx++) {
- printf(" %ld", in->sizeOfDimension[pndx]);
+ HDprintf(" %ld", in->sizeOfDimension[pndx]);
}
- printf("\n");
+ HDprintf("\n");
#endif
in->configOptionVector[DIM] = 1;
} /* if(!HDstrcmp("(", key)) start paren */
@@ -1699,7 +1699,7 @@ static int processConfigurationFile(char *infile, struct Input *in)
goto error;
}
#ifdef H5DEBUGIMPORT
- printf("h5dump DATASPACE SIMPLE %s found\n", temp);
+ HDprintf("h5dump DATASPACE SIMPLE %s found\n", temp);
#endif
if(!HDstrcmp("/", temp)) { /* / max dims */
if ((in->maxsizeOfDimension = (hsize_t *) HDmalloc ((size_t) in->rank * sizeof(hsize_t))) == NULL) {
@@ -1710,25 +1710,25 @@ static int processConfigurationFile(char *infile, struct Input *in)
goto error;
}
#ifdef H5DEBUGIMPORT
- printf("h5dump DATASPACE SIMPLE %s found\n", temp);
+ HDprintf("h5dump DATASPACE SIMPLE %s found\n", temp);
#endif
if(!HDstrcmp("(", temp)) { /* start paren */
int get_next_dim = 1;
int i = 0;
#ifdef H5DEBUGIMPORT
- printf("h5dump DATASPACE SIMPLE process max dim values\n");
+ HDprintf("h5dump DATASPACE SIMPLE process max dim values\n");
#endif
if (fscanf(strm, "%s", temp) != 1) { /* max dim with optional comma */
(void) HDfprintf(stderr, err16c, infile);
goto error;
}
#ifdef H5DEBUGIMPORT
- printf("h5dump DATASPACE SIMPLE %s found\n", temp);
+ HDprintf("h5dump DATASPACE SIMPLE %s found\n", temp);
#endif
while (get_next_dim) {
#ifdef H5DEBUGIMPORT
- printf("h5dump DATASPACE SIMPLE get max dim value\n");
+ HDprintf("h5dump DATASPACE SIMPLE get max dim value\n");
#endif
if(!HDstrcmp("H5S_UNLIMITED", temp) || !HDstrcmp("H5S_UNLIMITED,", temp)) { /* unlimited */
in->maxsizeOfDimension[i] = H5S_UNLIMITED;
@@ -1743,7 +1743,7 @@ static int processConfigurationFile(char *infile, struct Input *in)
goto error;
}
#ifdef H5DEBUGIMPORT
- printf("h5dump DATASPACE SIMPLE %s found\n", temp);
+ HDprintf("h5dump DATASPACE SIMPLE %s found\n", temp);
#endif
if(!HDstrcmp(")", temp)) { /* end paren */
get_next_dim = 0;
@@ -1757,12 +1757,12 @@ static int processConfigurationFile(char *infile, struct Input *in)
}
} /* while (get_next_dim) */
#ifdef H5DEBUGIMPORT
- printf("h5dump DATASPACE SIMPLE maxdims[%ld]:", in->rank);
+ HDprintf("h5dump DATASPACE SIMPLE maxdims[%ld]:", in->rank);
for (pndx = 0; pndx < in->rank; pndx++) {
- printf(" %ld", in->maxsizeOfDimension[pndx]);
+ HDprintf(" %ld", in->maxsizeOfDimension[pndx]);
}
- printf("\n");
- printf("h5dump DATASPACE SIMPLE get max dim finished\n");
+ HDprintf("\n");
+ HDprintf("h5dump DATASPACE SIMPLE get max dim finished\n");
#endif
} /* if(!HDstrcmp("(", key)) start paren */
else {
@@ -1771,7 +1771,7 @@ static int processConfigurationFile(char *infile, struct Input *in)
}
scanret = fscanf(strm, "%s", temp); /* end bracket */
#ifdef H5DEBUGIMPORT
- printf("h5dump DATASPACE SIMPLE %s found\n", temp);
+ HDprintf("h5dump DATASPACE SIMPLE %s found\n", temp);
#endif
} /* if(!HDstrcmp("/", key)) max dims separator */
} /* else if(!HDstrcmp("SIMPLE", key)) */
@@ -1782,21 +1782,21 @@ static int processConfigurationFile(char *infile, struct Input *in)
} /* else if(!HDstrcmp("DATASPACE", key)) RANK and DIMENSIONS */
else if(!HDstrcmp("STORAGE_LAYOUT", key)) { /* CHUNKED-DIMENSION-SIZES */
#ifdef H5DEBUGIMPORT
- printf("h5dump STORAGE_LAYOUT key\n");
+ HDprintf("h5dump STORAGE_LAYOUT key\n");
#endif
if (fscanf(strm, "%s", temp) != 1) { /* start bracket */
(void) HDfprintf(stderr, err6b, infile);
goto error;
}
#ifdef H5DEBUGIMPORT
- printf("h5dump STORAGE_LAYOUT %s found\n", temp);
+ HDprintf("h5dump STORAGE_LAYOUT %s found\n", temp);
#endif
if (fscanf(strm, "%s", temp) != 1) { /* CHUNKED */
(void) HDfprintf(stderr, err6b, infile);
goto error;
}
#ifdef H5DEBUGIMPORT
- printf("h5dump STORAGE_LAYOUT %s found\n", temp);
+ HDprintf("h5dump STORAGE_LAYOUT %s found\n", temp);
#endif
if(!HDstrcmp("CHUNKED", temp)) { /* CHUNKED */
if ((in->sizeOfChunk = (hsize_t *) HDmalloc ((size_t) in->rank * sizeof(hsize_t))) == NULL) {
@@ -1808,7 +1808,7 @@ static int processConfigurationFile(char *infile, struct Input *in)
goto error;
}
#ifdef H5DEBUGIMPORT
- printf("h5dump STORAGE_LAYOUT CHUNKED %s found\n", temp);
+ HDprintf("h5dump STORAGE_LAYOUT CHUNKED %s found\n", temp);
#endif
if(!HDstrcmp("(", temp)) { /* start paren */
int get_next_dim = 1;
@@ -1819,7 +1819,7 @@ static int processConfigurationFile(char *infile, struct Input *in)
goto error;
}
#ifdef H5DEBUGIMPORT
- printf("h5dump STORAGE_LAYOUT CHUNKED %s found\n", temp);
+ HDprintf("h5dump STORAGE_LAYOUT CHUNKED %s found\n", temp);
#endif
while (get_next_dim) {
char *more = temp;
@@ -1829,7 +1829,7 @@ static int processConfigurationFile(char *infile, struct Input *in)
goto error;
}
#ifdef H5DEBUGIMPORT
- printf("h5dump STORAGE_LAYOUT CHUNKED %s found\n", temp);
+ HDprintf("h5dump STORAGE_LAYOUT CHUNKED %s found\n", temp);
#endif
if(!HDstrcmp(")", temp)) { /* end paren */
in->configOptionVector[RANK] = 1;
@@ -1844,11 +1844,11 @@ static int processConfigurationFile(char *infile, struct Input *in)
}
} /* while (get_next_dim) */
#ifdef H5DEBUGIMPORT
- printf("h5dump STORAGE_LAYOUT CHUNKED dims [%ld]:", in->rank);
+ HDprintf("h5dump STORAGE_LAYOUT CHUNKED dims [%ld]:", in->rank);
for (pndx = 0; pndx < in->rank; pndx++) {
- printf(" %ld", in->sizeOfChunk[pndx]);
+ HDprintf(" %ld", in->sizeOfChunk[pndx]);
}
- printf("\n");
+ HDprintf("\n");
#endif
in->configOptionVector[DIM] = 1;
} /* if(!HDstrcmp("(", key)) start paren */
@@ -1861,7 +1861,7 @@ static int processConfigurationFile(char *infile, struct Input *in)
goto error;
}
#ifdef H5DEBUGIMPORT
- printf("h5dump STORAGE_LAYOUT CHUNKED %s found\n", temp);
+ HDprintf("h5dump STORAGE_LAYOUT CHUNKED %s found\n", temp);
#endif
if(!HDstrcmp("SIZE", temp)) { /* SIZE */
if (fscanf(strm, "%d", (&ival)) != 1) {
@@ -1869,7 +1869,7 @@ static int processConfigurationFile(char *infile, struct Input *in)
goto error;
}
#ifdef H5DEBUGIMPORT
- printf("h5dump STORAGE_LAYOUT CHUNKED SIZE %d found\n", ival);
+ HDprintf("h5dump STORAGE_LAYOUT CHUNKED SIZE %d found\n", ival);
#endif
}
while (HDstrcmp("}", temp)) {
@@ -1878,7 +1878,7 @@ static int processConfigurationFile(char *infile, struct Input *in)
goto error;
}
#ifdef H5DEBUGIMPORT
- printf("h5dump STORAGE_LAYOUT CHUNKED %s found\n", temp);
+ HDprintf("h5dump STORAGE_LAYOUT CHUNKED %s found\n", temp);
#endif
}
in->configOptionVector[CHUNK] = 1;
@@ -1886,53 +1886,53 @@ static int processConfigurationFile(char *infile, struct Input *in)
} /* else if(!HDstrcmp("STORAGE_LAYOUT", key)) CHUNKED-DIMENSION-SIZES */
else if(!HDstrcmp("FILTERS", key)) { /* FILTERS */
#ifdef H5DEBUGIMPORT
- printf("h5dump FILTERS key\n");
+ HDprintf("h5dump FILTERS key\n");
#endif
if (fscanf(strm, "%s", temp) != 1) { /* start bracket */
(void) HDfprintf(stderr, err6b, infile);
goto error;
}
#ifdef H5DEBUGIMPORT
- printf("h5dump FILTERS %s found\n", temp);
+ HDprintf("h5dump FILTERS %s found\n", temp);
#endif
if (fscanf(strm, "%s", temp) != 1) {
(void) HDfprintf(stderr, err6b, infile);
goto error;
}
#ifdef H5DEBUGIMPORT
- printf("h5dump FILTERS %s found\n", temp);
+ HDprintf("h5dump FILTERS %s found\n", temp);
#endif
if(!HDstrcmp("COMPRESSION", temp)) { /* COMPRESSION */
#ifdef H5DEBUGIMPORT
- printf("h5dump FILTERS COMPRESSION found\n");
+ HDprintf("h5dump FILTERS COMPRESSION found\n");
#endif
if (fscanf(strm, "%s", temp) != 1) { /* DEFLATE */
(void) HDfprintf(stderr, "%s", err18);
goto error;
}
#ifdef H5DEBUGIMPORT
- printf("h5dump FILTERS COMPRESSION %s found\n", temp);
+ HDprintf("h5dump FILTERS COMPRESSION %s found\n", temp);
#endif
if (fscanf(strm, "%s", temp) != 1) { /* bgin bracket */
(void) HDfprintf(stderr, "%s", err18);
goto error;
}
#ifdef H5DEBUGIMPORT
- printf("h5dump FILTERS COMPRESSION %s found\n", temp);
+ HDprintf("h5dump FILTERS COMPRESSION %s found\n", temp);
#endif
if (fscanf(strm, "%s", temp) != 1) { /* LEVEL */
(void) HDfprintf(stderr, "%s", err18);
goto error;
}
#ifdef H5DEBUGIMPORT
- printf("h5dump FILTERS COMPRESSION %s found\n", temp);
+ HDprintf("h5dump FILTERS COMPRESSION %s found\n", temp);
#endif
if (fscanf(strm, "%d", (&ival)) != 1) {
(void) HDfprintf(stderr, "%s", err19);
goto error;
}
#ifdef H5DEBUGIMPORT
- printf("h5dump FILTERS COMPRESSION LEVEL %d found\n", ival);
+ HDprintf("h5dump FILTERS COMPRESSION LEVEL %d found\n", ival);
#endif
in->compressionParam = ival;
if (fscanf(strm, "%s", temp) != 1) { /* end bracket */
@@ -1940,20 +1940,20 @@ static int processConfigurationFile(char *infile, struct Input *in)
goto error;
}
#ifdef H5DEBUGIMPORT
- printf("h5dump FILTERS COMPRESSION %s found\n", temp);
+ HDprintf("h5dump FILTERS COMPRESSION %s found\n", temp);
#endif
in->compressionType = 0; /* ONLY GZIP supported */
in->configOptionVector[COMPRESS] = 1;
}
else if(!HDstrcmp("CONTIGUOUS", temp)) { /* CONTIGUOUS */
#ifdef H5DEBUGIMPORT
- printf("h5dump FILTERS CONTIGUOUS found\n");
+ HDprintf("h5dump FILTERS CONTIGUOUS found\n");
#endif
in->configOptionVector[COMPRESS] = 0;
}
else if(!HDstrcmp("NONE", temp)) { /* NONE */
#ifdef H5DEBUGIMPORT
- printf("h5dump FILTERS NONE found\n");
+ HDprintf("h5dump FILTERS NONE found\n");
#endif
in->configOptionVector[COMPRESS] = 0;
}
@@ -1962,28 +1962,28 @@ static int processConfigurationFile(char *infile, struct Input *in)
goto error;
}
#ifdef H5DEBUGIMPORT
- printf("h5dump FILTERS %s found\n", temp);
+ HDprintf("h5dump FILTERS %s found\n", temp);
#endif
}
else if(!HDstrcmp("SUBSET", key)) { /* reduce dimensions */
hsize_t temp_dims[MAX_NUM_DIMENSION];
int get_next_prop = 1;
#ifdef H5DEBUGIMPORT
- printf("h5dump SUBSET key\n");
+ HDprintf("h5dump SUBSET key\n");
#endif
if (fscanf(strm, "%s", temp) != 1) { /* start bracket */
(void) HDfprintf(stderr, err20, infile);
goto error;
}
#ifdef H5DEBUGIMPORT
- printf("h5dump SUBSET %s found\n", temp);
+ HDprintf("h5dump SUBSET %s found\n", temp);
#endif
if (fscanf(strm, "%s", temp) != 1) { /* SUBSET keyword */
(void) HDfprintf(stderr, "%s", err18);
goto error;
}
#ifdef H5DEBUGIMPORT
- printf("h5dump SUBSET %s found\n", temp);
+ HDprintf("h5dump SUBSET %s found\n", temp);
#endif
while (get_next_prop) {
if(!HDstrcmp("COUNT", temp)) { /* COUNT */
@@ -1993,7 +1993,7 @@ static int processConfigurationFile(char *infile, struct Input *in)
goto error;
}
#ifdef H5DEBUGIMPORT
- printf("h5dump SUBSET %s found\n", temp);
+ HDprintf("h5dump SUBSET %s found\n", temp);
#endif
if(!HDstrcmp("(", temp)) { /* start paren */
int get_next_dim = 1;
@@ -2004,7 +2004,7 @@ static int processConfigurationFile(char *infile, struct Input *in)
goto error;
}
#ifdef H5DEBUGIMPORT
- printf("h5dump SUBSET COUNT [%s] found\n", temp);
+ HDprintf("h5dump SUBSET COUNT [%s] found\n", temp);
#endif
while (get_next_dim) {
char *more = temp;
@@ -2014,7 +2014,7 @@ static int processConfigurationFile(char *infile, struct Input *in)
goto error;
}
#ifdef H5DEBUGIMPORT
- printf("h5dump SUBSET COUNT %s found\n", temp);
+ HDprintf("h5dump SUBSET COUNT %s found\n", temp);
#endif
if(!HDstrcmp(");", temp)) { /* end paren */
in->rank = ++icount;
@@ -2033,11 +2033,11 @@ static int processConfigurationFile(char *infile, struct Input *in)
in->sizeOfDimension[i] = temp_dims[i];
}
#ifdef H5DEBUGIMPORT
- printf("h5dump SUBSET COUNT dims: [%d]", in->rank);
+ HDprintf("h5dump SUBSET COUNT dims: [%d]", in->rank);
for (pndx = 0; pndx < in->rank; pndx++) {
- printf(" %ld", in->sizeOfDimension[pndx]);
+ HDprintf(" %ld", in->sizeOfDimension[pndx]);
}
- printf("\n");
+ HDprintf("\n");
#endif
in->configOptionVector[DIM] = 1;
} /* if(!HDstrcmp("(", key)) start paren */
@@ -2049,7 +2049,7 @@ static int processConfigurationFile(char *infile, struct Input *in)
goto error;
}
#ifdef H5DEBUGIMPORT
- printf("h5dump SUBSET %s found\n", temp);
+ HDprintf("h5dump SUBSET %s found\n", temp);
#endif
if(!HDstrcmp("(", temp)) { /* start paren */
int get_next_dim = 1;
@@ -2060,7 +2060,7 @@ static int processConfigurationFile(char *infile, struct Input *in)
goto error;
}
#ifdef H5DEBUGIMPORT
- printf("h5dump SUBSET BLOCK [%s] found\n", temp);
+ HDprintf("h5dump SUBSET BLOCK [%s] found\n", temp);
#endif
while (get_next_dim) {
char *more = temp;
@@ -2070,7 +2070,7 @@ static int processConfigurationFile(char *infile, struct Input *in)
goto error;
}
#ifdef H5DEBUGIMPORT
- printf("h5dump SUBSET BLOCK %s found\n", temp);
+ HDprintf("h5dump SUBSET BLOCK %s found\n", temp);
#endif
if(!HDstrcmp(");", temp)) { /* end paren */
in->rank = ++icount;
@@ -2089,11 +2089,11 @@ static int processConfigurationFile(char *infile, struct Input *in)
in->sizeOfDimension[i] = in->sizeOfDimension[i] * temp_dims[i];
}
#ifdef H5DEBUGIMPORT
- printf("h5dump SUBSET BLOCK dims: [%d]", in->rank);
+ HDprintf("h5dump SUBSET BLOCK dims: [%d]", in->rank);
for (pndx = 0; pndx < in->rank; pndx++) {
- printf(" %ld", in->sizeOfDimension[pndx]);
+ HDprintf(" %ld", in->sizeOfDimension[pndx]);
}
- printf("\n");
+ HDprintf("\n");
#endif
in->configOptionVector[DIM] = 1;
} /* if(!HDstrcmp("(", key)) start paren */
@@ -2103,7 +2103,7 @@ static int processConfigurationFile(char *infile, struct Input *in)
goto error;
}
#ifdef H5DEBUGIMPORT
- printf("h5dump SUBSET %s found\n", temp);
+ HDprintf("h5dump SUBSET %s found\n", temp);
#endif
if(!HDstrcmp("}", temp)) { /* end bracket */
get_next_prop = 0;
@@ -2112,7 +2112,7 @@ static int processConfigurationFile(char *infile, struct Input *in)
} /* else if(!HDstrcmp("SUBSET", key)) */
else if(!HDstrcmp("DATA", key)) { /* FINSHED */
#ifdef H5DEBUGIMPORT
- printf("h5dump DATA key\n");
+ HDprintf("h5dump DATA key\n");
#endif
scanret = 0;
break;
@@ -2120,32 +2120,32 @@ static int processConfigurationFile(char *infile, struct Input *in)
scanret = fscanf(strm, "%s", key);
}
#ifdef H5DEBUGIMPORT
- printf("h5dump path");
+ HDprintf("h5dump path");
for (pndx = 0; pndx < in->path.count; pndx++) {
- printf(" : %s", in->path.group[pndx]);
- }
- printf("\n");
- printf("h5dump inputClass=%d\n", in->inputClass);
- printf("h5dump inputSize=%d\n", in->inputSize);
- printf("h5dump inputArchitecture=%d\n", in->inputArchitecture);
- printf("h5dump inputByteOrder=%d\n", in->inputByteOrder);
- printf("h5dump rank=%d\n", in->rank);
- printf("h5dump outputClass=%d\n", in->outputClass);
- printf("h5dump outputSize=%d\n", in->outputSize);
- printf("h5dump outputArchitecture=%d\n", in->outputArchitecture);
- printf("h5dump outputByteOrder=%d\n", in->outputByteOrder);
- printf("h5dump compressionType=%d\n", in->compressionType);
- printf("h5dump compressionParam=%d\n", in->compressionParam);
- printf("h5dump externFilename=%s\n", in->externFilename);
- printf("h5dump sizeOfDimensions:\n");
+ HDprintf(" : %s", in->path.group[pndx]);
+ }
+ HDprintf("\n");
+ HDprintf("h5dump inputClass=%d\n", in->inputClass);
+ HDprintf("h5dump inputSize=%d\n", in->inputSize);
+ HDprintf("h5dump inputArchitecture=%d\n", in->inputArchitecture);
+ HDprintf("h5dump inputByteOrder=%d\n", in->inputByteOrder);
+ HDprintf("h5dump rank=%d\n", in->rank);
+ HDprintf("h5dump outputClass=%d\n", in->outputClass);
+ HDprintf("h5dump outputSize=%d\n", in->outputSize);
+ HDprintf("h5dump outputArchitecture=%d\n", in->outputArchitecture);
+ HDprintf("h5dump outputByteOrder=%d\n", in->outputByteOrder);
+ HDprintf("h5dump compressionType=%d\n", in->compressionType);
+ HDprintf("h5dump compressionParam=%d\n", in->compressionParam);
+ HDprintf("h5dump externFilename=%s\n", in->externFilename);
+ HDprintf("h5dump sizeOfDimensions:\n");
for (pndx = 0; pndx < in->rank; pndx++) {
- printf(" %ld\n", in->sizeOfDimension[pndx]);
+ HDprintf(" %ld\n", in->sizeOfDimension[pndx]);
}
#endif
}
else {
#ifdef H5DEBUGIMPORT
- printf("original option keyword parsing\n");
+ HDprintf("original option keyword parsing\n");
#endif
while (scanret == 1) {
if ((kindex = mapKeywordToIndex(key)) == -1) {
@@ -2655,7 +2655,7 @@ static int getInputClassType(struct Input *in, char * buffer)
}
in->outputByteOrder = kindex;
#ifdef H5DEBUGIMPORT
- printf("h5dump inputByteOrder %d\n", in->inputByteOrder);
+ HDprintf("h5dump inputByteOrder %d\n", in->inputByteOrder);
#endif
kindex = 4;
@@ -2676,7 +2676,7 @@ static int getInputClassType(struct Input *in, char * buffer)
}
in->outputByteOrder = kindex;
#ifdef H5DEBUGIMPORT
- printf("h5dump inputByteOrder %d\n", in->inputByteOrder);
+ HDprintf("h5dump inputByteOrder %d\n", in->inputByteOrder);
#endif
kindex = 4;
@@ -2697,7 +2697,7 @@ static int getInputClassType(struct Input *in, char * buffer)
}
in->outputByteOrder = kindex;
#ifdef H5DEBUGIMPORT
- printf("h5dump inputByteOrder %d\n", in->inputByteOrder);
+ HDprintf("h5dump inputByteOrder %d\n", in->inputByteOrder);
#endif
kindex = 4;
@@ -2718,7 +2718,7 @@ static int getInputClassType(struct Input *in, char * buffer)
}
in->outputByteOrder = kindex;
#ifdef H5DEBUGIMPORT
- printf("h5dump inputByteOrder %d\n", in->inputByteOrder);
+ HDprintf("h5dump inputByteOrder %d\n", in->inputByteOrder);
#endif
kindex = 4;
@@ -2739,7 +2739,7 @@ static int getInputClassType(struct Input *in, char * buffer)
}
in->outputByteOrder = kindex;
#ifdef H5DEBUGIMPORT
- printf("h5dump inputByteOrder %d\n", in->inputByteOrder);
+ HDprintf("h5dump inputByteOrder %d\n", in->inputByteOrder);
#endif
kindex = 4;
@@ -2760,7 +2760,7 @@ static int getInputClassType(struct Input *in, char * buffer)
}
in->outputByteOrder = kindex;
#ifdef H5DEBUGIMPORT
- printf("h5dump inputByteOrder %d\n", in->inputByteOrder);
+ HDprintf("h5dump inputByteOrder %d\n", in->inputByteOrder);
#endif
kindex = 4;
@@ -2781,7 +2781,7 @@ static int getInputClassType(struct Input *in, char * buffer)
}
in->outputByteOrder = kindex;
#ifdef H5DEBUGIMPORT
- printf("h5dump inputByteOrder %d\n", in->inputByteOrder);
+ HDprintf("h5dump inputByteOrder %d\n", in->inputByteOrder);
#endif
kindex = 4;
@@ -2802,7 +2802,7 @@ static int getInputClassType(struct Input *in, char * buffer)
}
in->outputByteOrder = kindex;
#ifdef H5DEBUGIMPORT
- printf("h5dump inputByteOrder %d\n", in->inputByteOrder);
+ HDprintf("h5dump inputByteOrder %d\n", in->inputByteOrder);
#endif
kindex = 4;
@@ -2823,7 +2823,7 @@ static int getInputClassType(struct Input *in, char * buffer)
}
in->outputByteOrder = kindex;
#ifdef H5DEBUGIMPORT
- printf("h5dump inputByteOrder %d\n", in->inputByteOrder);
+ HDprintf("h5dump inputByteOrder %d\n", in->inputByteOrder);
#endif
kindex = 7;
@@ -2844,7 +2844,7 @@ static int getInputClassType(struct Input *in, char * buffer)
}
in->outputByteOrder = kindex;
#ifdef H5DEBUGIMPORT
- printf("h5dump inputByteOrder %d\n", in->inputByteOrder);
+ HDprintf("h5dump inputByteOrder %d\n", in->inputByteOrder);
#endif
kindex = 7;
@@ -2865,7 +2865,7 @@ static int getInputClassType(struct Input *in, char * buffer)
}
in->outputByteOrder = kindex;
#ifdef H5DEBUGIMPORT
- printf("h5dump inputByteOrder %d\n", in->inputByteOrder);
+ HDprintf("h5dump inputByteOrder %d\n", in->inputByteOrder);
#endif
kindex = 7;
@@ -2886,7 +2886,7 @@ static int getInputClassType(struct Input *in, char * buffer)
}
in->outputByteOrder = kindex;
#ifdef H5DEBUGIMPORT
- printf("h5dump inputByteOrder %d\n", in->inputByteOrder);
+ HDprintf("h5dump inputByteOrder %d\n", in->inputByteOrder);
#endif
kindex = 7;
@@ -2907,7 +2907,7 @@ static int getInputClassType(struct Input *in, char * buffer)
}
in->outputByteOrder = kindex;
#ifdef H5DEBUGIMPORT
- printf("h5dump inputByteOrder %d\n", in->inputByteOrder);
+ HDprintf("h5dump inputByteOrder %d\n", in->inputByteOrder);
#endif
kindex = 7;
@@ -2928,7 +2928,7 @@ static int getInputClassType(struct Input *in, char * buffer)
}
in->outputByteOrder = kindex;
#ifdef H5DEBUGIMPORT
- printf("h5dump inputByteOrder %d\n", in->inputByteOrder);
+ HDprintf("h5dump inputByteOrder %d\n", in->inputByteOrder);
#endif
kindex = 7;
@@ -2949,7 +2949,7 @@ static int getInputClassType(struct Input *in, char * buffer)
}
in->outputByteOrder = kindex;
#ifdef H5DEBUGIMPORT
- printf("h5dump inputByteOrder %d\n", in->inputByteOrder);
+ HDprintf("h5dump inputByteOrder %d\n", in->inputByteOrder);
#endif
kindex = 7;
@@ -2970,7 +2970,7 @@ static int getInputClassType(struct Input *in, char * buffer)
}
in->outputByteOrder = kindex;
#ifdef H5DEBUGIMPORT
- printf("h5dump inputByteOrder %d\n", in->inputByteOrder);
+ HDprintf("h5dump inputByteOrder %d\n", in->inputByteOrder);
#endif
kindex = 7;
@@ -3111,7 +3111,7 @@ static int getInputClassType(struct Input *in, char * buffer)
}
in->outputByteOrder = kindex;
#ifdef H5DEBUGIMPORT
- printf("h5dump inputByteOrder %d\n", in->inputByteOrder);
+ HDprintf("h5dump inputByteOrder %d\n", in->inputByteOrder);
#endif
kindex = 3;
@@ -3132,7 +3132,7 @@ static int getInputClassType(struct Input *in, char * buffer)
}
in->outputByteOrder = kindex;
#ifdef H5DEBUGIMPORT
- printf("h5dump inputByteOrder %d\n", in->inputByteOrder);
+ HDprintf("h5dump inputByteOrder %d\n", in->inputByteOrder);
#endif
kindex = 3;
@@ -3153,7 +3153,7 @@ static int getInputClassType(struct Input *in, char * buffer)
}
in->outputByteOrder = kindex;
#ifdef H5DEBUGIMPORT
- printf("h5dump inputByteOrder %d\n", in->inputByteOrder);
+ HDprintf("h5dump inputByteOrder %d\n", in->inputByteOrder);
#endif
kindex = 3;
@@ -3174,7 +3174,7 @@ static int getInputClassType(struct Input *in, char * buffer)
}
in->outputByteOrder = kindex;
#ifdef H5DEBUGIMPORT
- printf("h5dump inputByteOrder %d\n", in->inputByteOrder);
+ HDprintf("h5dump inputByteOrder %d\n", in->inputByteOrder);
#endif
kindex = 3;
@@ -3250,7 +3250,7 @@ static int getInputClassType(struct Input *in, char * buffer)
}
in->outputByteOrder = kindex;
#ifdef H5DEBUGIMPORT
- printf("h5dump inputByteOrder %d\n", in->inputByteOrder);
+ HDprintf("h5dump inputByteOrder %d\n", in->inputByteOrder);
#endif
kindex = -1;
@@ -3269,7 +3269,7 @@ static int getInputClassType(struct Input *in, char * buffer)
}
in->outputByteOrder = kindex;
#ifdef H5DEBUGIMPORT
- printf("h5dump inputByteOrder %d\n", in->inputByteOrder);
+ HDprintf("h5dump inputByteOrder %d\n", in->inputByteOrder);
#endif
kindex = -1;
@@ -3288,7 +3288,7 @@ static int getInputClassType(struct Input *in, char * buffer)
}
in->outputByteOrder = kindex;
#ifdef H5DEBUGIMPORT
- printf("h5dump inputByteOrder %d\n", in->inputByteOrder);
+ HDprintf("h5dump inputByteOrder %d\n", in->inputByteOrder);
#endif
kindex = -1;
@@ -3307,7 +3307,7 @@ static int getInputClassType(struct Input *in, char * buffer)
}
in->outputByteOrder = kindex;
#ifdef H5DEBUGIMPORT
- printf("h5dump inputByteOrder %d\n", in->inputByteOrder);
+ HDprintf("h5dump inputByteOrder %d\n", in->inputByteOrder);
#endif
kindex = -1;
@@ -3326,7 +3326,7 @@ static int getInputClassType(struct Input *in, char * buffer)
}
in->outputByteOrder = kindex;
#ifdef H5DEBUGIMPORT
- printf("h5dump inputByteOrder %d\n", in->inputByteOrder);
+ HDprintf("h5dump inputByteOrder %d\n", in->inputByteOrder);
#endif
kindex = -1;
@@ -3345,7 +3345,7 @@ static int getInputClassType(struct Input *in, char * buffer)
}
in->outputByteOrder = kindex;
#ifdef H5DEBUGIMPORT
- printf("h5dump inputByteOrder %d\n", in->inputByteOrder);
+ HDprintf("h5dump inputByteOrder %d\n", in->inputByteOrder);
#endif
kindex = -1;
@@ -3364,7 +3364,7 @@ static int getInputClassType(struct Input *in, char * buffer)
}
in->outputByteOrder = kindex;
#ifdef H5DEBUGIMPORT
- printf("h5dump inputByteOrder %d\n", in->inputByteOrder);
+ HDprintf("h5dump inputByteOrder %d\n", in->inputByteOrder);
#endif
kindex = -1;
@@ -3383,7 +3383,7 @@ static int getInputClassType(struct Input *in, char * buffer)
}
in->outputByteOrder = kindex;
#ifdef H5DEBUGIMPORT
- printf("h5dump inputByteOrder %d\n", in->inputByteOrder);
+ HDprintf("h5dump inputByteOrder %d\n", in->inputByteOrder);
#endif
kindex = -1;
@@ -3422,9 +3422,9 @@ static int getInputClassType(struct Input *in, char * buffer)
if (in->configOptionVector[OUTPUT_SIZE] == 0)
in->outputSize = in->inputSize;
#ifdef H5DEBUGIMPORT
- printf("h5dump DATATYPE InClass %d inputSize\n", in->inputSize);
- printf("h5dump DATATYPE InClass %d outputSize\n", in->outputSize);
- printf("h5dump DATATYPE InClass %d outputArchitecture\n", in->outputArchitecture);
+ HDprintf("h5dump DATATYPE InClass %d inputSize\n", in->inputSize);
+ HDprintf("h5dump DATATYPE InClass %d outputSize\n", in->outputSize);
+ HDprintf("h5dump DATATYPE InClass %d outputArchitecture\n", in->outputArchitecture);
#endif
in->inputClass = kindex;
@@ -4631,7 +4631,7 @@ static int process(struct Options *opt)
intype = createInputDataType(in);
outtype = createOutputDataType(in);
#ifdef H5DEBUGIMPORT
- printf("process intype %ld outtype %ld\n", intype, outtype);
+ HDprintf("process intype %ld outtype %ld\n", intype, outtype);
#endif
/* create property list */
diff --git a/tools/src/h5stat/h5stat.c b/tools/src/h5stat/h5stat.c
index ff67cf1..dc1dc4a 100644
--- a/tools/src/h5stat/h5stat.c
+++ b/tools/src/h5stat/h5stat.c
@@ -24,11 +24,11 @@
/* Parameters to control statistics gathered */
/* Default threshold for small groups/datasets/attributes */
-#define DEF_SIZE_SMALL_GROUPS 10
-#define DEF_SIZE_SMALL_DSETS 10
-#define DEF_SIZE_SMALL_ATTRS 10
+#define DEF_SIZE_SMALL_GROUPS 10
+#define DEF_SIZE_SMALL_DSETS 10
+#define DEF_SIZE_SMALL_ATTRS 10
-#define SIZE_SMALL_SECTS 10
+#define SIZE_SMALL_SECTS 10
#define H5_NFILTERS_IMPL 8 /* Number of currently implemented filters + one to
accommodate for user-define filters + one
@@ -74,7 +74,7 @@ typedef struct iter_t {
ohdr_info_t group_ohdr_info; /* Object header information for groups */
hsize_t max_attrs; /* Maximum attributes from a group */
- unsigned long *num_small_attrs; /* Size of small attributes tracked */
+ unsigned long *num_small_attrs; /* Size of small attributes tracked */
unsigned attr_nbins; /* Number of bins for attribute counts */
unsigned long *attr_bins; /* Pointer to array of bins for attribute counts */
@@ -83,7 +83,7 @@ typedef struct iter_t {
hsize_t max_dset_dims; /* Maximum dimension size of dataset */
unsigned long *small_dset_dims; /* Size of dimensions of small datasets tracked */
unsigned long dset_layouts[H5D_NLAYOUTS]; /* Type of storage for each dataset */
- unsigned long dset_comptype[H5_NFILTERS_IMPL]; /* Number of currently implemented filters */
+ unsigned long dset_comptype[H5_NFILTERS_IMPL]; /* Number of currently implemented filters */
unsigned long dset_ntypes; /* Number of diff. dataset datatypes found */
dtype_info_t *dset_type_info; /* Pointer to dataset datatype information found */
unsigned dset_dim_nbins; /* Number of bins for dataset dimensions */
@@ -103,9 +103,9 @@ typedef struct iter_t {
hsize_t super_ext_size; /* superblock extension size */
hsize_t ublk_size; /* user block size (if exists) */
H5F_fspace_strategy_t fs_strategy; /* File space management strategy */
- hbool_t fs_persist; /* Free-space persist or not */
+ hbool_t fs_persist; /* Free-space persist or not */
hsize_t fs_threshold; /* Free-space section threshold */
- hsize_t fsp_size; /* File space page size */
+ hsize_t fsp_size; /* File space page size */
hsize_t free_space; /* Amount of freespace in the file */
hsize_t free_hdr; /* Size of free space manager metadata in the file */
unsigned long num_small_sects[SIZE_SMALL_SECTS]; /* Size of small free-space sections */
@@ -136,9 +136,9 @@ static int display_dset_metadata = FALSE; /* display file space info f
static int display_object = FALSE; /* not implemented yet */
/* Initialize threshold for small groups/datasets/attributes */
-static int sgroups_threshold = DEF_SIZE_SMALL_GROUPS;
-static int sdsets_threshold = DEF_SIZE_SMALL_DSETS;
-static int sattrs_threshold = DEF_SIZE_SMALL_ATTRS;
+static int sgroups_threshold = DEF_SIZE_SMALL_GROUPS;
+static int sdsets_threshold = DEF_SIZE_SMALL_DSETS;
+static int sattrs_threshold = DEF_SIZE_SMALL_ATTRS;
/* a structure for handling the order command-line parameters come in */
struct handler_t {
@@ -257,7 +257,7 @@ leave(int ret)
}
-
+
/*-------------------------------------------------------------------------
* Function: usage
*
@@ -297,7 +297,7 @@ static void usage(const char *prog)
HDfprintf(stdout, " --enable-error-stack Prints messages from the HDF5 error stack as they occur\n");
}
-
+
/*-------------------------------------------------------------------------
* Function: ceil_log10
*
@@ -324,7 +324,7 @@ ceil_log10(unsigned long x)
return ret;
} /* ceil_log10() */
-
+
/*-------------------------------------------------------------------------
* Function: attribute_stats
*
@@ -374,7 +374,7 @@ attribute_stats(iter_t *iter, const H5O_info_t *oi)
return 0;
} /* end attribute_stats() */
-
+
/*-------------------------------------------------------------------------
* Function: group_stats
*
@@ -456,7 +456,7 @@ done:
return ret_value;
} /* end group_stats() */
-
+
/*-------------------------------------------------------------------------
* Function: dataset_stats
*
@@ -648,7 +648,7 @@ done:
return ret_value;
} /* end dataset_stats() */
-
+
/*-------------------------------------------------------------------------
* Function: datatype_stats
*
@@ -680,7 +680,7 @@ done:
return ret_value;
} /* end datatype_stats() */
-
+
/*-------------------------------------------------------------------------
* Function: obj_stats
*
@@ -736,7 +736,7 @@ done:
return ret_value;
} /* end obj_stats() */
-
+
/*-------------------------------------------------------------------------
* Function: lnk_stats
*
@@ -834,7 +834,7 @@ freespace_stats(hid_t fid, iter_t *iter)
return 0;
} /* end freespace_stats() */
-
+
/*-------------------------------------------------------------------------
* Function: hand_free
*
@@ -863,7 +863,7 @@ hand_free(struct handler_t *hand)
} /* end if */
} /* end hand_free() */
-
+
/*-------------------------------------------------------------------------
* Function: parse_command_line
*
@@ -1041,7 +1041,7 @@ error:
return -1;
}
-
+
/*-------------------------------------------------------------------------
* Function: iter_free
*
@@ -1106,7 +1106,7 @@ iter_free(iter_t *iter)
} /* end if */
} /* end iter_free() */
-
+
/*-------------------------------------------------------------------------
* Function: print_file_info
*
@@ -1138,7 +1138,7 @@ print_file_info(const iter_t *iter)
return 0;
} /* print_file_info() */
-
+
/*-------------------------------------------------------------------------
* Function: print_file_metadata
*
@@ -1198,7 +1198,7 @@ print_file_metadata(const iter_t *iter)
return 0;
} /* print_file_metadata() */
-
+
/*-------------------------------------------------------------------------
* Function: print_group_info
*
@@ -1255,7 +1255,7 @@ print_group_info(const iter_t *iter)
return 0;
} /* print_group_info() */
-
+
/*-------------------------------------------------------------------------
* Function: print_group_metadata
*
@@ -1282,7 +1282,7 @@ print_group_metadata(const iter_t *iter)
return 0;
} /* print_group_metadata() */
-
+
/*-------------------------------------------------------------------------
* Function: print_dataset_info
*
@@ -1369,7 +1369,7 @@ print_dataset_info(const iter_t *iter)
return 0;
} /* print_dataset_info() */
-
+
/*-------------------------------------------------------------------------
* Function: print_dataset_metadata
*
@@ -1398,7 +1398,7 @@ print_dset_metadata(const iter_t *iter)
return 0;
} /* print_dset_metadata() */
-
+
/*-------------------------------------------------------------------------
* Function: print_dset_dtype_meta
*
@@ -1439,7 +1439,7 @@ print_dset_dtype_meta(const iter_t *iter)
return 0;
} /* print_dset_dtype_meta() */
-
+
/*-------------------------------------------------------------------------
* Function: print_attr_info
*
@@ -1488,7 +1488,7 @@ print_attr_info(const iter_t *iter)
return 0;
} /* print_attr_info() */
-
+
/*-------------------------------------------------------------------------
* Function: print_freespace_info
*
@@ -1538,7 +1538,7 @@ print_freespace_info(const iter_t *iter)
return 0;
} /* print_freespace_info() */
-
+
/*-------------------------------------------------------------------------
* Function: print_storage_summary
*
@@ -1602,7 +1602,7 @@ print_storage_summary(const iter_t *iter)
return 0;
} /* print_storage_summary() */
-
+
/*-------------------------------------------------------------------------
* Function: print_file_statistics
*
@@ -1649,7 +1649,7 @@ print_file_statistics(const iter_t *iter)
if(display_summary) print_storage_summary(iter);
} /* print_file_statistics() */
-
+
/*-------------------------------------------------------------------------
* Function: print_object_statistics
*
@@ -1672,7 +1672,7 @@ print_object_statistics(const char *name)
printf("Object name %s\n", name);
} /* print_object_statistics() */
-
+
/*-------------------------------------------------------------------------
* Function: print_statistics
*
@@ -1698,7 +1698,7 @@ print_statistics(const char *name, const iter_t *iter)
print_file_statistics(iter);
} /* print_statistics() */
-
+
/*-------------------------------------------------------------------------
* Function: main
*
@@ -1733,7 +1733,7 @@ main(int argc, const char *argv[])
/* Disable tools error reporting */
H5Eget_auto2(H5tools_ERR_STACK_g, &tools_func, &tools_edata);
H5Eset_auto2(H5tools_ERR_STACK_g, NULL, NULL);
-
+
HDmemset(&iter, 0, sizeof(iter));
if(parse_command_line(argc, argv, &hand) < 0)
@@ -1780,15 +1780,15 @@ main(int argc, const char *argv[])
iter.free_hdr = finfo.free.meta_size;
} /* end else */
- iter.num_small_groups = (unsigned long *)HDcalloc((size_t)sgroups_threshold, sizeof(unsigned long));
- iter.num_small_attrs = (unsigned long *)HDcalloc((size_t)(sattrs_threshold+1), sizeof(unsigned long));
- iter.small_dset_dims = (unsigned long *)HDcalloc((size_t)sdsets_threshold, sizeof(unsigned long));
+ iter.num_small_groups = (unsigned long *)HDcalloc((size_t)sgroups_threshold, sizeof(unsigned long));
+ iter.num_small_attrs = (unsigned long *)HDcalloc((size_t)(sattrs_threshold+1), sizeof(unsigned long));
+ iter.small_dset_dims = (unsigned long *)HDcalloc((size_t)sdsets_threshold, sizeof(unsigned long));
- if(iter.num_small_groups == NULL || iter.num_small_attrs == NULL || iter.small_dset_dims == NULL) {
- error_msg("Unable to allocate memory for tracking small groups/datasets/attributes\n");
+ if(iter.num_small_groups == NULL || iter.num_small_attrs == NULL || iter.small_dset_dims == NULL) {
+ error_msg("Unable to allocate memory for tracking small groups/datasets/attributes\n");
h5tools_setstatus(EXIT_FAILURE);
- goto done;
- }
+ goto done;
+ }
if((fcpl = H5Fget_create_plist(fid)) < 0)
warn_msg("Unable to retrieve file creation property\n");
diff --git a/tools/test/h5import/h5importtest.c b/tools/test/h5import/h5importtest.c
index 489bc01..bbb67b6 100644
--- a/tools/test/h5import/h5importtest.c
+++ b/tools/test/h5import/h5importtest.c
@@ -71,9 +71,9 @@ main(void)
volatile uint32_t ibyte=0x01234567;
/* 0 for big endian, 1 for little endian. */
if ((*((uint8_t*)(&ibyte))) == 0x67)
- strncpy(machine_order, "LE", 2);
+ HDstrncpy(machine_order, "LE", 2);
else
- strncpy(machine_order, "BE", 2);
+ HDstrncpy(machine_order, "BE", 2);
/*
diff --git a/tools/test/perform/perf.c b/tools/test/perform/perf.c
index b421328..c6e62d5 100644
--- a/tools/test/perform/perf.c
+++ b/tools/test/perform/perf.c
@@ -63,13 +63,13 @@
#define H5FATAL 1
#define VRFY(val, mesg, fatal) do { \
if (!val) { \
- printf("Proc %d: ", mynod); \
+ printf("Proc %d: ", mynod); \
printf("*** Assertion failed (%s) at line %4d in %s\n", \
mesg, (int)__LINE__, __FILE__); \
- if (fatal){ \
+ if (fatal){ \
fflush(stdout); \
goto die_jar_jar_die; \
- } \
+ } \
} \
} while(0)
#define RANK 1
@@ -180,38 +180,38 @@ int main(int argc, char **argv)
/* setup file access template with parallel IO access. */
if (opt_split_vfd){
- hid_t mpio_pl;
-
- mpio_pl = H5Pcreate (H5P_FILE_ACCESS);
- VRFY((acc_tpl >= 0), "", H5FATAL);
- ret = H5Pset_fapl_mpio(mpio_pl, MPI_COMM_WORLD, MPI_INFO_NULL);
- VRFY((ret >= 0), "", H5FATAL);
-
- /* set optional allocation alignment */
- if (opt_alignment*opt_threshold != 1){
- ret = H5Pset_alignment(acc_tpl, opt_threshold, opt_alignment );
- VRFY((ret >= 0), "H5Pset_alignment succeeded", !H5FATAL);
- }
-
- /* setup file access template */
- acc_tpl = H5Pcreate (H5P_FILE_ACCESS);
- VRFY((acc_tpl >= 0), "", H5FATAL);
- ret = H5Pset_fapl_split(acc_tpl, meta_ext, mpio_pl, raw_ext, mpio_pl);
- VRFY((ret >= 0), "H5Pset_fapl_split succeeded", H5FATAL);
- ret = H5Pclose(mpio_pl);
- VRFY((ret >= 0), "H5Pclose mpio_pl succeeded", H5FATAL);
+ hid_t mpio_pl;
+
+ mpio_pl = H5Pcreate (H5P_FILE_ACCESS);
+ VRFY((acc_tpl >= 0), "", H5FATAL);
+ ret = H5Pset_fapl_mpio(mpio_pl, MPI_COMM_WORLD, MPI_INFO_NULL);
+ VRFY((ret >= 0), "", H5FATAL);
+
+ /* set optional allocation alignment */
+ if (opt_alignment*opt_threshold != 1){
+ ret = H5Pset_alignment(acc_tpl, opt_threshold, opt_alignment );
+ VRFY((ret >= 0), "H5Pset_alignment succeeded", !H5FATAL);
+ }
+
+ /* setup file access template */
+ acc_tpl = H5Pcreate (H5P_FILE_ACCESS);
+ VRFY((acc_tpl >= 0), "", H5FATAL);
+ ret = H5Pset_fapl_split(acc_tpl, meta_ext, mpio_pl, raw_ext, mpio_pl);
+ VRFY((ret >= 0), "H5Pset_fapl_split succeeded", H5FATAL);
+ ret = H5Pclose(mpio_pl);
+ VRFY((ret >= 0), "H5Pclose mpio_pl succeeded", H5FATAL);
}else{
- /* setup file access template */
- acc_tpl = H5Pcreate (H5P_FILE_ACCESS);
- VRFY((acc_tpl >= 0), "", H5FATAL);
- ret = H5Pset_fapl_mpio(acc_tpl, MPI_COMM_WORLD, MPI_INFO_NULL);
- VRFY((ret >= 0), "", H5FATAL);
-
- /* set optional allocation alignment */
- if (opt_alignment*opt_threshold != 1){
- ret = H5Pset_alignment(acc_tpl, opt_threshold, opt_alignment );
- VRFY((ret >= 0), "H5Pset_alignment succeeded", !H5FATAL);
- }
+ /* setup file access template */
+ acc_tpl = H5Pcreate (H5P_FILE_ACCESS);
+ VRFY((acc_tpl >= 0), "", H5FATAL);
+ ret = H5Pset_fapl_mpio(acc_tpl, MPI_COMM_WORLD, MPI_INFO_NULL);
+ VRFY((ret >= 0), "", H5FATAL);
+
+ /* set optional allocation alignment */
+ if (opt_alignment*opt_threshold != 1){
+ ret = H5Pset_alignment(acc_tpl, opt_threshold, opt_alignment );
+ VRFY((ret >= 0), "H5Pset_alignment succeeded", !H5FATAL);
+ }
}
h5_fixname_no_suffix(FILENAME[0], acc_tpl, filename, sizeof filename);
@@ -225,7 +225,7 @@ int main(int argc, char **argv)
sid = H5Screate_simple(RANK, dims, NULL);
VRFY((sid >= 0), "H5Screate_simple succeeded", H5FATAL);
dataset = H5Dcreate2(fid, "Dataset1", H5T_NATIVE_CHAR, sid,
- H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
+ H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
VRFY((dataset >= 0), "H5Dcreate2 succeeded", H5FATAL);
/* create the memory dataspace and the file dataspace */