From c348f9405e134e722edfb0c26133c471c926c64d Mon Sep 17 00:00:00 2001 From: Quincey Koziol Date: Fri, 3 Sep 2010 22:43:08 -0500 Subject: [svn-r19351] Description: Minor code cleanups to align w/trunk. Tested on: Mac OS X/32 10.6.4 (amazon) w/debug & production (h5committest not required on this branch) --- src/H5Dchunk.c | 68 +++++++++++-------------------------------------------- test/set_extent.c | 28 +++++++---------------- 2 files changed, 21 insertions(+), 75 deletions(-) diff --git a/src/H5Dchunk.c b/src/H5Dchunk.c index cde291f..0deb578 100644 --- a/src/H5Dchunk.c +++ b/src/H5Dchunk.c @@ -283,11 +283,6 @@ H5FL_BLK_DEFINE_STATIC(chunk); * Programmer: Quincey Koziol * Tuesday, June 30, 2009 * - * Modifications: - * Vailin Choi; June 2010 - * Modified to handle extendible datdaset for Fixed Array Indexing. - * (fixed max. dim. setting but not H5S_UNLIMITED) - * *------------------------------------------------------------------------- */ static herr_t @@ -335,11 +330,6 @@ done: * Programmer: Quincey Koziol * Tuesday, June 30, 2009 * - * Modifications: - * Vailin Choi; June 2010 - * Modified to handle extendible datdaset for Fixed Array Indexing. - * (fixed max. dim. setting but not H5S_UNLIMITED) - * *------------------------------------------------------------------------- */ herr_t @@ -1747,8 +1737,7 @@ H5D_chunk_read(H5D_io_info_t *io_info, const H5D_type_info_t *type_info, src_accessed_bytes = chunk_info->chunk_points * (uint32_t)type_info->src_type_size; /* Lock the chunk into the cache */ - if(NULL == (chunk = H5D_chunk_lock(io_info, &udata, FALSE, - FALSE))) + if(NULL == (chunk = H5D_chunk_lock(io_info, &udata, FALSE, FALSE))) HGOTO_ERROR(H5E_IO, H5E_READERROR, FAIL, "unable to read raw data chunk") /* Set up the storage buffer information for this chunk */ @@ -1781,8 +1770,7 @@ H5D_chunk_read(H5D_io_info_t *io_info, const H5D_type_info_t *type_info, HGOTO_ERROR(H5E_DATASET, H5E_READERROR, FAIL, "chunked read failed") /* Release the cache lock on the chunk. */ - if(chunk && H5D_chunk_unlock(io_info, &udata, FALSE, - chunk, src_accessed_bytes) < 0) + if(chunk && H5D_chunk_unlock(io_info, &udata, FALSE, chunk, src_accessed_bytes) < 0) HGOTO_ERROR(H5E_IO, H5E_READERROR, FAIL, "unable to unlock raw data chunk") } /* end if */ @@ -1805,12 +1793,6 @@ done: * Programmer: Raymond Lu * Thursday, April 10, 2003 * - * Modification:Raymond Lu - * 4 Feb 2009 - * One case that was considered cacheable was when the chunk - * was bigger than the cache size but not allocated on disk. - * I moved it to uncacheable branch to bypass the cache to - * improve performance. *------------------------------------------------------------------------- */ static herr_t @@ -1887,8 +1869,7 @@ H5D_chunk_write(H5D_io_info_t *io_info, const H5D_type_info_t *type_info, entire_chunk = FALSE; /* Lock the chunk into the cache */ - if(NULL == (chunk = H5D_chunk_lock(io_info, &udata, entire_chunk, - FALSE))) + if(NULL == (chunk = H5D_chunk_lock(io_info, &udata, entire_chunk, FALSE))) HGOTO_ERROR(H5E_IO, H5E_READERROR, FAIL, "unable to read raw data chunk") /* Set up the storage buffer information for this chunk */ @@ -1940,8 +1921,7 @@ H5D_chunk_write(H5D_io_info_t *io_info, const H5D_type_info_t *type_info, HGOTO_ERROR(H5E_DATASET, H5E_READERROR, FAIL, "chunked write failed") /* Release the cache lock on the chunk. */ - if(chunk && H5D_chunk_unlock(io_info, &udata, TRUE, chunk, - dst_accessed_bytes) < 0) + if(chunk && H5D_chunk_unlock(io_info, &udata, TRUE, chunk, dst_accessed_bytes) < 0) HGOTO_ERROR(H5E_IO, H5E_READERROR, FAIL, "unable to unlock raw data chunk") /* Advance to next chunk in list */ @@ -2754,14 +2734,6 @@ done: * Programmer: Robb Matzke * Thursday, May 21, 1998 * - * Modifications: Neil Fortner - * Tuesday, December 15, 2009 - * Added new_unfilt_chunk parameter - if true indicates that - * the chunk just became a partial edge chunk and the dataset - * is set to disable filters on partial chunks. - * Added prev_unfilt_chunk parameter - if true indicates that - * the chunk just had filters re-enabled after being disabled. - * *------------------------------------------------------------------------- */ void * @@ -3536,12 +3508,13 @@ H5D_chunk_allocate(H5D_t *dset, hid_t dxpl_id, hbool_t full_overwrite, * for each chunk. */ fill_buf = &fb_info.fill_buf; - /* Check if there are filters which need to be applied to the chunk */ - /* (only do this in advance when the chunk info can be re-used (i.e. - * it doesn't contain any non-default VL datatype fill values) - */ - if(!fb_info.has_vlen_fill_type && pline->nused > 0) { - size_t buf_size = orig_chunk_size; + /* Check if there are filters which need to be applied to the chunk */ + /* (only do this in advance when the chunk info can be re-used (i.e. + * it doesn't contain any non-default VL datatype fill values) + */ + if(!fb_info.has_vlen_fill_type && pline->nused > 0) { + size_t buf_size = orig_chunk_size; + /* If the dataset has disabled partial chunk filters, create a copy * of the unfiltered fill_buf to use for partial chunks */ if(has_unfilt_edge_chunks) { @@ -4095,8 +4068,7 @@ H5D_chunk_prune_fill(H5D_chunk_it_ud1_t *udata, hbool_t new_unfilt_chunk) HGOTO_ERROR(H5E_DATASET, H5E_CANTSELECT, FAIL, "unable to select hyperslab") /* Lock the chunk into the cache, to get a pointer to the chunk buffer */ - if(NULL == (chunk = (void *)H5D_chunk_lock(io_info, &chk_udata, FALSE, - FALSE))) + if(NULL == (chunk = (void *)H5D_chunk_lock(io_info, &chk_udata, FALSE, FALSE))) HGOTO_ERROR(H5E_DATASET, H5E_READERROR, FAIL, "unable to lock raw data chunk") @@ -4137,8 +4109,7 @@ H5D_chunk_prune_fill(H5D_chunk_it_ud1_t *udata, hbool_t new_unfilt_chunk) bytes_accessed = (uint32_t)sel_nelmts * layout->u.chunk.dim[rank]; /* Release lock on chunk */ - if(H5D_chunk_unlock(io_info, &chk_udata, TRUE, chunk, - bytes_accessed) < 0) + if(H5D_chunk_unlock(io_info, &chk_udata, TRUE, chunk, bytes_accessed) < 0) HGOTO_ERROR(H5E_IO, H5E_WRITEERROR, FAIL, "unable to unlock raw data chunk") done: @@ -4243,14 +4214,6 @@ done: * To release the chunks, we traverse the B-tree to obtain a list of unused * allocated chunks, and then call H5B_remove() for each chunk. * - * Modifications: Neil Fortner - * 4 May 2010 - * Rewrote algorithm to work in a way similar to - * H5D_chunk_allocate: it now iterates over all chunks that need - * to be filled or removed, and does so as appropriate. This - * avoids various issues with coherency of locally cached data - * which could occur with the previous implementation. - * *------------------------------------------------------------------------- */ herr_t @@ -5086,11 +5049,6 @@ done: * Programmer: Peter Cao * August 20, 2005 * - * Modifications: - * Vailin Choi; June 2010 - * Modified to handle extendible datdaset for Fixed Array Indexing. - * (fixed max. dim. setting but not H5S_UNLIMITED) - * *------------------------------------------------------------------------- */ herr_t diff --git a/test/set_extent.c b/test/set_extent.c index 4351635..8de5649 100644 --- a/test/set_extent.c +++ b/test/set_extent.c @@ -291,29 +291,25 @@ static int do_ranks( hid_t fapl, hbool_t new_format ) if(H5Pset_fill_time(dcpl, H5D_FILL_TIME_ALLOC) < 0) TEST_ERROR - if(test_rank1(fapl, dcpl, do_fillvalue, disable_edge_filters, - FALSE) < 0) { + if(test_rank1(fapl, dcpl, do_fillvalue, disable_edge_filters, FALSE) < 0) { DO_RANKS_PRINT_CONFIG("Rank 1") printf(" Fill time: %s\n", (ifset ? "H5D_FILL_TIME_IFSET" : "H5D_FILL_TIME_ALLOC")); goto error; } /* end if */ - if(test_rank2(fapl, dcpl, do_fillvalue, disable_edge_filters, - FALSE) < 0) { + if(test_rank2(fapl, dcpl, do_fillvalue, disable_edge_filters, FALSE) < 0) { DO_RANKS_PRINT_CONFIG("Rank 2") printf(" Fill time: %s\n", (ifset ? "H5D_FILL_TIME_IFSET" : "H5D_FILL_TIME_ALLOC")); goto error; } /* end if */ - if(test_rank3(fapl, dcpl, do_fillvalue, disable_edge_filters, - FALSE) < 0) { + if(test_rank3(fapl, dcpl, do_fillvalue, disable_edge_filters, FALSE) < 0) { DO_RANKS_PRINT_CONFIG("Rank 3") printf(" Fill time: %s\n", (ifset ? "H5D_FILL_TIME_IFSET" : "H5D_FILL_TIME_ALLOC")); goto error; } /* end if */ - if(test_rank2(fapl, dcpl, do_fillvalue, disable_edge_filters, - TRUE) < 0) { + if(test_rank2(fapl, dcpl, do_fillvalue, disable_edge_filters, TRUE) < 0) { DO_RANKS_PRINT_CONFIG("Rank 2 with non-default indexed storage B-tree") printf(" Fill time: %s\n", (ifset ? "H5D_FILL_TIME_IFSET" : "H5D_FILL_TIME_ALLOC")); @@ -327,23 +323,19 @@ static int do_ranks( hid_t fapl, hbool_t new_format ) if(H5Pset_fill_time(dcpl, H5D_FILL_TIME_ALLOC) < 0) TEST_ERROR - if(test_rank1(fapl, dcpl, do_fillvalue, disable_edge_filters, FALSE) - < 0) { + if(test_rank1(fapl, dcpl, do_fillvalue, disable_edge_filters, FALSE) < 0) { DO_RANKS_PRINT_CONFIG("Rank 1") goto error; } /* end if */ - if(test_rank2(fapl, dcpl, do_fillvalue, disable_edge_filters, FALSE) - < 0) { + if(test_rank2(fapl, dcpl, do_fillvalue, disable_edge_filters, FALSE) < 0) { DO_RANKS_PRINT_CONFIG("Rank 2") goto error; } /* end if */ - if(test_rank3(fapl, dcpl, do_fillvalue, disable_edge_filters, FALSE) - < 0) { + if(test_rank3(fapl, dcpl, do_fillvalue, disable_edge_filters, FALSE) < 0) { DO_RANKS_PRINT_CONFIG("Rank 3") goto error; } /* end if */ - if(test_rank2(fapl, dcpl, do_fillvalue, disable_edge_filters, TRUE) - < 0) { + if(test_rank2(fapl, dcpl, do_fillvalue, disable_edge_filters, TRUE) < 0) { DO_RANKS_PRINT_CONFIG("Rank 2 with non-default indexed storage B-tree") goto error; } /* end if */ @@ -431,14 +423,10 @@ static int do_layouts( hid_t fapl ) TESTING("storage layout use"); if (test_layouts( H5D_COMPACT, fapl ) < 0) - { goto error; - } if (test_layouts( H5D_CONTIGUOUS, fapl ) < 0) - { goto error; - } PASSED(); -- cgit v0.12