diff options
Diffstat (limited to 'testpar/t_span_tree.c')
-rw-r--r-- | testpar/t_span_tree.c | 151 |
1 files changed, 44 insertions, 107 deletions
diff --git a/testpar/t_span_tree.c b/testpar/t_span_tree.c index 02d2cca..9a4ac4d 100644 --- a/testpar/t_span_tree.c +++ b/testpar/t_span_tree.c @@ -32,14 +32,7 @@ */ -#define H5S_FRIEND /*suppress error about including H5Spkg */ - -/* Define this macro to indicate that the testing APIs should be available */ -#define H5S_TESTING - -#include "hdf5.h" #include "H5private.h" -#include "H5Spkg.h" /* Dataspaces */ #include "testphdf5.h" @@ -51,7 +44,7 @@ static void coll_read_test(int chunk_factor); * Function: coll_irregular_cont_write * * Purpose: Wrapper to test the collectively irregular hyperslab write in - contiguous storage + * contiguous storage * * Return: Success: 0 * @@ -60,8 +53,6 @@ static void coll_read_test(int chunk_factor); * Programmer: Unknown * Dec 2nd, 2004 * - * Modifications: - * *------------------------------------------------------------------------- */ void @@ -78,7 +69,7 @@ coll_irregular_cont_write(void) * Function: coll_irregular_cont_read * * Purpose: Wrapper to test the collectively irregular hyperslab read in - contiguous storage + * contiguous storage * * Return: Success: 0 * @@ -87,8 +78,6 @@ coll_irregular_cont_write(void) * Programmer: Unknown * Dec 2nd, 2004 * - * Modifications: - * *------------------------------------------------------------------------- */ void @@ -104,7 +93,7 @@ coll_irregular_cont_read(void) * Function: coll_irregular_simple_chunk_write * * Purpose: Wrapper to test the collectively irregular hyperslab write in - chunk storage(1 chunk) + * chunk storage(1 chunk) * * Return: Success: 0 * @@ -113,8 +102,6 @@ coll_irregular_cont_read(void) * Programmer: Unknown * Dec 2nd, 2004 * - * Modifications: - * *------------------------------------------------------------------------- */ void @@ -131,7 +118,7 @@ coll_irregular_simple_chunk_write(void) * Function: coll_irregular_simple_chunk_read * * Purpose: Wrapper to test the collectively irregular hyperslab read in chunk - storage(1 chunk) + * storage(1 chunk) * * Return: Success: 0 * @@ -140,8 +127,6 @@ coll_irregular_simple_chunk_write(void) * Programmer: Unknown * Dec 2nd, 2004 * - * Modifications: - * *------------------------------------------------------------------------- */ void @@ -156,7 +141,7 @@ coll_irregular_simple_chunk_read(void) * Function: coll_irregular_complex_chunk_write * * Purpose: Wrapper to test the collectively irregular hyperslab write in chunk - storage(4 chunks) + * storage(4 chunks) * * Return: Success: 0 * @@ -165,8 +150,6 @@ coll_irregular_simple_chunk_read(void) * Programmer: Unknown * Dec 2nd, 2004 * - * Modifications: - * *------------------------------------------------------------------------- */ void @@ -183,7 +166,7 @@ coll_irregular_complex_chunk_write(void) * Function: coll_irregular_complex_chunk_read * * Purpose: Wrapper to test the collectively irregular hyperslab read in chunk - storage(1 chunk) + * storage(1 chunk) * * Return: Success: 0 * @@ -192,8 +175,6 @@ coll_irregular_complex_chunk_write(void) * Programmer: Unknown * Dec 2nd, 2004 * - * Modifications: - * *------------------------------------------------------------------------- */ void @@ -209,9 +190,9 @@ coll_irregular_complex_chunk_read(void) * Function: coll_write_test * * Purpose: To test the collectively irregular hyperslab write in chunk - storage + * storage * Input: number of chunks on each dimension - if number is equal to 0, contiguous storage + * if number is equal to 0, contiguous storage * Return: Success: 0 * * Failure: -1 @@ -219,8 +200,6 @@ coll_irregular_complex_chunk_read(void) * Programmer: Unknown * Dec 2nd, 2004 * - * Modifications: Oct 18th, 2005 - * *------------------------------------------------------------------------- */ void coll_write_test(int chunk_factor) @@ -231,19 +210,11 @@ void coll_write_test(int chunk_factor) hid_t file, datasetc,dataseti; /* File and dataset identifiers */ hid_t mspaceid1, mspaceid, fspaceid,fspaceid1; /* Dataspace identifiers */ - hsize_t mdim1[1],fsdim[2],mdim[2]; - -#if 0 - hsize_t mdim1[] = {MSPACE1_DIM}; /* Dimension size of the first dataset - (in memory) */ - hsize_t fsdim[] = {FSPACE_DIM1, FSPACE_DIM2}; /* Dimension sizes of the dataset - (on disk) */ - - hsize_t mdim[] = {MSPACE_DIM1, MSPACE_DIM2}; /* Dimension sizes of the - dataset in memory when we - read selection from the - dataset on the disk */ -#endif + hsize_t mdim1[1]; /* Dimension size of the first dataset (in memory) */ + hsize_t fsdim[2]; /* Dimension sizes of the dataset (on disk) */ + hsize_t mdim[2]; /* Dimension sizes of the dataset in memory when we + * read selection from the dataset on the disk + */ hsize_t start[2]; /* Start of hyperslab */ hsize_t stride[2]; /* Stride of hyperslab */ @@ -255,15 +226,9 @@ void coll_write_test(int chunk_factor) unsigned i; int fillvalue = 0; /* Fill value for the dataset */ -#if 0 - int matrix_out[MSPACE_DIM1][MSPACE_DIM2]; - int matrix_out1[MSPACE_DIM1][MSPACE_DIM2]; /* Buffer to read from the - dataset */ - int vector[MSPACE1_DIM]; -#endif - - - int *matrix_out = NULL, *matrix_out1 = NULL, *vector = NULL; + int *matrix_out = NULL; + int *matrix_out1 = NULL; /* Buffer to read from the dataset */ + int *vector = NULL; int mpi_size,mpi_rank; @@ -684,9 +649,9 @@ void coll_write_test(int chunk_factor) * Function: coll_read_test * * Purpose: To test the collectively irregular hyperslab read in chunk - storage + * storage * Input: number of chunks on each dimension - if number is equal to 0, contiguous storage + * if number is equal to 0, contiguous storage * Return: Success: 0 * * Failure: -1 @@ -694,9 +659,6 @@ void coll_write_test(int chunk_factor) * Programmer: Unknown * Dec 2nd, 2004 * - * Modifications: Oct 18th, 2005 - * Note: This test must be used with the correpsonding - coll_write_test. *------------------------------------------------------------------------- */ static void @@ -710,14 +672,10 @@ coll_read_test(int chunk_factor) /* Dimension sizes of the dataset (on disk) */ -#if 0 - hsize_t mdim[] = {MSPACE_DIM1, MSPACE_DIM2}; /* Dimension sizes of the - dataset in memory when we - read selection from the - dataset on the disk */ + hsize_t mdim[2]; /* Dimension sizes of the dataset in memory when we + * read selection from the dataset on the disk + */ -#endif - hsize_t mdim[2]; hsize_t start[2]; /* Start of hyperslab */ hsize_t stride[2]; /* Stride of hyperslab */ hsize_t count[2]; /* Block count */ @@ -727,13 +685,8 @@ coll_read_test(int chunk_factor) unsigned i; int *matrix_out; - int *matrix_out1; -#if 0 - int matrix_out[MSPACE_DIM1][MSPACE_DIM2]; - int matrix_out1[MSPACE_DIM1][MSPACE_DIM2]; /* Buffer to read from the - dataset */ + int *matrix_out1; /* Buffer to read from the dataset */ -#endif int mpi_size,mpi_rank; MPI_Comm comm = MPI_COMM_WORLD; @@ -940,7 +893,7 @@ coll_read_test(int chunk_factor) ret = H5Fclose(file); VRFY((ret >= 0),""); - return ; + return; } @@ -948,18 +901,18 @@ coll_read_test(int chunk_factor) ** ** lower_dim_size_comp_test__select_checker_board(): ** -** Given a data space of tgt_rank, and dimensions: +** Given a dataspace of tgt_rank, and dimensions: ** ** (mpi_size + 1), edge_size, ... , edge_size ** ** edge_size, and a checker_edge_size, select a checker ** board selection of a sel_rank (sel_rank < tgt_rank) -** dimensional slice through the data space parallel to the +** dimensional slice through the dataspace parallel to the ** sel_rank fastest changing indicies, with origin (in the ** higher indicies) as indicated by the start array. ** ** Note that this function, is hard coded to presume a -** maximum data space rank of 5. +** maximum dataspace rank of 5. ** ** While this maximum is declared as a constant, increasing ** it will require extensive coding in addition to changing @@ -1304,7 +1257,7 @@ lower_dim_size_comp_test__select_checker_board( } #endif /* LOWER_DIM_SIZE_COMP_TEST__SELECT_CHECKER_BOARD__DEBUG */ - /* Clip the selection back to the data space proper. */ + /* Clip the selection back to the dataspace proper. */ for ( i = 0; i < test_max_rank; i++ ) { @@ -1564,15 +1517,13 @@ lower_dim_size_comp_test__verify_data(uint32_t * buf_ptr, * Function: lower_dim_size_comp_test__run_test() * * Purpose: Verify that a bug in the computation of the size of the - * lower dimensions of a data space in H5S_obtain_datatype() + * lower dimensions of a dataspace in H5S_obtain_datatype() * has been corrected. * * Return: void * * Programmer: JRM -- 11/11/09 * - * Modifications: - * *------------------------------------------------------------------------- */ @@ -1763,7 +1714,7 @@ lower_dim_size_comp_test__run_test(const int chunk_edge_size, } #endif - /* create data spaces */ + /* create dataspaces */ full_mem_small_ds_sid = H5Screate_simple(5, small_dims, NULL); VRFY((full_mem_small_ds_sid != 0), @@ -2177,7 +2128,7 @@ lower_dim_size_comp_test__run_test(const int chunk_edge_size, #endif /* LOWER_DIM_SIZE_COMP_TEST__RUN_TEST__DEBUG */ } - /* try clipping the selection back to the large data space proper */ + /* try clipping the selection back to the large dataspace proper */ start[0] = start[1] = start[2] = start[3] = start[4] = (hsize_t)0; stride[0] = (hsize_t)(2 * (mpi_size + 1)); @@ -2331,12 +2282,11 @@ lower_dim_size_comp_test__run_test(const int chunk_edge_size, large_sel_start); - /* verify that H5S_select_shape_same() reports the two + /* verify that H5Sselect_shape_same() reports the two * selections as having the same shape. */ - check = H5S_select_shape_same_test(mem_large_ds_sid, - file_small_ds_sid); - VRFY((check == TRUE), "H5S_select_shape_same_test passed (1)"); + check = H5Sselect_shape_same(mem_large_ds_sid, file_small_ds_sid); + VRFY((check == TRUE), "H5Sselect_shape_same passed (1)"); ret = H5Dread(small_dataset, @@ -2452,12 +2402,11 @@ lower_dim_size_comp_test__run_test(const int chunk_edge_size, large_sel_start); - /* verify that H5S_select_shape_same() reports the two + /* verify that H5Sselect_shape_same() reports the two * selections as having the same shape. */ - check = H5S_select_shape_same_test(mem_small_ds_sid, - file_large_ds_sid); - VRFY((check == TRUE), "H5S_select_shape_same_test passed (2)"); + check = H5Sselect_shape_same(mem_small_ds_sid, file_large_ds_sid); + VRFY((check == TRUE), "H5Sselect_shape_same passed (2)"); ret = H5Dread(large_dataset, @@ -2613,8 +2562,6 @@ lower_dim_size_comp_test__run_test(const int chunk_edge_size, * * Programmer: JRM -- 11/11/09 * - * Modifications: - * *------------------------------------------------------------------------- */ @@ -2622,31 +2569,23 @@ void lower_dim_size_comp_test(void) { /* const char *fcnName = "lower_dim_size_comp_test()"; */ - int chunk_edge_size = 0; - int use_collective_io = 1; - hid_t dset_type = H5T_NATIVE_UINT; -#if 0 - HDsleep(60); -#endif - HDcompile_assert(sizeof(uint32_t) == sizeof(unsigned)); - for ( use_collective_io = (hbool_t)0; - (int)use_collective_io <= 1; - (hbool_t)(use_collective_io++) ) { + int chunk_edge_size = 0; + int use_collective_io; + HDcompile_assert(sizeof(uint32_t) == sizeof(unsigned)); + for(use_collective_io = 0; use_collective_io <= 1; use_collective_io++) { chunk_edge_size = 0; lower_dim_size_comp_test__run_test(chunk_edge_size, (hbool_t)use_collective_io, - dset_type); - + H5T_NATIVE_UINT); chunk_edge_size = 5; lower_dim_size_comp_test__run_test(chunk_edge_size, (hbool_t)use_collective_io, - dset_type); - } + H5T_NATIVE_UINT); + } /* end for */ return; - } /* lower_dim_size_comp_test() */ @@ -2676,8 +2615,6 @@ lower_dim_size_comp_test(void) * * Programmer: JRM -- 12/16/09 * - * Modifications: - * *------------------------------------------------------------------------- */ @@ -2741,7 +2678,7 @@ link_chunk_collective_io_test(void) /* setup dims */ dims[0] = ((hsize_t)mpi_size) * ((hsize_t)(LINK_CHUNK_COLLECTIVE_IO_TEST_CHUNK_SIZE)); - /* setup mem and file data spaces */ + /* setup mem and file dataspaces */ write_mem_ds_sid = H5Screate_simple(1, chunk_dims, NULL); VRFY((write_mem_ds_sid != 0), "H5Screate_simple() write_mem_ds_sid succeeded"); |