diff options
author | Mohamad Chaarawi <chaarawi@hdfgroup.org> | 2013-06-12 13:38:30 (GMT) |
---|---|---|
committer | Mohamad Chaarawi <chaarawi@hdfgroup.org> | 2013-06-12 13:38:30 (GMT) |
commit | d92a3d0ed22b60ee3188f20bbddf24dcd3f9262f (patch) | |
tree | bed5a4d3ade5a2c306fa22f981c495b0a432c354 | |
parent | 5e66e28d550e47f7a99d943c2553b7b1da1b8a17 (diff) | |
download | hdf5-d92a3d0ed22b60ee3188f20bbddf24dcd3f9262f.zip hdf5-d92a3d0ed22b60ee3188f20bbddf24dcd3f9262f.tar.gz hdf5-d92a3d0ed22b60ee3188f20bbddf24dcd3f9262f.tar.bz2 |
[svn-r23758] use new checksum routine in test program
-rw-r--r-- | examples/test_client.c | 16 | ||||
-rw-r--r-- | src/H5VLiod.c | 3 |
2 files changed, 15 insertions, 4 deletions
diff --git a/examples/test_client.c b/examples/test_client.c index 093c546..a23188f 100644 --- a/examples/test_client.c +++ b/examples/test_client.c @@ -34,6 +34,7 @@ int main(int argc, char **argv) { int num_requests = 0;
hsize_t extent = 20;
hbool_t exists;
+ uint32_t cs;
H5_request_t req1;
H5_status_t status1;
@@ -206,18 +207,29 @@ int main(int argc, char **argv) { H5P_DEFAULT,H5P_DEFAULT,H5P_DEFAULT, 0, event_q);
assert(did3);
+ /* Attach a checksum to the dxpl which is verified all the way
+ down at the server */
+ dxpl_id = H5Pcreate (H5P_DATASET_XFER);
+ cs = H5_checksum_fletcher32(data, sizeof(int) * nelem);
+ H5Pset_dxpl_checksum(dxpl_id, cs);
+
/* Raw data write on D1. This is asynchronous, but it is delayed
internally at the server until the create for D1
is completed. Internal to the IOD-VOL plugin client we
generate a checksum for data and ship it with the write bulk
data function shipper handle to the server. */
- H5Dwrite_ff(did1, int_id, dataspaceId, dataspaceId, H5P_DEFAULT, data,
+ H5Dwrite_ff(did1, int_id, dataspaceId, dataspaceId, dxpl_id, data,
0, event_q);
+ cs = H5_checksum_fletcher32(data2, sizeof(int) * nelem);
+ H5Pset_dxpl_checksum(dxpl_id, cs);
+
/* Raw data write on D2. same as previous. */
- H5Dwrite_ff(did2, int_id, dataspaceId, dataspaceId, H5P_DEFAULT, data2,
+ H5Dwrite_ff(did2, int_id, dataspaceId, dataspaceId, dxpl_id, data2,
0, event_q);
+ H5Pclose(dxpl_id);
+
/* Raw data write on D3. Same as previous; however we specify that
the data in the buffer is in BE byte order and of smaller
extent than the datatype of the dataset. Type conversion will
diff --git a/src/H5VLiod.c b/src/H5VLiod.c index 79e99da..7c798d0 100644 --- a/src/H5VLiod.c +++ b/src/H5VLiod.c @@ -160,7 +160,6 @@ H5FL_DEFINE(H5VL_iod_dset_t); H5FL_DEFINE(H5VL_iod_dtype_t); static na_addr_t PEER; -uint32_t write_checksum; static na_class_t *network_class = NULL; static uint64_t axe_id; @@ -3868,8 +3867,8 @@ H5VL_iod_attribute_write(void *_attr, hid_t type_id, const void *buf, hid_t dxpl /* calculate a checksum for the data */ cs = H5_checksum_fletcher32(buf, size); + /* MSC- store it in a global variable for now so that the read can see it (for demo purposes */ - write_checksum = cs; printf("Checksum Generated for attribute data at client: %u\n", cs); /* allocate a bulk data transfer handle */ |