summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMohamad Chaarawi <chaarawi@hdfgroup.org>2013-07-16 20:44:47 (GMT)
committerMohamad Chaarawi <chaarawi@hdfgroup.org>2013-07-16 20:44:47 (GMT)
commite9c6a782d863c02159d05b733c3987b40e9f7570 (patch)
tree64e75b3196401206909f08372a6cedf4d519dd81
parent8ed1df3f85e60d6cdf2531700be90a8fdaceb1d5 (diff)
downloadhdf5-e9c6a782d863c02159d05b733c3987b40e9f7570.zip
hdf5-e9c6a782d863c02159d05b733c3987b40e9f7570.tar.gz
hdf5-e9c6a782d863c02159d05b733c3987b40e9f7570.tar.bz2
[svn-r23908] fix bug in generating IOD hyperslabs.
-rw-r--r--examples/h5ff_client_old_api.c6
-rw-r--r--src/H5VLiod_dset.c2
-rw-r--r--src/H5VLiod_dtype.c3
-rw-r--r--src/H5VLiod_server.c37
4 files changed, 27 insertions, 21 deletions
diff --git a/examples/h5ff_client_old_api.c b/examples/h5ff_client_old_api.c
index c57796d..7875b97 100644
--- a/examples/h5ff_client_old_api.c
+++ b/examples/h5ff_client_old_api.c
@@ -1,9 +1,3 @@
-/*
- * test_client.c: Client side of Milestone 3.3 Asynchronous I/O and initial
- * IOD VOL plugin demonstration. This is, in effect, the application program that
- * would run on one or more compute nodes and make calls to the HDF5 API.
- */
-
#include <stdio.h>
#include <stdlib.h>
#include <assert.h>
diff --git a/src/H5VLiod_dset.c b/src/H5VLiod_dset.c
index 40d7fe3..6899b7b 100644
--- a/src/H5VLiod_dset.c
+++ b/src/H5VLiod_dset.c
@@ -1021,7 +1021,7 @@ H5VL_iod_server_dset_close_cb(AXE_engine_t UNUSED axe_engine,
HGOTO_ERROR(H5E_SYM, H5E_CANTINIT, FAIL, "can't close object");
}
else {
- /* MSC - need a way to kill object handle for this group */
+ /* MSC - need a way to kill object handle for this dataset */
fprintf(stderr, "I do not have the OH of this dataset to close it\n");
}
diff --git a/src/H5VLiod_dtype.c b/src/H5VLiod_dtype.c
index 6bc17c1..454cd03 100644
--- a/src/H5VLiod_dtype.c
+++ b/src/H5VLiod_dtype.c
@@ -307,9 +307,6 @@ H5VL_iod_server_dtype_open_cb(AXE_engine_t UNUSED axe_engine,
if (iod_obj_open_write(coh, sp.mdkv_id, NULL /*hints*/, &mdkv_oh, NULL) < 0)
HGOTO_ERROR(H5E_FILE, H5E_CANTINIT, FAIL, "can't open scratch pad");
- /* MSC - need to read datatype; size should be stored in metadata,
- but since no real IOD, can't do anything now */
-
#if 0
kv_size = 0;
/* read the datatypes's creation properties */
diff --git a/src/H5VLiod_server.c b/src/H5VLiod_server.c
index a3f29a1..59c4a56 100644
--- a/src/H5VLiod_server.c
+++ b/src/H5VLiod_server.c
@@ -2837,9 +2837,11 @@ H5VL_iod_get_file_desc(hid_t space_id, hssize_t *count, iod_hyperslab_t *hslabs)
if(NULL != hslabs) {
hsize_t *points = NULL;
+ size_t point_count = 0;
- if(NULL == (points = (hsize_t *)malloc(sizeof(hsize_t) * ndims *
- (hsize_t)num_descriptors)))
+ point_count = ndims * num_descriptors * sizeof(hsize_t);
+
+ if(NULL == (points = (hsize_t *)malloc(point_count)))
HGOTO_ERROR(H5E_SYM, H5E_NOSPACE, FAIL, "can't allocate array for points coords");
if(H5Sget_select_elem_pointlist(space_id, (hsize_t)0,
@@ -2848,13 +2850,18 @@ H5VL_iod_get_file_desc(hid_t space_id, hssize_t *count, iod_hyperslab_t *hslabs)
/* populate the hyperslab */
for(n=0 ; n<num_descriptors ; n++) {
+ hsize_t *cur_ptr = points; /* temp pointer into points array */
+
+ /* adjust the current pointer to the current point */
+ cur_ptr += n*ndims;
for(i=0 ; i<ndims ; i++) {
- hslabs[n].start[i] = *points++;
+ hslabs[n].start[i] = *(cur_ptr+i);
hslabs[n].stride[i] = 1;
- hslabs[n].block[i] = 1;
hslabs[n].count[i] = 1;
+ hslabs[n].block[i] = *(cur_ptr+ndims+i) + 1 - hslabs[n].start[i];
}
}
+
free(points);
}
break;
@@ -2876,29 +2883,37 @@ H5VL_iod_get_file_desc(hid_t space_id, hssize_t *count, iod_hyperslab_t *hslabs)
HGOTO_ERROR(H5E_SYM, H5E_CANTGET, FAIL, "Failed to retrieve hyperslab selection");
}
}
- /* Otherwise populate the hslabs by gettinge very block */
+ /* Otherwise populate the hslabs by getting every block */
else {
if((num_descriptors = H5Sget_select_hyper_nblocks(space_id)) < 0)
HGOTO_ERROR(H5E_SYM, H5E_CANTINIT, FAIL, "invalid hyperslab selection");
if(NULL != hslabs) {
- hsize_t *blocks;
+ hsize_t *blocks = NULL;
+ size_t block_count = 0;
- if(NULL == (blocks = (hsize_t *)malloc(sizeof(hsize_t) * 2 *
- ndims * num_descriptors)))
+ block_count = ndims * num_descriptors * sizeof(hsize_t) * 2;
+
+ if(NULL == (blocks = (hsize_t *)malloc(block_count)))
HGOTO_ERROR(H5E_SYM, H5E_NOSPACE, FAIL, "can't allocate array for points coords");
+ fprintf(stderr, "block count = %zu\n", block_count);
+
if(H5Sget_select_hyper_blocklist(space_id, (hsize_t)0,
(hsize_t)num_descriptors, blocks) < 0)
HGOTO_ERROR(H5E_SYM, H5E_CANTGET, FAIL, "Failed to retrieve point coordinates");
/* populate the hyperslab */
for(n=0 ; n<num_descriptors ; n++) {
+ hsize_t *cur_ptr = blocks; /* temp pointer into blocks array */
+
+ /* adjust the current pointer to the current block */
+ cur_ptr += n*ndims*2;
for(i=0 ; i<ndims ; i++) {
- hslabs[n].start[i] = *blocks++;
+ hslabs[n].start[i] = *(cur_ptr+i);
hslabs[n].stride[i] = 1;
- hslabs[n].block[i] = 1;
- hslabs[n].count[i] = *blocks++;
+ hslabs[n].count[i] = 1;
+ hslabs[n].block[i] = *(cur_ptr+ndims+i) + 1 - hslabs[n].start[i];
}
}