diff options
author | Dana Robinson <derobins@hdfgroup.org> | 2016-09-19 20:30:22 (GMT) |
---|---|---|
committer | Dana Robinson <derobins@hdfgroup.org> | 2016-09-19 20:30:22 (GMT) |
commit | 5ac0b328c8de74c11afb7aad7a5305389c70adaa (patch) | |
tree | 81bdef26f7c5a696fcacd5d824ef8abf97d80d2e /testpar/t_mdset.c | |
parent | c15d93826b1fee98dfebc9903808a3b8a29e9512 (diff) | |
parent | 2646f917adb5b2e17404260e433dc3ed7c39a602 (diff) | |
download | hdf5-5ac0b328c8de74c11afb7aad7a5305389c70adaa.zip hdf5-5ac0b328c8de74c11afb7aad7a5305389c70adaa.tar.gz hdf5-5ac0b328c8de74c11afb7aad7a5305389c70adaa.tar.bz2 |
Merge pull request #32 in HDFFV/hdf5 from ~DEROBINS/hdf5_der:evict_on_close to evict_on_close
Sync with develop and cleaned up feature. Feature works with datasets but testing is minimal.
* commit '2646f917adb5b2e17404260e433dc3ed7c39a602': (102 commits)
Cleaned up feature for dissemination to LLNL: - Removed support for datatypes. - Commented out support for groups - General change clean-up - Added a list of improvements to BRANCH.txt
Removed blank line in Fortran file (leftover from last commit)
Reverted H5T code since datatypes will not be supported at this time.
Fixed format_convert and fortran files (bad merge?).
Updated manifest. Was missing BRANCH.txt.
Add missing command to set shared generated file
Add default site names
Separate fortran generation into static and shared folders.
Revert to using old set command
Change string to list - older usage
Add option to submit to Cdash
Change UPDATE_TYPE to git
Update CMake java functions
Added missing evict on close test file line to test/CMakeLists.txt.
Restrict git commit hash in tar file names to first 7 characters with --short option.
Add longer timeout to cache tests - test has consistently exceeded default timing.
Removed -p option from invocation of autogen.sh by h5vers script to allow running h5vers on machines without /usr/hdf/bin/AUTOTOOLS.
Add bin/pkgscrpts files to MANIFEST.
dd bin/pkgscrpts directory with scripts to package deployed unix binaries into tarfiles.
Purpose: Code cleanup Description: - Used FP_EPSILON in comparing float values to verify read data - Casted C macro to fix mismatched types in verify_val calls Platforms tested: Linux/32 2.6 (jam) Linux/64 (platypus) Darwin (osx1010test)
...
Diffstat (limited to 'testpar/t_mdset.c')
-rw-r--r-- | testpar/t_mdset.c | 86 |
1 files changed, 86 insertions, 0 deletions
diff --git a/testpar/t_mdset.c b/testpar/t_mdset.c index c88cb86..7077081 100644 --- a/testpar/t_mdset.c +++ b/testpar/t_mdset.c @@ -2610,6 +2610,92 @@ void rr_obj_hdr_flush_confusion_reader(MPI_Comm comm) #undef Writer_Root #undef Reader_Root + +/* + * Test creating a chunked dataset in parallel in a file with an alignment set + * and an alignment threshold large enough to avoid aligning the chunks but + * small enough that the raw data aggregator will be aligned if it is treated as + * an object that must be aligned by the library + */ +#define CHUNK_SIZE 72 +#define NCHUNKS 32 +#define AGGR_SIZE 2048 +#define EXTRA_ALIGN 100 + + void chunk_align_bug_1(void) + { + int mpi_rank; + hid_t file_id, dset_id, fapl_id, dcpl_id, space_id; + hsize_t dims = CHUNK_SIZE * NCHUNKS, cdims = CHUNK_SIZE; + h5_stat_size_t file_size; + hsize_t align; + herr_t ret; + const char *filename; + + MPI_Comm_rank(MPI_COMM_WORLD, &mpi_rank); + + filename = (const char *)GetTestParameters(); + + /* Create file without alignment */ + fapl_id = create_faccess_plist(MPI_COMM_WORLD, MPI_INFO_NULL, facc_type); + VRFY((fapl_id >= 0), "create_faccess_plist succeeded"); + file_id = H5Fcreate(filename, H5F_ACC_TRUNC, H5P_DEFAULT, fapl_id); + VRFY((file_id >= 0), "H5Fcreate succeeded"); + + /* Close file */ + ret = H5Fclose(file_id); + VRFY((ret >= 0), "H5Fclose succeeded"); + + /* Get file size */ + file_size = h5_get_file_size(filename, fapl_id); + VRFY((file_size >= 0), "h5_get_file_size succeeded"); + + /* Calculate alignment value, set to allow a chunk to squeak in between the + * original EOF and the aligned location of the aggregator. Add some space + * for the dataset metadata */ + align = (hsize_t)file_size + CHUNK_SIZE + EXTRA_ALIGN; + + /* Set aggregator size and alignment, disable metadata aggregator */ + HDassert(AGGR_SIZE > CHUNK_SIZE); + ret = H5Pset_small_data_block_size(fapl_id, AGGR_SIZE); + VRFY((ret >= 0), "H5Pset_small_data_block_size succeeded"); + ret = H5Pset_meta_block_size(fapl_id, 0); + VRFY((ret >= 0), "H5Pset_meta_block_size succeeded"); + ret = H5Pset_alignment(fapl_id, CHUNK_SIZE + 1, align); + VRFY((ret >= 0), "H5Pset_small_data_block_size succeeded"); + + /* Reopen file with new settings */ + file_id = H5Fopen(filename, H5F_ACC_RDWR, fapl_id); + VRFY((file_id >= 0), "H5Fopen succeeded"); + + /* Create dataset */ + space_id = H5Screate_simple(1, &dims, NULL); + VRFY((space_id >= 0), "H5Screate_simple succeeded"); + dcpl_id = H5Pcreate(H5P_DATASET_CREATE); + VRFY((dcpl_id >= 0), "H5Pcreate succeeded"); + ret = H5Pset_chunk(dcpl_id, 1, &cdims); + VRFY((ret >= 0), "H5Pset_chunk succeeded"); + dset_id = H5Dcreate2(file_id, "dset", H5T_NATIVE_CHAR, space_id, H5P_DEFAULT, dcpl_id, H5P_DEFAULT); + VRFY((dset_id >= 0), "H5Dcreate2 succeeded"); + + /* Close ids */ + ret = H5Dclose(dset_id); + VRFY((dset_id >= 0), "H5Dclose succeeded"); + ret = H5Sclose(space_id); + VRFY((space_id >= 0), "H5Sclose succeeded"); + ret = H5Pclose(dcpl_id); + VRFY((dcpl_id >= 0), "H5Pclose succeeded"); + ret = H5Pclose(fapl_id); + VRFY((fapl_id >= 0), "H5Pclose succeeded"); + + /* Close file */ + ret = H5Fclose(file_id); + VRFY((ret >= 0), "H5Fclose succeeded"); + + return; +} /* end chunk_align_bug_1() */ + + /*============================================================================= * End of t_mdset.c *===========================================================================*/ |