diff options
author | Quincey Koziol <koziol@hdfgroup.org> | 2009-07-02 22:34:20 (GMT) |
---|---|---|
committer | Quincey Koziol <koziol@hdfgroup.org> | 2009-07-02 22:34:20 (GMT) |
commit | c243e1e13456365b0b555a9c82d5cc17f1436727 (patch) | |
tree | acf5130fd8bede482315c050b1ec0e3faf096ee4 /src/H5Olayout.c | |
parent | 47e4e67e3cd11f99ac417613eed9f47e65f55468 (diff) | |
download | hdf5-c243e1e13456365b0b555a9c82d5cc17f1436727.zip hdf5-c243e1e13456365b0b555a9c82d5cc17f1436727.tar.gz hdf5-c243e1e13456365b0b555a9c82d5cc17f1436727.tar.bz2 |
[svn-r17148] Description:
Refactor how chunked dataset information is computed, moving it earlier and
avoiding more recomputation.
Tested on:
FreeBSD/32 6.3 (duty) in debug mode
FreeBSD/64 6.3 (liberty) w/C++ & FORTRAN, in debug mode
Linux/32 2.6 (jam) w/PGI compilers, w/C++ & FORTRAN, w/threadsafe,
in debug mode
Linux/64-amd64 2.6 (smirom) w/Intel compilers w/default API=1.6.x,
w/C++ & FORTRAN, in production mode
Solaris/32 2.10 (linew) w/deprecated symbols disabled, w/C++ & FORTRAN,
w/szip filter, in production mode
Linux/64-ia64 2.6 (cobalt) w/Intel compilers, w/C++ & FORTRAN,
in production mode
Linux/64-ia64 2.4 (tg-login3) w/parallel, w/FORTRAN, in debug mode
Linux/64-amd64 2.6 (abe) w/parallel, w/FORTRAN, in production mode
Mac OS X/32 10.5.7 (amazon) in debug mode
Mac OS X/32 10.5.7 (amazon) w/C++ & FORTRAN, w/threadsafe,
in production mode
Diffstat (limited to 'src/H5Olayout.c')
-rw-r--r-- | src/H5Olayout.c | 21 |
1 files changed, 19 insertions, 2 deletions
diff --git a/src/H5Olayout.c b/src/H5Olayout.c index da8f2a8..3483c3e 100644 --- a/src/H5Olayout.c +++ b/src/H5Olayout.c @@ -630,13 +630,30 @@ H5O_layout_copy_file(H5F_t *file_src, void *mesg_src, H5F_t *file_dst, case H5D_CHUNKED: if(H5D_chunk_is_space_alloc(layout_src)) { + hsize_t curr_dims[H5O_LAYOUT_NDIMS]; /* Curr. size of dataset dimensions */ + int sndims; /* Rank of dataspace */ + unsigned ndims; /* Rank of dataspace */ + /* Layout is not created in the destination file, reset index address */ if(H5D_chunk_idx_reset(layout_dst, TRUE) < 0) - HGOTO_ERROR(H5E_IO, H5E_CANTINIT, NULL, "unable to reset chunked storage index in dest") + HGOTO_ERROR(H5E_OHDR, H5E_CANTINIT, NULL, "unable to reset chunked storage index in dest") + + /* Get the dim info for dataset */ + if((sndims = H5S_extent_get_dims(udata->src_space_extent, curr_dims, NULL)) < 0) + HGOTO_ERROR(H5E_OHDR, H5E_CANTGET, NULL, "can't get dataspace dimensions") + H5_ASSIGN_OVERFLOW(ndims, sndims, int, unsigned); + + /* Set the source layout chunk information */ + if(H5D_chunk_set_info_real(layout_src, ndims, curr_dims) < 0) + HGOTO_ERROR(H5E_OHDR, H5E_CANTSET, NULL, "can't set layout's chunk info") + + /* Set the dest. layout chunk info also */ + if(H5D_chunk_set_info_real(layout_dst, ndims, curr_dims) < 0) + HGOTO_ERROR(H5E_OHDR, H5E_CANTSET, NULL, "can't set layout's chunk info") /* Create chunked layout */ if(H5D_chunk_copy(file_src, layout_src, file_dst, layout_dst, udata->src_dtype, cpy_info, udata->src_pline, dxpl_id) < 0) - HGOTO_ERROR(H5E_IO, H5E_CANTINIT, NULL, "unable to copy chunked storage") + HGOTO_ERROR(H5E_OHDR, H5E_CANTINIT, NULL, "unable to copy chunked storage") } /* if ( H5F_addr_defined(layout_srct->u.chunk.addr)) */ break; |