summaryrefslogtreecommitdiffstats
path: root/examples/h5ff_client_dset.c
diff options
context:
space:
mode:
authorMohamad Chaarawi <chaarawi@hdfgroup.org>2013-09-19 23:41:05 (GMT)
committerMohamad Chaarawi <chaarawi@hdfgroup.org>2013-09-19 23:41:05 (GMT)
commit32ec6c6568fc611a2d16a0c42f88c10d150573af (patch)
tree2398d0ef75590b0bcf9b6540d12774cf254a67fc /examples/h5ff_client_dset.c
parent359d51effedde76636e0a65f0580b6bcfcb5753d (diff)
downloadhdf5-32ec6c6568fc611a2d16a0c42f88c10d150573af.zip
hdf5-32ec6c6568fc611a2d16a0c42f88c10d150573af.tar.gz
hdf5-32ec6c6568fc611a2d16a0c42f88c10d150573af.tar.bz2
[svn-r24173] - update checksum verification to check for properties for enabling/disabling checksums.
- done for raw data, scratch pads. to do KV pairs.
Diffstat (limited to 'examples/h5ff_client_dset.c')
-rw-r--r--examples/h5ff_client_dset.c20
1 files changed, 20 insertions, 0 deletions
diff --git a/examples/h5ff_client_dset.c b/examples/h5ff_client_dset.c
index d09a6bb..a595b4c 100644
--- a/examples/h5ff_client_dset.c
+++ b/examples/h5ff_client_dset.c
@@ -39,6 +39,7 @@ int main(int argc, char **argv) {
int num_requests = 0;
unsigned int i = 0;
uint32_t cs = 0,read1_cs = 0, read2_cs = 0;
+ uint32_t cs_scope = 0;
herr_t ret;
MPI_Init_thread(&argc, &argv, MPI_THREAD_MULTIPLE, &provided);
@@ -78,6 +79,11 @@ int main(int argc, char **argv) {
event_q = H5EQcreate(fapl_id);
assert(event_q);
+ /* set the metada data integrity checks to happend at transfer through mercury */
+ cs_scope |= H5_CHECKSUM_TRANSFER;
+ ret = H5Pset_metadata_integrity_scope(fapl_id, cs_scope);
+ assert(ret == 0);
+
/* create the file. */
file_id = H5Fcreate(file_name, H5F_ACC_TRUNC, H5P_DEFAULT, fapl_id);
assert(file_id > 0);
@@ -135,6 +141,12 @@ int main(int argc, char **argv) {
dxpl_id = H5Pcreate (H5P_DATASET_XFER);
cs = H5checksum(wdata1, sizeof(int32_t) * nelem, NULL);
H5Pset_dxpl_checksum(dxpl_id, cs);
+
+ /* tell HDF5 to disable all data integrity checks for this write */
+ cs_scope = 0;
+ ret = H5Pset_rawdata_integrity_scope(dxpl_id, cs_scope);
+ assert(ret == 0);
+
ret = H5Dwrite_ff(did1, dtid, sid, sid, dxpl_id, wdata1, tid1, event_q);
assert(ret == 0);
@@ -144,6 +156,13 @@ int main(int argc, char **argv) {
cs = H5checksum(wdata2, sizeof(int32_t) * nelem, NULL);
H5Pset_dxpl_checksum(dxpl_id, cs);
H5Pset_dxpl_inject_corruption(dxpl_id, 1);
+
+ /* tell HDF5 to disable data integrity checks stored at IOD for this write;
+ The transfer checksum will still capture the corruption. */
+ cs_scope |= H5_CHECKSUM_IOD;
+ ret = H5Pset_rawdata_integrity_scope(dxpl_id, cs_scope);
+ assert(ret == 0);
+
ret = H5Dwrite_ff(did2, dtid, sid, sid, dxpl_id, wdata2, tid1, event_q);
assert(ret == 0);
@@ -237,6 +256,7 @@ int main(int argc, char **argv) {
H5Pset_dxpl_inject_corruption(dxpl_id, 1);
/* Give a location to the DXPL to store the checksum once the read has completed */
H5Pset_dxpl_checksum_ptr(dxpl_id, &read2_cs);
+
ret = H5Dread_ff(did2, dtid, sid, sid, dxpl_id, rdata2, rid2, event_q);
assert(ret == 0);
H5Pclose(dxpl_id);