diff --git a/src/C/H5Block.c b/src/C/H5Block.c index 0393f5e..0fd4b9b 100644 --- a/src/C/H5Block.c +++ b/src/C/H5Block.c @@ -116,12 +116,12 @@ H5Block3dSetView ( h5_err_t H5Block3dGetView ( h5_file_t *const f, /*!< IN: File handle */ - h5_size_t *i_start, /*!< OUT: start index of \c i */ - h5_size_t *i_end, /*!< OUT: end index of \c i */ - h5_size_t *j_start, /*!< OUT: start index of \c j */ - h5_size_t *j_end, /*!< OUT: end index of \c j */ - h5_size_t *k_start, /*!< OUT: start index of \c k */ - h5_size_t *k_end /*!< OUT: end index of \c k */ + h5_int64_t *i_start, /*!< OUT: start index of \c i */ + h5_int64_t *i_end, /*!< OUT: end index of \c i */ + h5_int64_t *j_start, /*!< OUT: start index of \c j */ + h5_int64_t *j_end, /*!< OUT: end index of \c j */ + h5_int64_t *k_start, /*!< OUT: start index of \c k */ + h5_int64_t *k_end /*!< OUT: end index of \c k */ ) { SET_FNAME( f, __func__ ); @@ -139,12 +139,12 @@ H5Block3dGetView ( h5_err_t H5Block3dGetReducedView ( h5_file_t *const f, /*!< IN: File handle */ - h5_size_t *i_start, /*!< OUT: start index of \c i */ - h5_size_t *i_end, /*!< OUT: end index of \c i */ - h5_size_t *j_start, /*!< OUT: start index of \c j */ - h5_size_t *j_end, /*!< OUT: end index of \c j */ - h5_size_t *k_start, /*!< OUT: start index of \c j */ - h5_size_t *k_end /*!< OUT: end index of \c j */ + h5_int64_t *i_start, /*!< OUT: start index of \c i */ + h5_int64_t *i_end, /*!< OUT: end index of \c i */ + h5_int64_t *j_start, /*!< OUT: start index of \c j */ + h5_int64_t *j_end, /*!< OUT: end index of \c j */ + h5_int64_t *k_start, /*!< OUT: start index of \c j */ + h5_int64_t *k_end /*!< OUT: end index of \c j */ ) { SET_FNAME( f, __func__ ); @@ -184,12 +184,14 @@ h5_err_t H5Block3dGetChunk ( h5_file_t *const f, /*!< IN: File handle */ const char *field_name, /*!< IN: name of dataset */ - h5_size_t *dims /*!< OUT: array containing the chunk dimensions */ + h5_int64_t *i, /*!< OUT: size of \c i */ + h5_int64_t *j, /*!< OUT: size of \c j */ + h5_int64_t *k /*!< OUT: size of \c k */ ) { SET_FNAME( f, __func__ ); - return h5b_3d_get_chunk(f, field_name, dims); + return h5b_3d_get_chunk(f, field_name, i, j, k); } /*! diff --git a/src/C/Makefile.am b/src/C/Makefile.am index bbf8045..e2ccd0a 100644 --- a/src/C/Makefile.am +++ b/src/C/Makefile.am @@ -43,5 +43,5 @@ libH5hutC_a_SOURCES = \ H5Fed_store.c \ H5Fed_tags.c -clean: cleam-am +clean: clean-am diff --git a/src/Fortran/H5Block_F.c b/src/Fortran/H5Block_F.c index bfdc72f..01da8f5 100755 --- a/src/Fortran/H5Block_F.c +++ b/src/Fortran/H5Block_F.c @@ -96,20 +96,12 @@ h5bl_3d_getview ( h5_file_t *filehandle = (h5_file_t*)(size_t)*f; h5_set_funcname( filehandle, __func__ ); - h5_size_t view[6]; h5_err_t herr = h5b_3d_get_view ( filehandle, - view+0, view+1, view+2, view+3, view+4, view+5 ); + i_start, i_end, j_start, j_end, k_start, k_end ); if ( herr < 0 ) return herr; - *i_start = view[0]+1; - *i_end = view[1]+1; - *j_start = view[2]+1; - *j_end = view[3]+1; - *k_start = view[4]+1; - *k_end = view[5]+1; - return H5_SUCCESS; } @@ -126,20 +118,12 @@ h5bl_3d_getreducedview ( h5_file_t *filehandle = (h5_file_t*)(size_t)*f; h5_set_funcname( filehandle, __func__ ); - h5_size_t view[6]; h5_err_t herr = h5b_3d_get_reduced_view ( filehandle, - view+0, view+1, view+2, view+3, view+4, view+5 ); + i_start, i_end, j_start, j_end, k_start, k_end ); if ( herr < 0 ) return herr; - *i_start = view[0]+1; - *i_end = view[1]+1; - *j_start = view[2]+1; - *j_end = view[3]+1; - *k_start = view[4]+1; - *k_end = view[5]+1; - return H5_SUCCESS; } diff --git a/src/Fortran/H5_F.c b/src/Fortran/H5_F.c index 164fc23..a495997 100644 --- a/src/Fortran/H5_F.c +++ b/src/Fortran/H5_F.c @@ -168,7 +168,7 @@ h5pt_opena_par_align ( h5_int32_t fbits = H5_O_APPEND | _flagsfor2c ( flags2 ); - h5_file_t* f = H5OpenFile( file_name2, ccomm, fbits, __func__ ); + h5_file_t* f = h5_open_file( file_name2, ccomm, fbits, __func__ ); free ( file_name2 ); free ( flags2 ); diff --git a/src/h5core/h5_openclose.c b/src/h5core/h5_openclose.c index 6a0c68e..2a08519 100644 --- a/src/h5core/h5_openclose.c +++ b/src/h5core/h5_openclose.c @@ -24,7 +24,11 @@ h5_check_filehandle ( h5_file_t* const f /*!< filehandle to check validity of */ ) { - if (f == NULL || f->file < 0 || f->u == NULL || f->b == NULL || f->t == NULL) { + if (f == NULL || f->file < 0 || f->u == NULL || f->b == NULL +#ifndef PARALLEL_IO + || f->t == NULL +#endif + ) { return h5_error ( f, H5_ERR_BADFD, @@ -225,7 +229,9 @@ h5priv_open_file ( TRY( h5upriv_open_file (f) ); TRY( h5bpriv_open_file (f) ); +#ifndef PARALLEL_IO TRY( h5tpriv_open_file (f) ); +#endif return H5_SUCCESS; } @@ -339,7 +345,9 @@ h5_close_file ( TRY( h5priv_close_step (f) ); TRY( h5upriv_close_file (f) ); TRY( h5bpriv_close_file (f) ); +#ifndef PARALLEL_IO TRY( h5tpriv_close_file (f) ); +#endif TRY( h5priv_close_hdf5_group (f, f->step_gid) ); TRY( h5priv_close_hdf5_property (f, f->xfer_prop) ); TRY( h5priv_close_hdf5_property (f, f->access_prop) ); diff --git a/src/h5core/h5b_model.c b/src/h5core/h5b_model.c index 8dfc859..ed8cc79 100644 --- a/src/h5core/h5b_model.c +++ b/src/h5core/h5b_model.c @@ -523,12 +523,12 @@ h5b_3d_has_view ( h5_err_t h5b_3d_set_view ( h5_file_t *const f, /*!< IN: File handle */ - const h5_size_t i_start, /*!< IN: start index of \c i */ - const h5_size_t i_end, /*!< IN: end index of \c i */ - const h5_size_t j_start, /*!< IN: start index of \c j */ - const h5_size_t j_end, /*!< IN: end index of \c j */ - const h5_size_t k_start, /*!< IN: start index of \c k */ - const h5_size_t k_end /*!< IN: end index of \c k */ + const h5_int64_t i_start, /*!< IN: start index of \c i */ + const h5_int64_t i_end, /*!< IN: end index of \c i */ + const h5_int64_t j_start, /*!< IN: start index of \c j */ + const h5_int64_t j_end, /*!< IN: end index of \c j */ + const h5_int64_t k_start, /*!< IN: start index of \c k */ + const h5_int64_t k_end /*!< IN: end index of \c k */ ) { h5b_partition_t *p = f->b->user_layout; @@ -590,12 +590,12 @@ h5b_3d_set_view ( h5_err_t h5b_3d_get_view ( h5_file_t *const f, /*!< IN: File handle */ - h5_size_t *i_start, /*!< OUT: start index of \c i */ - h5_size_t *i_end, /*!< OUT: end index of \c i */ - h5_size_t *j_start, /*!< OUT: start index of \c j */ - h5_size_t *j_end, /*!< OUT: end index of \c j */ - h5_size_t *k_start, /*!< OUT: start index of \c k */ - h5_size_t *k_end /*!< OUT: end index of \c k */ + h5_int64_t *i_start, /*!< OUT: start index of \c i */ + h5_int64_t *i_end, /*!< OUT: end index of \c i */ + h5_int64_t *j_start, /*!< OUT: start index of \c j */ + h5_int64_t *j_end, /*!< OUT: end index of \c j */ + h5_int64_t *k_start, /*!< OUT: start index of \c k */ + h5_int64_t *k_end /*!< OUT: end index of \c k */ ) { h5b_partition_t *p = f->b->user_layout; @@ -613,12 +613,12 @@ h5b_3d_get_view ( h5_err_t h5b_3d_get_reduced_view ( h5_file_t *const f, /*!< IN: File handle */ - h5_size_t *i_start, /*!< OUT: start index of \c i */ - h5_size_t *i_end, /*!< OUT: end index of \c i */ - h5_size_t *j_start, /*!< OUT: start index of \c j */ - h5_size_t *j_end, /*!< OUT: end index of \c j */ - h5_size_t *k_start, /*!< OUT: start index of \c k */ - h5_size_t *k_end /*!< OUT: end index of \c k */ + h5_int64_t *i_start, /*!< OUT: start index of \c i */ + h5_int64_t *i_end, /*!< OUT: end index of \c i */ + h5_int64_t *j_start, /*!< OUT: start index of \c j */ + h5_int64_t *j_end, /*!< OUT: end index of \c j */ + h5_int64_t *k_start, /*!< OUT: start index of \c k */ + h5_int64_t *k_end /*!< OUT: end index of \c k */ ) { h5b_partition_t *p = f->b->write_layout; @@ -636,9 +636,9 @@ h5b_3d_get_reduced_view ( h5_err_t h5b_3d_set_chunk ( h5_file_t *const f, /*!< IN: File handle */ - const h5_size_t i, /*!< IN: size of \c i */ - const h5_size_t j, /*!< IN: size of \c j */ - const h5_size_t k /*!< IN: size of \c k */ + const h5_int64_t i, /*!< IN: size of \c i */ + const h5_int64_t j, /*!< IN: size of \c j */ + const h5_int64_t k /*!< IN: size of \c k */ ) { if ( i == 0 || j == 0 || k == 0 ) @@ -662,7 +662,9 @@ h5_err_t h5b_3d_get_chunk ( h5_file_t *const f, /*!< IN: File handle */ const char *field_name, /*!< IN: name of dataset */ - h5_size_t *dims /*!< OUT: array containing the chunk dimensions */ + h5_int64_t *i, /*!< OUT: size of \c i */ + h5_int64_t *j, /*!< OUT: size of \c j */ + h5_int64_t *k /*!< OUT: size of \c k */ ) { CHECK_TIMEGROUP ( f ); @@ -681,15 +683,15 @@ h5b_3d_get_chunk ( TRY( h5priv_close_hdf5_property(f, plist_id) ); TRY( h5priv_close_hdf5_dataset(f, dataset_id) ); - dims[0] = hdims[2]; - dims[1] = hdims[1]; - dims[2] = hdims[0]; + *i = hdims[2]; + *j = hdims[1]; + *k = hdims[0]; h5_info(f, "Found chunk dimensions (%lld,%lld,%lld)", - (long long)dims[0], - (long long)dims[1], - (long long)dims[2] ); + (long long)hdims[0], + (long long)hdims[1], + (long long)hdims[2] ); return H5_SUCCESS; } @@ -818,20 +820,12 @@ h5b_3d_set_halo ( h5b_fdata_t *b = f->b; - b->user_layout->i_start -= k; - b->user_layout->i_end += k; + b->user_layout->i_start -= i; + b->user_layout->i_end += i; b->user_layout->j_start -= j; b->user_layout->j_end += j; - b->user_layout->k_start -= i; - b->user_layout->k_end += i; - - b->user_layout->i_start = MAX(0, b->user_layout->i_start); - b->user_layout->j_start = MAX(0, b->user_layout->j_start); - b->user_layout->k_start = MAX(0, b->user_layout->k_start); - - b->user_layout->i_end = MIN(b->i_max, b->user_layout->i_end); - b->user_layout->j_end = MIN(b->j_max, b->user_layout->j_end); - b->user_layout->k_end = MIN(b->k_max, b->user_layout->k_end); + b->user_layout->k_start -= k; + b->user_layout->k_end += k; return H5_SUCCESS; } diff --git a/src/h5core/h5b_types_private.h b/src/h5core/h5b_types_private.h index ddc35bb..8dde5e0 100644 --- a/src/h5core/h5b_types_private.h +++ b/src/h5core/h5b_types_private.h @@ -2,12 +2,12 @@ #define __H5B_TYPES_PRIVATE_H struct h5b_partition { - h5_size_t i_start; - h5_size_t i_end; - h5_size_t j_start; - h5_size_t j_end; - h5_size_t k_start; - h5_size_t k_end; + h5_int64_t i_start; + h5_int64_t i_end; + h5_int64_t j_start; + h5_int64_t j_end; + h5_int64_t k_start; + h5_int64_t k_end; }; struct h5b_fdata { diff --git a/src/include/h5core/h5b_model.h b/src/include/h5core/h5b_model.h index 2fedf07..e321984 100644 --- a/src/include/h5core/h5b_model.h +++ b/src/include/h5core/h5b_model.h @@ -37,49 +37,51 @@ h5b_3d_has_view ( h5_err_t h5b_3d_set_view ( h5_file_t *const f, /*!< IN: File handle */ - const h5_size_t i_start, /*!< IN: start index of \c i */ - const h5_size_t i_end, /*!< IN: end index of \c i */ - const h5_size_t j_start, /*!< IN: start index of \c j */ - const h5_size_t j_end, /*!< IN: end index of \c j */ - const h5_size_t k_start, /*!< IN: start index of \c k */ - const h5_size_t k_end /*!< IN: end index of \c k */ + const h5_int64_t i_start, /*!< IN: start index of \c i */ + const h5_int64_t i_end, /*!< IN: end index of \c i */ + const h5_int64_t j_start, /*!< IN: start index of \c j */ + const h5_int64_t j_end, /*!< IN: end index of \c j */ + const h5_int64_t k_start, /*!< IN: start index of \c k */ + const h5_int64_t k_end /*!< IN: end index of \c k */ ); h5_err_t h5b_3d_get_view ( h5_file_t *const f, /*!< IN: File handle */ - h5_size_t *i_start, /*!< OUT: start index of \c i */ - h5_size_t *i_end, /*!< OUT: end index of \c i */ - h5_size_t *j_start, /*!< OUT: start index of \c j */ - h5_size_t *j_end, /*!< OUT: end index of \c j */ - h5_size_t *k_start, /*!< OUT: start index of \c k */ - h5_size_t *k_end /*!< OUT: end index of \c k */ + h5_int64_t *i_start, /*!< OUT: start index of \c i */ + h5_int64_t *i_end, /*!< OUT: end index of \c i */ + h5_int64_t *j_start, /*!< OUT: start index of \c j */ + h5_int64_t *j_end, /*!< OUT: end index of \c j */ + h5_int64_t *k_start, /*!< OUT: start index of \c k */ + h5_int64_t *k_end /*!< OUT: end index of \c k */ ); h5_err_t h5b_3d_get_reduced_view ( h5_file_t *const f, /*!< IN: File handle */ - h5_size_t *i_start, /*!< OUT: start index of \c i */ - h5_size_t *i_end, /*!< OUT: end index of \c i */ - h5_size_t *j_start, /*!< OUT: start index of \c j */ - h5_size_t *j_end, /*!< OUT: end index of \c j */ - h5_size_t *k_start, /*!< OUT: start index of \c k */ - h5_size_t *k_end /*!< OUT: end index of \c k */ + h5_int64_t *i_start, /*!< OUT: start index of \c i */ + h5_int64_t *i_end, /*!< OUT: end index of \c i */ + h5_int64_t *j_start, /*!< OUT: start index of \c j */ + h5_int64_t *j_end, /*!< OUT: end index of \c j */ + h5_int64_t *k_start, /*!< OUT: start index of \c k */ + h5_int64_t *k_end /*!< OUT: end index of \c k */ ); h5_err_t h5b_3d_set_chunk ( h5_file_t *const f, /*!< IN: File handle */ - const h5_size_t i, /*!< IN: size of \c i */ - const h5_size_t j, /*!< IN: size of \c j */ - const h5_size_t k /*!< IN: size of \c k */ + const h5_int64_t i, /*!< IN: size of \c i */ + const h5_int64_t j, /*!< IN: size of \c j */ + const h5_int64_t k /*!< IN: size of \c k */ ); h5_err_t h5b_3d_get_chunk ( h5_file_t *const f, /*!< IN: File handle */ const char *field_name, /*!< IN: name of dataset */ - h5_size_t *dims /*!< OUT: array containing the chunk dimensions */ + h5_int64_t *i, /*!< OUT: size of \c i */ + h5_int64_t *j, /*!< OUT: size of \c j */ + h5_int64_t *k /*!< OUT: size of \c k */ ); h5_err_t diff --git a/test/h5b_read.c b/test/h5b_read.c index f4f18a7..9d0d5c9 100644 --- a/test/h5b_read.c +++ b/test/h5b_read.c @@ -56,6 +56,7 @@ test_read_field_attribs( static void test_read_data64(h5_file_t *file, int step) { + extern h5_size_t grid[3]; extern h5_size_t layout[6]; int i,t; @@ -114,9 +115,9 @@ test_read_data64(h5_file_t *file, int step) IVALUE(type[0], type[1], "field type"); IVALUE(field_rank[0], 3, "field rank"); - IVALUE(field_dims[0], NBLOCKX, "field dims x"); - IVALUE(field_dims[1], NBLOCKY, "field dims y"); - IVALUE(field_dims[2], NBLOCKZ, "field dims z"); + IVALUE(field_dims[0], grid[0]*NBLOCKX, "field dims x"); + IVALUE(field_dims[1], grid[1]*NBLOCKY, "field dims y"); + IVALUE(field_dims[2], grid[2]*NBLOCKZ, "field dims z"); if (i==1) { CVALUE(name[0], 'e', "field name"); IVALUE(elem_rank[0], 1, "elem rank"); @@ -231,10 +232,10 @@ test_read_data32(h5_file_t *file, int step) int i; for (i=0; i