-
-
Notifications
You must be signed in to change notification settings - Fork 311
Change default file format to 1.8 #5949
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
022bf4c
ee97f34
6a8af24
85332ed
d40c6c8
b664b75
8d44d38
179ce0f
229f27a
9a7f6dc
3e6db16
84a68b5
4451a5e
8aa4fad
6aaa4e1
02badad
b8d8ccb
4914415
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -52,8 +52,12 @@ | |
| static int | ||
| test_file_image(size_t open_images, size_t nflags, const unsigned *flags) | ||
| { | ||
| hid_t *file_id = NULL, *dset_id = NULL, file_space, plist; /* HDF5 ids */ | ||
| hsize_t dims1[RANK] = {2, 3}; /* original dimension of datasets */ | ||
| hid_t *file_id = NULL; /* Array of file IDs */ | ||
| hid_t *dset_id = NULL; /* Array of dataset IDs */ | ||
| hid_t file_space_id = H5I_INVALID_HID; /* Dataspace ID */ | ||
| hid_t dcpl_id = H5I_INVALID_HID; /* DCPL ID */ | ||
| hid_t fapl_id = H5I_INVALID_HID; /* FAPL ID */ | ||
| hsize_t dims1[RANK] = {2, 3}; /* original dimension of datasets */ | ||
| hsize_t max_dims[RANK] = {H5S_UNLIMITED, H5S_UNLIMITED}; | ||
| int data1[6] = {1, 2, 3, 4, 5, 6}; /* original contents of dataset */ | ||
| int data2[6] = {7, 8, 9, 10, 11, 12}; /* "wrong" contents of dataset */ | ||
|
|
@@ -99,6 +103,13 @@ test_file_image(size_t open_images, size_t nflags, const unsigned *flags) | |
| if (NULL == (dset_id = (hid_t *)malloc(sizeof(hid_t) * open_images))) | ||
| FAIL_PUTS_ERROR("malloc() failed"); | ||
|
|
||
| /* Create FAPL and set earliest format */ | ||
| /* TODO: run this test with all different formats */ | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. TODO still relevant here? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yes. It will require different hacking of the superblock for each format version which is why I didn't have time to do it for this release. I can file an issue for it. |
||
| if ((fapl_id = H5Pcreate(H5P_FILE_ACCESS)) < 0) | ||
| FAIL_PUTS_ERROR("H5Pcreate() failed"); | ||
| if (H5Pset_libver_bounds(fapl_id, H5F_LIBVER_EARLIEST, H5F_LIBVER_LATEST) < 0) | ||
| FAIL_PUTS_ERROR("H5Pset_libver_bounds() failed"); | ||
|
|
||
| HL_TESTING2("get file images"); | ||
|
|
||
| /* create several file images */ | ||
|
|
@@ -117,24 +128,24 @@ test_file_image(size_t open_images, size_t nflags, const unsigned *flags) | |
| snprintf(filename[i], filenamelength, "image_file%d.h5", (int)i); | ||
|
|
||
| /* create file */ | ||
| if ((file_id[i] = H5Fcreate(filename[i], H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT)) < 0) | ||
| if ((file_id[i] = H5Fcreate(filename[i], H5F_ACC_TRUNC, H5P_DEFAULT, fapl_id)) < 0) | ||
| FAIL_PUTS_ERROR("H5Fcreate() failed"); | ||
|
|
||
| /* define dataspace for the dataset */ | ||
| if ((file_space = H5Screate_simple(RANK, dims1, max_dims)) < 0) | ||
| if ((file_space_id = H5Screate_simple(RANK, dims1, max_dims)) < 0) | ||
| FAIL_PUTS_ERROR("H5Screate_simple() failed"); | ||
|
|
||
| /* create dataset property list */ | ||
| if ((plist = H5Pcreate(H5P_DATASET_CREATE)) < 0) | ||
| if ((dcpl_id = H5Pcreate(H5P_DATASET_CREATE)) < 0) | ||
| FAIL_PUTS_ERROR("H5Pcreate() failed"); | ||
|
|
||
| /* set property list to create chunked dataset */ | ||
| if (H5Pset_chunk(plist, RANK, dims1) < 0) | ||
| if (H5Pset_chunk(dcpl_id, RANK, dims1) < 0) | ||
| FAIL_PUTS_ERROR("H5Pset_chunk() failed"); | ||
|
|
||
| /* create and write an integer type dataset named "dset" */ | ||
| if ((dset_id[i] = H5Dcreate2(file_id[i], DSET_NAME, H5T_NATIVE_INT, file_space, H5P_DEFAULT, plist, | ||
| H5P_DEFAULT)) < 0) | ||
| if ((dset_id[i] = H5Dcreate2(file_id[i], DSET_NAME, H5T_NATIVE_INT, file_space_id, H5P_DEFAULT, | ||
| dcpl_id, H5P_DEFAULT)) < 0) | ||
| FAIL_PUTS_ERROR("H5Dcreate() failed"); | ||
|
|
||
| /* dataset in open image 1 is written with "wrong" data */ | ||
|
|
@@ -153,11 +164,11 @@ test_file_image(size_t open_images, size_t nflags, const unsigned *flags) | |
| FAIL_PUTS_ERROR("H5Fflush() failed"); | ||
|
|
||
| /* close dataset property list */ | ||
| if (H5Pclose(plist) < 0) | ||
| if (H5Pclose(dcpl_id) < 0) | ||
| FAIL_PUTS_ERROR("H5Pclose() failed"); | ||
|
|
||
| /* close dataspace */ | ||
| if (H5Sclose(file_space) < 0) | ||
| if (H5Sclose(file_space_id) < 0) | ||
| FAIL_PUTS_ERROR("H5Sclose() failed"); | ||
|
|
||
| /* close dataset */ | ||
|
|
@@ -277,11 +288,11 @@ test_file_image(size_t open_images, size_t nflags, const unsigned *flags) | |
| FAIL_PUTS_ERROR("H5Dopen() failed"); | ||
|
|
||
| /* get dataspace for the dataset */ | ||
| if ((file_space = H5Dget_space(dset_id[i])) < 0) | ||
| if ((file_space_id = H5Dget_space(dset_id[i])) < 0) | ||
| FAIL_PUTS_ERROR("H5Dget_space() failed"); | ||
|
|
||
| /* get dimensions for the dataset */ | ||
| if (H5Sget_simple_extent_dims(file_space, dims3, NULL) < 0) | ||
| if (H5Sget_simple_extent_dims(file_space_id, dims3, NULL) < 0) | ||
| FAIL_PUTS_ERROR("H5Sget_simple_extent_dims() failed"); | ||
|
|
||
| /* read dataset */ | ||
|
|
@@ -312,7 +323,7 @@ test_file_image(size_t open_images, size_t nflags, const unsigned *flags) | |
| } /* end else */ | ||
|
|
||
| /* close dataspace */ | ||
| if (H5Sclose(file_space) < 0) | ||
| if (H5Sclose(file_space_id) < 0) | ||
| FAIL_PUTS_ERROR("H5Sclose() failed"); | ||
| } /* end for */ | ||
|
|
||
|
|
@@ -455,11 +466,11 @@ test_file_image(size_t open_images, size_t nflags, const unsigned *flags) | |
| FAIL_PUTS_ERROR("H5Dopen() failed"); | ||
|
|
||
| /* get dataspace for the dataset */ | ||
| if ((file_space = H5Dget_space(dset_id[i])) < 0) | ||
| if ((file_space_id = H5Dget_space(dset_id[i])) < 0) | ||
| FAIL_PUTS_ERROR("H5Dget_space() failed"); | ||
|
|
||
| /* get dimensions for the dataset */ | ||
| if (H5Sget_simple_extent_dims(file_space, dims3, NULL) < 0) | ||
| if (H5Sget_simple_extent_dims(file_space_id, dims3, NULL) < 0) | ||
| FAIL_PUTS_ERROR("H5Sget_simple_extent_dims() failed"); | ||
|
|
||
| /* read dataset */ | ||
|
|
@@ -479,7 +490,7 @@ test_file_image(size_t open_images, size_t nflags, const unsigned *flags) | |
| FAIL_PUTS_ERROR("comparison of image values with original data failed"); | ||
|
|
||
| /* close dataspace */ | ||
| if (H5Sclose(file_space) < 0) | ||
| if (H5Sclose(file_space_id) < 0) | ||
| FAIL_PUTS_ERROR("H5Sclose() failed"); | ||
|
|
||
| /* close dataset */ | ||
|
|
@@ -513,6 +524,10 @@ test_file_image(size_t open_images, size_t nflags, const unsigned *flags) | |
|
|
||
| } /* end for */ | ||
|
|
||
| /* close file access property list */ | ||
| if (H5Pclose(fapl_id) < 0) | ||
| FAIL_PUTS_ERROR("H5Pclose() failed"); | ||
|
|
||
| /* release temporary working buffers */ | ||
| for (i = 0; i < open_images; i++) | ||
| free(filename[i]); | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why the change in file access mode here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The test is creating a new file. H5F_ACC_EXCL causes it to fail if the file already exists, which is what was happening. It was failing silently before, but with the 1.8 format it causes issues due to a fapl mismatch - see #5954
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I see. Fine either way, though previously the issues with this test involved the fact that it left a file open unintentionally and also forgot to delete it, so I wonder if that isn't the case here as well.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this is at least partly due to it simply using HDremove() to remove the test files, which obviously doesn't work with the family file driver. Something that should be fixed for sure, but not within the scope of this PR