Commit Graph

35 Commits

Author SHA1 Message Date
David Young
d91b9f9b0a Fix compilation: use H5Oget_info() instead of specifying the version
(H5O_getinfo2).
2020-05-20 09:37:20 -05:00
David Young
4e48041a13 Move fetch_env_ulong() from vfd_swmr.c to vfd_swmr_common.c for eventual
reuse by the zoo writer.
2020-04-28 08:35:12 -05:00
David Young
53cb28016d Straggler from last: retire vfd_swmr_writer_g. 2020-04-20 16:08:25 -05:00
David Young
aee40b370d Retire globals vfd_swmr_writer_g and end_of_tick_g. 2020-04-20 16:05:27 -05:00
David Young
fc36f53115 Quiet some used-before-initialized warnings and, while I am here,
initialize one variable with a named constant instead of -1.
2020-04-20 15:55:03 -05:00
David Young
3aaa7a4f27 Don't try to free a NULL pointer. 2020-04-07 10:51:00 -05:00
David Young
a3262d2274 Quiet a warning about the variable being used before it is initialized.
Looks like the compiler actually was wrong, but this is a harmless
change to make.
2020-04-07 10:50:08 -05:00
David Young
a788202831 If the shadow-index size is 0 in the current step, don't calloc(3)
anything, since calloc(0, ...) is undefined.
2020-04-06 12:32:54 -05:00
David Young
14a8543c7a Remove a duplicate #define H5FD_TESTING line. 2020-03-24 15:39:19 -05:00
David Young
ad8460cc16 When creating a shadow index for testing, increase the page number from
one entry to the next by *at least* 1 so that the index is well-formed.
This fixes a crash that occurred with H5_SHADOW_INDEX_SEED=1585006453.
2020-03-24 15:30:09 -05:00
David Young
e7b2095809 The forced-fail index comes only from the environment, never from
time(3).
2020-03-24 15:26:40 -05:00
David Young
2646ee0ba7 Add an environment variable, H5_SHADOW_INDEX_FAIL, that I can set to an
unsigned integer value that tells at which index to inject a failure
for testing purposes.  I used this to establish that I can start the
shadow-index lookup test with a previous seed and see the same tests run
again.
2020-03-02 15:45:42 -06:00
David Young
32f6a742b3 Add a test for shadow-index lookups per the specification agreed with John and
Mike and described in my email "testing estimates version 2."
2020-02-28 16:46:47 -06:00
David Young
3cb259c5a2 So that I can use PASSED(); anywhere a statement can go, #define PASSED() with
a do-while wrapper.
2020-02-28 16:44:16 -06:00
David Young
29ee63787b Numerous changes supporting a floating shadow index:
Add to the H5F_shared_t (!) a new member that tells the index in
the shadow file where the index should be written.

Allocate shadow filespace for the header and the index separately so
that the index can float.  Update tests to match the expected original
location of the index.

Introduce vfd_swmr_enlarge_shadow_index(), a routine that allocates space in
the shadow file for a new index that has (up to) twice as many entries as the
old index, allocates a new in-core index of the same size, and copies the old
in-core index to the new.  Call vfd_swmr_enlarge_shadow_index() in
H5PB_vfd_swmr__update_index() when the in-core index has too few slots.

In the comment at the top of H5FD__vfd_swmr_load_hdr_and_idx(), describe the
protocol that it follows, now, when it reads the shadow header and index.
Delete some dead code in the function and add a bit of diagnostic code.
TBD quiet the diagnostic code.

In H5F_vfd_swmr_init(), follow the protocol: write the index, first, then
the header.

Modify property-list checks and tests to reserve no fewer than two pages at the
front of the shadow file for the header and index.
2020-02-03 15:04:21 -06:00
David Young
005bd89ad5 Use FAIL_STACK_ERROR instead of TEST_ERROR after library calls, so that the
error stack will be reported.

Use calloc instead of malloc+memset.
2020-02-03 13:10:11 -06:00
David Young
2e15f48d78 Repair indentation and delete some superfluous comments. NFCI. 2020-01-30 10:48:36 -06:00
David Young
2c5c110378 Align the shadow images on page boundaries so that they don't overlap. This
seems to be the programmer's original intention.  It sure makes debugging
easier to have non-overlapping shadow images.
2019-12-18 15:29:48 -06:00
David Young
941daa6b07 In the faked-up shadow-index entries, assign independent page numbers in the
HDF5 file and in the shadow file.  I had added assertions that the page numbers
were unique, and this caused those assertions to fail.  I don't know if I'll
keep the assertions, but this is an inexpensive change that makes the test more
realistic.
2019-12-18 15:26:40 -06:00
David Young
1a55342b3e Allocate and zero using calloc(3) instead of malloc(3)+memset(3). 2019-12-18 15:25:11 -06:00
David Young
93175a115c Remove the ugly casts on calloc() and malloc(). Change some malloc() to
calloc() so that all bytes are initialized to something.
2019-12-13 10:24:02 -06:00
David Young
fed174988d Shorten the type name H5F_vfd_swmr_eot_queue_entry_t to eot_queue_entry_t:
people have to read and type this stuff!

