diff options
author | Mohamad Chaarawi <chaarawi@hdfgroup.org> | 2014-01-07 19:36:34 (GMT) |
---|---|---|
committer | Mohamad Chaarawi <chaarawi@hdfgroup.org> | 2014-01-07 19:36:34 (GMT) |
commit | aa2b252a537172470083f8c75c1e6d2dc68c4cc5 (patch) | |
tree | 774c9a0ec72c95a67b5b944d91434c939c0dc8d2 /src | |
parent | 5fd8fd0d6caabb38484d17c0d620a22c8223281e (diff) | |
download | hdf5-aa2b252a537172470083f8c75c1e6d2dc68c4cc5.zip hdf5-aa2b252a537172470083f8c75c1e6d2dc68c4cc5.tar.gz hdf5-aa2b252a537172470083f8c75c1e6d2dc68c4cc5.tar.bz2 |
[svn-r24620] add vl dataset example.
Diffstat (limited to 'src')
-rw-r--r-- | src/H5VLiod_dset.c | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/src/H5VLiod_dset.c b/src/H5VLiod_dset.c index dec2edb..ed310e6 100644 --- a/src/H5VLiod_dset.c +++ b/src/H5VLiod_dset.c @@ -96,6 +96,7 @@ H5VL_iod_server_dset_create_cb(AXE_engine_t UNUSED axe_engine, scratch_pad sp; iod_ret_t ret = 0; int step = 0; + H5T_class_t dt_class; iod_size_t array_dims[H5S_MAX_RANK], current_dims[H5S_MAX_RANK]; herr_t ret_value = SUCCEED; @@ -117,8 +118,14 @@ H5VL_iod_server_dset_create_cb(AXE_engine_t UNUSED axe_engine, fprintf(stderr, "at (OH %"PRIu64" ID %"PRIx64")\n", cur_oh.wr_oh, cur_id); #endif + dt_class = H5Tget_class(input->type_id); /* Set the IOD array creation parameters */ - array.cell_size = (uint32_t)H5Tget_size(input->type_id); + if(dt_class == H5T_VLEN || + (dt_class == H5T_STRING && H5Tis_variable_str(input->type_id)) ) + array.cell_size = sizeof(iod_obj_id_t) + sizeof(iod_size_t); + else + array.cell_size = (uint32_t)H5Tget_size(input->type_id); + array.num_dims = (uint32_t)H5Sget_simple_extent_ndims(space_id); /* Handle Scalar Dataspaces (set rank and current dims size to 1) */ @@ -147,7 +154,7 @@ H5VL_iod_server_dset_create_cb(AXE_engine_t UNUSED axe_engine, array.chunk_dims = NULL; #if H5VL_IOD_DEBUG - fprintf(stderr, "now creating the dataset %s cellsize %d num dimenstions %d\n", + fprintf(stderr, "now creating the dataset %s cellsize %d num dimensions %d\n", last_comp, array.cell_size, array.num_dims); #endif @@ -1518,7 +1525,7 @@ H5VL__iod_server_vl_data_io_cb(void UNUSED *elem, hid_t type_id, unsigned ndims, HGOTO_ERROR2(H5E_SYM, H5E_CANTINIT, FAIL, "can't open Datatype"); seq_len = *((size_t *)(udata->buf_ptr)); - udata->buf_ptr += sizeof(size_t); + udata->buf_ptr += sizeof(iod_size_t); buf_size = seq_len * udata->mem_type_size; |