summaryrefslogtreecommitdiffstats
path: root/testpar/t_mdset.c
diff options
context:
space:
mode:
authorAlbert Cheng <acheng@hdfgroup.org>2003-04-23 20:21:44 (GMT)
committerAlbert Cheng <acheng@hdfgroup.org>2003-04-23 20:21:44 (GMT)
commitd98f0d77c19badf83ecb0af7c40ab35fca23b424 (patch)
treebc7d6a458df1da122dc65f25c82e6490d46c8096 /testpar/t_mdset.c
parent7927acd7f31e2fb4136ac7e1826dc07a758ef11f (diff)
downloadhdf5-d98f0d77c19badf83ecb0af7c40ab35fca23b424.zip
hdf5-d98f0d77c19badf83ecb0af7c40ab35fca23b424.tar.gz
hdf5-d98f0d77c19badf83ecb0af7c40ab35fca23b424.tar.bz2
[svn-r6740] Purpose:
simple code cleanup. Description: While debug a problem in multiple_group_write(), noticed some returned values were not checked. Added code to check on all returned code. Platforms tested: h5committested. Misc. update:
Diffstat (limited to 'testpar/t_mdset.c')
-rw-r--r--testpar/t_mdset.c27
1 files changed, 16 insertions, 11 deletions
diff --git a/testpar/t_mdset.c b/testpar/t_mdset.c
index 6da82a9..f4ae360 100644
--- a/testpar/t_mdset.c
+++ b/testpar/t_mdset.c
@@ -386,7 +386,7 @@ void multiple_group_write(char *filename, int ngroups)
hid_t fid, gid, plist, memspace, filespace;
hssize_t chunk_origin[DIM];
hsize_t chunk_dims[DIM], file_dims[DIM], count[DIM];
- herr_t ret1, ret2;
+ herr_t ret;
MPI_Comm_rank(MPI_COMM_WORLD, &mpi_rank);
MPI_Comm_size(MPI_COMM_WORLD, &mpi_size);
@@ -401,15 +401,16 @@ void multiple_group_write(char *filename, int ngroups)
/* select hyperslab in memory and file spaces. These two operations are
* identical since the datasets are the same. */
memspace = H5Screate_simple(DIM, file_dims, NULL);
- ret1 = H5Sselect_hyperslab(memspace, H5S_SELECT_SET, chunk_origin,
+ VRFY((memspace>=0), "memspace");
+ ret = H5Sselect_hyperslab(memspace, H5S_SELECT_SET, chunk_origin,
chunk_dims, count, chunk_dims);
+ VRFY((ret>=0), "mgroup memspace selection");
+
filespace = H5Screate_simple(DIM, file_dims, NULL);
- ret2 = H5Sselect_hyperslab(filespace, H5S_SELECT_SET, chunk_origin,
- chunk_dims, count, chunk_dims);
- VRFY((memspace>=0), "memspace");
VRFY((filespace>=0), "filespace");
- VRFY((ret1>=0), "mgroup memspace selection");
- VRFY((ret2>=0), "mgroup filespace selection");
+ ret = H5Sselect_hyperslab(filespace, H5S_SELECT_SET, chunk_origin,
+ chunk_dims, count, chunk_dims);
+ VRFY((ret>=0), "mgroup filespace selection");
/* creates ngroups groups under the root group, writes datasets in
* parallel. */
@@ -437,11 +438,15 @@ void multiple_group_write(char *filename, int ngroups)
/* recursively creates subgroups under the first group. */
gid = H5Gopen(fid, "group0");
create_group_recursive(memspace, filespace, gid, 0);
- H5Gclose(gid);
+ ret = H5Gclose(gid);
+ VRFY((ret>=0), "H5Gclose");
- H5Sclose(filespace);
- H5Sclose(memspace);
- H5Fclose(fid);
+ ret = H5Sclose(filespace);
+ VRFY((ret>=0), "H5Sclose");
+ ret = H5Sclose(memspace);
+ VRFY((ret>=0), "H5Sclose");
+ ret = H5Fclose(fid);
+ VRFY((ret>=0), "H5Fclose");
}
/*