Use TAILQ_* macros instead of an unnecessary custom implementation of
doubly-linked lists.
2019-12-10 10:52:58 -06:00
David Young
a6be1c0397 Be brief: don't cast the last parameter of H5Pset_file_space_strategy(), the
constant `1`, to `hsize_t`.
2019-12-09 15:42:40 -06:00
David Young
0f33e41541 Don't see a 1GB threshold for tracking free filespace, that workaround for VFD
SWMR was never 100% effective, and now that there is a delay line on filespace
frees, it is not necesesary.
2019-12-09 15:30:17 -06:00
David Young
c8f533cfc3 Merge all of my changes from merge-back-to-feature-vfd_swmr-attempt-1,
including the merge of `hdffv/hdf5/develop`, back to the branch that Vailin and
I share.

Now I need to put this branch on a fork with a less confusing name than
vchoi_fork!
2019-12-09 10:30:58 -06:00
Vailin Choi
12438c22b7 Fix for punch list #28:
Given that the VFD SWMR configuration FAPL property is set, the writer field must
be consistent with the flags passed in the H5Fopen() (either H5F_ACC_RDWR for the
VFD SWMR writer, or H5F_ACC_RDONLY for the VFD SWMR readers).
2019-11-20 16:23:03 -06:00
Vailin Choi
68ad19d9cc Changes for punch list #4: Add support for opening mulitple files in either VFD SWMR writer or reader mode. See EOT queue in section 3.2.2 and 3.3 and 3.3.2 in the RFC.
Update punch list with items completed and in progress.
2019-11-20 11:39:26 -06:00
Vailin Choi
227688c9cd Modifications for the following items in the punch list:
(A) #5: Add the "pb_expansion_threshold" field to the "H5F_vfd_swmr_config_t" structure
and update H5Pset_vfd_swmr_config() and H5Pget_vfd_swmr_config() accordingly
(B) #13 bullet 2: Comment H5F_vfd_swmr_config_t in H5Fpublic.h properly
(copied from John's description in the RFC)
(C) Change the field name "vfd_swmr_writer" to "writer" in "struct H5F_vfd_swmr_config_t"
(as indicated on page 11 in the RFC) and all references to it
2019-11-14 13:15:23 -06:00
mainzer
b4f607bc13 Intermin commit to allow update from Vailin's recent changes 2019-01-15 16:36:51 -06:00
mainzer
4f8917f908 Interim checkin to allow Vailin to address assertion failure in
the memory manager -- details shown below.

Note that there are other issues as well -- this is not a
working version.

[mainzer@jelly test]$ ./vfd_swmr
Testing Configure VFD SWMR with fapl                                   PASSED
Testing VFD SWMR configuration for the file and fapl                   PASSED
Testing H5Fvfd_swmr_end_tick() for VFD SWMR                            PASSED
Testing Create/Open/Flush an HDF5 file for VFD SWMR                    PASSED
Testing Verify the metadata file for VFD SWMR writer                  vfd_swmr: H5MVsection.c:233: H5MV__sect_can_merge: Assertion `((sect1->sect_info.addr)!=((haddr_t)(long)(-1)) && (sect2->sect_info.addr)!=((haddr_t)(long)(-1)) && (sect1->sect_info.addr)<(sect2->sect_info.addr))' failed.
Abort (core dumped)
[mainzer@jelly test]$
2019-01-03 13:50:53 -06:00
Vailin Choi
0e0abc50c8 Fixes for issues #1 and #2 listed in John's email dated Dec 7 2018:
(1) Assertion failure in the vfd_swmr test
(2) Reader error in the vfd swmr concurrent tests
Also fixes for:
(a) Use H5MV_alloc() to allocate space for md_pages_reserved when creating the metadata file in H5F__vfd_swmr_init()
(b) Remove a multi-page (when vfd_swmr_writer is true) from the page buffer in H5MF_xfree()
2018-12-19 16:30:44 -06:00
Vailin Choi
d4d7687ad1 1) Add concurrent test for VFD SWMR reader
2) Bug fixes in H5FDvfd_swmr.c
2018-10-29 16:46:39 -05:00
Vailin Choi
a1bd33ad08 (1) Add tests for VFD SWMR writer
(2) Bug fixes
2018-10-22 13:43:55 -05:00
Vailin Choi
1daccbded7 Second batch of checkin:
1) Define driver for the VFD SWMR reader
2) Implement VFD SWMR open callback
3) Implement H5FD_vfd_swmr_get_tick_and_idx()
4) Load and decode metadata file header and index
4) Closing for VFD SWMR
2018-09-03 23:11:36 -05:00
Vailin Choi
45be06a387 Preliminary checkins for implementation done so far:
1) Public routines: H5Pget/set_vfd_swmr_config
2) Public routine: H5Fvfd_swmr_end_tick
3) Initialization when opening a file with VFD SWMR writer
4) Tests in test/vfd_swmr.c for VFD SWMR
5) Fix a bug in src/H5Fint.c: when error is encountered after the root group is created
Note the following:
--This is WORK IN PROGRESS and will subject to change as implementation goes.
--There is test failure form enc_dec_plist.c: I will fix this when changes to the property list are settled.
--The branch is updated with the latest from develop as of 8/14/2018
2018-08-14 13:21:00 -05:00