Compare commits

...

1175 Commits

Author SHA1 Message Date
Dana Robinson
e97e0b8a5d Turned off maintainer mode in configure.ac 2021-03-26 16:57:27 -07:00
Dana Robinson
6ad8fb58ff Removes extraneous documents 2021-03-26 16:46:59 -07:00
Dana Robinson
ad1b93848a Adds Autotools generated files for alpha 2 release 2021-03-26 16:42:23 -07:00
Dana Robinson
bddf457034 Merge pull request #525 from derobins/vfd_swmr/thg_standards
Fixed 1.6 compatibility issues and ran source formatter
2021-03-26 16:18:37 -07:00
Dana Robinson
0a73f3dd4b Fixed 1.6 compatibility issues and ran source formatter 2021-03-26 16:16:38 -07:00
Dana Robinson
c81afbff45 Merge pull request #518 from derobins/vfd_swmr/thg_standards
Vfd swmr/thg standards
2021-03-25 11:28:38 -07:00
Dana Robinson
0011a5e758 Temporarily disable some tests that fail on Windows 2021-03-25 11:26:52 -07:00
Dana Robinson
8d526ed137 test_same_file_opens() works on Windows now (vfd_swmr.c) 2021-03-25 02:48:27 -07:00
Dana Robinson
3176c92453 Merge pull request #515 from derobins/vfd_swmr/thg_standards
Brings file locking from develop, fixes parallel
2021-03-25 02:14:15 -07:00
Dana Robinson
df685806b2 Fixes phdf5 2021-03-25 02:11:45 -07:00
Dana Robinson
c0c978e627 Normalization of the bin scripts (with develop) 2021-03-25 01:16:59 -07:00
Dana Robinson
2cf9bed552 Brings Windows file locking from develop 2021-03-25 00:57:21 -07:00
Dana Robinson
1dbb83aabd Brings file locking changes from develop 2021-03-25 00:32:40 -07:00
Dana Robinson
9d8344d88c Merge pull request #514 from derobins/vfd_swmr/thg_standards
Brings the 'warnings-as-errors' changes from develop
2021-03-24 19:13:24 -07:00
Dana Robinson
711d12bb58 Brings the 'warnings-as-errors' changes from develop 2021-03-24 19:11:34 -07:00
Dana Robinson
091ed42aa5 Merge pull request #513 from derobins/vfd_swmr/thg_standards
Updates license url and history docs
2021-03-24 18:37:07 -07:00
Dana Robinson
67cfa2396c Updates license url and history docs 2021-03-24 18:29:11 -07:00
Dana Robinson
8589bd0148 Merge pull request #512 from derobins/vfd_swmr/thg_standards
Formats the source, misc Autotools fixes
2021-03-24 17:41:58 -07:00
Dana Robinson
feb20aac30 Formats the source and updates the gcc warning pragmas 2021-03-24 17:39:37 -07:00
Dana Robinson
bdac2ecdbf Brings some Autotools improvements over from develop
* configure.ac tidying
* helpful XCode comments
* FreeBSD improvements
* Fixes for finding Java on MacOS
* The improved warnhist script
2021-03-24 16:02:07 -07:00
Dana Robinson
2e3b24078e Brings the clang-format files from develop
NOTE: Not wired into github actions at this time.
2021-03-24 15:46:48 -07:00
Dana Robinson
93080fa619 Brings fixes for splitter VFD test from develop 2021-03-24 15:34:04 -07:00
Dana Robinson
bef660f867 Merge pull request #511 from derobins/vfd_swmr/thg_standards
Removes Dave Young from the COPYING document
2021-03-24 15:02:33 -07:00
Dana Robinson
a091157a42 Removes Dave Young from the COPYING document
His personal code has been removed.
2021-03-24 14:58:46 -07:00
Dana Robinson
3adde0cc19 Merge pull request #510 from derobins/vfd_swmr/thg_standards
More changes that bring the branch closer to working on Windows
2021-03-24 14:56:32 -07:00
Dana Robinson
ca3721e3d7 Merge remote-tracking branch 'canonical/feature/vfd_swmr' into vfd_swmr/thg_standards 2021-03-23 14:37:51 -07:00
Dana Robinson
13d4ed7e3a Merge pull request #504 from derobins/vfd_swmr/hide_timespeccmp
Protects timespeccmp
2021-03-23 14:36:00 -07:00
Dana Robinson
915e36f1d2 Protects timespeccmp 2021-03-23 14:32:25 -07:00
Dana Robinson
1598238b2f Merge pull request #500 from derobins/vfd_swmr/minor
Fixed MANIFEST
2021-03-22 18:22:21 -07:00
Dana Robinson
d2e5e45e10 Fixed MANIFEST 2021-03-22 18:21:16 -07:00
Dana Robinson
b5302290b7 Merge pull request #499 from derobins/vfd_swmr/missing_dedups
Adds missing dedup callback entries to other VFDs
2021-03-22 17:07:06 -07:00
Dana Robinson
5a5a2dbca8 Adds missing dedup callback entries to other VFDs
NOTE: The mirror VFD and parallel are currently broken
2021-03-22 17:03:40 -07:00
Dana Robinson
1e71b31e8a Fixes H5CX_pop badness 2021-03-22 16:45:12 -07:00
Dana Robinson
e736ca2b69 Adds a dedup callback to the mirror VFD 2021-03-22 15:08:31 -07:00
Dana Robinson
0a9e2fed69 Removes pre-2015 Visual Studio cruft (from develop) 2021-03-22 11:58:45 -07:00
Dana Robinson
904315962c Brings the tcheck_version test changes from develop 2021-03-22 11:50:26 -07:00
Dana Robinson
f695908160 Brings HSYS_GOTO_ERROR changes from develop 2021-03-22 11:45:49 -07:00
Dana Robinson
0d4ed0eb9a Brings accum.c changes from develop 2021-03-22 11:45:32 -07:00
raylu-hdf
e74ffa9578 Merge pull request #456 from HDFGroup/raylu_group_test
Changing the signal handling to named pipe in the group test for better portablity
2021-03-17 20:50:33 -05:00
Songyu Lu
796018e558 Re-arranged the communication between the writer and reader through named pipes to facilitate possible test improvements in the future. 2021-03-16 20:39:01 -05:00
Songyu Lu
20cbe68958 Adding more comments. 2021-03-15 11:01:25 -05:00
Songyu Lu
923e15b749 Some minor changes. 2021-03-15 10:49:43 -05:00
Songyu Lu
11486e26a2 Changing the signal handling to named pipe for better portablity. 2021-03-10 11:07:21 -06:00
Dana Robinson
f213ff673d Windows cleanup
* A splitter VFD test in vfd.c fails
* Several vfd_swmr.c tests are #ifdef'd around
2021-03-09 19:16:38 -08:00
Dana Robinson
a44ac1af3f Excludes VFD SWMR acceptance tests on Windows
Via #ifdefs, not build system
2021-03-09 17:14:09 -08:00
Dana Robinson
3ba3ce9bfa Converts nanosleep to H5_nanosleep in genall5.c 2021-03-09 16:52:59 -08:00
Dana Robinson
c3825a3a6f Fix brackets on non-POSIX vfd_swmr.c 2021-03-09 16:21:47 -08:00
Dana Robinson
9aa3b40b9e Removes err.h cruft from genall5.c and vfd_swmr_common.c 2021-03-09 16:19:13 -08:00
Dana Robinson
d5b5f022cd Removes an unused variable from vfd_swmr.c 2021-03-09 13:06:37 -08:00
Dana Robinson
9d914b1bb0 Fixes order of magnitude issue in Windows nanosleep equivalent 2021-03-09 12:47:31 -08:00
Dana Robinson
f0c562554f Hides use of clock_gettime() on Windows
timespec_get() is C11 and probably only has about 10 ms resolution. We
may have to revisit this.
2021-03-09 12:44:41 -08:00
Dana Robinson
829432e3fd Rips out unused, unportable "print elapsed time" code in page_buffer.c 2021-03-09 12:42:14 -08:00
Dana Robinson
6d239fc41e Adds DLLVAR macros to allow exporting symbols on Windows 2021-03-09 12:19:04 -08:00
Dana Robinson
79b0aa571d Replaces BSD random functions with ISO 2021-03-09 10:57:48 -08:00
Dana Robinson
b8c5c9f20d Removes libgen.h detection from Autotools and CMake 2021-03-09 06:52:26 -08:00
Dana Robinson
22723e87d8 Replaces basename and dirname with code that will work everywhere 2021-03-09 06:50:13 -08:00
Dana Robinson
d72405e43d Changes to help vfd_swmr.c build on Windows 2021-03-08 14:19:41 -08:00
Dana Robinson
84b31b5a55 Merge pull request #416 from derobins/vfd_swmr/thg_standards
Brings VFD SWMR code closer to THG standards and allows C library compilation on Windows
2021-03-04 12:53:35 -08:00
Dana Robinson
ef5a1941f7 Merge remote-tracking branch 'canonical/feature/vfd_swmr' into vfd_swmr/thg_standards 2021-03-04 11:54:43 -08:00
Dana Robinson
7cd0949828 Merge pull request #426 from vchoi-hdfgroup/demo_feature_vfd_swmr
Add the two VFD SWMR demo programs to "examples" directory.
2021-03-04 11:48:41 -08:00
vchoi
b0ce859b2c Add the two VFD SWMR demo programs to "examples" directory.
Provide instructions on compiling and running the demos.
2021-03-04 13:36:39 -06:00
vchoi-hdfgroup
0e61a9abf6 Merge pull request #413 from vchoi-hdfgroup/feature/vfd_swmr
VFD SWMR TestExpress limits on testvfdswmr.sh
2021-03-03 14:20:33 -06:00
Dana Robinson
94694f91a3 Engineers around naked clock_gettime() calls
This is a temporary solution, as not all POSIX platforms will have
clock_gettime(). Further code fixes will be required.

With this change, the main C library should compile on Windows.
2021-03-02 17:22:22 -08:00
Dana Robinson
eb24fbe89c Adds missing private VFD SWMR headers to CMake 2021-03-02 16:49:40 -08:00
Dana Robinson
dea61b33b3 Removed Wnanosleep stub and adds Win32 code to H5_nanosleep() 2021-03-02 16:38:17 -08:00
Dana Robinson
99237a7291 Switch to using H5_nanosleep() instead of HDnanosleep()
* Just in the main library and test/vfd_swmr.c
* VFD SWMR acceptance tests still use HDnanosleep() directly
2021-03-02 16:04:42 -08:00
Dana Robinson
c7518ef299 Fixes a missing declaration for H5_get_win32_times() 2021-03-02 15:19:31 -08:00
Dana Robinson
ae24b82f77 Brings MacOS fixes from main feature branch 2021-03-02 14:30:01 -08:00
vchoi
c18b6eaea8 Add test settings for vfd_swmr_bigset_writer.c based on HDF5TestExpress:
Default, Exhaustive, and quick runs.
2021-03-02 11:59:33 -06:00
Dana Robinson
69b2061d68 HD prefix and hbool_t changes in test/vfd_swmr.c 2021-03-02 06:42:50 -08:00
Dana Robinson
132dd66269 Fixes a bug from when the hlog code was removed 2021-03-02 05:42:17 -08:00
Dana Robinson
0455457cc7 Switch to hbool_t and TRUE/FALSE in library code 2021-03-02 05:20:03 -08:00
Dana Robinson
7d53a8b837 Removed the rest of the hlog code 2021-03-02 04:34:09 -08:00
Dana Robinson
6661b21e9a Stripped hlog code from H5MV.c 2021-03-02 04:07:31 -08:00
Dana Robinson
f1bc0c97a9 Makes libgen.h functions ready for implementation on Windows 2021-03-02 03:22:50 -08:00
Dana Robinson
6639693cff Removed most C library include lines from tests 2021-03-02 02:51:55 -08:00
Dana Robinson
eea7c11b6a Fix unfreed memory after fork in vfd_swmr test
The writer configuration in the vfd_swmr test was not freed in the
child process after a call to fork() causing a memory leak.
2021-03-02 02:39:36 -08:00
Dana Robinson
7b603397c3 Switches memcpy to H5MM_memcpy in H5Fvfd_swmr.c 2021-03-02 02:29:01 -08:00
Dana Robinson
4173c4b0b9 Switches H5FDvfd_swmr.c memory calls to use H5MM 2021-03-02 02:13:31 -08:00
Dana Robinson
cd3011edad H5MF.c cleanup
* Removes hlog code
* Mostly meets THG coding standards now
* Still needs commenting and probably another tidying pass
2021-03-02 01:40:05 -08:00
Dana Robinson
46865e70af Switches H5MF memory calls to use H5MM 2021-03-01 20:32:15 -08:00
Dana Robinson
65bf098ee6 Adds HD prefix to POSIX calls in src 2021-03-01 20:25:33 -08:00
vchoi
d9f44665cd Revert "Add the two VFD SWMR demo programs to the test directory so that they can be built as needed."
This reverts commit f6e7edcedf.
2021-03-01 18:10:07 -06:00
vchoi
f792bdbbc5 Merge remote-tracking branch 'canonical/feature/vfd_swmr' into feature/vfd_swmr 2021-03-01 18:04:33 -06:00
Dana Robinson
3d90a076fb Fixes include guards for a few headers 2021-03-01 14:31:16 -08:00
Dana Robinson
fa87a22f82 Fixes the MANIFEST
Also renames "SWMR Example.png" to SWMR_Example.png since the MANIFEST
doesn't deal with spaces very well.
2021-03-01 14:24:50 -08:00
Dana Robinson
db95737047 Merge pull request #388 from derobins/vfd_swmr/H5FD_public_fix
Moves the BSD queue to a wrapper to keep it out of the public API
2021-03-01 14:06:03 -08:00
Dana Robinson
d7b277a22a Improves autotools and CMake support for sigtimedwait alternative 2021-03-01 13:54:27 -08:00
Dana Robinson
051cf5330b Minor change to H5FDvfd_swmr.h include guard name 2021-03-01 12:47:53 -08:00
Dana Robinson
77f2b0b207 Fixes leading underscores in VFD SWMR include guards 2021-03-01 12:45:20 -08:00
vchoi
f6e7edcedf Add the two VFD SWMR demo programs to the test directory so that they can be built as needed. 2021-02-26 13:54:11 -06:00
Dana Robinson
0e9f9a280a Adds MacOS work-around for sigtimedwait(2) in the VFD SWMR tests 2021-02-26 11:34:53 -08:00
Dana Robinson
0a1444ea78 Adapts H5queue.h to work on MacOS 2021-02-26 11:21:49 -08:00
Dana Robinson
90bfcb9fba Moves H5queue.h to H5private.h and yanks circular queue macros 2021-02-26 10:39:46 -08:00
Dana Robinson
ba5808196e Moves H5queue.h from H5FDpublic.h to H5FD.c 2021-02-26 10:03:54 -08:00
Dana Robinson
8c7b4c7de3 Moves the BSD queue to a wrapper to keep it out of the public API 2021-02-26 03:37:03 -08:00
raylu-hdf
511b940da6 Merge pull request #331 from HDFGroup/raylu_fixed_array
Adding the test case for fixed-array chunked dataset and VDS
2021-02-15 11:31:16 -06:00
songyulu
c20fb7c76d Corrected a typo in the comment. 2021-02-15 11:26:34 -06:00
songyulu
1d6b21a4a1 Added some comments. 2021-02-12 16:21:34 -06:00
songyulu
ddd24e2651 Adding the test case for fixed-array chunked dataset and VDS. 2021-02-12 11:26:39 -06:00
vchoi-hdfgroup
85ae0a2687 Merge pull request #305 from vchoi-hdfgroup/feature/vfd_swmr
(1) Add new routine to configure for VFD SWMR: init_vfd_swmr_config()
2021-02-02 18:11:45 -06:00
vchoi
d8e77f13be (1) Add new routine to configure for VFD SWMR: init_vfd_swmr_config()
(2) Revise routine to setup fapl for VFD SWMR legacy and other integration tests: vfd_swmr_create_fapl()
(3) Update all VFD SWMR integration tests to use the above two routines
(4) Clean up VFD SWMR legacy tests: turn on compression in test script, remove #ifdef OUT H5Fflush(), message file name
2021-02-02 16:01:35 -06:00
Dana Robinson
592f8b738e Merge pull request #35 from derobins/thg/feature/vfd_swmr
Updates CMake files to work with VFD SWMR
2020-10-14 12:18:41 -07:00
Dana Robinson
16fbbfb766 Updates CMake files to work with VFD SWMR
- CMake files were updated to build new files in src and test.

- As with legacy SWMR, the test programs that are run via shell
  scripts are built but not run.

- Updated whitespace in the links_env output file. It's unclear why
  this changed, but CMake does an exact diff on the file whereas
  the autotools do not.
2020-10-14 10:45:53 -07:00
John Mainzer
0698d23269 Merge pull request #2893 in HDFFV/hdf5 from ~MAINZER/vfd_swmr:feature/vfd_swmr to feature/vfd_swmr
* commit '47b1c667c64677d2e28c4128fc027cfdfe60b354':
  More minor edits to users guide.
  Updated users guide for location of alpha 1 release & repaired several typos.
  Added .pdf and .docx versions of the most recent version of the VFD SWMR RFC.  Updates on the RFC are cursory, and mostly in the introduction.  The design section is dated -- added a warning to this effect.
2020-09-21 17:41:09 -05:00
mainzer
47b1c667c6 More minor edits to users guide. 2020-09-21 17:38:18 -05:00
mainzer
2dd0cbe9a7 Updated users guide for location of alpha 1 release & repaired
several typos.
2020-09-21 17:30:06 -05:00
Dana Robinson
35b47b892a Merge pull request #2890 in HDFFV/hdf5 from ~DEROBINS/hdf5_der:feature/vfd_swmr to feature/vfd_swmr
* commit '594b17165effd9ce43bf0b2dd97e0b3df281e69d':
  Removes older VFD SWMR RFC versions
2020-09-21 16:45:01 -05:00
mainzer
3696129c7b Added .pdf and .docx versions of the most recent version of the
VFD SWMR RFC.  Updates on the RFC are cursory, and mostly in the
introduction.  The design section is dated -- added a warning to
this effect.

Reviewed and editied the users guide -- specifically:

   Verified instructions for build and test, and also for demos.
   Removed mention of call to autogen.sh, as that will already be
   run on the friendly user release version.

   Re-worked the introduction to better discribe VFD SWMR, and
   to outline current limitations.

   Changed references to "shadow file" to "metadata file" to match
   field names.

Still need to update pointer to the bit-bucket repository for the
friendly user release.

Also, must verify that the demo code mentioned in the user guide
is publicly available.
2020-09-21 09:01:06 -05:00
David Young
b3cf131855 Merge pull request #2889 in HDFFV/hdf5 from ~DYOUNG/vchoi_fork:quiet-zoo to feature/vfd_swmr
* commit 'aebc84053f9a592aac765fbd3b26f2941015d2e5':
  Limit the repeat rate for duplicate zoo warnings to once every five seconds.
  Move below_speed_limit() from vfd_swmr_bigset_writer.c to vfd_swmr_common.c, document it, and fix a bug.
  Document some of the functions in here.  Update the comment at the top of the file.  NFCI.
2020-09-17 17:18:15 -05:00
Dana Robinson
594b17165e Removes older VFD SWMR RFC versions
These are archived in hdf5doc.
2020-09-17 14:49:48 -07:00
David Young
aebc84053f Merge branch 'vswmr-base' into quiet-zoo 2020-09-17 15:31:33 -05:00
David Young
07ad063b4b Limit the repeat rate for duplicate zoo warnings to once every five
seconds.
2020-09-17 15:24:36 -05:00
David Young
8e2053bb3d Move below_speed_limit() from vfd_swmr_bigset_writer.c to
vfd_swmr_common.c, document it, and fix a bug.
2020-09-17 14:35:54 -05:00
David Young
da688311af Document some of the functions in here. Update the comment at the top
of the file.  NFCI.
2020-09-17 14:34:46 -05:00
David Young
43470c8daf Merge branch 'feature/vfd_swmr' into multi 2020-09-14 12:42:33 -05:00
David Young
69f4053692 Move the open issues noted in the outdated VFD_SWMR_Guide.md to
vfd-swmr-user-guide.md and delete VFD_SWMR_Guide.md.
2020-09-14 12:41:27 -05:00
David Young
c96c891d32 Merge branch 'feature/vfd_swmr' into multi 2020-09-14 11:17:11 -05:00
David Young
2b7d87ecbe Add the U. of California copyright notice from src/H5queue.h. 2020-09-14 11:16:31 -05:00
David Young
86ee920e8c Merge branch 'feature/vfd_swmr' into multi 2020-09-14 11:07:55 -05:00
Dana Robinson
a56e5dc7e4 Fixes a leak of the metadata index memory 2020-09-14 10:48:02 -05:00
David Young
de03f876f5 Merge branch 'feature/vfd_swmr' into multi 2020-09-14 10:47:34 -05:00
Dana Robinson
361861da89 Merge pull request #1 in ~DYOUNG/vchoi_fork from ~DEROBINS/hdf5_der:svd_multi_memory_fix to multi
* commit '09981b58d800d784a2aa7e3ea5f7f1cad576e8db':
  Fixes a leak of the metadata index memory
2020-09-08 20:04:06 -05:00
Dana Robinson
09981b58d8 Fixes a leak of the metadata index memory 2020-09-08 14:59:33 -07:00
David Young
1acfef5737 Rewrap lines. 2020-09-03 16:48:33 -05:00
David Young
ff8b70dc0f Merge branch 'feature/vfd_swmr' into multi 2020-09-03 14:58:57 -05:00
David Young
9bb743136e Individually track the steps verified on each dataset. Take care
not to skip a step.
2020-09-03 14:58:15 -05:00
David Young
68643772e3 Mention that creating new objects is not possible with legacy SWMR.
Add abbreviation TBD where we need to add a hyperlink.
2020-09-03 14:58:15 -05:00
David Young
101f040b80 Add Dana's words about MS Windows support. 2020-09-03 14:58:15 -05:00
David Young
a4a969f0fd Give an overview of the bigsets test in a mega-comment at the top. Also,
describe the test pattern.  And while I'm here, repair a comment,
s/writer/reader/.
2020-09-03 14:58:14 -05:00
David Young
f58c2c5cce Merge branch 'feature/vfd_swmr' into multi 2020-09-02 11:08:34 -05:00
David Young
135af42c09 Describe the command-line options for the bigset reader/writer
with a handful of bullets.
2020-09-02 10:50:34 -05:00
David Young
bfc42a18ce Don't pass CFLAGS to the configure script, that's not in the HDF5 configure
idiom and it's just too much detail.

Repair a TBD: mention the vfdswmr@hdfgroup.org address for contacting the VFD
SWMR developers.
2020-09-02 10:06:20 -05:00
David Young
79560265af Merge branch 'feature/vfd_swmr' into multi 2020-08-31 18:56:25 -05:00
David Young
f45bb21979 Write a comment about a bit of overflow-avoidance logic. NFCI. 2020-08-31 17:21:58 -05:00
David Young
599be55d97 Be less specific about Windows support. 2020-08-31 17:01:50 -05:00
David Young
53fe9189e1 Improve/expand the comments on the file->writer assertions. 2020-08-31 15:57:59 -05:00
David Young
aaeb21bdea Delete an unhelpful comment. NFCI. 2020-08-31 15:57:39 -05:00
David Young
918d8894a0 Add some header comments to functions. 2020-08-31 15:56:46 -05:00
David Young
4f833668b0 Rename api_elapsed_nslots to api_elapsed_nbuckets: possibly clarifies
things, possibly does not?  NFCI.
2020-08-31 15:55:20 -05:00
David Young
349ed1418b Document vfd_swmr_pageno_to_mdf_idx_entry() and rename its parameter
nindices -> nentries.
2020-08-31 15:52:48 -05:00
David Young
96c6a7c8d8 Wrap a line in a comment at 80 columns. 2020-08-31 15:52:17 -05:00
David Young
733a02386b Add/improve some struct/member documentation per John's request. 2020-08-31 15:50:31 -05:00
David Young
fd406a654c Document vfd_swmr_writer_may_increase_tick_to() and
vfd_swmr_reader_did_increase_tick_to().  NFCI.
2020-08-31 15:46:47 -05:00
David Young
5756ac4233 Document H5HG_trap(). 2020-08-31 15:46:22 -05:00
David Young
60787f34e7 Delete unused local variable. NFCI. 2020-08-31 15:46:05 -05:00
David Young
aecd29c2ad Use the DECODE macro with the correct signedness for the variable. 2020-08-31 15:43:35 -05:00
David Young
b0e9960460 Merge branch 'feature/vfd_swmr' into multi 2020-08-28 12:51:39 -05:00
David Young
0624ed2e48 Also accept transitions of the superblock status flags to
H5F_SUPER_WRITE_ACCESS|H5F_SUPER_SWMR_WRITE_ACCESS.  This should fix the
problem Dana's seeing on his test VM.
2020-08-28 12:49:40 -05:00
David Young
0c7c4ba490 Fix a typo in a comment. NFCI. 2020-08-28 09:23:46 -05:00
David Young
a9d7f0d2ec Merge branch 'feature/vfd_swmr' into multi 2020-08-25 15:47:07 -05:00
David Young
c97970f7a1 Use the terminology "expected" and "unexpected" errors instead of "soft" and
"hard" errors.
2020-08-25 15:46:34 -05:00
David Young
ea6dd16fbb Describe the behavior of H5FD_vfd_swmr_dedup() in excruciating detail. 2020-08-25 15:46:34 -05:00
David Young
9ee6be22b9 Clarify my descriptions of H5FD_dedup() and H5FD_deduplicate(). 2020-08-25 15:46:34 -05:00
David Young
e1419c872e Do not use first person singular in the SWMR demos section.
In the `vfd_swmr_create_fapl()` dissection, change the /** **/
comments in the literal code to plain markdown paragraphs.

Slightly change wording and markdown elsewhere.
2020-08-25 10:46:36 -05:00
David Young
da4c72a138 Incorporate Mike's changes, fix some of my punctuation and markdown. 2020-08-25 10:23:01 -05:00
David Young
c492036b0d Add the VFD SWMR User's Guide, a work in progress. 2020-08-25 09:22:04 -05:00
David Young
563665c894 Merge branch 'feature/vfd_swmr' into multi 2020-08-21 13:44:27 -05:00
David Young
7af1fa67d6 When the superblock status flags don't meet our expectations, print
the flags and the expectations.
2020-08-21 13:43:41 -05:00
David Young
482ee0765d Apply Dana's fix for production mode builds. 2020-08-21 13:43:08 -05:00
David Young
0bbf92da01 Merge branch 'feature/vfd_swmr' into multi 2020-08-21 09:53:50 -05:00
David Young
c68700769f Avoid potential shadow-file clashes, call the shadow file group-shadow. 2020-08-21 09:53:17 -05:00
David Young
d0f1d9ab7b Call the shadow files bigset-shadow-<number> for some <number>,
to avoid unlikely shadow-file clashes.
2020-08-21 09:52:26 -05:00
David Young
fe4b7110a7 Avoid potential shadow-file clashes, call the file generator-shadow. 2020-08-21 09:51:32 -05:00
David Young
88342f8b3f Use the safe calloc() idiom, p = calloc(1, sizeof(*p)), and do
not gratuitously cast to p's type.
2020-08-21 09:50:49 -05:00
David Young
2fe7d17a76 Avoid potential shadow-file clashes, call the shadow file rw-shadow. 2020-08-21 09:49:44 -05:00
David Young
2f30671e84 Straggler from last: call the shadow file vlstr-shadow. 2020-08-21 09:48:39 -05:00
David Young
24e6e55c56 Avoid shadow file clashes, call the file vlstr-shadow. 2020-08-21 09:48:17 -05:00
David Young
0c741c5997 To avoid potential clashes with other tests, call the shadow file zoo-shadow. 2020-08-21 09:47:14 -05:00
David Young
bcf91a09df Derive the name of the shadow file from the HDF5 file: drop the .h5, add
.shadow.
2020-08-21 09:46:30 -05:00
David Young
2ef65c82a6 Merge branch 'feature/vfd_swmr' into multi 2020-08-20 10:15:49 -05:00
David Young
cd9c80925e Delete disused routine H5FD_has_conflict(). 2020-08-20 10:14:48 -05:00
David Young
1373eec7e5 Merge branch 'feature/vfd_swmr' into multi 2020-08-18 17:43:01 -05:00
David Young
38310e9176 Sleep 1/10s between H5Dopen() tries. Make a couple of warning/error messages
more clear/correct.
2020-08-18 17:42:35 -05:00
David Young
2d1fc21f49 Merge branch 'feature/vfd_swmr' into multi 2020-08-18 12:08:37 -05:00
David Young
a06d6f235d Perform the dataset opens in reverse order to their creation, and if
H5Dopen fails, rapidly retry up to 9,999 times.  Log H5Dopen failures,
but log no more than once every five seconds to avoid spamming the
terminal.

With these changes, it's easier for the reader to open the last dataset
before the writer created it, but the reader recovers instead of
quitting with an error.  It should only be necessary to retry opening
the *last* dataset; all previous datasets should open on one try if the
last is open.
2020-08-18 12:08:05 -05:00
David Young
a51442b8ad Merge branch 'feature/vfd_swmr' into multi 2020-08-17 10:38:01 -05:00
David Young
0619c3dfd8 Fix copy-and-paste error: do not copy the H5T_C_S1 type twice. 2020-08-17 10:36:12 -05:00
David Young
cb1c50dfb1 Merge branch 'feature/vfd_swmr' into may-merge-mainzer-to-mine 2020-08-05 13:39:40 -05:00
David Young
695bd92140 Fix a regression that crept in with the August merge: use the "swmr" VFD when
that's called for.
2020-08-05 13:37:49 -05:00
David Young
9bdd3878e7 Merge branch 'aug-merge-attempt/feature/vfd_swmr' into aug-merge-attempt/may-merge-mainzer-to-mine 2020-08-04 12:38:25 -05:00
David Young
dc97b9a165 Merge branch 'aug-develop' into aug-merge-attempt/feature/vfd_swmr 2020-08-04 10:22:47 -05:00
David Young
f28c92bb36 Merge branch 'may-develop' into may-merge-head/feature/vfd_swmr 2020-08-04 10:03:49 -05:00
David Young
e5f061d5a4 Merge branch 'feature/vfd_swmr' into may-merge-mainzer-to-mine 2020-08-03 16:24:31 -05:00
David Young
316aa34bac Make tests pass on both of my branches, like they ought to: in the tests that
call H5F__vfd_swmr_writer_md_test(), actually sleep for more than `max_lag`
ticks so that the deferred-frees queue is actually flushed before we force new
items onto the queue and count them.

In H5F__vfd_swmr_writer_md_test(), check that the number of deferred
shadow-space frees is *precisely* the number `nshadow_defrees`, since that
seems to be what the tests that call this routine intend.
2020-08-03 15:00:25 -05:00
David Young
6500ea09a0 Merge branch 'feature/vfd_swmr' into may-merge-mainzer-to-mine 2020-08-03 11:13:06 -05:00
David Young
20a6b82597 In VFD SWMR, use H5F_shared_t instead of H5F_t wherever that is possible. 2020-08-03 11:11:23 -05:00
David Young
b9888cceff The second argument to H5MV__sect_shrink() has to be an actual H5F_t *, not
NULL, so pass an actual H5F_t *.  Bug found by code inspection.
2020-08-03 11:06:14 -05:00
David Young
88e8b4fd7d Merge branch 'feature/vfd_swmr' into may-merge-mainzer-to-mine 2020-07-31 16:15:25 -05:00
David Young
d01bcf6667 Perform virtual dataset tests with multiple source files, too. 2020-07-31 16:14:10 -05:00
David Young
6caa0c5ac5 Let us use virtual datasets with multiple source files that are open with VFD
SWMR mode: pass H5P_FILE_ACCESS_ANY_VFD so that the discrepancy between VFD
SWMR file-access properties and default file-access properties is ignored.
2020-07-31 16:12:27 -05:00
David Young
7321d0e813 Improve code readability: extract common subexpressions into temporary
variables.
2020-07-30 17:21:24 -05:00
David Young
a8cbf2579d In test_reader_md_concur(), the child has to exit(3), not FAIL_STACK_ERROR, on
error.
2020-07-30 17:01:16 -05:00
David Young
bf004fcba8 Bug fixes: don't double-close a FAPL ID. Always close a file ID. 2020-07-30 17:00:38 -05:00
David Young
92887cad1c Update an out-of-date comment. 2020-07-30 16:58:37 -05:00
David Young
b6b92aff09 Remove superfluous casts from void * to another pointer type prior to
assignment. Use a safer sizeof(array element) idiom.  NFCI.
2020-07-30 16:56:20 -05:00
David Young
2a64d2fe93 Change H5F_open to perform deduplication of open VFDs in a more flexible way,
using the new routine H5FDdeduplicate().

Simplify H5F_open() a bit, pushing some of the configuration checks into the
SMWR VFD.  For example, check that page buffering is enabled in
H5FD_vfd_swmr_open() instead of in H5F_open().  Compare VFD SWMR configurations
in H5FD_vfd_swmr_dedup() instead of in H5F_open().

Clone the default file-access property list at a new file-access property list
ID, H5P_FILE_ACCESS_ANY_VFD.  The new ID is used to indicate that if the file
that's being opened is already open under an existing virtual file, and if that
virtual file would not ordinarily be opened with the default FAPL, then it's ok
to use that virtual file.

Add a new optional method, `dedup`, to H5FD_class_t, and use it to customize a
VFD's deduplication.

Customize the SWMR VFD's deduplication.  Make it honor H5P_FILE_ACCESS_ANY_VFD
Embed the VFD SWMR configuration in the H5FD_vfd_swmr_t to facilitate
comparison of configuration between new and old SWMR virtual files.

In H5F__sfile_search(), match using a pointer comparison instead of H5FD_cmp(),
because we will only ever enter H5F__sfile_search() with a deduplicated
H5FD_t *.
2020-07-30 16:53:01 -05:00
David Young
0b189968ff Merge branch 'feature/vfd_swmr' into may-merge-mainzer-to-mine 2020-07-28 09:41:09 -05:00
David Young
5632094d5c Initialize refresh member. 2020-07-28 09:40:35 -05:00
David Young
0cb028b717 Merge branch 'feature/vfd_swmr' into may-merge-mainzer-to-mine 2020-07-28 09:20:28 -05:00
David Young
d93bc843aa Promote more warnings to errors. 2020-07-28 09:14:12 -05:00
David Young
0fd4a7f5e1 Merge branch 'feature/vfd_swmr' into may-merge-mainzer-to-mine 2020-07-21 11:25:28 -05:00
David Young
04e775b127 Straggler from last: update declaration of vfd_swmr_create_fapl(). 2020-07-21 11:15:44 -05:00
David Young
78bd491aad Add to the "bigset" writer a -M command-line option that enables the use of
multiple files with virtual datasets.

Add to vfd_swmr_create_fapl() printf(3)-like arguments for setting the shadow
filename.  Update all callers.
2020-07-21 11:13:05 -05:00
David Young
a9fefff620 Add evsnprintf for printing a va_list to a buffer or aborting the program on
an overflow or other error.
2020-07-21 10:18:43 -05:00
David Young
6e3ad3213d Delete superfluous comments that interpret obvious program syntax/semantics. 2020-07-21 10:15:56 -05:00
David Young
0ae43ff6cd Mention an improvement asked for by ITER. 2020-07-21 10:04:49 -05:00
David Young
43cec81db6 Only count metadata reads/writes on the page buffer. Neaten the count logs. 2020-07-21 10:01:12 -05:00
David Young
c66f7d5b65 Merge branch 'feature/vfd_swmr' into may-merge-mainzer-to-mine 2020-07-15 16:47:07 -05:00
David Young
c9d8f3e4f1 Log the number of page-buffer accesses at various multiples of the page size
with log outlet `pb_access_sizes`.
2020-07-15 16:44:52 -05:00
David Young
be0b2f132d Perform the few_big and many_small tests with and without VDS enabled. 2020-07-15 16:43:48 -05:00
David Young
91a7258dbf Don't perform EOT processing on the same H5F_shared_t more than once if it has
multiple referring H5F_t on the EOT queue.  This stops the VFD SWMR writer from
advancing the shadow file's tick number too fast when we're using virtual
datasets (VDS) with VFD SWMR.
2020-07-15 16:28:52 -05:00
David Young
767afc60be Update comment. 2020-07-15 16:26:52 -05:00
David Young
0e9f3038d2 Merge branch 'feature/vfd_swmr' into may-merge-mainzer-to-mine 2020-07-14 15:13:45 -05:00
David Young
a0be3626c8 Delete whitespace at EOL. NFCI. 2020-07-14 15:13:20 -05:00
David Young
814b428b2a When H5FD_vfd_swmr_read() reads a page from the shadow file whose checksum
fails, re-load the shadow-file header and log the last-read and current tick
number.
2020-07-14 15:10:30 -05:00
David Young
2056e23fc9 Avoid some casts, change some parameters from H5FD_t to H5FD_vfd_swmr_t when
that's what both the callers and callees expect.  NFCI.
2020-07-14 15:09:18 -05:00
David Young
c3120ac3da Delete some dead code. 2020-07-14 15:06:02 -05:00
David Young
5c9d2724be Add some new diagnostic logging. 2020-07-14 15:04:37 -05:00
David Young
3d89d6ca4e Suppress the error-stack printouts while attempting to open and read an
attribute: failures are expected.
2020-07-14 15:02:49 -05:00
David Young
30a62d1380 Don't check an unsigned integer for being negative. Quiets a GCC warning. 2020-07-14 15:01:50 -05:00
David Young
7840f5f3b5 Merge branch 'feature/vfd_swmr' into may-merge-mainzer-to-mine 2020-07-14 09:06:43 -05:00
David Young
63c7ec2496 Bug fix: avoid leaking memory and other resources, perform the reader-only
close activities under the correct condition!  Extract the reader-only open and
close code into helper routines.
2020-07-14 09:00:44 -05:00
David Young
f7fab27b25 If the function-enter macro fails, return FAIL. Now the compiler can see that
if H5FD__vfd_swmr_header_deserialize() succeeds, then the header that was
passed in was actually initialized.  This squashes a used-before-initialized
warning from GCC.
2020-07-14 08:58:11 -05:00
David Young
12e5f29e48 Take care to initialize the metadata file descriptor to -1 so that we don't try
to close descriptor 0, later.
2020-07-14 08:56:32 -05:00
David Young
323380e6b9 If a group's attribute isn't present, that's ok. Retry. 2020-07-14 08:55:26 -05:00
David Young
8593cd2d93 Close attribute after use. 2020-07-14 08:54:56 -05:00
David Young
fefc6cf885 Delete dead code. NFCI. 2020-07-14 08:54:44 -05:00
David Young
326b98fd08 Delete whitespace at EOL. Join consecutive line. NFCI. 2020-07-13 10:09:40 -05:00
David Young
62240b1a55 Delete whitespace at EOL. 2020-07-13 10:03:12 -05:00
David Young
0e1b6bfcef Fix a copy-pasto in an error message. 2020-07-10 16:18:39 -05:00
David Young
a2308ffd2c Move the dapl initialization to state_init and, if VDS is enabled,
set the virtual view to "first missing."
2020-07-10 16:17:51 -05:00
David Young
2882736643 Delete unused local variables. Delete an empty line. NFCI. 2020-07-10 16:16:40 -05:00
David Young
0c98fe96e5 Don't leak a fapl on error. 2020-07-10 16:16:01 -05:00
David Young
09b17b6563 Remove gratuitous local variable initialization: it's better to let the
compiler detect use-before-initialization.  Use the safer `memset(p, ...,
sizeof(*p))` idiom.
2020-07-10 16:12:05 -05:00
David Young
98f441a606 Add a new log outlet and some log statements for EOT queue manipulation. 2020-07-10 16:10:41 -05:00
David Young
8aeba09f55 Straggler from previous: bsdqueue.h -> H5queue.h 2020-07-10 16:09:37 -05:00
David Young
847d22244a Change some H5F_t uses to H5F_shared_t uses: gradually we will rid VFD SWMR of
H5F_t.
2020-07-10 16:06:22 -05:00
David Young
9907d5fdcd Be brief: remove gratuitous cast of _xfree(). Use reference to member pub
instead of cast to H5FD_t *.
2020-07-10 16:04:19 -05:00
David Young
3553c7617d Make a VFD SWMR writer use the SWMR VFD, to facilitate avoiding conflicting
multiple opens of the same file with VFD SWMR---i.e., twice for writing, or for
reading and for writing.  In the long run, this will help me encapsulate more
of the SWMR functionality in the VFD, too.
2020-07-10 16:00:09 -05:00
David Young
03cdbe9376 Straggler from previous commit: when closing the VFD SWMR virtual file, clear
the lower virtual file's `exc_owner` field.  While I'm here, remove a
gratuitous assertion.

This is part of a changeset that helps us avoid creating multiple H5F_shared_t
for one file when virtual datasets are used with VFD SWMR.  The old code for
deduplicating VFD SWMR H5F_shared_t instances did not work correctly with VFD
SWMR, so we'd end up with multiple H5F_shared_t all active on the same file.
2020-07-10 15:23:38 -05:00
David Young
b030664aaa Delete gratuitous comment and initialization from a variable declaration. 2020-07-10 15:16:25 -05:00
David Young
2e66b5cf86 Add all extant virtual files to a list. Add an "exclusive owner" (exc_owner)
member to all virtual files.  Add a routine, H5FD_has_conflict(), that returns
true if a new virtual file is identical to an existing virtual file that has an
exclusive owner.  Establish an exclusive owner for a VFD SWMR virtual file's
lower virtual file.

Rename bsdqueue.h to H5queue.h and install it, since it's used by H5FDpublic.h.

This is part of a changeset that helps us avoid creating multiple H5F_shared_t
for one file when virtual datasets are used with VFD SWMR.  The old code for
deduplicating VFD SWMR H5F_shared_t instances did not work correctly with VFD
SWMR, so we'd end up with multiple H5F_shared_t all active on the same file.
2020-07-10 15:09:29 -05:00
David Young
5e0c814296 Fix a bug where I was trying to store ndatasets * 4 source-dataset
handles in 4 variables and, of course, failing.  Refactor the
dataspace/dataset initialization.
2020-07-07 12:57:39 -05:00
David Young
6ff70c9e03 Fix a bug in H5D__virtual_write_one to stop an assertion from failing
deep in H5Dwrite---project the *clipped* virtual selection instead of
the virtual selection:

assertion "((src_space)->select.num_elem) == ((dst_space)->select.num_elem)"
failed: file "../../../vchoi_fork/src/H5Sselect.c", line 2617, function
"H5S_select_project_intersection"

with this backtrace:

    at /home/dyoung/plain-nbsd/src/lib/libc/gen/raise.c:48
    at /home/dyoung/plain-nbsd/src/lib/libc/stdlib/abort.c:74
    file=0xae9e3e80 "../../../vchoi_fork/src/H5Sselect.c", line=2617,
    function=0xae9e4ca0 <__func__.15686> "H5S_select_project_intersection",
    failedexpr=0xae9e0e54 "((src_space)->select.num_elem) ==
((dst_space)->select.num_elem)") at
/home/dyoung/plain-nbsd/src/lib/libc/gen/assert.c:72
    dst_space=0xae26f0dc, src_intersect_space=0xae0b577c,
    new_space_ptr=0xbfb85fac, share_selection=true)
    at ../../../vchoi_fork/src/H5Sselect.c:2749
    type_info=type_info@entry=0xbfb86084,
    file_space=file_space@entry=0xae0b577c, source_dset=0xae24741c,
    io_info=<optimized out>) at ../../../vchoi_fork/src/H5Dvirtual.c:2784
    type_info=0xbfb86084, nelmts=256, file_space=0xae0b577c,
    mem_space=0xae26ec8c, fm=0xadf0401c)
    at ../../../vchoi_fork/src/H5Dvirtual.c:2873
    mem_type_id=216172782113783837, mem_space=0xae26ec8c,
    file_space=0xae0b577c, buf=0xae203808)
    at ../../../vchoi_fork/src/H5Dio.c:780
    mem_type_id=216172782113783837, mem_space_id=288230376151711754,
    file_space_id=288230376151711755, dxpl_id=792633534417207304,
    buf=0xae203808, req=0x0)
    at ../../../vchoi_fork/src/H5VLnative_dataset.c:206
    mem_type_id=216172782113783837, mem_space_id=288230376151711754,
    file_space_id=288230376151711755, dxpl_id=792633534417207304,
    buf=0xae203808, req=0x0, cls=<optimized out>)
    at ../../../vchoi_fork/src/H5VLcallback.c:2152
    mem_type_id=216172782113783837, mem_space_id=288230376151711754,
    file_space_id=288230376151711755, dxpl_id=792633534417207304,
    buf=0xae203808, req=0x0) at ../../../vchoi_fork/src/H5VLcallback.c:2186
    mem_type_id=216172782113783837, mem_space_id=288230376151711754,
    file_space_id=288230376151711755, dxpl_id=792633534417207304,
    buf=0xae203808) at ../../../vchoi_fork/src/H5Dio.c:313
2020-07-07 12:57:39 -05:00
David Young
5493f4faac Fix a bug where I was trying to store ndatasets * 4 source-dataset
handles in 4 variables and, of course, failing.  Refactor the
dataspace/dataset initialization.
2020-07-07 12:56:03 -05:00
David Young
b9c2b8faff Fix a bug in H5D__virtual_write_one to stop an assertion from failing
deep in H5Dwrite---project the *clipped* virtual selection instead of
the virtual selection:

assertion "((src_space)->select.num_elem) == ((dst_space)->select.num_elem)"
failed: file "../../../vchoi_fork/src/H5Sselect.c", line 2617, function
"H5S_select_project_intersection"

with this backtrace:

    at /home/dyoung/plain-nbsd/src/lib/libc/gen/raise.c:48
    at /home/dyoung/plain-nbsd/src/lib/libc/stdlib/abort.c:74
    file=0xae9e3e80 "../../../vchoi_fork/src/H5Sselect.c", line=2617,
    function=0xae9e4ca0 <__func__.15686> "H5S_select_project_intersection",
    failedexpr=0xae9e0e54 "((src_space)->select.num_elem) ==
((dst_space)->select.num_elem)") at
/home/dyoung/plain-nbsd/src/lib/libc/gen/assert.c:72
    dst_space=0xae26f0dc, src_intersect_space=0xae0b577c,
    new_space_ptr=0xbfb85fac, share_selection=true)
    at ../../../vchoi_fork/src/H5Sselect.c:2749
    type_info=type_info@entry=0xbfb86084,
    file_space=file_space@entry=0xae0b577c, source_dset=0xae24741c,
    io_info=<optimized out>) at ../../../vchoi_fork/src/H5Dvirtual.c:2784
    type_info=0xbfb86084, nelmts=256, file_space=0xae0b577c,
    mem_space=0xae26ec8c, fm=0xadf0401c)
    at ../../../vchoi_fork/src/H5Dvirtual.c:2873
    mem_type_id=216172782113783837, mem_space=0xae26ec8c,
    file_space=0xae0b577c, buf=0xae203808)
    at ../../../vchoi_fork/src/H5Dio.c:780
    mem_type_id=216172782113783837, mem_space_id=288230376151711754,
    file_space_id=288230376151711755, dxpl_id=792633534417207304,
    buf=0xae203808, req=0x0)
    at ../../../vchoi_fork/src/H5VLnative_dataset.c:206
    mem_type_id=216172782113783837, mem_space_id=288230376151711754,
    file_space_id=288230376151711755, dxpl_id=792633534417207304,
    buf=0xae203808, req=0x0, cls=<optimized out>)
    at ../../../vchoi_fork/src/H5VLcallback.c:2152
    mem_type_id=216172782113783837, mem_space_id=288230376151711754,
    file_space_id=288230376151711755, dxpl_id=792633534417207304,
    buf=0xae203808, req=0x0) at ../../../vchoi_fork/src/H5VLcallback.c:2186
    mem_type_id=216172782113783837, mem_space_id=288230376151711754,
    file_space_id=288230376151711755, dxpl_id=792633534417207304,
    buf=0xae203808) at ../../../vchoi_fork/src/H5Dio.c:313
2020-07-07 12:52:00 -05:00
David Young
f2305cfc67 Merge branch 'feature/vfd_swmr' into may-merge-mainzer-to-mine 2020-07-02 14:57:06 -05:00
David Young
5cb598fb11 Use native byte order unless big-endian is specified with -b option. 2020-07-02 14:56:18 -05:00
David Young
49bb232d6f Merge branch 'feature/vfd_swmr' into may-merge-mainzer-to-mine 2020-06-30 15:13:52 -05:00
David Young
6274081bdd Add a VDS mode to the bigset test. 2020-06-30 15:13:15 -05:00
David Young
92cf20e865 Merge branch 'feature/vfd_swmr' into may-merge-mainzer-to-mine 2020-06-26 16:43:43 -05:00
David Young
c6250072da Gather a couple of assertions. 2020-06-26 16:43:13 -05:00
David Young
26d5a950e8 Create one dataset creation property list and one file dataspace and
share them across all datasets/iterations.  Extract common code into
state_destroy().
2020-06-26 16:41:38 -05:00
David Young
ef699d8880 Merge branch 'feature/vfd_swmr' into may-merge-mainzer-to-mine 2020-06-26 14:36:28 -05:00
David Young
bf4fca57f7 When extending the dataset in one dimension, add columns instead of rows
so that it's possible to produce a virtual dataset (VDS) variant of the
test.
2020-06-26 14:35:10 -05:00
vchoi
9f48f4e266 (1) Add public routines H5Fvfd_swmr_end_tick, H5Fvfd_swmr_disable_end_of_tick, H5Fvfd_swmr_enable_end_of_tick().
(2) Tests for the above APIs.
2020-06-26 14:18:19 -05:00
vchoi
7d50012a40 (1) Add public routines H5Fvfd_swmr_end_tick, H5Fvfd_swmr_disable_end_of_tick, H5Fvfd_swmr_enable_end_of_tick().
(2) Tests for the above APIs.
2020-06-24 10:58:22 -05:00
David Young
5449b2af49 Merge branch 'feature/vfd_swmr' into may-merge-mainzer-to-mine 2020-06-22 16:14:39 -05:00
David Young
d98d6746e0 Add/check a group attribute every so many steps. delete some dead code, and
set a non-zero default for the number of steps.
2020-06-22 16:12:41 -05:00
David Young
99245b55f3 Merge branch 'feature/vfd_swmr' into may-merge-mainzer-to-mine 2020-06-19 17:04:33 -05:00
David Young
efd1c0a305 Extract common subexpressions into oent and nent for brevity.
Assert index entries are in sorted order earlier in the loop over
old and new indices.

When looping over the remaining new index entries, just do
`entries_added++` to match the other loops.

In the final log entry in H5F_vfd_swmr_reader_end_of_tick(), mention
whether the call will exit with success or failure.
2020-06-19 17:00:26 -05:00
David Young
2b1df16925 Make H5Drefresh() copy non-persistent properties---e.g., dataset access
property lists---from the closed dataset to the reopened dataset.  Now my
chunk-cache settings appear to survive H5Drefresh() calls.
2020-06-19 16:38:01 -05:00
David Young
bd87af0408 Create a dataset access property list (dapl) that disables the chunk cache and
apply it individually to each dataset instead of setting the chunk-cache
parameters on the file.  Alas, it didn't make any difference, but I'll keep the
change.
2020-06-19 16:34:53 -05:00
David Young
64cedaa228 Merge branch 'feature/vfd_swmr' into may-merge-mainzer-to-mine 2020-06-17 10:24:16 -05:00
David Young
afd49812d5 On each SWMR VFD open for reading, keep a histogram for the number of
ticks elapsed during API calls.  Write the histogram to the swmr_stats
log outlet when the SWMR VFD closes.
2020-06-16 17:09:09 -05:00
David Young
a5afe927e1 Rename H5F__vfd_swmr_writer__create_index to H5F__vfd_swmr_create_index.
H5F_vfd_swmr_reader_end_of_tick: delete superfluous assertions and
extract a com mon subexpression into a H5FD_t * variable.

Carry on with HGOTO_ERROR() cleanup.  Delete superfluous parentheses to
reduce visual clutter.  Delete superfluous casts.  Delete out-of-date
comment: the index size is not fixed any longer.
2020-06-16 17:05:29 -05:00
David Young
8810656911 Delete superfluous casts. Remove superfluous backslashes and
statement-ify, changing

    HGOTO_ERROR(..., \
             )

to

    HGOTO_ERROR(...,
             );

Remove blank lines between if-clause and HGOTO_ERROR.  Add some curly
braces to if-statements where that clarifies things.

NFCI.
2020-06-16 16:58:30 -05:00
David Young
cb18697b3b Close all of the datasets we opened. 2020-06-16 16:53:15 -05:00
David Young
3fa6b2e09f Merge branch 'feature/vfd_swmr' into may-merge-mainzer-to-mine 2020-06-12 11:26:45 -05:00
David Young
625ef85fe5 Avoid leaving a v1 B-tree used as a chunk index in a bad state
that makes assertions fail.

Add an optional `close` method to the `H5D_chunk_ops_t`, and use that to
release "holds" on metadata cache (MDC) entries.

For extensible arrays and v2 B-trees, use the existing `dest`(roy)
method to implement `close`.  For v1 B-trees and other chunk indices,
don't provide `close`: we cannot safely close the v1 B-tree index, and
the other indices don't have a meaningful presence in the MDC.

Revert my first attempt at making v1 B-tree chunk indices closeable
with `dest`.

Put my comment about the stopgap fix for VFD SWMR at the right place
in src/H5Dchunk.c.
2020-06-12 11:24:27 -05:00
David Young
749a718c23 Merge branch 'feature/vfd_swmr' into may-merge-mainzer-to-mine 2020-06-11 17:42:04 -05:00
David Young
ff43cd3631 Activate tests few_big and many_small, now that they pass. 2020-06-11 17:40:10 -05:00
David Young
8505c1262c Always restart H5C_evict_or_refresh_all_entries_in_page()'s scan of
the entries in a hash bucket after evicting tagged entries.  Evicting
tagged entries can can affect both entries before and after the current
entry in the bucket's linked list, so we cannot be sure that either
`entry_ptr` or `follow_ptr` is valid.

This stops the assertion (entry_ptr->page != page) ||
(entry_ptr->refreshed_in_tick == tick) from failing in the test
`testvfdswmr.sh many_small`.
2020-06-11 17:37:51 -05:00
David Young
b5d304acf6 Extract a subroutine that closes chunk indices,
H5D__chunk_index_close(), and call it in H5D__chunk_read() after reading
a chunked dataset.  In this way, indices based on extensible arrays and
v2 B-trees do not leave pinned/tagged entries in the metadata cache that
we cannot evict/refresh when we load changes from the shadow file.

Make some changes to the v1 B-tree code that set the pointer to the
closed B-tree to NULL and, further, tolerate a NULL pointer where
previously that was impossible.
2020-06-11 17:02:22 -05:00
David Young
ff8f7e6da4 Limit every chunk cache to 1 slot and 1kB so that the test doesn't run
my dinky development server out of memory.
2020-06-11 16:24:30 -05:00
David Young
56bc1ea535 Make the test more challenging: on every other step, read a chunk-sized
region offset by 1 unit from a chunk boundary.
2020-06-11 16:23:09 -05:00
David Young
57fde42f7d Wrap a line. NFCI. 2020-06-11 16:21:52 -05:00
David Young
5cde36e2cd Delete code that has no effect: don't empty a mask set only to fill it
in the next expression.
2020-06-11 16:20:46 -05:00
David Young
f8a26a86c6 Merge branch 'feature/vfd_swmr' into may-merge-mainzer-to-mine 2020-06-08 17:48:36 -05:00
David Young
4351ad6c4e Only remove shadow-index entries in H5PB__evict_entry() if we're a
VFD SWMR writer, so that the reader does not lose track of the real
shadow-index content.
2020-06-08 17:47:17 -05:00
David Young
05dafca8e0 Merge branch 'feature/vfd_swmr' into may-merge-mainzer-to-mine 2020-06-03 15:25:03 -05:00
David Young
052257ec62 Delete unused variables and struct members. 2020-06-03 15:24:15 -05:00
David Young
8e8cece303 Be concise and more obviously correct, and knock many line widths
below than 80 columns: use the malloc idiom,

```
type *p;

p = malloc(sizeof(*p));
```

instead of

```
type *p;

p = (type *)malloc(sizeof(type));
```

Make a similar change to some `memset` calls.  NFCI.
2020-06-03 15:21:54 -05:00
David Young
1f488a60e6 If we're processing the EOT queue when we *enter* a function, use
HGOTO_ERROR() instead of HDONE_ERROR() so that we jump to the `done`
label right away.  This ought to fix the problem Vailin was seeing,
where the library left H5F_vfd_swmr_reader_end_of_tick() prematurely for
seemingly no reason.
2020-06-03 15:18:29 -05:00
David Young
5a3f7830db Improve debug output: when the lower file's shadow file image moves,
tell old and new shadow file offset.
2020-06-03 15:17:05 -05:00
David Young
01cf824faa Add a label, addr, to an HDF5 file address in debug output. 2020-06-03 15:16:13 -05:00
David Young
44c114017e Merge branch 'feature/vfd_swmr' into may-merge-mainzer-to-mine 2020-05-29 12:46:50 -05:00
David Young
6e23b5d263 In H5FD_vfd_swmr_read(), log on outlet swmr_read whether the read is
satisfied from the lower file or the shadow file.
2020-05-29 12:46:04 -05:00
David Young
7bfba8aa39 Merge branch 'feature/vfd_swmr' into may-merge-mainzer-to-mine 2020-05-28 15:49:12 -05:00
David Young
7ecf5d5466 Perform a test where a writer creates 10,000 groups while a reader waits for
each to appear.

Add but do not yet perform tests on many small extensible datasets and a few
big extensible datasets.  Vailin is working on a bug that causes both tests to
fail virtually always.
2020-05-28 15:36:39 -05:00
David Young
5c534e41b6 If there were hard errors, report any soft errors, too. 2020-05-28 15:36:21 -05:00
David Young
1410aa21a0 Straggler from previous: don't count errors *and* exit, just count. 2020-05-28 15:35:42 -05:00
David Young
47890e826f A zoo error is not a soft error. Count it as a hard error instead of a soft
error.
2020-05-28 15:34:31 -05:00
David Young
91d388a41c Don't count up errors *and* exit right away when there is an error. Just
count.
2020-05-28 15:33:41 -05:00
David Young
cb73324ce5 Disable the error-stack printing around the H5Gopen() call that we know will
sometimes fail.
2020-05-28 15:31:51 -05:00
David Young
a9ad156810 Merge branch 'feature/vfd_swmr' into may-merge-mainzer-to-mine 2020-05-27 10:48:53 -05:00
David Young
f8d469ca38 Add a test writer that creates groups under the root and a reader that polls
until all of the expected groups appear.
2020-05-27 10:47:04 -05:00
David Young
56fd83f66a Delete unused state_t members. NFCI. 2020-05-27 10:31:02 -05:00
David Young
6759aaa012 Merge branch 'feature/vfd_swmr' into may-merge-mainzer-to-mine 2020-05-26 16:32:10 -05:00
David Young
1280b34b7f Join some lines. NFCI. 2020-05-26 16:31:29 -05:00
David Young
38e959b2f2 Add -a steps option and if steps != 0, then add (or verify) an attribute on
each dataset every `steps` steps.

Update usage message.

Add a cast to `time_t` to quiet a compiler warning.

Replace two occurrences of a debug statement in `verify_extensible_dset()` with
one occurrence in `verify_chunk()`.

Replace the anonymous constant `2` with `hang_back` and increase `hang_back` to
3.  XXX Now that I've fixed a bug, reduce `hang_back` to 2, again.

Verify datasets in the reverse of the order they are written so that we spend
less time re-verifying datasets written in the same step.
2020-05-26 16:30:46 -05:00
David Young
cd0eaf6271 Cast a non-negative int to size_t before comparing with size_t so that
the compiler believes we know what we're doing and does not warn.
2020-05-26 15:48:17 -05:00
David Young
132f0f6ce2 We don't write through the metadata accumulator any more. We only write
through the lower VFD.  Update error message to match.
2020-05-26 15:46:47 -05:00
David Young
e917d66df6 Merge branch 'feature/vfd_swmr' into may-merge-mainzer-to-mine 2020-05-26 13:14:20 -05:00
David Young
d46b2c5afb When a checksum fails, indicate the address and size of the affected metadata. 2020-05-26 13:11:33 -05:00
David Young
cc58a22b37 Reduce differences with may-merge-mainzer-to-mine. 2020-05-26 13:10:39 -05:00
David Young
cc28a6c67a On the VFD SWMR branches, treat warnings as errors. 2020-05-26 13:09:09 -05:00
David Young
a6d88e2b81 When the new index is bigger than the old, invalidate all of the pages affected
by the added entries.  This fixes a bug in the vfd_swmr_bigset_writer/_reader
test, where the reader would read metadata with a bad checksum.  This may also
fix an error that Vailin is seeing.
2020-05-26 13:06:06 -05:00
David Young
eeda47bcf6 Reduce differences with pre-rebase state. 2020-05-21 09:55:56 -05:00
mainzer
18dab4e576 Modified page buffer to split entries only where necessary -- specifically
when handling an I/O request on a metadata entry that has been sub-allocated
from a larger file space allocation (i.e. fixed and extensible array), and
that crosses at least one page boundary.  .

This required modifying the metadata cache to provide the type of the
metadata cache entry in the current I/O request.  For now, this is done
with a function call.  Once we are sure this works, it may be appropriate
to convert this to a macro, or to add a flags parameter to the H5F block
read/write calls.

Also updated the metadata cache to report whether a read request is
speculative -- again via a function call.  This allowed me to remove
the last address static variable in the H5PB_read() call, which is
necessary to support multiple files opened in VFD SWMR mode.

Also re-wrote the H5PB_remove_entries() call to handle release
of large metadata file space allocations that have been sub-allocated
into multiple metadata entries.  Also modified the call to
H5PB_remove_entries() in H5MF__xfree_impl() to invoke it whenever
the page buffer is enabled and the size of the space to be freed is
of page size or larger.

Tested serial / debug on charis and Jelly.

Found a bug in H5MF_xfree_impl(), in which the call to H5PB_remove_entries()
is skipped due to HGOTO_DONE calls earlier in the function.  While the
obvious action is to move the call earlier in the function, best to
consult with Vailin first, as there is much going on and it would be
best to avoid making the situation worse.  If nothing else, there are
some error management issues.
2020-05-21 09:51:39 -05:00
David Young
d5ad503cfe and vfd_swmr_reader_did_increase_tick_to declarations. 2020-05-20 12:06:58 -05:00
David Young
168858b9a1 Rebase repair: do not list any VFD SWMR source files twice. 2020-05-20 12:06:33 -05:00
David Young
abced7dc4e Rebase repair: add stubs.c back to the test library sources. 2020-05-20 12:06:00 -05:00
David Young
b5ec806496 Reduce diffs with develop. 2020-05-20 09:37:22 -05:00
David Young
0750c5bded Reduce diffs with develop. 2020-05-20 09:37:22 -05:00
David Young
cf4d51f2d3 Reduce diffs with develop. 2020-05-20 09:37:22 -05:00
David Young
9eb33fe812 Reduce diffs with develop, where H5C_move_entry takes an H5C_t *
argument, first, not `H5F_t *`.
2020-05-20 09:37:22 -05:00
David Young
95c57f07bc Reduce diffs with develop. 2020-05-20 09:37:22 -05:00
David Young
dcb9aa4518 Reduce diffs with develop. 2020-05-20 09:37:22 -05:00
David Young
b4492dba50 Reduce diffs with develop. 2020-05-20 09:37:22 -05:00
David Young
7f0d3f431e Reduce diffs with develop. 2020-05-20 09:37:22 -05:00
David Young
eae6bb5efd Reduce diffs with develop. 2020-05-20 09:37:22 -05:00
David Young
19a6976899 Make sure to initialize vfd_info.fname. 2020-05-20 09:37:22 -05:00
David Young
dd31948823 Reduce diffs with develop. 2020-05-20 09:37:22 -05:00
David Young
c54c92bf13 Use new style of error reporting. 2020-05-20 09:37:21 -05:00
David Young
f8096dcea3 Use H5_ATTR_NDEBUG_UNUSED instead of H5_ATTR_SANITY_CHECK. 2020-05-20 09:37:21 -05:00
David Young
e083b2834e Be sure to fill the fname field in vfd_info. 2020-05-20 09:37:21 -05:00
David Young
975fc23fb4 Use the write name for the VFD index, SWMR_IDX -> SWMR_VFD_IDX. 2020-05-20 09:37:21 -05:00
David Young
25585400e6 Repair a bunch of H5_ATTR_SANITY_CHECK uses that should have been
H5_ATTR_NDEBUG_UNUSED.  This really makes me wonder what else I have
screwed up in this merge....
2020-05-20 09:37:21 -05:00
David Young
3de98efff8 Fix tools compilation. 2020-05-20 09:37:20 -05:00
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
0103e8f1e0 Move declarations before statements, ugh. 2020-05-20 09:37:20 -05:00
Dana Robinson
13bbc96261 Replaced a few calls to HDmemcpy with H5MM_memcpy, which does overlap
checking.
2020-05-20 09:37:20 -05:00
Dana Robinson
29fca624e5 Misc warning fixes. 2020-05-20 09:37:20 -05:00
Dana Robinson
ef51913e29 Removed HDgets macros since gets was deprecated in C99 and removed
in C11 (gets() is not used in our repo).
2020-05-20 09:37:20 -05:00
Allen Byrne
a809ab0285 Comment out pull-request action and enable fail fast 2020-05-20 09:37:20 -05:00
Allen Byrne
ca0df1b87e Correct filename 2020-05-20 09:37:20 -05:00
Allen Byrne
c04878cbf2 Change to use alias 2020-05-20 09:37:20 -05:00
Allen Byrne
981ff81e37 Fix name setting 2020-05-20 09:37:20 -05:00
Allen Byrne
71a0b376d1 OESS-65 fix packaging config files 2020-05-20 09:37:20 -05:00
Allen Byrne
60f84d1b85 Correct path 2020-05-20 09:37:20 -05:00
Allen Byrne
2a7df0f50c Correct step name 2020-05-20 09:37:20 -05:00
Allen Byrne
2d07dba725 Correct test 2020-05-20 09:37:20 -05:00
Allen Byrne
a8a31334a1 Add github actions 2020-05-20 09:37:20 -05:00
Quincey Koziol
a96e6246d0 Align contents of CMake and autotools testfile cleanup lists. 2020-05-20 09:37:20 -05:00
Quincey Koziol
4ad7dca124 Avoid allocating a chunk index for datasets with 0-sized dimensions, until
the dataset is extended.
2020-05-20 09:37:20 -05:00
Dana Robinson
7fa219e204 Protected H5Oset_comment() in h5dump test generator.
(Assumes environment variable overrides default VOL connector)
2020-05-20 09:37:20 -05:00
Quincey Koziol
82e3368f78 Range check # of 'extra' command-line parameters against array size. 2020-05-20 09:37:20 -05:00
Quincey Koziol
2eec9f839b Refactor "extra" command-line arguments, and clean up code so the tool doesn't
assert when exiting.
2020-05-20 09:37:20 -05:00
Quincey Koziol
828504f46a Extend h5debug to support 3-D datasets for chunks. 2020-05-20 09:37:20 -05:00
Jordan Henderson
3454833bf7 Fix memory error in h5dump xml 'escape the string' routine 2020-05-20 09:37:20 -05:00
Dana Robinson
aa30bd054d Fixed pio_perf const pointers. 2020-05-20 09:37:20 -05:00
Dana Robinson
6eebd57742 Further updates to the tools warnings fixes from code review. 2020-05-20 09:37:20 -05:00
Dana Robinson
e0d954f845 Updates to tools warning PR from code review. 2020-05-20 09:37:20 -05:00
Dana Robinson
3efed9c111 Fixes for warnings in the tools code. 2020-05-20 09:37:20 -05:00
Dana Robinson
97431e256b Moved -Woverlength-strings to the developer flags. 2020-05-20 09:37:19 -05:00
Allen Byrne
d90b2ae7e2 Add "override with" to error message 2020-05-20 09:37:19 -05:00
Allen Byrne
6e84122833 HDFFV-10576 add Option name to Error Message 2020-05-20 09:37:19 -05:00
Allen Byrne
5383152d67 Restrict errors to gcc 4.8 and above. 2020-05-20 09:37:19 -05:00
David Young
1cff43a935 For compatibility with non-C99 Visual Studio versions, use "%" PRIuMAX
instead of "%ju".
2020-05-20 09:37:19 -05:00
David Young
0f2bc7d918 Fix `test/swmr_sparse_reader.c:118:77: error: cast from pointer
to integer of different size [-Werror=pointer-to-int-cast]` and
`test/snapshots-hdf5/current/test/swmr_sparse_reader.c:129:100:
error: cast from pointer to integer of different size
[-Werror=pointer-to-int-cast]`.
2020-05-20 09:37:19 -05:00
David Young
c506a1f435 Fix `src/H5FDdirect.c:1346:5: error: ISO C90 forbids mixed declarations
and code [-Werror=declaration-after-statement]`.
2020-05-20 09:37:19 -05:00
Allen Byrne
b5481fac24 Fix NoFilter build 2020-05-20 09:37:19 -05:00
Allen Byrne
117ead60a3 TRILAB-244 separate CXX warnings and errors from C 2020-05-20 09:37:19 -05:00
Larry Knox
68e1561d87 Add missing ')'. 2020-05-20 09:37:19 -05:00
Larry Knox
8767748f87 Add C++ warnings treated as error for autotools builds. 2020-05-20 09:37:19 -05:00
Larry Knox
7fd40ef81e Move macro ADD_H5_CFLAGS to cmake_ext_mod/HDFMacros.cmake and remove
duplicate versions.
2020-05-20 09:37:19 -05:00
Larry Knox
38abd125c1 Address PR suggestions and add overlooked GCC compiler version flags. 2020-05-20 09:37:19 -05:00
Larry Knox
76af1a4b5f Don't add general warnings flags for unsupported old versions of gcc and
g++ (older than gcc/g++ 4.2).
Correct gnu-cxxflags to determine warnings flags to be added based on
C++ compiler version instead of C compiler version.
2020-05-20 09:37:19 -05:00
Allen Byrne
9b21908223 Remove old szip line 2020-05-20 09:37:19 -05:00
Dana Robinson
2f5d6bac34 Fixed h5diff command-line parameters to use 1 and 2 instead of src
and dst.
2020-05-20 09:37:19 -05:00
Dana Robinson
957e4eba9c Added VOL command-line options to (p)h5diff, h5ls, h5dump, and h5mkgrp. 2020-05-20 09:37:19 -05:00
Allen Byrne
7381bea1e8 OESS-65 add option to use AEC library in place of SZip 2020-05-20 09:37:19 -05:00
Dana Robinson
ce4be694e8 Separated VFD and VOL parameters in tools. 2020-05-20 09:37:19 -05:00
Quincey Koziol
d35daa45e9 Trim trailing whitespace 2020-05-20 09:37:19 -05:00
Dana Robinson
071fe1dc39 Fixed some minor cmp callback bugs and cleaned warnings. 2020-05-20 09:35:18 -05:00
Dana Robinson
58dfaafcce Fixed problems with S3 and HDFS VFDs.
* Updated info struct parameter to correct info_string
* Fixed Makefile.am where the S3 VFD was listed twice, causing
  duplicated symbols errors.
2020-05-20 09:35:18 -05:00
Dana Robinson
6609048ecf Update h5repack long arguments for id-->value changes. 2020-05-20 09:34:20 -05:00
Dana Robinson
755971029c Changed identifiers and command-line options from "id" to "value" in tools
code to be in agreement with H5VL API terminology.
2020-05-20 09:34:20 -05:00
Allen Byrne
aea3232b32 TRILAB-192 version of std=f2008 special check 2020-05-20 09:34:20 -05:00
Allen Byrne
21de7f2818 Fix shadowed type 2020-05-20 09:34:20 -05:00
Allen Byrne
8521689caa TRILAB-192 - cleanup edits and match CMake CXX to autotools 2020-05-20 09:34:20 -05:00
Jacob Smith
094effdf0d Add enable-mirror-vfd flag to configure options. 2020-05-20 09:34:20 -05:00
Jacob Smith
a3f6f24c82 Tidying of Mirror VFD.
* Rename server-stop utility to mirror_server_stop.
* Remove external dependency on bzero().
* Modify test/use_common to use only the public API.
* Rename internal bitswap macro to follow convention.
2020-05-20 09:34:20 -05:00
Jacob Smith
3bc8877513 Add function header comment for mirror_writer:run_writer(). 2020-05-20 09:34:20 -05:00
Jacob Smith
b11015c4cc Add Splitter VFD to library.
* "Simultaneous and equivalent" Read-Write and Write-Only channels for
  file I/O.
* Only supports drivers with the H5FD_FEAT_DEFAULT_VFD_COMPATIBLE flag for
  now, preventing issues with multi-file drivers.

Add Mirror VFD to library.

* Write-only operations over a network.
* Uses TCP/IP sockets.
* Server and auxiliary server-shutdown programs provided in a new directory,
  `utils/mirror_vfd`.
* Automated testing via loopback ("remote" of localhost).
2020-05-20 09:34:20 -05:00
Larry Knox
333388c744 Add missing " and update function calls incorrectly named
load_gcc_arguments.
2020-05-20 09:31:58 -05:00
Allen Byrne
481e3aff7c TRILAB-192 update LTparse files 2020-05-20 09:31:58 -05:00
Dana Robinson
59d1a0e7a1 Added support for passing connector info strings via the command
line to the tools internals.
2020-05-20 09:31:58 -05:00
Dana Robinson
55e2b3170e Fix for passthrough VOL not passing tools tests due to incorrect
optional callback queries.
2020-05-20 09:31:58 -05:00
Larry Knox
9c8ec41791 Update all load_gcc_arguments to load_gnu_arguments.
Fixes TRILAB-212.
2020-05-20 09:31:58 -05:00
vchoi
5aa4de3c32 Fix according to PR feedback. 2020-05-20 09:31:58 -05:00
vchoi
8754e38ce7 Fix an error in previous merge: should use NULL instead of FAIL. 2020-05-20 09:31:58 -05:00
Larry Knox
74fdd50f59 Squashed commit of the following:
commit 8963c3bf756f8f8ec21beea9bd29a767e77675a8
Author: Larry Knox <lrknox@hdfgroup.org>
Date:   Wed Apr 8 16:52:27 2020 -0500

    Commit changes to gnu-cxxflags to remove unmatched " and to gnu-fflags
    to not add C warnings flags to H5_FCFLAGS.
2020-05-20 09:31:58 -05:00
Larry Knox
01a152f83c Add \d to list of characters allowed after '-' in versions. 2020-05-20 09:31:58 -05:00
Jordan Henderson
14bb06448b Fix memory leak in t_span_tree.c test 2020-05-20 09:31:58 -05:00
Allen Byrne
b46882fb0a Hide Frortran directive warnings 2020-05-20 09:31:58 -05:00
Dana Robinson
da9752598f Updated test ddl files so CMake passes after h5dump failures. 2020-05-20 09:31:58 -05:00
vchoi
9c153cce90 Modifications based on PR review feedback. 2020-05-20 09:31:58 -05:00
vchoi
517d630718 Add two routines gen_ref_files() and gen_sel_files() to generate test files related to
references and selections.
These test files will be copied to 1.12, 1.10 and 1.8 for compatibility testing.
2020-05-20 09:31:58 -05:00
Allen Byrne
dc86e0ec5d Remove flag from gfort-general in gfort-5, add /EHsc to Win C++ 2020-05-20 09:31:58 -05:00
Allen Byrne
af99886167 Update printf pointer syntax and revert fortran to f2003 2020-05-20 09:31:58 -05:00
Allen Byrne
ca81ce29fb Reduce window fortran standard to f90 2020-05-20 09:31:58 -05:00
Dana Robinson
503720de02 Updated tools dump output when dataset offset is undefined. 2020-05-20 09:31:58 -05:00
Dana Robinson
12ecc595d8 Added checks for native optional call support in some of the tools. 2020-05-20 09:31:57 -05:00
Dana Robinson
2001e80bb2 Misc changes for h5dump VOL changes. 2020-05-20 09:31:57 -05:00
Scot Breitenfeld
3ecdd3c0f9 Narrowed the scope of ISO_C_BINDING with ONLY additions 2020-05-20 09:31:57 -05:00
Allen Byrne
e9f711699d Minor updates and fix settings for fortran flags 2020-05-20 09:31:57 -05:00
Allen Byrne
f2ae83054a Update intel flags 2020-05-20 09:31:57 -05:00
Allen Byrne
269478552f Fix missing endif 2020-05-20 09:31:57 -05:00
Allen Byrne
c56d76e122 Correct improper file move 2020-05-20 09:31:57 -05:00
Allen Byrne
e1db7ff410 Move intel warnings to subfolder, update autotools files 2020-05-20 09:31:57 -05:00
Allen Byrne
f94696a662 Corrected note 2020-05-20 09:31:57 -05:00
Allen Byrne
a35379b296 Remove overzealous additions 2020-05-20 09:31:57 -05:00
Allen Byrne
c178ec429e Correct whitespace in flags, force list mode 2020-05-20 09:31:57 -05:00
Allen Byrne
75b878326d Flag construction must be after compiler detection 2020-05-20 09:31:57 -05:00
Jordan Henderson
8d9323aab7 Skip testing of passthrough VOL connector in a Family File tools test 2020-05-20 09:31:57 -05:00
Jordan Henderson
1a1343cb19 Restore previous tools library driver name behavior with passthrough VOL connector 2020-05-20 09:31:57 -05:00
Allen Byrne
f5dc2a2f8d TRILAB-192 add c++ and fortran warnings build systems one file 2020-05-20 09:31:57 -05:00
Allen Byrne
9cc06d671a Update release note for CMake warnings 2020-05-20 09:31:57 -05:00
Allen Byrne
48e81261e6 Add missing header include 2020-05-20 09:31:57 -05:00
Dana Robinson
02f8df1937 Fixed unnecessary H5R casts in the tools that were raising warnings. 2020-05-20 09:31:57 -05:00
vchoi
3a2d222a52 A fix in the cleaning up code for datatype when datatype initialization via H5D__init_type() fails.
This is triggered by the tests for revised references when the libver bounds setting does not allow version
4 datatype message to be created.  The test failure is abort core dumped.
This is due to the datatype initialization fails before the datatype ID is registered.
The datatype cleanup code should provide for the above situation.
The code to fix the problem is the same as what is done in H5D__open_oid().
2020-05-20 09:31:57 -05:00
Dana Robinson
27c3a519e9 Changed default dataset shared struct to initialize hid_t IDs to
H5I_INVALID_HID.
2020-05-20 09:31:57 -05:00
David Young
8040d73fbe Remove tongue-in-cheek credit for Rusty Shackleford and Dale Alvin Gribble.
Delete the comment questioning whether pthread_mutex_lock is allowed
in a key destructor, since pthread_key_create(3) provides the answer:

   There  is  no  notion  of a destructor-safe function. If an application
   does not call pthread_exit() from a signal handler, or if it blocks any
   signal whose handler may call pthread_exit() while calling async-unsafe
   functions, all functions may be safely called from destructors.

Delete redundant comment.
2020-05-20 09:31:57 -05:00
David Young
8ae25d32b0 Follow HDF5 conventions. 2020-05-20 09:31:57 -05:00
Allen Byrne
70d43341ec Correct extra flags 2020-05-20 09:31:57 -05:00
Dana Robinson
d4a43eebdf Minor renaming in the tools code. 2020-05-20 09:31:57 -05:00
Gerd Heber
a641a130e7 Fix for HDFFV-11065. 2020-05-20 09:31:57 -05:00
Jordan Henderson
ba79f94586 Fix latent bug in h5repack options file reading
Add 'enable-error-stack' option to h5format_convert
2020-05-20 09:31:57 -05:00
Allen Byrne
e36accb306 TRILAB-192 remove comment 2020-05-20 09:31:57 -05:00
Quincey Koziol
358558ad03 Refactor to reduce verbosity. 2020-05-20 09:31:57 -05:00
Dana Robinson
5b17d45120 Minor renaming in h5dump (addr --> token) 2020-05-20 09:31:57 -05:00
Allen Byrne
b4534374f7 TRILAB-192 add comparable clang flags 2020-05-20 09:31:57 -05:00
Jordan Henderson
0368174822 Fix some missing symbols issues in tools library 2020-05-20 09:31:57 -05:00
Jordan Henderson
46a9771a9e A few small tweaks to the tools from review 2020-05-20 09:31:56 -05:00
Jordan Henderson
1da4855528 Replace usage of some standard library functions with HD- versions 2020-05-20 09:31:56 -05:00
Jordan Henderson
254388494a Update Tools library to be better compatible with VOL connectors
Modify h5repack to integrate with VOL connectors

Update tools library to accomodate VOL connectors

Update logic in h5tools_fopen for VOL connectors

Add command-line options to h5repack for specifying in/out VOL
connectors

Implement h5tools_set_vol_fapl

Fix library shutdown issue

Integrate ROS3 and HDFS VFDs into new h5tools_get_fapl() scheme

Avoid H5Ocopy in h5repack when using different VOL connectors

Update h5tools_test_utils.c for ROS3 and HDFS integration
2020-05-20 09:31:56 -05:00
Allen Byrne
0a72a7bf6b TRILAB-24 use CHECK_STRUCT_HAS_MEMBER 2020-05-20 09:31:56 -05:00
Quincey Koziol
aad3ff8244 Correct macro check 2020-05-20 09:31:56 -05:00
Allen Byrne
f4333990dd Add extensive warnings to tools executables 2020-05-20 09:31:56 -05:00
Allen Byrne
ac64ea0b63 Reorg comments 2020-05-20 09:31:56 -05:00
Allen Byrne
ad5dbf9539 Correct warning flag form 2020-05-20 09:31:56 -05:00
Allen Byrne
579625801a Because of tools macro, this needs to be a warning 2020-05-20 09:31:56 -05:00
Allen Byrne
3e81528f3b unused set-variable in macro 2020-05-20 09:31:56 -05:00
Allen Byrne
e498e3ac3e Fix Werror issues in JNI and tools 2020-05-20 09:31:56 -05:00
Allen Byrne
1bd5fb6bf1 TRILAB-192 fix JNI shadow warning 2020-05-20 09:31:56 -05:00
Allen Byrne
e7c76ec46f TRILAB-192 restrict extensive warnings to libraries 2020-05-20 09:31:56 -05:00
Quincey Koziol
f2e152c9db Correct failure when allocation tracking are disabled. 2020-05-20 09:31:56 -05:00
Allen Byrne
b373cd9a44 TRILAB-192 add release note 2020-05-20 09:31:56 -05:00
Allen Byrne
42828098ed TRILAB-192 Identify warnings that fail as errors 2020-05-20 09:31:56 -05:00
David Young
27e3c31d6c Update the MANIFEST for the autoconf/cmake shared warnings files. 2020-05-20 09:31:56 -05:00
Quincey Koziol
7b119d614b Revise API for H5get_alloc_stats() to take a struct instead of separate values. 2020-05-20 09:31:56 -05:00
Quincey Koziol
20df4bd395 Add routines to query the library's free list sizes and allocation stats. 2020-05-20 09:31:56 -05:00
Allen Byrne
7afe25de20 Correct syntax 2020-05-20 09:31:56 -05:00
Allen Byrne
00edda5aa8 Update CMake compiler flags to use same set of warnings 2020-05-20 09:31:56 -05:00
David Young
5050218f74 Move the GNU warnings configuration under config/gnu-warnings/ and trim
the filename prefixes.  Update config/gnu-flags to suit.

I also made changes to config/cmake/HDFCompilerFlags.cmake, but I'm not
sure they're correct.
2020-05-20 09:31:56 -05:00
David Young
0822b91ec9 By default, demote warnings promoted to errors back to warnings. 2020-05-20 09:31:56 -05:00
David Young
03a86e551d Incorporate the H5_ECFLAGS into the library CFLAGS. Now a bunch of errors will
occur.  Next commit will demote the warnings promoted to errors back to
warnings again.
2020-05-20 09:31:56 -05:00
David Young
5e3e0308db Break out warnings into more files that autoconf and CMake can share. This
change temporarily disables the warnings that were promoted to errors, but I
will add those warnings back as warnings, not errors, in the next commit.
2020-05-20 09:31:56 -05:00
Allen Byrne
cde72dfc27 Allow use of INTEL icl/icl++ for clang 2020-05-20 09:31:56 -05:00
Allen Byrne
3e42250f0f Fix threadsafe for new test 2020-05-20 09:31:56 -05:00
Dana Robinson
ce9ef0ba12 Fixed the RELEASE.txt note for HDFFV-11057 2020-05-20 09:31:56 -05:00
Dana Robinson
4cfafa10d5 Fix shutdown errors when using the HDF5_VOL_CONNECTOR environment
variable to set a dynamically loaded plugin as the default VOL
connector. Fixes HDFFV-11057
2020-05-20 09:31:56 -05:00
Dana Robinson
c7fd077ffb Very minor comment change in H5VLconnector.h. 2020-05-20 09:31:56 -05:00
David Young
5df5bc37da Use the correct error macro. 2020-05-20 09:31:56 -05:00
Vailin Choi
1612e90c2b Fix issues when deserializing point/all/none selection with version beyond the library's supported version:
(1) Verify the decoded version before proceeding further with deserialization
(2) Close the dataspace if errors occurred after opening the dataspace
2020-05-20 09:31:56 -05:00
David Young
313501fd17 Avoid a crash, don't check if we're flushing when the file is closing:
there's no need to check if the metadata cache is flushing if we already
know the file is closing, because the condition we rely on is "closing
OR flushing."  Further, the cache may have already gone away, so
sometimes calling into the cache to see if it's flushing will crash the
program.
2020-05-20 09:31:56 -05:00
David Young
84f402deea Use a naked pthread_self() call in the HDF5 thread wrappers. 2020-05-20 09:31:56 -05:00
David Young
4ffc7ad8df Add semicolons to more PASSED() invocations. 2020-05-20 09:31:55 -05:00
Allen Byrne
52a797e697 Remove system command from valgrind reports 2020-05-20 09:31:55 -05:00
Jacob Smith
95d6578dea Fix incorrect FUNC_LEAVE macro (should match FUNC_ENTER_*_TAG). 2020-05-20 09:31:55 -05:00
Allen Byrne
506991575f Whitespace 2020-05-20 09:31:55 -05:00
kmu
5228f61f79 revert type cast 2020-05-20 09:31:55 -05:00
Quincey Koziol
47e2160f22 Switch the 'get offset' operation from a dataset 'get' callback to a [native]
dataset 'optional' operation.
2020-05-20 09:31:55 -05:00
David Young
4bbd9649c0 Complete the comment on thread_main(), explaining why the barrier is used. 2020-05-20 09:31:55 -05:00
David Young
4562a584af The first implementation seemed to allow for the possibility that a thread
could block at the barrier, wake and exit the barrier, re-acquire the barrier
lock and increase `nentered` before the other blocked threads woke and checked
`nentered % count == 0`.  Then the other blocked threads would check `nentered
% count == 0` and, finding it false, go back to sleep in the barrier.  This new
implementation waits for a looser condition to obtain so that threads don't go
back to sleep in the barrier.
2020-05-20 09:31:55 -05:00
David Young
88920baf53 Test the right condition for the EBUSY return in pthread_barrier_destroy(). 2020-05-20 09:31:55 -05:00
David Young
b7f27e0381 s/exit_failure/EXIT_FAILURE/g 2020-05-20 09:31:55 -05:00
David Young
8c5e0a1e53 Implement pthread_barrier(3) for Darwin using a counter, condition variable,
and mutex.  Untested.
2020-05-20 09:31:55 -05:00
Larry Knox
eeb8a5a754 Modfy expression to match mpicc build with Intel as intel compiler, not
gcc.
2020-05-20 09:31:55 -05:00
M. Scot Breitenfeld
d40e543e63 Fixed issue building HDF5 with NAG Fortran 7.0.
Accounted for the additon of half precision floating-point with a KIND=16.

HDFFV-11033
2020-05-20 09:31:55 -05:00
Allen Byrne
e417c01bd3 Add java version and reference libsettings 2020-05-20 09:31:55 -05:00
Allen Byrne
95c4222cd1 Update examples and fix old version references. 2020-05-20 09:31:55 -05:00
Allen Byrne
ccdb8f360f Move MODEL check to before usage in CTestScript.cmake. 2020-05-20 09:31:55 -05:00
Allen Byrne
481c11b3f9 Copy generated files instead creating twice 2020-05-20 09:31:55 -05:00
Allen Byrne
0e45724b69 Fix standalone link 2020-05-20 09:31:55 -05:00
Allen Byrne
8ad375d345 Fix Fortran macro use and jni comment 2020-05-20 09:31:55 -05:00
Allen Byrne
a549df80b3 Update Windows platforms 2020-05-20 09:31:55 -05:00
David Young
c12bda5d37 Add missing MANIFEST entry, ./doc/code-conventions.md . 2020-05-20 09:31:55 -05:00
Allen Byrne
bc2e406f78 HDFFV-11036 add release note 2020-05-20 09:31:55 -05:00
Allen Byrne
0aadc45530 HDFFV-11036 add file compare test process 2020-05-20 09:31:55 -05:00
Allen Byrne
799873706a Correct usage of add_compile_definitions 2020-05-20 09:31:55 -05:00
Allen Byrne
60a4987f97 TRILAB-142 Change minimum CMake version to 3.12 2020-05-20 09:31:55 -05:00
Allen Byrne
d6c2f9966f Fix always true issue because member is not dynamically allocated 2020-05-20 09:31:55 -05:00
Allen Byrne
925d3e82bd CMake cleanup 2020-05-20 09:31:55 -05:00
Allen Byrne
a2dc6e0285 HDFFV-11032 fix JNI call 2020-05-20 09:31:55 -05:00
David Young
422f5adebe Replace the old H5F_DECODE_LENGTH() implementation with one that
initializes the variable it's loading on every path.
2020-05-20 09:31:55 -05:00
M. Scot Breitenfeld
995c8126ae Corrected INTERFACE INTENT(IN) to INTENT(OUT) for buf_size inh5fget_file_image_f.
HDFFV-11029
2020-05-20 09:31:55 -05:00
David Young
71231f3726 Start to document the function/parameter/variable attribute macros. 2020-05-20 09:31:55 -05:00
David Young
4cd3dc95d9 Filter all of the new _USED / _UNUSED type modifiers. 2020-05-20 09:31:55 -05:00
David Young
28103327a5 H5_HAVE_PARALLEL, _DEBUG_API, etc. Add attributes to some variables and
parameters that are unused under some configurations.
2020-05-20 09:31:55 -05:00
David Young
5640d832e4 Use HD prefix. 2020-05-20 09:31:55 -05:00
David Young
0afcd66d2b Delete unhelpful comment per Jordan's question. 2020-05-20 09:31:55 -05:00
David Young
f44798804d Make sure that H5TS_thread_id() is available as either a function or a macro in
all configurations.

Previously it was neither declared nor defined in --disable-threadsafety
builds.  The compiler's warning got lost in the noise---I first saw the issue
because my -Werror branch stopped compiling cold---and the tests still linked
and ran.
2020-05-20 09:31:55 -05:00
David Young
50d7f83e6e Provide local copies of err(3)- and errx(3)-alike functions
for Visual Studio compatibility.
2020-05-20 09:31:55 -05:00
David Young
40d104b5c2 Provide C99/POSIX.1 format strings PRI[doux]{8,16,32,64,MAX,PTR} on systems
that are missing <inttypes.h>.
2020-05-20 09:31:55 -05:00
David Young
e3ce3bf76a Take out the temporary performance tests. 2020-05-20 09:31:54 -05:00
David Young
b00d843c2d Make calls through a function pointer. Use the same number of arguments,
always.
2020-05-20 09:31:54 -05:00
David Young
17f8b2913b Increase iterations, provide a baseline for no-op, simplify the overhead
case a bit.
2020-05-20 09:31:54 -05:00
David Young
66334f899d Temporarily add some code that measures the time to run the simplest possible
H5T__copy_all()-like routine 10 million times and then measures the version
with FUNC_ENTER_STATIC/_LEAVE_NOAPI and a HGOTO_ERROR() statement.
2020-05-20 09:31:54 -05:00
David Young
d21d9aa1fb H5T_copy() constification plus Quincey's contributions. 2020-05-20 09:31:54 -05:00
Allen Byrne
ad9424bed4 TRILAB-148 fix sanitizer and -fsanitize usage 2020-05-20 09:31:54 -05:00
Allen Byrne
9f024afb2a Update sanitizer note. 2020-05-20 09:31:54 -05:00
Jacob Smith
3ef00a150d Fix improper S3 signing key null check (HDFFV-11015). 2020-05-20 09:31:54 -05:00
M. Scot Breitenfeld
2a252eada1 HDFFV-11018 Add Fortran H5F_LIBVER_V*_F definitions
Added
------
New Definitions:

  INTEGER :: H5F_LIBVER_ERROR_F
  INTEGER :: H5F_LIBVER_NBOUNDS_F
  INTEGER :: H5F_LIBVER_V18_F
  INTEGER :: H5F_LIBVER_V110_F
  INTEGER :: H5F_LIBVER_V112_F
  INTEGER :: H5F_LIBVER_V114_F

New API:
  h5pget_libver_bounds_f(fapl_id, low, high, hdferr)

Removed:
  call to C wrapper h5pset_libver_bounds_c in h5pset_libver_bounds_f
2020-05-20 09:31:54 -05:00
Muqun Yang
9c3fe9fe7c HDFFV-11014, fix the h5repack issue that misses a few attributes during the repacking. The flag that checks the object reference attribute is not updated properly. The fix is trivial. Just need to move the flag update line into the inner loop. Tested at Jelly. Also update the release.txt. 2020-05-20 09:31:54 -05:00
David Young
f6bf61975e Oops, the test has to return success in the unimplemented case. 2020-05-20 09:31:54 -05:00
David Young
25f69a687a If H5_HAVE_THREADSAFE is not #defined, define nothing but a stub implementation
of H5TS_thread_id().
2020-05-20 09:31:54 -05:00
David Young
cc57aa73c8 src/H5Eint.c: #include H5TSprivate.h for H5TS_thread_id() definitions.
test/thread_id.c: move threads_failure() inside #ifdefs.
2020-05-20 09:31:54 -05:00
David Young
364a277143 Change thread IDs to uint64_t from unsigned long, per Quincey's suggestion.
Fix a typo in the H5TS_thread_init() comment and reword some ID
properties.
2020-05-20 09:31:54 -05:00
David Young
5178dd70ec Add thread_id.c to the MANIFEST and the CMakeLists.txt per Allen's
request.
2020-05-20 09:31:54 -05:00
David Young
06dfd6025d Replace pthread_self_ulong() with H5TS_thread_id(). The POSIX Threads
implementation ought to be portable to any system that has POSIX
Threads.  On Windows, I use the same API call as before.
2020-05-20 09:31:54 -05:00
Jordan Henderson
ecdaf09c11 Add RELEASE.txt note for token refactoring changes 2020-05-20 09:31:54 -05:00
Allen Byrne
55a2411851 HDFFV-11012 - add release note 2020-05-20 09:31:54 -05:00
Allen Byrne
676f014e30 HDFFV-11012 - add correct fortran include path properties 2020-05-20 09:31:54 -05:00
Allen Byrne
e8e8ae8f58 HDFFV-10996 add release note 2020-05-20 09:31:54 -05:00
Allen Byrne
0bdf289f98 HDFFV-10996 - add java vol tests 2020-05-20 09:31:54 -05:00
Dana Robinson
1311f9e999 Minor refactoring to the VFD info free call. 2020-05-20 09:31:54 -05:00
Dana Robinson
aacc603804 Updated the 'const memory free' changes based on PR feedback. 2020-05-20 09:31:54 -05:00
Dana Robinson
5e76dccbe0 Added a free wrapper that lets us free constant pointers without
generating warnings.

Also, brought the const-ness of the VOL connector info in line with
the VFD info (not visible externally).
2020-05-20 09:31:54 -05:00
Allen Byrne
c3974173a1 VS2010 needs an underscore 2020-05-20 09:31:54 -05:00
Dana Robinson
dea87efdf9 Cleaned up remaining warnings in high-level library. 2020-05-20 09:31:54 -05:00
Allen Byrne
e0e020eb6b Small fixes for tools and skip autotools tests for no filter 2020-05-20 09:31:54 -05:00
David Young
13bb3afdc6 Reduce differences between my -Werror branch and develop:
Rename index -> idx, fileno -> fnumber, fileno -> fno to avoid GCC
shadowed declaration warnings about index(3).

Convert #pragma GCC diagnostic push/pop/ignored to the HDF5 library's
H5_GCC_DIAG_OFF()/H5_GCC_DIAG_ON() macros.
2020-05-20 09:31:54 -05:00
David Young
2badc1bf32 Reduce casts of HDcalloc()/HDmalloc() that -Wc++-compat required.
Reduce gratuitous casts---e.g., (size_t)1.

Use the right format string for a pointer.

In the H5C sanity checks, change a "size increase" variable from ssize_t
(too narrow) to int64_t (wide enough).

Parenthesize every appearance of `storage` in the macro
`H5D_CHUNK_STORAGE_INDEX_CHK(storage)` so that you can pass in an
expression like &sc and it works properly.

Disallow re-assignment of the `dset` parameter to H5D__chunk_init()
because it helped assure me that it's safe to replace the repeating
expression `&dset->shared->layout.storage.u.chunk` with `sc` throughout.

Replace lengthy expressions such as
`&dset->shared->layout.storage.u.chunk` with `sc` throughout several
functions in H5Dchunk.c ISTR that the compiler warned that `sc` was
declared but unused in a couple of functions, and then I found that `sc`
could be used in many places.  Maybe the disused `sc` appeared because a
bunch of code was copied and pasted, I don't know.  Anyway, it's a lot
tighter code now that I use `sc`.

In H5D__chunk_update_old_edge_chunks() and H5D__chunk_delete()
I actually expand `sc` and another temporary variable, `pline`,
because they're used only in !defined(NDEBUG) code.  This squashes
unused-variable warnings in the defined(NDEBUG) configuration.

Don't drop the `volatile` qualification with a cast in
tools/src/h5import/h5import.c.
2020-05-20 09:31:53 -05:00
David Young
2360f6e644 testpar/t_2Gio.c: Fix a typo that I think was introduced by a
previous warnings PR.  An array element was assigned to
        itself---shape[2]Â =Â shape[2];---instead of being assigned to
        chunk[2].

fortran/src/H5Pf.c: move conditional compilation controlled by
        H5_NO_DEPRECATED_SYMBOLS outside of a function for readability.

fortran/src/H5match_types.c: put a variable's declaration under the same
        conditional compilation (H5_FORTRAN_HAVE_C_LONG_DOUBLE) as its
        use.

For now, skip compilation of some unused debug dump routines in the JNI.
While I'm in the JNI, delete a set-but-unused variable.

src/H5Z.c: condition a variable declaration on H5_NO_DEPRECATED_SYMBOLS
        so that it's not declared but unused or vice versa.

test/cache_common.h: add an #include in to get some symbols we need to
        avoid implicit declaration warnings.

test/dsets.c: use a more conventional conditional-compilation syntax.

test/dt_arith.c, test/fillval.c: initialize a bunch of uninitialized
        variables before use.

test/vfd.c: pass the expected type of `void **` to posix_memalign(3)
        instead of `int **`.

testpar/t_bigio.c: explicitly compare with 0 instead of using ! when
        "equal to 0?" is the question not "is false?"  Repair some
        indentation while I'm here.

testpar/testpar.h: repair misaligned line-continuation backslashes in a
        macro that probably should be a function so that we don't have
        to fiddle with the line continuation to begin with.

tools/src/h5repack/h5repack_main.c: fix some compiler fussing about
        enums.

tools/test/perform/pio_engine.c: the compiler fusses if you cast a
        function call returning double directly to off_t.  It's ok if
        you cast a variable that's a double to off_t, however.  Write
        and use a new function, sqrto(), to avoid the cast warnings.
2020-05-20 09:31:53 -05:00
kmu
cfcac15f03 fix bad function cast warning 2020-05-20 09:31:53 -05:00
kmu
f06ae5ec74 initialization discards const warning 2020-05-20 09:31:53 -05:00
kmu
1e5dd76d25 fix unused function warning 2020-05-20 09:31:53 -05:00
Allen Byrne
9908743dd7 HDFFV-11011 - merge include list 2020-05-20 09:31:53 -05:00
Allen Byrne
b44b3d136d HDFFV-11011 correct issues with target file extension 2020-05-20 09:31:53 -05:00
Jordan Henderson
2e962dc49b Introduce new H5VL _by_value routines 2020-05-20 09:31:53 -05:00
Allen Byrne
09ba68d026 Correctly manage warnings for new tests 2020-05-20 09:31:53 -05:00
Allen Byrne
55212d3a02 Ext libs ZLIB and SZIP warnings are separate concerns 2020-05-20 09:31:53 -05:00
Allen Byrne
99993f3360 Remove commented warnings line 2020-05-20 09:31:53 -05:00
kmu
76c0e0aa4c rename macro 2020-05-20 09:31:53 -05:00
kmu
d59460e632 change condition 2020-05-20 09:31:53 -05:00
kmu
c3549ae3f9 pick up from Dave's fix 2020-05-20 09:31:53 -05:00
kmu
d63080b19a leave Wswitch-default for later fix 2020-05-20 09:31:53 -05:00
kmu
51f9a51c25 fix Wredundant-decls, Wswitch-default, Wdeclaration-after-statement, Wsign-compare, Wmisleading-indentation, Wshadow 2020-05-20 09:31:53 -05:00
kmu
4d9155bade fix issues from test fail 2020-05-20 09:31:53 -05:00
Dana Robinson
eaaedabaa5 Replaced my_isnan with C99 isnan in h5diff. 2020-05-20 09:31:53 -05:00
Allen Byrne
2a2dc4ab93 Add another warning variation 2020-05-20 09:31:53 -05:00
Allen Byrne
c0a1ba8750 Correct ignore warnings 2020-05-20 09:31:53 -05:00
Allen Byrne
c01add2ac7 Only use sanitizer with Clang 2020-05-20 09:31:53 -05:00
Allen Byrne
c491fd1cfc Remove cmake macros from valgrind tests 2020-05-20 09:31:53 -05:00
Larry Knox
27e35a62e9 Restore fix of test assert fail eror undone by later commit. 2020-05-20 09:31:53 -05:00
Dana Robinson
f935bc271a Cleaned up warnings in test/tid.c. 2020-05-20 09:31:53 -05:00
kmu
136d3b7ea2 fix assert fail 2020-05-20 09:31:53 -05:00
Dana Robinson
6e8ce00c0b Optimized the floating point comparisons a little bit. 2020-05-20 09:31:53 -05:00
Dana Robinson
23f103cf6b Fix for failing h5diff tests involving floating-point compares. 2020-05-20 09:31:53 -05:00
Dana Robinson
0479a345cc Removed H5_DEC_ENUM 2020-05-20 09:31:52 -05:00
Dana Robinson
3290803120 Revert "Revert "Moved -Wunsuffixed-float-constants to the developer warnings.""
This reverts commit 6486e06545.
2020-05-20 09:31:52 -05:00
Dana Robinson
36647e79b9 Revert "Moved -Wunsuffixed-float-constants to the developer warnings."
This reverts commit 12bc75c617.
2020-05-20 09:31:52 -05:00
Dana Robinson
40c5e67e41 Moved -Wunsuffixed-float-constants to the developer warnings. 2020-05-20 09:31:52 -05:00
Dana Robinson
2c520b2ba6 Fixed a bug in testpar/t_cache.c concerning checking expected
vs. actual cache entry reads and writes.
2020-05-20 09:31:52 -05:00
kmu
9f5444199e remove unnecessary stuff 2020-05-20 09:31:52 -05:00
kmu
30e61cf090 squash cast warning fix 2020-05-20 09:31:52 -05:00
Allen Byrne
cfd8856288 Change tools debug macros to not use error stack 2020-05-20 09:31:52 -05:00
Larry Knox
812e7eda57 Max Library "index" should be 7. 2020-05-20 09:31:51 -05:00
kmu
f0ee8b2883 not use hdf5 private header 2020-05-20 09:31:51 -05:00
kmu
1c226ac077 fix float type cmp warning 2020-05-20 09:31:51 -05:00
kmu
8d5ae4f460 fix float type cmp warning 2020-05-20 09:31:51 -05:00
kmu
742aa75cd0 fix missing prototype warning 2020-05-20 09:31:51 -05:00
kmu
af79e1613e more cleanup 2020-05-20 09:31:51 -05:00
kmu
364d25abea change it back 2020-05-20 09:31:51 -05:00
kmu
d03083de5f pick up missing piece 2020-05-20 09:31:51 -05:00
kmu
27c618b91d fix unused related warnings 2020-05-20 09:31:51 -05:00
kmu
8377789f8f removed unused parameter 2020-05-20 09:31:51 -05:00
kmu
6b07d692f4 more fix and address comments 2020-05-20 09:31:51 -05:00
kmu
a6e8f34b7b remove unsed var,function,macro, etc 2020-05-20 09:31:51 -05:00
kmu
0c9d2de9e2 fix uninitizlized warning 2020-05-20 09:31:50 -05:00
Dana Robinson
f77d99d3e9 Fixed yet another small issue in test/efc.c. 2020-05-20 09:31:50 -05:00
Larry Knox
08c29a0995 Remove irrelevant sentence from comment. 2020-05-20 09:31:50 -05:00
Larry Knox
ec3847712c Remove duplicate lines noted on forum by Eric Bavier 2020-05-20 09:31:50 -05:00
Larry Knox
7bbca40652 Add v111 version for H5O functions to enable version1 default for HDF5
1.8-1.10 and version 3 default for HDF5 1.12.  Version 2 functions are
available (deprecated) but will not be the default for any version.
2020-05-20 09:31:50 -05:00
Larry Knox
531530551f Only 2 versions of H5O_info_t and H5O_iterate_t. 2020-05-20 09:31:50 -05:00
Larry Knox
48036abeed H5vers.txt has versions v10 that should be v110 and some missing v110
entries.
2020-05-20 09:31:50 -05:00
Dana Robinson
4405118a04 PATH_MAX fix in efc test for Windows. 2020-05-20 09:31:50 -05:00
Dana Robinson
55b41104b9 Tidying from code review. 2020-05-20 09:31:50 -05:00
Dana Robinson
0585e6fb34 Fixed stack and frame size warnings. Not complete, but fixes most of
the easier cases.
2020-05-20 09:31:50 -05:00
Dana Robinson
d11be7974e Removed UIUC from copyright, added helpful comment. 2020-05-20 09:31:50 -05:00
Dana Robinson
6c0ecdc496 Updated MANIFEST 2020-05-20 09:31:50 -05:00
Dana Robinson
55b96a9fff Added a config file for ARM (Tested on a Raspberry Pi 3B+
w/ gcc 6).
2020-05-20 09:31:50 -05:00
Allen Byrne
d8e352ec4f Note for common warnings files 2020-05-20 09:31:50 -05:00
Allen Byrne
23493cb1b2 Create common build system files for warnings 2020-05-20 09:31:50 -05:00
Allen Byrne
e54dcb1609 Correct standalone function attributes 2020-05-20 09:31:50 -05:00
Allen Byrne
f59dfcb711 Standalone should not use import/export attributes 2020-05-20 09:31:50 -05:00
Dana Robinson
3e6a192e9c Squashed commit of the token_refactoring branch: 2020-05-20 09:31:50 -05:00
Jerome Soumagne
335fc0096c Add test for reference shutdown issue 2020-05-20 09:20:26 -05:00
Jerome Soumagne
3ab7612604 H5R: set app ref when incrementing ref_count on location held by reference
(fix HDFFV-10992)
2020-05-20 09:20:26 -05:00
Allen Byrne
53d6f0dc3e HDFFV-11001 fix if block 2020-05-20 09:20:26 -05:00
Allen Byrne
6b106b2cab HDFFV-11001 need to qualify all by parallel or serial types 2020-05-20 09:20:26 -05:00
Allen Byrne
234492f9e7 HDDFV-11001 add note 2020-05-20 09:20:26 -05:00
Allen Byrne
6682c717e2 HDFFV-11001 Add fine control over testing 2020-05-20 09:20:26 -05:00
Allen Byrne
9ebf36e893 Adjust regex for warnings 2020-05-20 09:20:26 -05:00
Allen Byrne
16245b0440 Update tools hid_t declarations with H5I_INVALID_HID 2020-05-20 09:20:26 -05:00
Allen Byrne
280329e192 Ignore ZLIB warnings 2020-05-20 09:20:26 -05:00
Allen Byrne
b98190628f Added JIRA note 2020-05-20 09:20:26 -05:00
Larry Knox
14e2c9d3f7 Modify external_env.c to prevent deleting test file of external.c.
Fix for HDFFV-10941.
2020-05-20 09:20:26 -05:00
Allen Byrne
738b025b3e io_timer.c uses a parallel lib function 2020-05-20 09:20:25 -05:00
Allen Byrne
d915fa7f07 Fix standalone compile issues 2020-05-20 09:20:25 -05:00
Allen Byrne
4a977332f0 Separate result variables for the function performed 2020-05-20 09:20:25 -05:00
Allen Byrne
f4e614c5cd Check for actual content before using file 2020-05-20 09:20:25 -05:00
Allen Byrne
207b87cbb9 HDFFV-10995 - add missing import 2020-05-20 09:20:25 -05:00
Allen Byrne
f9f4774065 HDFFV-10995 - need to add import 2020-05-20 09:20:25 -05:00
Allen Byrne
0c852d4ae7 HDFFV-10995 - Update all time instances 2020-05-20 09:20:25 -05:00
Allen Byrne
91729ca3d0 HDFFV-10995 adjust testing to tolerate non-US locale 2020-05-20 09:20:25 -05:00
kmu
156bc312ed fix test assert fail error 2020-05-20 09:20:25 -05:00
kmu
a52f4135f9 add new type support 2020-05-20 09:20:25 -05:00
kmu
fd374fb234 address problems from comments 2020-05-20 09:20:25 -05:00
kmu
95e509db46 fix and address comments 2020-05-20 09:20:25 -05:00
kmu
9281d24a5b change according to previous comments 2020-05-20 09:20:25 -05:00
kmu
740d491ef3 add missing piece 2020-05-20 09:20:25 -05:00
kmu
271bce5b10 remove unnecessary check macro 2020-05-20 09:20:25 -05:00
kmu
1d46e82317 fix intel compile warnings 2020-05-20 09:20:25 -05:00
kmu
fb8f955a73 Revert "fix warnings from Intel compiler"
This reverts commit 8b9338ab57.
2020-05-20 09:20:24 -05:00
kmu
3e4a99d17d Revert "fix warnings and some text alignment"
This reverts commit d06474c4e1.
2020-05-20 09:20:24 -05:00
kmu
71610c9677 Revert "let hdf5 pick up the right compiler in Intel environment"
This reverts commit 3613ec7296.
2020-05-20 09:20:24 -05:00
kmu
9d8fb46a2c Revert "fix issues from previous PR comments"
This reverts commit d242a900f4.
2020-05-20 09:20:24 -05:00
kmu
f2028c7568 Revert "using a different MACRO"
This reverts commit fc61b7a9f3.
2020-05-20 09:20:24 -05:00
kmu
9a3a13cacb using a different MACRO 2020-05-20 09:20:23 -05:00
kmu
bb53a566e8 fix issues from previous PR comments 2020-05-20 09:20:23 -05:00
kmu
540e50df28 let hdf5 pick up the right compiler in Intel environment 2020-05-20 09:20:23 -05:00
kmu
c1f6c50b35 fix warnings and some text alignment 2020-05-20 09:20:23 -05:00
kmu
6725222332 fix warnings from Intel compiler 2020-05-20 09:20:23 -05:00
Quincey Koziol
d1d4635550 Small changes from the token_refactoring branch, to reduce the delta to develop 2020-05-20 09:20:23 -05:00
Jordan Henderson
d459e350a5 Fix some places where H5P_DEFAULT gets passed down to a VOL connector 2020-05-20 09:20:22 -05:00
Dana Robinson
37a141db61 Changed -Wformat-truncation to level 2 in CMake w/ gcc. 2020-05-20 09:20:22 -05:00
Dana Robinson
6cfeb96b36 Changed -Wformat-truncation's level from 2 to 1. 2020-05-20 09:20:22 -05:00
Jordan Henderson
295185f368 Fix issue in h5dump where reference objects weren't being destroyed 2020-05-20 09:20:22 -05:00
Jordan Henderson
ac6aeb9adf Clean up tools warnings introduced by H5TOOLS_ERR_INIT macro 2020-05-20 09:20:22 -05:00
Jordan Henderson
d4aa380dd1 Refactor tools library error handling macros 2020-05-20 09:20:22 -05:00
Allen Byrne
4f86f43b60 Add MPI libs to standalone perf 2020-05-20 09:20:22 -05:00
Allen Byrne
8c43c2a955 Grep needs to search error file 2020-05-20 09:20:22 -05:00
Allen Byrne
9701014075 Correct flaws in test scripts and files 2020-05-20 09:20:22 -05:00
Allen Byrne
f66d3366ce grep for failure text in error stack 2020-05-20 09:20:22 -05:00
Allen Byrne
dcfeaddb32 Add list to function arg 2020-05-20 09:20:22 -05:00
Allen Byrne
ffb7d748f6 Test files for new ref types 2020-05-20 09:20:22 -05:00
Allen Byrne
1301b25aa9 h5diff test script files 2020-05-20 09:20:22 -05:00
Allen Byrne
a9b6fde99e Add ref changes to test script 2020-05-20 09:20:22 -05:00
Allen Byrne
0b2fe3fcc7 Add new h5diff files 2020-05-20 09:20:22 -05:00
Allen Byrne
463671a4f4 Fix compile statement order 2020-05-20 09:20:22 -05:00
Allen Byrne
972c57f769 HDFFV-10976,-10980 Init obj_type before calling H5Rget_obj_type3 2020-05-20 09:20:22 -05:00
Allen Byrne
e5cb404bb2 Add unknown define for h5dump ref objects 2020-05-20 09:20:22 -05:00
Allen Byrne
d486a9b27e HDFFV-10980 - h5diff uses new ref APIs 2020-05-20 09:20:22 -05:00
Quincey Koziol
b6b0567bdf Remove unnecessary H5CX call 2020-05-20 09:20:21 -05:00
Quincey Koziol
53e62bcbeb Refactor H5Dvlen_get_buf_size to use optional dataset operation, with generic fallback for VOL connectors that don't implement operation 2020-05-20 09:20:21 -05:00
Quincey Koziol
ba9f12b6d8 Cleanups from PR reviews 2020-05-20 09:20:21 -05:00
Quincey Koziol
996e12e796 Refactor all the 'H5VL_*_optional' callbacks to move the type of operation out
of the va_list, so it's at least possible for another connector to know what
the operation is and decide whether to implement it or not.

Added a new VOL sub-class called "introspect" where callbacks that report
information about the connector or container can be placed.  Added an
'opt_query' callback to this sub-class, for a connector to report back
to the library whether a particular optional callback operation is supported.
Also added a 'get_conn_cls' introspection callback, to retrieve the H5VL_class_t
of a connector (either the "current" connector, H5VL_GET_CONN_LVL_CURR, or
the terminal connector, H5VL_GET_CONN_LVL_TERM).

Moved the "post open" operation from a file 'specific' operation to a file
'optional' operation, now that it's possible to detect (with the 'opt_query'
introspection callback) whether a VOL connector implements an optional
operation, without just returning an error.

Added new internal VOL helper routines: H5VL_object_is_native, to determine
if an object is in (or is a) native file, and H5VL_file_is_same, to determine
if two objects are in (or are) the same terminal VOL connector's container.
(And moved the special handling for FILE_IS_EQUAL operation out of internal VOL
callback routine into H5VL_file_is_same)

Made new dataset 'get' operation for H5Dvlen_get_buf_size, aligning it better
with other 'get' operations in API.

Fixed several issues with pass-through connectors, which are now passing the
'make check-passthrough-vol' tests again.

A bunch of warning and style cleanups as well.
2020-05-20 09:20:21 -05:00
Allen Byrne
68373c2d78 Standalone doesn't use h5test lib implementation. 2020-05-20 09:20:21 -05:00
David Young
2914c7baf8 In portable shell scripts (using #!/bin/sh) we have to use single square
brackets, [ ], instead of the bash-ism double square brackets, [[ ]].
2020-05-20 09:20:21 -05:00
David Young
5ad9d9277e Make this script work on hosts where PERL is not installed at
/usr/bin/perl.
2020-05-20 09:20:21 -05:00
Allen Byrne
e3f12a5a22 Add missing note 2020-05-20 09:20:21 -05:00
Allen Byrne
9f5fdc677a Remove const 2020-05-20 09:20:21 -05:00
Allen Byrne
344f4139d7 Fix compile error - declaration after executable statement 2020-05-20 09:20:21 -05:00
Allen Byrne
def01d7676 Adjust cache.c only variables. 2020-05-20 09:20:21 -05:00
Allen Byrne
2cff38d38e Fix include to correct memory calls - big-endian issue. 2020-05-20 09:20:21 -05:00
Quincey Koziol
091b45c02d Update h5debug to retrieve file pointer through VOL framework 2020-05-20 09:20:21 -05:00
Allen Byrne
b71046be5a Minor whitespace 2020-05-20 09:20:21 -05:00
Dana Robinson
0e133ade90 Fixed bugs in pread/pwrite I/O in VFDs.
Fixes HDFFV-10945.
2020-05-20 09:20:21 -05:00
Vailin Choi
19934f8654 More fixes for previous committed PR #2079 dated Dec 5 2019.
(1) H5O_dtype_ver_bounds[] for V112 should be H5O_DTYPE_VRESION_4
(2) The tests for the new reference types should work for V112 and beyond
2020-05-20 09:20:21 -05:00
Allen Byrne
bc69c4177b Remove duplicate instance 2020-05-20 09:20:21 -05:00
Allen Byrne
931bc7fa51 Revert and move declaration 2020-05-20 09:20:21 -05:00
Allen Byrne
d6356f58f1 Correct struct access 2020-05-20 09:20:20 -05:00
Allen Byrne
1814f0363f Fix duplicate and varname 2020-05-20 09:20:20 -05:00
Allen Byrne
1409fcee4e Fix compile and test issues from DT 2020-05-20 09:20:20 -05:00
Allen Byrne
ba4eaeb660 Add release note for sanitizer support 2020-05-20 09:20:20 -05:00
Allen Byrne
5b50f47f31 HDFFV-10979 cleanup globals 2020-05-20 09:20:20 -05:00
Allen Byrne
371439c6bd TRILABS-135 Add clang analyzers 2020-05-20 09:20:20 -05:00
Neil Fortner
958ba4c8a2 Modify H5VL initialization routines to initialize all VOL-managed object
types.  Modify H5VLwrap_register() to reject non-VOL-managed object
types.  Also fix overisights in h5trace.c from previous changes.
2020-05-20 09:20:20 -05:00
Allen Byrne
59d5321a33 HDFFV-10979 fix global name clash 2020-05-20 09:20:20 -05:00
Allen Byrne
d91fa68f27 Fix 2010 compile issues 2020-05-20 09:20:20 -05:00
Allen Byrne
34518626c4 Fix issues found with ONLY_SHARED_LIBS option 2020-05-20 09:20:20 -05:00
Richard Warren
c1eae1a659 Change from using H5Dcreate to H5Dcreate2 2020-05-20 09:20:20 -05:00
Allen Byrne
85bf828d0c Correct assignment 2020-05-20 09:20:20 -05:00
Allen Byrne
64da9d289b Fix java include, h5watch and remove clang tool. 2020-05-20 09:20:20 -05:00
Allen Byrne
c054c43a9f Add missing filenames 2020-05-20 09:20:20 -05:00
Chris Hogan
e7895c4b3a Update RELEASE.txt with performance improvements 2020-05-20 09:20:20 -05:00
Allen Byrne
1401be4805 HDFFV-10974 Change defines to eliminate Windows conflict 2020-05-20 09:20:20 -05:00
Chris Hogan
c5a7afb7a0 Add RELEASE.txt entry for Jira 10934 2020-05-20 09:20:20 -05:00
Allen Byrne
271432db35 Add H5Rdestroy calls to cleanup 2020-05-20 09:20:20 -05:00
Allen Byrne
ff35d0e423 Remove problem tests for now 2020-05-20 09:20:20 -05:00
Allen Byrne
ed40350312 Add new test reference 2020-05-20 09:20:20 -05:00
Allen Byrne
768d9897b6 HDFFV-10876 fix compare reference 2020-05-20 09:20:20 -05:00
Allen Byrne
a768dd5a0c HDFFV-10876 ignore old reference API tests 2020-05-20 09:20:20 -05:00
Allen Byrne
7319765239 Add missing quotes 2020-05-20 09:20:20 -05:00
Allen Byrne
82751ecbb9 Fix windows 10 compile error 2020-05-20 09:20:20 -05:00
Allen Byrne
c7fe3b143b Correct indentation 2020-05-20 09:20:20 -05:00
Allen Byrne
70b7848c8e Revert declaration used in macro. 2020-05-20 09:20:20 -05:00
Dana Robinson
fe1f87bc5c Minor tweaks noticed while going over VOL documentation. 2020-05-20 09:20:20 -05:00
Neil Fortner
79557814af Add note to RELEASE.txt for H5Sselect_adjust. 2020-05-20 09:20:20 -05:00
Neil Fortner
9f77be02e5 Add RELEASE.txt note for H5Sselect_project_interesection 2020-05-20 09:20:20 -05:00
Allen Byrne
91a6e37dbc Revert declaration deletion. 2020-05-20 09:20:20 -05:00
Neil Fortner
6d5169c1da Add RELEASE.txt note for HVLget_file_type() 2020-05-20 09:20:20 -05:00
Allen Byrne
64af1dab2c HDFFV-10876 add note 2020-05-20 09:20:19 -05:00
Allen Byrne
56249af938 Address compile warnings 2020-05-20 09:20:19 -05:00
Richard Warren
972ce40f36 Fixed PR issues pointed out by Allen 2020-05-20 09:20:19 -05:00
Richard Warren
41eada6dac Remove the Copyright UofI per Larry's guidance 2020-05-20 09:20:19 -05:00
Richard Warren
62639a4568 Adds a new t_2Gio.c MPI test 2020-05-20 09:20:19 -05:00
Allen Byrne
14578dabd4 Fix compile errors - mostly in jni 2020-05-20 09:20:19 -05:00
Jerome Soumagne
56d210ac3f Fix H5VL_token_t type and fix H5VL_loc_by_token to use H5VL_token_t * 2020-05-20 09:20:19 -05:00
David Young
7bbe57d309 Change hdset_reg_ref_t and H5R_ref_t from arrays of unsigned char to
structs containing those arrays.  Encapsulating the arrays in this way
makes it easier to write and think about pointers to these types, casts
to/from these types, etc.

An interesting side-effect that we probably should *not* rely on is
that the struct-encapsulation changes the alignment so that some GCC
warnings about casts that increase the alignment requirement of the
operand go away.  Warnings like that have to be taken seriously:  I will
add -Werror=cast-align to the default compiler flags so that they stop
the build quickly.

GCC warnings led me to some surprising casts in test/trefer.c. I found
that it was possible to make many simplifications after introducing the
struct-encapsulation that I described, above.

In test objcopy_ref `same_file` is assigned but never used.  Delete it.
2020-05-20 09:20:19 -05:00
Neil Fortner
d00c5685b6 Implement support for using H5Dvlen_get_buf_size with
non-native VOL connectors.
2020-05-20 09:20:19 -05:00
Vailin Choi
44e8fe048b Two fixes:
(1) Set the version for reference datatype messge to H5O_DTYPE_VERSION_4.
(2) Verify the decoded version for hyperslab selection.
2020-05-20 09:20:19 -05:00
Neil Fortner
1ece440e78 Add H5VL_MAP_OPTIONAL operation id (unused currently). 2020-05-20 09:20:19 -05:00
Allen Byrne
64601e9a96 HDFFV-10876 Update dump to match DDL spec 2020-05-20 09:20:19 -05:00
Dana Robinson
e4f9ad3dbb Yanked -Wc++-compat from the flags used to build the C library in both
the Autotools and CMake.
2020-05-20 09:20:18 -05:00
Allen Byrne
715374934d Add extra line 2020-05-20 09:20:18 -05:00
Allen Byrne
6a8a3f826d Adjust whitespace 2020-05-20 09:20:18 -05:00
Allen Byrne
19e6c0b26a Update h5ls help and rework dump_mem routines for attrs 2020-05-20 09:20:18 -05:00
Allen Byrne
bb26e035e6 Update create calls 2020-05-20 09:20:18 -05:00
Allen Byrne
417b890436 Add debug compile option as comment 2020-05-20 09:20:18 -05:00
Allen Byrne
1e32da3e3f Update reference calls 2020-05-20 09:20:18 -05:00
Neil Fortner
d2b93dbc9e Fix issues with using H5Pget_fill_value() with file datatypes retrieved
from H5VLget_file_type().
2020-05-20 09:20:18 -05:00
Neil Fortner
08d6ed84b7 Add support for scalar dataspaces to H5Sproject_intersection. Add
checking for ank validity.
2020-05-20 09:20:18 -05:00
Dana Robinson
57b38f58bd Fixed missing blob callbacks in test VOL connectors. 2020-05-20 09:20:18 -05:00
Allen Byrne
69937a4b8a Add missing javadoc for new arg 2020-05-20 09:20:18 -05:00
Allen Byrne
2a30c55439 Update data output reference 2020-05-20 09:20:18 -05:00
Allen Byrne
8972b96622 Update reference files and fix int as string 2020-05-20 09:20:18 -05:00
Jordan Henderson
f56dbdc823 Add OAPL parameter to H5Rcreate_ APIs 2020-05-20 09:20:18 -05:00
Chris Hogan
8c86d9a7ba Fix failing test and retain semantics for chunk cache properties in non-chunked datasets 2020-05-20 09:20:18 -05:00
Chris Hogan
8ef9cc1fc0 Add two missing calls to H5I_dec_ref for new dapl_id 2020-05-20 09:20:18 -05:00
Chris Hogan
9ae1382fb4 Community-proposed fix 2020-05-20 09:20:18 -05:00
Allen Byrne
9e2bc84d64 Update to new error text 2020-05-20 09:20:18 -05:00
Allen Byrne
60bb18eee3 Update reference files to latest output 2020-05-20 09:20:18 -05:00
Neil Fortner
fc34a593a7 Fix missing free in H5T__ref_mem_read() 2020-05-20 09:20:17 -05:00
Neil Fortner
175a14466c Fix bugs in H5VL file comparison code. Add short circuit success to
H5VL_cmp_connector_cls().
2020-05-20 09:20:17 -05:00
Neil Fortner
22ad1bd668 Implement file comparison VOL callback. Other changes to allow
references to work with non-native connectors.  There is a bug
somewhere.
2020-05-20 09:20:17 -05:00
Jerome Soumagne
267b97c3ea H5R: fix H5Tconv to check for null references
Valid for both deprecated and non-deprecated references

Update test
2020-05-20 09:20:17 -05:00
Neil Fortner
aae787569b Add support for point selections to H5S_select_project_intersection. 2020-05-20 09:20:17 -05:00
Jerome Soumagne
e1f67e8610 Remove H5VL_NATIVE_FILE_GET_FILE_ID and add H5VL_OBJECT_GET_FILE
Remove H5F__get_file_id() and use only private routine instead
2020-05-20 09:20:17 -05:00
David Young
77144641df Revert "Make a squash commit of 'Quiet some warnings by adjusting warnings level and fixing some code.' (commit 5c911d8baf)" 2020-05-20 09:20:17 -05:00
David Young
e07ca4b4a5 Revert "Oops, remove more C99 designated initializers for VS 2010 compatibility."
This reverts commit f907b511d0.
2020-05-20 09:19:38 -05:00
Neil Fortner
975a360db2 Move checking for zero offset in selection adjust calls to the selection callbacks. This makes the
procedure for checking it consistent across selection types and between
_s and _u, ensures it is always is performed even when called within the H5S package, and removes the redundant check that would occur when callins H5S_select_adjust_s() from outside the H5S package.
2020-05-20 09:19:38 -05:00
Neil Fortner
c7c302a64b Replace H5Sselect_adjust_u() and H5Shyper_adjust_s() with
H5Sselect_adjust.  Implement "adjust_s" callback for all selection
types.  Add range checking to H5Sselect_adjust().
2020-05-20 09:19:38 -05:00
Dana Robinson
fcfc5700df Trivial parameter renaming in VOL API calls. 2020-05-20 09:19:38 -05:00
David Young
10911a1176 Oops, remove more C99 designated initializers for VS 2010 compatibility. 2020-05-20 09:19:38 -05:00
David Young
dffa21d2fb Add an #include to get a function declaration. 2020-05-20 09:19:38 -05:00
David Young
c258fc10fc Don't use C99 designated initializers, they're not compatible with
Visual Studio 2010.
2020-05-20 09:19:37 -05:00
David Young
f77dbfe4ac Quiet some more maybe-uninitialized warnings---each is a false positive,
*sigh*.  This is more code that may not compile with VS2010, *sigh
sigh*.
2020-05-20 09:19:37 -05:00
David Young
765ab7ee45 Always warn on maybe-uninitialized. -Wincompatible-pointer-types was not
available until GCC 5, so enable it only if that's the GCC version we're using.
2020-05-20 09:19:37 -05:00
David Young
0e7dffc0dd Only promote maybe-uninitialized warnings to errors on GCC 8. Even on
GCC 8, there may be false positives at low optimization levels?  I need
to check.
2020-05-20 09:19:37 -05:00
David Young
9734b5993c Only use -Werror=cast-function-type with GCC 8 and later. 2020-05-20 09:19:37 -05:00
David Young
1fed8986df Put all of the -W options back into the order I found them in so that it's
easier to compare old and new config/gnu-flags.
2020-05-20 09:19:37 -05:00
David Young
4a4f4b76cf Add new source files to CMakeLists.txt. 2020-05-20 09:19:37 -05:00
David Young
1fc2171299 Mention the -Werror= flags in libhdf5.settings.in. 2020-05-20 09:19:37 -05:00
David Young
a7c153fff1 free -> HDfree 2020-05-20 09:19:37 -05:00
David Young
312496013e Promote decleration-after-statement warnings to errors. 2020-05-20 09:19:37 -05:00
David Young
d1ceb04c5d Quiet decleration-after-statement warnings. 2020-05-20 09:19:37 -05:00
David Young
34e51def7e Move a statement under some declarations since some vintages of Visual
Studio don't like declarations after statements.
2020-05-20 09:19:37 -05:00
David Young
902cb3e0d0 Document H5D__chunk_mem_xfree_wrapper(). 2020-05-20 09:19:37 -05:00
David Young
b1be318a62 Undo accidental test deletion. 2020-05-20 09:19:37 -05:00
David Young
3a65ddc936 Oops, delete a debug printf that snuck in here. 2020-05-20 09:19:37 -05:00
David Young
9685e4fb64 Undo my changes to the HD macros, hadn't really intended those to be on
this branch....
2020-05-20 09:19:37 -05:00
David Young
c30b30258d Make errors of some more warnings. Move disabled warnings to
DEVELOPER_WARNING_CFLAGS.  Put just one warning option on a line, and
sort some of the options.
2020-05-20 09:19:37 -05:00
David Young
2aa85f15ea Cast to the parameter type, H5VL_token_t *, instead of to unsigned char *.
(H5VL_token_t, too, probably should turn from a typedef for a
constant-length array to an array encapsulated in a struct.)
2020-05-20 09:19:37 -05:00
David Young
224653db64 Change hdset_reg_ref_t and H5R_ref_t from arrays of unsigned char to
structs containing those arrays.  Encapsulating the arrays in this way
makes it easier to write and think about pointers to these types, casts
to/from these types, etc.

An interesting side-effect that we probably should *not* rely on is
that the struct-encapsulation changes the alignment so that some GCC
warnings about casts that increase the alignment requirement of the
operand go away.  Warnings like that have to be taken seriously:  I will
add -Werror=cast-align to the default compiler flags so that they stop
the build quickly.

GCC warnings led me to some surprising casts in test/trefer.c. I found
that it was possible to make many simplifications after introducing the
struct-encapsulation that I described, above.
2020-05-20 09:19:37 -05:00
David Young
386138daa3 In every instance, x is initialized by memcpy, but GCC isn't smart
enough to figure that out.  Quiet some warnings by always initializing
`x` to 0.
2020-05-20 09:19:37 -05:00
David Young
7605df3cf0 same_file is assigned but never used. Delete it. 2020-05-20 09:19:37 -05:00
David Young
354fca5b59 Don't assign a constant string to a pointer to non-constant character. 2020-05-20 09:19:37 -05:00
David Young
cbd2e29914 GCC isn't smart enough to realize that fill_c is always initialized
and exclusively used in `datatype == H5T_COMPOUND` branches, so just
initialize it at its declaration so that GCC doesn't warn.
2020-05-20 09:19:37 -05:00
David Young
7638fbb258 I'm not sure what the previous code was trying to do, casting an array
of `hsize_t`, `start`, to `long long`, but I think the way that I have
rewritten it, it probably produces a more useful result?  As a bonus,
GCC has stopped warning about it.
2020-05-20 09:19:37 -05:00
David Young
1132ed87bc Quiet a warning about an unused variable. This code looks like it
should be heavily restructured to avoid the use of globals like `pass`,
but that's a project for another day and another person.
2020-05-20 09:19:37 -05:00
David Young
6b80036fde Straggler from previous commit: build and link the new .c files where I
moved some previously-static variables and functions that were causing
unused-variable/function warnings.
2020-05-20 09:19:37 -05:00
David Young
ad2b1fa0c5 Explicitly initialize type_flags; the compiler does not realize that
it is set before use by passing it as a reference to another function.
2020-05-20 09:17:27 -05:00
David Young
395d4f0716 Initialize a couple of return values to avoid used-before-set warnings. 2020-05-20 09:17:27 -05:00
David Young
1f7fdfe14c Initialize a couple of variables that the compiler does not realize are
initialized when they're passed by reference to functions.
2020-05-20 09:17:27 -05:00
David Young
ca0fcd34f3 To quiet a warning, initialize some struct timevals that the compiler
does not realize are always set before use by `gettimeofday`.
2020-05-20 09:17:27 -05:00
David Young
0206b1055e Move some static functions and variables to .c files to avoid unused
function/variable warnings.
2020-05-20 09:17:27 -05:00
David Young
f7699a7be4 Delete unused variable. 2020-05-20 09:17:27 -05:00
David Young
4440ccca7d Change a signed variable to unsigned to avoid a warning about the sign
being lost by a cast.
2020-05-20 09:17:27 -05:00
David Young
46ed46aa72 Avoid unused-variable warnings: change static const strings in a couple
of header-file templates to #defines.
2020-05-20 09:17:27 -05:00
David Young
f089da9c15 Demote errors to warnings for a couple of unused-but-set variables that
I cannot untangle right now.
2020-05-20 09:17:27 -05:00
David Young
ea084e6383 Delete an unused variable. 2020-05-20 09:17:27 -05:00
David Young
440bf2fc34 Mark an unused parameter H5_ATTR_UNUSED. 2020-05-20 09:17:27 -05:00
David Young
72a8f38a9f Delete variables that are unused or set and unused. 2020-05-20 09:17:27 -05:00
David Young
7b601c2611 Initialize a variable before its first use. 2020-05-20 09:17:27 -05:00
David Young
2b863a8119 Change some GCC warnings to errors. Fix code to quiet some warnings. 2020-05-20 09:17:27 -05:00
Allen Byrne
5069cbf96f Remove unneeded flag overwrites 2020-05-20 09:17:26 -05:00
Chris Hogan
ba7db398e0 Add documentation for H5CX_get_ohdr_flags 2020-05-20 09:17:26 -05:00
Chris Hogan
847a16dccc Add object header flags to API context
Add missing DCPL to API context state
Replace a couple LCPL H5P_get calls with H5CX_get_*
2020-05-20 09:17:26 -05:00
Chris Hogan
45f56375dc Use major error code of calling package 2020-05-20 09:17:26 -05:00
Chris Hogan
e5b0979bf7 Handle H5CX_state_t for lcpl 2020-05-20 09:17:26 -05:00
Chris Hogan
d596963eb9 Add character encoding to lcpl context 2020-05-20 09:17:26 -05:00
Chris Hogan
7555de2a26 Change LC property name from 'create_intermediate_group' to 'intermediate_group' 2020-05-20 09:17:26 -05:00
Chris Hogan
d4fb9dbc61 Use API context to store/retrieve LCPL when creating intermediate groups 2020-05-20 09:17:26 -05:00
Neil Fortner
49a4f6e64b Modify H5Ssel_iter_get_seq_list() to accept iterators that have reached
the end of iteration (returning zero sequences).  Previously it could
cause an assertion failure.
2020-05-20 09:17:26 -05:00
Allen Byrne
753e0ff0c9 Comment correction 2020-05-20 09:17:26 -05:00
Allen Byrne
b7e1dd706c Minor correction 2020-05-20 09:17:26 -05:00
Allen Byrne
820baf8531 Update list of tested platforms 2020-05-20 09:17:26 -05:00
Allen Byrne
66fc35d49c Add VS2019 support 2020-05-20 09:17:26 -05:00
Richard Warren
c77bda497a Fixed the H5_mpi_get_bigio_count function prototype 2020-05-20 09:17:26 -05:00
Allen Byrne
ac3ffbeff9 Correct file extension 2020-05-20 09:17:26 -05:00
Neil Fortner
0d9624b4d5 Implement public H5Sselect_project_intersection(). Updated internal
algorithm to (optionally) avoid sharing selection data structures.
Tested internal code (including with valgrind) by setting VDS code to
avoid sharing selection, has since been changed to share selection for
performance, so this code is not yet tested in regression tests.  API
has not been tested.
2020-05-20 09:17:26 -05:00
David Young
e067612d25 Use HD prefix. 2020-05-20 09:17:26 -05:00
Neil Fortner
814d5c3875 Fix issue where H5R__reopen_file did not make the file "post open"
callback.
2020-05-20 09:17:26 -05:00
David Young
058d7a1b3c Apparently, + has no special meaning, and neither does \+, in so-called
"obsolete" / POSIX "basic" regular expressions.  Also, not every version of
`sed` out there supports the `-E` option.  So delete the -E flag and use
the regex `[^/][^/]*` instead of `[^/]+`.

Add config/netbsd to the MANIFEST.
2020-05-20 09:17:26 -05:00
Neil Fortner
31fd2e60c7 Implement H5VLget_file_type() to return a copy of a datatype with the
location set to be in a file.  Only meant to be used by VOL connectors.
Implement H5VLpeek_connector_id() to support connectors querying their
own IDs.  Fix app_ref with connector IDs in a couple places (external
VOLs registered as default through ENV should be visible to the
application).  Modify vlen and reference interfaces to work with
arbitrary VOL connectors.  Implement file "post open" specific
callback, to enable connectors to update their file structs after a
wrap context has been set.
2020-05-20 09:17:26 -05:00
Allen Byrne
1e7387a5f8 HDFFV-10876 Update h5dump and h5ls for new ref api. 2020-05-20 09:17:26 -05:00
David Young
408146236d Make these scripts relocatable again: derive a relative path for the
original installation prefix from the examples prefix.  Use that
relative path to locate the current installation prefix, always.  Fall
back to an absolute installation prefix if the relative path cannot be
derived.
2020-05-20 09:17:25 -05:00
David Young
3fee0cf435 Get the path to prefix right: needs a ../ to back out of subdirectory
c/.
2020-05-20 09:17:25 -05:00
David Young
94ecdfe1a3 Make this script relocatable again: derive a relative path for the
original installation prefix from the examples prefix.  Use that
relative path to locate the current installation prefix, always.  Fall
back to an absolute installation prefix if the relative path cannot be
derived.
2020-05-20 09:17:25 -05:00
David Young
8d3d457890 Let us override the examples directory using --with-examplesdir=DIR.
This is handy for NetBSD where HDF5 examples are installed
by convention in $prefix/share/examples/hdf5/ rather than in
${prefix}/share/hdf5_examples/, which is the HDF5 default.

Place hdf5_examples/ under ${datarootdir} which on most systems will be
${prefix}/share/, anyway.
2020-05-20 09:17:25 -05:00
Jordan Henderson
4c481e5564 Partial fix for HDFFV-10792 2020-05-20 09:17:25 -05:00
David Young
2943ab87e0 Add missing newline to dbgf() statement. 2020-05-15 12:26:40 -05:00
David Young
eb69be608d Make -q actually quiet the program. 2020-05-15 12:24:52 -05:00
David Young
a2ad44f419 Make the personality detection more robust like I did for
vfd_swmr_zoo_writer, previously.
2020-05-15 12:20:21 -05:00
David Young
ad79ca8ae7 Let us change the chunk size with command-line options, -r rows and -c
columns.  If the number of datasets is greater than the number of steps,
then only pause between steps, do not pause between individual datasets
written/verified.  Otherwise, pause between each dataset written/verified.
2020-05-15 11:36:00 -05:00
David Young
2fe43bd423 Fix inverted logic: report "soft" errors if there were *not* 0 of them. 2020-05-13 11:46:54 -05:00
David Young
89bf6de17f This test doesn't need to log/modify traps in the global heap, so don't
provide a H5HG_trap() routine.
2020-05-13 11:46:30 -05:00
David Young
b4813b0c54 In H5FD_vfd_swmr_read(), do not verify checksums on shadow entries
that are longer than the buffer that the caller supplied: the checksum
usually will fail, but that's not actually a fatal condition, and
usually we will have another opportunity to verify the checksum.

In H5FD_vfd_swmr_read(), remove a bunch of disused code.

In H5FD_vfd_swmr_read(), do not re-read a shadow image that has a
bad checksum, because a bad checksum indicates a serious problem
(writer outran reader, OS defect, hardware failure) from which
H5FD_vfd_swmr_read() cannot recover.

Rationale: the writer write(2)s new shadow images before the new index,
and the new index before the new header.  In H5FD_vfd_swmr_read(),
the reader has read(2) both the index and the header in full.  POSIX
semantics indicate that in these circumstances, the last shadow image
write(2) MUST be completely visible when we read(2).  That is, the index
write(2) & read(2) and the header write(2) & read(2) pair cannot
divide a preceding shadow-image write(2).

The reader may see a "torn" image at this juncture if, for example,
the writer got max_lag ticks ahead of it and reused the storage for
this shadow image.  Even if the reader "recovers" by re-reading the
image until its checksum is correct, it cannot be sure that the
image thus read is the right one for the HDF5 address passed to
H5FD_vfd_swmr_read(), and it cannot be sure that the image thus read is
not stale, because it's operating with an out-of-date shadow index.

Add log outlets swmr_read, swmr_read_exception, and swmr_read_err.
Log to `swmr_read` on entry to H5FD_vfd_swmr_read(), log to
`swmr_read_exception` when checksums are skipped for exceptional
conditions (page buffer not configured, buffer shorter than shadow
image), and log to `swmr_read_err` when the checksum fails.
2020-05-13 10:30:00 -05:00
David Young
92142cba38 When an entry changes size, remove it from the tick list and add it back
to keep the cumulative bytes in the tick list up-to-date.  That prevents
an assertion, later.
2020-05-11 18:06:23 -05:00
David Young
cc6e4055cb Don't initialize seed without need. NFCI. 2020-05-11 17:24:53 -05:00
David Young
562d5beab2 Look for the personality in the program name *suffix*, because on
`jelly` libtool adds an `lt-` prefix to the program name.
2020-05-11 15:17:42 -05:00
David Young
8ed6529fc0 In H5MF__xfree_impl(), always invalidate the page-table entries
overlapped by the freed region.  Previously, the page-table entries were
only freed on one success path through _xfree_impl().
2020-05-11 15:14:58 -05:00
David Young
4b61113d2f Split VFD_SWMR_TEST_FOR_END_OF_TICK() into VFD_SWMR_ENTER() and
VFD_SWMR_LEAVE() for use by FUNC_ENTER_API/_LEAVE_API macros.  In the
macros, don't HGOTO_ERROR(), since that will jump back to the `out`
label, but HDONE_ERROR() on error, instead.
2020-05-08 19:33:15 -05:00
David Young
35a4bfb551 Extend VFD SWMR tick length and maximum lag parameters. 2020-05-08 19:32:24 -05:00
David Young
d1de9d695f Delete extra line. NFCI. 2020-05-08 19:32:09 -05:00
David Young
561974d329 Add missing return-value check. 2020-05-08 19:31:54 -05:00
David Young
a69c33af13 Take care not to leak property lists or data spaces. 2020-05-08 19:31:32 -05:00
David Young
b7c05d2231 Fix bugs in the dataset dimensions checks. 2020-05-07 14:34:34 -05:00
David Young
5d4b109abf Create a reader for the extensible datasets tests. 2020-05-07 12:09:15 -05:00
David Young
f8e494ba80 Add my work-in-progress dataset test. It writes a handful of datasets
that expand in one or two dimensions, depending on the setting of the -d
option argument.
2020-05-06 15:01:29 -05:00
David Young
696173c284 Add esnprintf that prints to the given buffer, observing the given
buffer size, using vsnprintf(3), but exits with err(3)/errx(3) if the
buffer is too small or if vsnprintf returns < 0.
2020-05-06 14:44:59 -05:00
David Young
c07a958e1d Insert a random delay between zoo-writer test steps. Let us control
the random seed with an environment variable, H5_ZOO_STEP_SEED, and the
maximum delay in milliseconds with a command-line option, `-m ms`.
2020-04-30 15:39:35 -05:00
David Young
fdeeac1c1b Use a one-character buffer to send/receive messages to/from
writer/reader, since that's all we need.  Avoid deadlock by flushing the
file before waiting for the reader's message.
2020-04-30 15:26:39 -05:00
David Young
57e5c4305c Avoid deadlock of reader and writer: make the writer flush file content
before waiting for the reader's message.
2020-04-30 15:22:36 -05:00
David Young
becb9d8292 In fetch_env_ulong(), report a parse that consumes fewer than all
characters differently than other parse failures.
2020-04-30 15:21:26 -05:00
David Young
a5ca065b7c Add a rudimentary zoo test to the VFD SWMR test script.
Briefly describe the variable-length test with a comment.
2020-04-28 10:27:55 -05:00
David Young
17a1789b85 Change some fprintf callss to dbgf calls, and increase the debug level
of several dbgf statements from 1 to 2 so that `-q` quiets them.
2020-04-28 08:44:35 -05:00
David Young
a204a184aa Let catch_out_err_and_rc() callers redirect the standard input and
output streams using STDIN_PATH and STDOUT_PATH.  I will use that for
the zoo reader and writer.  Move redirection of standard error output to
the standard output stream outside of the curly braces, since usually
I want to save the `echo` and `wait` output, too, and it makes the
redirection of the supervised program a little easier to follow, I
think.
2020-04-28 08:40:58 -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
d16006c45d To avoid name clashes, rename FILENAME -> COMMON_FILENAME in
test/vfd_swmr_common.h and in all files that #include it.  Now I can
2020-04-27 10:28:10 -05:00
David Young
068399054a Implement the remainder of the delete/validate-delete cases. 2020-04-23 16:03:29 -05:00
David Young
8966557705 Flesh out the delete/validate-deletion tests. Extract a shared
subroutine.
2020-04-23 15:33:39 -05:00
David Young
a9849089c6 Delete dead code. Re-enable the coordination between reader and writer:
the writer expects to read a character on its standard input stream when
the reader is ready for it to delete the zoo content.
2020-04-23 15:31:56 -05:00
David Young
b1e2eceed7 Let the reader-side tick instrumentation know about the first tick read
from the shadow file.
2020-04-23 15:29:53 -05:00
David Young
a0b6979c6f Relax an assertion condition. 2020-04-23 15:29:17 -05:00
David Young
3cc2644c70 Bug fix: in the freespace manager, use a new routine,
H5PB_remove_entries(), to remove *all* pages overlapped by the freed
space, instead of just the first one.
2020-04-23 15:26:25 -05:00
David Young
744ff2b84d Delete an assertion that doesn't hold true for multipage entries. 2020-04-21 16:42:59 -05:00
David Young
13e930d306 Add a skip compact configuration for skipping the "zoo" tests for
compact datasets.

Bundle the zoo-test configuration into a new type, zoo_config_t.

Add a couple new "zoo" test phases, "delete" and "validate-deletion", to
the existing "create" and "verify" phases.  Give names and numbers to
all phases with the new `enum`, `phase_t`, and refactor so that tend_zoo
runs a selection of phases at each step.

Stub the "delete" and "validate-deletion" phases for most test steps.
Actually implement for compact dataset (ds_cpt_i) test.

In tend_zoo(), delay for 50 milliseconds after running all steps.
Really, this should delay after each step....

Implement vfd_swmr_writer_may_increase_tick_to() and
vfd_swmr_reader_did_increase_tick_to() with a file that reader and
writer share.  The reader saves its current tick number in the shared
file.  The writer does not advance its tick number past the reader's.
Collect some statistics in vfd_swmr_writer_may_increase_tick_to() and
print them before the writer exits.

Add option flags for skipping compact dataset tests (-C) and for
printing error stacks (-e).  Update the usage message, which was
stale before the new options were added.

Delete some dead code.

Add #if 0'd-out code for the reader to wait for the writer before
running "delete" and "validate-deletion" steps.
2020-04-21 15:39:25 -05:00
David Young
de18e8c95a Make await_signal() await any signal instead of just SIGINT. Add a
(commented out) private version of strsignal(3), just in case we need
one on some platform.
2020-04-21 15:19:19 -05:00
David Young
95105d3fac Prevent a spurious assertion by using the correct index, oops! 2020-04-21 14:24:01 -05:00
David Young
b1de3197d3 Delete an empty line. NFCI. 2020-04-21 14:23:23 -05:00
David Young
62ae44da95 Straggler from last: provide stub implementations
of vfd_swmr_writer_may_increase_tick_to() and
vfd_swmr_reader_did_increase_tick_to().
2020-04-21 14:20:52 -05:00
David Young
1d9ab42c57 Add a second bool argument to H5F_vfd_swmr_writer_end_of_tick() that
tells whether the call may wait for the reader tick to catch up.

Add stub routines vfd_swmr_writer_may_increase_tick_to() and
vfd_swmr_reader_did_increase_tick_to() for tests---e.g.,
vfd_swmr_zoo_writer/_reader---to use to coordinate their tick numbers.

vfd_swmr_writer_may_increase_tick_to(new_tick, wait_for_reader) returns
true if the writer may increase its tick number to `new_tick` without
overrunning the reader.

A reader uses vfd_swmr_reader_did_increase_tick_to() to tell a writer
that its tick number has increased.
2020-04-21 14:17:15 -05:00
David Young
ea51b2e095 Condense H5F_vfd_swmr_close_or_flush() for readability: remove
unnecessary comments and trim whitespace.  Remove unnecessary backslash
line continuations and add semicolons to HGOTO_ERROR() statements.
NFCI.
2020-04-21 14:10:00 -05:00
David Young
f05358b410 Quiet some used-before-initialized warnings. 2020-04-20 16:15:48 -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
752af2134f Stragglers from previous: globally declare some hlog outlets and add
declare some new functions.
2020-04-16 17:04:21 -05:00
David Young
69e95c3748 Add a log outlet for metadata cache (MDC) invalidations,
`mdc_invalidation`, and use it to log a message when
H5C_evict_or_refresh_all_entries_in_page() does not find any affected
entries.

Pass a page length to H5C_evict_or_refresh_all_entries_in_page() so that
it can assert if a multipage eviction overlaps a single-page entry,
which had better not happen.

Fix a bug in H5F_vfd_swmr_reader_end_of_tick() and heavily rework it:
remove page-table entries and evict/refresh MDC entries that overlap
*added* shadow-index entries.  Because we didn't do that before, in the
zoo test, the reader didn't see all of the changes made by the writer
until the writer closed the file:  MDC entries covered the new content
in the shadow file.

In H5F_vfd_swmr_reader_end_of_tick(), log changes to the shadow index
with the new outlet, `shadow_index_update`.

Convert a some of John's disused diagnostic printfs to an
`hlog_fast(eot, ...)` call.
2020-04-16 17:03:25 -05:00
David Young
71b7a186ef Delete unused line, shorten a comment, wrap some lines, add missing
semicolons and curly braces.  NFCI.
2020-04-16 16:36:27 -05:00
David Young
9c6b5a270c Re-enable reclamation of disused shadow-index entries. 2020-04-16 16:20:56 -05:00
David Young
98838cb0f3 Remove unnecessary pointer test: it cannot possibly be NULL. 2020-04-16 16:16:12 -05:00
David Young
ad4206a604 Remove gratuitous initialization, comment, and assertions. 2020-04-16 16:13:59 -05:00
David Young
6f65412b76 Extract a subroutine, H5F_vfd_swmr_process_eot_queue(), from the
end-of-tick processing macro.  H5F_vfd_swmr_process_eot_queue() looks
for files due for end-of-tick processing and calls either the reader or
writer EOT routine.

Always call the reader/writer EOT routines with an actual H5F_t instead
of NULL.
2020-04-16 16:08:15 -05:00
David Young
21f3fae469 Refactor: extract subroutine estack_get_state() for reuse in a commit
that's coming soon.
2020-04-16 15:30:27 -05:00
David Young
86be273386 Send debug messages to stderr instead of to stdout. 2020-04-16 15:29:26 -05:00
David Young
1f563c80b5 Improve diagnostic logging. 2020-04-16 15:26:00 -05:00
David Young
c69d756f75 Oops, properly the outlet symbol-name prefix with the rest of the symbol
name, so the symbols are not prefixed with `HLOG_PREFIX` but with
`hlog_gbl_`.
2020-04-16 15:21:09 -05:00
David Young
aebeeada31 When hlog_set_state() changes the state of an outlet, reset each
outlet's cached state so that its state is reevaluated.
2020-04-16 15:18:51 -05:00
David Young
6bf7e1cada Log page-buffer reads and writes no matter what storage type. (Used to
log only the global heap-type reads and writes.)
2020-04-16 15:02:15 -05:00
David Young
f51f69faad Re-wrap paragraphs at < 80 columns. 2020-04-15 09:44:14 -05:00
David Young
4b40738946 Mark a task complete, fix some typos, wrap some paragraphs. 2020-04-15 09:40:17 -05:00
David Young
671c28bfad Put multiline if-body in curly braces, repair indentation, remove
gratuitous backslash line continuation, add missing semicolons.
2020-04-14 12:15:49 -05:00
David Young
a6d7004c03 Wrap a line before 80 characters. NFCI. 2020-04-14 10:55:53 -05:00
David Young
4dc315dfb7 Document hlog a bit. 2020-04-14 09:04:18 -05:00
David Young
43b8671231 Change the prefix for hlog_outlet_t's from log_ to hlog_gbl_ to avoid
namespace pollution.  Use a `#define HLOG_PREFIX hlog_gbl_` so that I
can change all of the prefixes in one place if need be.
2020-04-13 17:10:30 -05:00
David Young
03a91f3cf5 Add a log outlet, tick, and log some changes to the tick number there.
While I'm here, assert in the reader that the tick number hasn't leapt
forward by more than max_lag ticks.
2020-04-13 16:16:53 -05:00
David Young
5248e9f2c5 tick_num_g has been gone for a while, so do not refer to it in
comments any longer.
2020-04-13 16:14:01 -05:00
David Young
647091ab53 Add clean_shadow_index() for removing shadow-index entries that were
flushed more than max_lag ticks ago.  This conserves space in the shadow
file, which would grow great big while the `credel` demo ran.
2020-04-13 16:02:55 -05:00
vchoi
2b5dbc7d42 Add H5MV split method for alignment. 2020-04-13 14:52:26 -05:00
David Young
1ce8ff1fea Check whether or not the shadow entry size is different from the
pagebuffer entry size.  If the sizes are different, then release the old
shadow space (using the correct size) and set the shadow page number to
0 so that H5F_update_vfd_swmr_metadata_file() will allocate new shadow
space with the right size.

Vailin says that this fixes the bug she found, where a 4096-byte buffer
allocated by H5MV_alloc() is released with H5MV_free() as if it was 8192
bytes long.
2020-04-13 12:10:02 -05:00
David Young
8ec3ad3d93 Be brief: remove commas and equal signs from diagnostic log messages. 2020-04-08 10:13:00 -05:00
David Young
6d0d1b490b Fix spelling in a comment. 2020-04-08 10:12:15 -05:00
David Young
c1b655b568 Count failures of the variable-length string tests as "soft errors"
that don't count as VFD SWMR test failures.

The variable-length string tests are nondeterministic, so we expect them to
fail, and they do fail quite often on `jelly`, for example.
2020-04-07 16:36:16 -05:00
David Young
25968a795b Add a new log outlet and change an fprintf(stderr, to an
`hlog_fast(lengthen_pbentry,`.  This quiets one of the VFD SWMR tests.
2020-04-07 10:56:50 -05:00
David Young
1292630c62 Straggler from previous: declare the new shadow_index_reclaim log
outlet.
2020-04-07 10:51:23 -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
7b83633d5e Simplify H5PB_vfd_swmr__update_index(), which figures in
my investigation of shadow-file freespace leaks.

Copy the tick number from the H5F_shared_t to a temporary variable
and use the temporary instead of spelling out `shared->tick_num`.

Assert that every entry on the tick list is dirty, since clean
entries will not appear on the tick list.  Mark each corresponding
shadow-index entry dirty, and set its "tick of last change" to the
current tick and "tick of last flush" to 0.  This makes the scan
for entries that do not appear on the tick list more believable.

Lower staircase in the loop that scans for shadow-index entries that
did not appear on the tick list.  Log indicies that are marked for
reclamation.
2020-04-07 10:39:33 -05:00
David Young
46832e59ec Declutter: remove superfluous comment and assertion. NFCI. 2020-04-07 09:45:00 -05:00
David Young
d9ee55cbd9 Remove extraneous whitespace. NFCI. 2020-04-07 09:44:35 -05:00
David Young
1137ffef6a After adding a shadow page to the deferred free list, set the entry's
page number to 0 so that we cannot free it again by accident.
2020-04-07 09:41:49 -05:00
David Young
8d6c1eca16 Add a log outlet and shorten the name of an existing outlet. 2020-04-07 09:22:07 -05:00
David Young
25bafe0063 Fix the width of an index variable. 2020-04-07 09:21:27 -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
9678dcffbf Make some changes to conserve filespace and ensure that all filespace is
eventually reclaimed.

Defer reclamation of raw data filespace, only.

XXX Deferring only raw-data reclamation isn't *quite* sufficient because
XXX a writer could conceivably reuse metadata space as raw-data space
XXX before max_lag ticks have elapsed.  Readers could see metadata
XXX corrupted by raw data.

Once a file starts to close, stop deferring reclamation.

In H5MF_free_aggrs(), perform all deferred reclamations if the file is
closing.
2020-04-06 12:32:20 -05:00
David Young
fd079a2357 Improve diagnostic logging. 2020-04-02 15:58:12 -05:00
David Young
1041983d87 Standardize and shorten diagnostic messages to help my search for the
leak of shadow-file space.
2020-04-02 15:56:22 -05:00
David Young
a1175c1b98 Remove superfluous comment. Remove unnecessary variable
initializations: the compiler will tell us if the variables are used
before they're set.  NFCI.
2020-04-02 15:54:29 -05:00
David Young
40c638dcab Remove superfluous whitespace, insert whitespace around / operator,
repair for-loop indentation.  NFCI.
2020-04-02 15:53:44 -05:00
David Young
9c957495db Update comments, shorten comments, remove superfluous comments. 2020-04-02 15:53:02 -05:00
David Young
9b5384b436 Add a reader personality to vfd_swmr_zoo_writer. Remove the disused
`-t` option.  Disable the error stack across create_/validate_zoo()
calls.
2020-03-31 13:14:59 -05:00
David Young
69fcb52eca Prepare for reuse in vfd_swmr_zoo_{reader,writer}: in
validate_zoo()/check_zoo(), instead of checking/modifying the global
variable `pass`, just return `false` on failure, `true` on success.
Update test `cache_image` to match.
2020-03-31 13:13:39 -05:00
David Young
817756a0e0 Rename process_deferred_frees as H5MF_process_deferred_frees and make it
available to other files.  Make the tick number a parameter instead of
using the f->shared->tick_num, so that we can pass a maximal tick number
and that way reclaim all of the deferred frees.
2020-03-31 12:54:10 -05:00
David Young
da70686a5a Fix whitespace at end (beginning?) of line. NFCI. 2020-03-31 09:52:11 -05:00
David Young
928c820d04 Straggler: add htri_to_string() for converting htri_t to a string
constant.
2020-03-30 14:34:27 -05:00
David Young
d0b8accbc1 Relax H5F_update_vfd_swmr_metadata_file() argument checking so that we can call
it with num_entries == 0 and a non-NULL `index`.  Delete some code that isn't
necessary if `num_entries == 0 && index != NULL` is allowed.  NFCI.
2020-03-30 13:44:44 -05:00
David Young
c7af3df890 Simplify: change if (cond) { assert(FALSE); } to assert(!cond);. 2020-03-30 13:43:47 -05:00
David Young
ba7dde8ba9 Lower staircase. NFCI. 2020-03-30 13:42:56 -05:00
David Young
53aee36c3e Delete an #ifdef H5MV_VFD_SWMR_DEBUG debug fprintf that probably never worked
quite as intended.
2020-03-30 13:40:08 -05:00
David Young
9db701e95b Add a log outlet. Replace #ifdef H5MV_VFD_SWMR_DEBUG debug fprintf's with
hlog_fast() calls.
2020-03-30 13:39:14 -05:00
David Young
db5942d3f1 Add log outlets. Convert existing #ifdef H5MF_ALLOC_DEBUG{,_MORE} debug
fprintf's to hlog_fast() calls.  Add some new hlog_fast() calls.
2020-03-30 13:37:05 -05:00
David Young
5f58844bd5 Delete ridiculous comments. Remove superfluous curly braces. NFCI. 2020-03-30 13:22:17 -05:00
David Young
989b6c2063 Delete ridiculous comment and excess for-loop whitespace. NFCI. 2020-03-30 13:22:17 -05:00
David Young
57ae4206ca Delete ridiculous comments and repair some whitespace. NFCI. 2020-03-30 13:22:17 -05:00
David Young
7d50e9c89e Be brief: turn 7 lines of if-else to one line of ?:. Be sensible: don't
assert a pointer we just dereferenced is non-NULL.
2020-03-30 13:22:17 -05:00
David Young
78fac0241a Let us use space as well as comma to separate outlet=yes|no clauses in
the HLOG environment variable.
2020-03-30 13:22:17 -05:00
mainzer
0135ec8d61 Reverted optimization in the metadata cache that avoided re-reading
the first portion of a metadata cache entry in speculative reads.
This is necessary for VFD SWMR as it presumes that metadata entries
are read and written atomically.  See comments in H5C.c / H5C_load_entry()
for further details.
2020-03-26 10:26:49 -05:00
David Young
14a8543c7a Remove a duplicate #define H5FD_TESTING line. 2020-03-24 15:39:19 -05:00
David Young
8ccff19e02 Add option flag -v for verbose messages. Alphabetize the options
switch-statement.
2020-03-24 15:35:47 -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
85f5bfb3b7 Use the name vfd_swmr_zoo.h5 for the zoo file, not vfd_swmr_vlstr.h5. 2020-03-23 14:57:58 -05:00
David Young
cb5e1ead29 Let tests provide a "hook" that runs after each step in create_zoo().
Provide a hook in vfd_swmr_zoo_writer that calls H5Fvfd_swmr_end_tick().
2020-03-23 14:55:07 -05:00
David Young
51b8fa3ffe Take a stab at a "zoo" writer for VFD SWMR: write all of the same
objects as the cache_image test does.  The zoo writer is a work in
progress.

This version is useful as a reproducer for the hang in the global heap
that I stumbled over, yesterday.  I run this to reproduce,

env HLOG="pbio=on" ./vfd_swmr_zoo_writer -W -a
2020-03-20 15:20:51 -05:00
David Young
52f8d8a1b1 Deduplicate create_zoo() and validate_zoo() and refactor for reuse by
VFD SWMR tests.

This change reduces the length of genall5.c by 171 lines.
2020-03-20 15:18:19 -05:00
David Young
a4a2dd2cc0 Add a log outlet for pagebuffer I/O and subordinate outlets for
pagebuffer reads and writes: pbio, pbrd, pbwr.  In H5PB_read() and
H5PB_write(), log only global heap accesses, for now.
2020-03-20 14:56:23 -05:00
David Young
b6b43e6dc4 Protect against an assertion during H5Fflush(): do not doubly-increment
the tick number in H5F_vfd_swmr_close_or_flush() when just flushing,
because that made the assertion in H5PB_vfd_swmr__set_tick(), that the
tick number had not increased by more than one, fail.
2020-03-20 14:26:14 -05:00
David Young
cca9617742 Use more iterations on the variable-length string reader & writer to
lower the possibility of a false test failure.
2020-03-17 17:14:08 -05:00
David Young
f7b44e40c5 In H5PB__write_meta(), extend a single-page entry when overwriting it
with multiple pages.  Update statistics to maintain consistency.

Refactor a bit: in H5PB__write_meta(), move code that's in both the if-
and else- branch to either before the if-else or after and de-duplicate.

In H5PB_vfd_swmr__update_index(), always update the length of a
shadow-index entry to the current size of its corresponding page-table
entry.

In H5PB_vfd_swmr__update_index(), disregard shadow-index entries that
await garbage collection.
2020-03-17 17:13:50 -05:00
David Young
5d94976423 Join some lines. NFCI. 2020-03-17 14:16:15 -05:00
David Young
705f52d222 Test H5Dread() for the right "success" conditions. I'm not sure how
this even appeared to work, before.
2020-03-16 17:20:43 -05:00
David Young
3d51febb37 Fix spelling, alread -> already. NFCI. 2020-03-13 14:17:39 -05:00
David Young
ae351c2376 Add tests for the two expected failure modes for variable-length (VL) strings
in VFD SWMR mode.
2020-03-13 14:16:40 -05:00
David Young
9e81f0103c Add disable_estack() and restore_estack() for disabling the current error-stack
handling and restoring the previous error-stack handling.
2020-03-12 12:27:57 -05:00
David Young
9592b80913 Mention the problems VFD SWMR has with variable-length data. 2020-03-11 14:24:59 -05:00
David Young
8cc8d63d5e Update Guide. Switch to a short and informative function name. 2020-03-11 12:50:18 -05:00
David Young
4e4c1c3850 Add my work in progress on variable-length string test for VFD SWMR. 2020-03-10 17:48:32 -05:00
David Young
ecea500047 Start a user's guide. Mention problems with variable-length data. 2020-03-10 17:21:40 -05:00
David Young
3f2e3659c2 Stop changing the type of global-heap storage to raw data before accessing the
page buffer.  Now variable-length (VL) data such as VL strings work with VFD
SWMR.  This change also makes the library more consistent in its treatment of
global-heap storage, since it's always been allocated as metadata, not raw
data.
2020-03-09 14:06:10 -05:00
David Young
1818420acd In await_signal(), print a less alarming message when exiting in normal
circumstances.

Write a comment that tells why await_signal() periodically calls the HDF5 API.
2020-03-09 13:47:26 -05:00
David Young
d0e6a1bbc6 Don't assert that an H5FD_mem_t read/written through the page buffer is not
H5FD_MEM_GHEAP, that's an out-of-date assumption.
2020-03-06 16:03:33 -06:00
David Young
ba9dd7e926 Instead of duplicating H5F_shared_block_write() and _read() wholesale in
H5F_block_write() and _read(), make the latter functions call the former.
2020-03-06 12:43:54 -06:00
David Young
20e59d90e9 Break metadata reads and writes into up to three pieces, the non-page-aligned
piece in the beginning, 1 or more full pages, and whatever is leftover at the
end.  Passes all of our tests.
2020-03-03 18:08:03 -06: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
0a662ea448 No, Robb Matzke did *not* write this file. Get to the point in a
copy-and-pasted comment.
2020-02-28 16:39:25 -06:00
David Young
b233408fe8 Move the swmr log-outlet declaration to H5FDvfd_swmr_private.h and use swmr
as the parent outlet of a new outlet for messages about the motion of the
shadow index.
2020-02-28 16:36:55 -06:00
David Young
ac4afca0c2 Shave 44 lines off of H5PB_read() by gathering a bunch of checks into one if
condition, reducing diagnostic checks, single-spacing, etc.
2020-02-27 13:13:46 -06:00
David Young
42e6eba1e1 Don't re-test a condition that's assert()'d at function entry and
couldn't change in the mean time, but do be paranoid and re-assert.
2020-02-26 16:34:18 -06:00
David Young
56a9459eb5 On the reader, zero the shadow-index entries before filling fields from the
shadow file so that members like `garbage` are not filled with garbage that
fools us, later.
2020-02-26 16:31:50 -06:00
David Young
8b2ba616eb Update some comments. 2020-02-26 16:29:13 -06:00
David Young
4b70e13e14 Where n is the number of page-table/shadow-index entries, avoid spending O(n^2)
time in H5PB_dest().  While we're in H5PB_dest(), mark deleted shadow-index
entries as "garbage" and skip the O(n) shadow index-entries copy.

Rename shadow index-entry member `moved_to_hdf5_file` to `moved_to_lower_file`
while I'm in here---NFCI.
2020-02-26 16:24:42 -06:00
David Young
d859bc4ba7 Pass the right parameter, H5F_shared_t * not H5F_t *. (Grr, serious warnings
not treated as errors....)
2020-02-26 14:48:44 -06:00
David Young
9d5bb32b83 Add log outlets h5mf and h5mf_defer and write some diagnostic
messages to them.

Move and update a comment about removing (all) items from the deferred queue
before processing them.

Bug fix: don't leak file space, add back to the deferred queue all items that
were not disposed of.
2020-02-24 11:25:36 -06:00
David Young
9a29c2212b Move all frequently-read fields---ls_resolved, ls_state, ls_parent---to the top
of hlog_outlet_t so that they're likely to be in the same cacheline.
2020-02-24 11:07:47 -06:00
David Young
bdc6d8ffcd For bool, true, and false, #include <stdbool.h>. 2020-02-24 11:07:19 -06:00
David Young
ce35b2f35f Change a couple more occurrences of "sink" to "outlet." 2020-02-24 11:05:10 -06:00
David Young
1a4097e55c Don't use the __ prefix for attributes __unused and such, since that's reserved
for the system software, IIUC, and it clashes with a symbol on CentOS.
Instead, use a _ prefix.
2020-02-24 11:03:26 -06:00
David Young
48ca10f80e Improve some comments: fix typos, shorten. 2020-02-19 16:46:42 -06:00
David Young
ac1912b361 Add a log outlet for shadow-index enlargement and use it instead of
mysteriously printing "ding ding!" when the shadow index is enlarged.

While I'm here, place the new index into place regardless of whether we succeed
at the deferred free of the old index's shadow-file space.
2020-02-18 13:01:21 -06:00
David Young
323e8f8d8b Delete an out-of-date comment. 2020-02-18 13:00:00 -06:00
David Young
d19456dae2 In process_deferred_frees(), remove *all* deferred frees from the
H5F_shared_t's queue before processing any, instead of removing just one,
processing it, removing another, processing it, and so on.  While we processed
the first entry on the queue, we often called H5MF_xfree() again, which called
process_deferred_frees() again, which processed the first entry, calling
H5MF_xfree() again, and on and on, until the deferred frees list was exhausted.
This deep recursion showed up as a wide, tall stack in my flame graphs.  Taking
all deferred entries off of the queue to start definitely breaks the recursion
and saves processing time.
2020-02-18 12:43:37 -06:00
David Young
e43895e3b4 Don't perform superfluous casts. 2020-02-18 11:50:15 -06:00
David Young
a162fbbaaa Trim excess detail. Use shadow/lower file terminology. Be less wordy about
"page or multi-page entry."
2020-02-18 09:59:10 -06:00
David Young
dfd3f782ca Share latest changes: change many occurrences of "metadata" file/index/header
to "shadow" file/index/header.  Simplify the description of freespace
management.  Finish describing the floating shadow index.
2020-02-12 16:25:22 -06:00
David Young
848219ccb8 Share my latest RFC changes. 2020-02-12 13:29:32 -06:00
David Young
f99bbd565a Let us provide a default state to HLOG_OUTLET_MEDIUM_DEFN(). 2020-02-12 13:28:33 -06:00
David Young
f75430585b Add a new log outlet for individual deferred shadow frees and use it.
Rename a variable that tells whether or not we started with an empty
deferred-free list, and take care not to set it excessively.
2020-02-12 13:28:33 -06:00
David Young
ec6919449b Delete misleading "Programmer:" field and excessive decoration from the
H5FD_vfd_swmr_write() comment header.  Delete a superfluous comment.  Delete
some whitespace at EOL.  NFCI.
2020-02-12 13:28:33 -06:00
David Young
2b7347d577 Record the state of a log outlet on first use and reuse that state on
subsequent hlog_fast() calls.

While I'm here, add a typedef, hlog_outlet_t, for struct hlog_outlet, and use
it.
2020-02-12 13:28:33 -06:00
David Young
a3e6c35b2d Whitespace repair. NFCI. 2020-02-12 13:28:33 -06:00
David Young
41a8036511 Make a typedef for enum hlog_outlet_state, hlog_outlet_state_t, and use it.
NFCI.
2020-02-12 13:28:33 -06:00
David Young
47438c741a Don't declare a bunch of undefined log outlets. 2020-02-12 13:28:33 -06:00
David Young
2069224d0d Share my latest changes to the RFC. 2020-02-11 13:43:58 -06:00
David Young
89247be681 Add latest commentary on RFC. 2020-02-11 13:43:58 -06:00
David Young
4f452ea359 Call them log "outlets" not log "sinks". 2020-02-10 14:25:27 -06:00
David Young
0d94627836 Rename loglib_ / LOGLIB_ to hlog_ / HLOG_, remove the syslog-based
implementation, rename hlog_log() to hlog(), hlog_vlog() to vhlog(), et cetera.
Rename hlog_lazy() to hlog_fast().

Define some log sinks and use them in the page buffer and in VFD SWMR.
2020-02-10 13:48:35 -06:00
David Young
6500ad88a8 Rename log.c to hlog.c, add hlog.[ch] to MANIFEST. 2020-02-07 16:45:07 -06:00
David Young
76892a3ff9 Add my logging library in existing form. Abbreviate copyright notices in the
sources but put the full notices & license terms in COPYING.
2020-02-06 17:30:05 -06:00
David Young
251d62c5dd Update punch list a bit: mention the over-long postponement of shadow-index
reclamation.  Mention that a writer can delete an object out from under a
reader who holds an hid_t for it.
2020-02-06 16:06:13 -06:00
David Young
ba9dd0b871 Escape some underscores. I'm not sure if this is strictly necessary, but vim's
syntax highlighting colors some (but not all) unescaped underscores red like
there is some problem.  It's possible there is some problem, since underscores
are used to indicate some kind of emphasis---probably underlining.
2020-02-06 16:04:47 -06:00
David Young
8526d61cf4 In a comment, mention that reclamation of shadow indices is postponed for
longer than it needs to be.  NFCI.
2020-02-06 16:03:25 -06:00
David Young
0a544ce307 Extract a routine from shadow_image_defer_free(), shadow_range_defer_free(),
that works in byte offsets rather than page offsets.  Use
shadow_range_defer_free() to defer shadow-index frees.
2020-02-06 14:57:33 -06:00
David Young
5eba819f39 Avoid going back and forth between signed and unsigned in the same expression
with some casts and an unsigned constant.  This quiets GCC warnings, especially
-Wconversion, IIRC.
2020-02-06 14:22:18 -06:00
David Young
34267d8631 Fix a typo in a comment and delete whitespace at EOL. 2020-02-06 14:21:30 -06:00
David Young
afa09c80bd Use an early exit to lower a staircase. 2020-02-06 14:14:34 -06:00
David Young
b972248b73 Reduce code duplication by using vfd_swmr_pageno_to_mdf_idx_entry() to look up
shadow pages.  Reduce casts by choosing correct format strings and compatible
variable types.

Poison writes to addr by making it const.  Don't increase addr in the read(2)
loop because it's never used afterward.

Delete some more dead code.

Rename read_ptr as p and declare it much closer to its use.  Change its type to
`char *` so that no casts are necessary to increase it.
2020-02-06 14:14:34 -06:00
David Young
fcd9e78f8c Delete unused code. 2020-02-06 14:14:34 -06:00
David Young
eaeede0120 Delete the hdf5_page_offset member of shadow_defree_t, it is initialized but
never read.
2020-02-06 14:14:34 -06:00
David Young
4ffc6839e1 Fix a typo in a diagnostic printf and, while I'm here, use the right format
strings.
2020-02-06 14:14:34 -06:00
David Young
bc27f0d1ce Use proper format string. 2020-02-06 14:14:34 -06:00
David Young
9a8ba2a7d3 Make H5FD_vfd_swmr_dump_status() take an unsigned page number to be consistent
with other code.
2020-02-06 14:14:34 -06:00
David Young
456f5c6ee6 Quiet some warnings about jumping over variable initialization,
an improper format string, etc.  NFCI.
2020-02-06 14:14:34 -06:00
David Young
70515b290f Rename the deferred-free queues. There are two of them, and the names I used
for them did not help me keep track of what they were for.

For brevity, I will call a deferred free record a "defree" in the code.

The deferred_free_queue_t becomes a lower_defree_queue_t, and each record on
the queue becomes a lower_defree_t.  A lower_defree_t tracks one deferred free
on the lower VFD---that is, the one under the SWMR VFD.

The old_image_queue_t becomes a shadow_defree_queue_t, and a record therein is
a shadow_defree_t.  A shadow_defree_t tracks one deferred free on the shadow
file.
2020-02-06 14:14:34 -06:00
David Young
3c4a34951e Move the bsdqueue.h #inclusion up with the other #inclusions. 2020-02-06 14:14:34 -06:00
Mike Folk
fbcbf76907 Update VFD_SWMR_Punch_List.md 2020-02-06 13:37:07 -06:00
Mike Folk
ae61a8e826 Update VFD_SWMR_Punch_List.md 2020-02-04 15:25:06 -06:00
David Young
3c65919776 NFCI: exit(EXIT_FAILURE) instead of exit(1) for portability.
Delete a comment on a closing curly brace.
2020-02-03 15:05:58 -06:00
David Young
036dd539d3 It's not necessary to assert(p != NULL) if you're dereferencing p in the next
assertion.
2020-02-03 15:04:52 -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
64f1ef1fda Make the first argument to H5PB_vfd_swmr__update_index() and H5F_t instead of
an H5F_shared_t because the new routine that will relocate the index (which
will be in a future commit) has to pass an H5F_t to the filespace allocator.
2020-02-03 13:16:05 -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
57fe4a52a2 Consolidate shadow-file allocation code in H5MV.c. 2020-01-30 17:27:59 -06:00
David Young
590c51b68c Remove some dead code and out-of-date comments. 2020-01-30 17:22:01 -06:00
David Young
2e15f48d78 Repair indentation and delete some superfluous comments. NFCI. 2020-01-30 10:48:36 -06:00
David Young
b7f5776c53 Fix typo. NFCI. 2020-01-30 10:25:46 -06:00
David Young
cb66576c7a Use fewer gratuitous casts. Use struct assignment instead of member-by-member
assignment to copy `struct timespec`.  NFCI.
2020-01-28 10:57:57 -06:00
David Young
b34e6d2f45 Add some missing spaces. 2020-01-27 13:41:42 -06:00
David Young
59e7b10a7e Fix spelling. NFCI. 2020-01-27 13:27:01 -06:00
David Young
0fbd8654f7 Prepare the VFD SWMR reader for a "floating" shadow index by overhauling
the way that the shadow header and shadow index are loaded.

In H5FD__vfd_swmr_load_hdr_and_idx(), adopt a new protocol for reading
the shadow file:

0 If the maximum number of retries have been attempted, then exit
  with an error.

1 Try to read the shadow file *header*.  If successful, continue to 2.

  If there is a hard failure, then return an error.  If there is a failure
  that may be transient, then sleep and retry at 0.

2 If the tick number in the header is less than the tick last read by the VFD,
  then return an error.

3 If the tick number in the header is equal to the last tick read by the
  VFD, then exit without doing anything.

4 Try to read the shadow file *index*.  If successful, continue to 5.

  If there is a hard failure, then return an error.  If there is a failure
  that may be transient, then sleep and retry at 0.

5 If a different tick number was read from the index than from the index,
  then continue at 0.

6 Try to *re-read* the shadow file *header*.  If successful, continue to 7.

  If there is a hard failure, then return an error.  If there is a failure
  that may be transient, then sleep and retry at 0.

7 Compare the header that was read previously with the new header.  If
  the new header is different than the old, then we may not have read
  the index at the right shadow-file offset, or the index may have been
  read in an inconsistent state, so sleep and retry at 0.  Otherwise,
  return success.

Simplify H5FD__vfd_swmr_header_deserialize() and
H5FD__vfd_swmr_index_deserialize().  Remove their retry loops.  Make
each return TRUE on success, FALSE on an error that may be transient,
and FAIL on an irrecoverable error.

In H5FD__vfd_swmr_header_deserialize(), do not check the size of the
shadow file with fstat(2), since the read(2) will fail if the file is
too small.  This saves us a system call.

Lightly consti-ify H5FD__vfd_swmr_index_deserialize() arguments.

In H5FD__vfd_swmr_load_hdr_and_idx():

    Consolidate all of the retry-looping.  Increase the initial
    retry delay from 1ns to 1/10s.  Delete the disused maximum-retry
    constants.

    Use #if 0 to disable some error-checking code that ought to be
    unnecessary under the new protocol.

    Don't memset() the header and index header, but make sure
    they're fully initialized with real content, instead.
2020-01-24 14:49:09 -06:00
David Young
33ea1d2b06 Add my newest commentary. Finally reached page 14! 2020-01-17 17:25:38 -06:00
David Young
2754bb2b76 Change md_pages_reserved and pb_expansion_threshold parameters to uint32_t from
int32_t.
2020-01-16 16:51:08 -06:00
David Young
fe7965d38f Don't use the bash-ism [[ ]]. Use the [ ], which is standard and
perfectly adequate in this case.
2020-01-13 11:22:34 -06:00
David Young
16ca8f2c95 Prepare a bit to let the shadow index "float": drastically
simplify H5FD__vfd_swmr_index_deserialize(): reuse
h5_retry_init()/h5_retry_next() for retry loops.

Don't wait for the fstat(2) to read the correct size, because the
read(2) will return short if the file isn't long enough.  (This change
should save at least one system call, always.)

Leave a bunch of comments about the changes that I will have to make so
that the shadow index will float.

NFCI: do not cast H5MM_malloc() return values, this is not C++.
2020-01-10 14:52:19 -06:00
David Young
5fb463bb2e Now that we're buffering the removed pages to process at once,
it's not necessary to iterate over pass numbers any more,
so just use two loops.

While I'm in here, change a comment or formatting here and there.
2020-01-10 14:41:12 -06:00
David Young
7a0a2a0b5d H5F_vfd_swmr_reader_end_of_tick(),
compares both new and old shadow indices and calls H5PB_remove_entry()
on each entry that was in the old index but is not in the new.

Ever since H5PB_remove_entry() started removing shadow index
entries, it has been possible for H5F_vfd_swmr_reader_end_of_tick()
to walk past the end of the new shadow index or even to skip entries
in the new index.  Sometimes an assertion failed when that happened.

I have restructured the code in H5F_vfd_swmr_reader_end_of_tick()
so that it compares the old and new indices, gathering a list of
removed pages, in one step.  In the next step, it processes the
list of removed pages, calling H5PB_remove_entry() on each page.
In the step after that, it notifies the metadata cache of each
removed page.  This fixes the bug I described, above.
2020-01-10 14:22:06 -06:00
David Young
cdbdc33c5a Simplify nested logic in H5FD_vfd_swmr_get_tick_and_idx().
assert() our expectation that either a NULL index was passed, or a
pointer to the index length was passed in, too.
2020-01-10 12:00:22 -06:00
David Young
671f7552ab Correct some irregular indentation, delete an unused line, split an
`if ((p = allocate(...)) == NULL) { }` into two statements, `p =
allocate(...); if (p == NULL) { }`, put a semicolon at the end of an
HGOTO_ERROR(), remove comments /* end if */, /* end for */ after closing
curly braces.
2020-01-10 12:00:22 -06:00
David Young
f19b6c4d48 Make H5FD__vfd_swmr_load_hdr_and_idx() simpler and faster: copy a
pointer to the metadata index instead of copying the index itself.  Use
struct assignment instead of copying individual struct members.  Lower a
staircase.
2020-01-10 12:00:22 -06:00
David Young
c4e19fa84b After quick-sorting the index, go ahead and assert that there are not
duplicate entries for the same HDF5 page offset.  There's an O(n) cost
to that, but it should be no more than the O(n log n) cost of the
quicksort.
2020-01-10 12:00:22 -06:00
David Young
d288a7b93c In H5F__vfd_swmr_writer__create_index(), use calloc(3) instead of
malloc(3) and a for-loop that zeroes the index.
2020-01-10 12:00:22 -06:00
David Young
8d2217d295 In H5PB_remove_entry(), do not call vfd_swmr_mdf_idx_entry_remove(),
because the H5PB__evict_entry() call should have already done that.
Instead, just assert() that the index entry is not present.
2020-01-10 12:00:22 -06:00
David Young
790eccbc20 In vfd_swmr_mdf_idx_entry_remove(), give some local variables less wordy
names.  While I am here, do not copy the last element of the index over
the element that's being deleted, because in the very next step I'm
shifting all elements over by one.
2020-01-10 12:00:22 -06:00
David Young
f4d8894158 Straggler from previous: provide uint64_decode(). 2020-01-10 12:00:22 -06:00
David Young
3fd9dc7b83 Clean up the code a bit: remove some unnecessary casts and such. NFCI. 2020-01-10 12:00:22 -06:00
David Young
3a911e2b39 Change the blah_blah_blah_md_header index_length member from
`uint64_t` to `size_t` because it describes the size of an in-core
structure as well as an on-disk one, and `size_t` is wide enough
to store the size of any in-core structure, while `uint64_t` may
be much too wide.  Check that `index_length` is no more than SIZE_MAX
after we read it.
2020-01-10 12:00:22 -06:00
David Young
1df69ed3a0 Delete unused constants. 2020-01-10 12:00:22 -06:00
David Young
5ae8d135a5 Be brief, replace (H5FS_section_info_t *)node with &node->sect_info. 2020-01-10 12:00:22 -06:00
David Young
f8c5797bd6 Provide a convenience constant, H5_RETRY_ONE_SECOND. 2020-01-10 12:00:22 -06:00
David Young
62e1340bdd Disable C++ compatibility warnings to follow develop on the main fork. 2020-01-10 12:00:22 -06:00
David Young
c09a9e90e1 Update punchlist a bit with John: add some items, update entries that are now
complete.
2020-01-09 11:41:02 -06:00
David Young
0b11cfbf50 Add a new version of the RFC with some commentary by me. 2020-01-08 17:27:43 -06:00
David Young
0ec3340692 Makes some updates: in-progress, needs unit testing. Insert some whitespace
where it makes things more readable.
2020-01-06 15:48:34 -06:00
David Young
12ea13f745 Mention the current situation concerning raw-data flushing. 2019-12-31 09:58:19 -06:00
David Young
68b012f017 Mention that I fixed the VFD SWMR tests. 2019-12-30 16:59:15 -06:00
David Young
0b5dfad751 Don't cast a malloc(3), this is C. Put curly braces around a multiline if
statement.  Delete an unnecessary backslash line continuation.  NFCI.
2019-12-20 09:53:29 -06:00
David Young
e024b2737c Assert that a shadow image is page-aligned since we assume that it is when we
compute its base address and free it.
2019-12-20 09:52:09 -06:00
David Young
37fb4bda71 Delete unnecessary whitespace including invisible whitespace at the end of
lines.  Wrap a couple of lines.  NFCI.
2019-12-20 09:50:53 -06:00
David Young
07e6f39f4b Change the unwieldy name vfd_swmr_idx_entry_defer_free() to
shadow_image_defer_free(), which is also a better description of what the
routine does.
2019-12-19 14:14:13 -06:00
David Young
dc15a6987e Use the "tail queue" from queue(3) for the delayed free list of shadow images.
Delete the little-used free-list length, dl_len, and just count up the list
entries when diagnostic code needs the length.

Extract the code for deferring shadow-image free into a new subroutine,
`vfd_swmr_idx_entry_defer_free()`.

Rename type `deferred_free_head_t` as `deferred_free_queue_t`.

Remove the disused H5F__LL_{REMOVE,PREPEND} macros.

Add some diagnostic code and #if 0'd assertions.

Change `qsort(ptr, n, sizeof(type), cmp)` to
`qsort(ptr, n, sizeof(*ptr), cmp)`.

Use a `continue` statement to lower a staircase in
H5F_update_vfd_swmr_metadata_file().

Add vfd_swmr_mdf_idx_entry_remove() to delete a shadow index entry and add the
image at that entry to a deferred-free list.  Call it whenever a page is
evicted.

Update the comment in H5PB_remove_entry() that asks if we need to remove shadow
index entries: now we *do* remove them.  Remove shadow index entries in
H5PB__evict_entry().  Also mention in the comment that the index-entry removal
performed by H5PB__evict_entry() ought to be sufficient.
2019-12-19 13:43:54 -06:00
David Young
10a7a47415 Remove unnecessary casts. Use the ptr = calloc(n, sizeof(*ptr)) idiom for
specifying the item size to be allocated.  NFCI.
2019-12-19 11:21:57 -06:00
David Young
13386f3c91 Prepare for some changes I'm committing shortly: pass an H5F_shared_t * as
the first argument to H5PB__evict_entry() instead of an `H5PB_t *`.
2019-12-19 11:08:33 -06:00
David Young
9a66eb1377 Make the first parameter of H5PB_remove_entry() non-const to support some
changes I will commit shortly.
2019-12-19 11:03:22 -06:00
David Young
10353ef87d There's no need to name parameters in a function declaration, and it makes them
very long, so just delete the parameters.
2019-12-18 15:53:34 -06:00
David Young
f0a01e6915 Allocate regionsin the shadow file of page size or greater size with page
alignment.  The VFD SWMR code had always assumed that the regions were aligned
to page size.  It would blithely round the start addresses of regions to the
next lower page.  When the region was freed, the freespace manager (H5MV) would
suffer an assertion or corruption.
2019-12-18 15:50:29 -06:00
David Young
3455c4031e Tell the tick number in diagnostic messages. 2019-12-18 15:38:09 -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
2c0dddf263 Follow the naming convention enforced by FUNC_ENTER_/FUNC_EXIT_* macros (?)
where static routines have to have double underscores (__) in their name or
else the library asserts false.
2019-12-18 15:09:13 -06:00
David Young
2d4e4e217c Delete a macro that's not used. 2019-12-13 10:34:03 -06:00
David Young
17d6de5396 Remove disused duplicate of H5F__idx_entry_cmp(). I probably introduced that
by accident when I merged Vailin's changes that moved some functions from one
file to another.
2019-12-13 10:25:25 -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
5d163c8d78 Fix some typos. NFCI. 2019-12-13 10:22:19 -06:00
David Young
8f62e5dafb Wrap some comments at <= 80 characters. 2019-12-10 10:56:04 -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
38902de493 Fix typo. NFCI. 2019-12-09 18:05:04 -06:00
David Young
305a64f674 Remove disused #ifdef QAK code. 2019-12-09 15:47:08 -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
adcf8a315e Fix the FSM bug when setting the FSM threshold to a non-default value.
Check for smaller or larger section size after merging and shrinking a section,
for this case is the section that is smaller than threshold (see H5MF_xfree() in H5MF.c).
It is possible for the section to be smaller after merging/shrinking (see H5MF__sect_large_shrink()
in H5MFsection.c).
2019-12-02 11:07:25 -06:00
David Young
4d50f9a7a8 Update status of the expand/shrink test. 2019-11-25 11:01:42 -06:00
David Young
0f9678b415 Mention the Markdown cheat sheet and tutorial, per John's request. 2019-11-22 15:36:56 -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
David Young
d3055b85b9 Add my name to some entries. 2019-11-19 17:16:06 -06:00
David Young
65c38da1f0 Mention the items that Vailin is working on. 2019-11-19 16:35:02 -06:00
David Young
7579e10abb Use bold to highlight items status. 2019-11-19 15:53:57 -06:00
David Young
898871545d Add some notes about what's done and what I'm working on. 2019-11-19 15:52:38 -06:00
David Young
d84343004e Add URL for the punch list. 2019-11-19 14:14:17 -06:00
David Young
c905d7105a Remove the last (?) vestige of gettimeofday alternate implementation of
VFD SWMR.
2019-11-19 14:12:29 -06:00
vchoi
e847ec43ac Fix for punch list #9 Move VFD SWMR H5F code to its own file: H5Fvfd_swmr.c. 2019-11-15 14:17:02 -06:00
Vailin Choi
350a786486 Fix for punch list #13 item #1: Odd behavior in the superblock refresh routine.
The test "driver_addr != sblock->driver_addr" is failing for superblock version 2 & 3.
Fix: there is no driver_addr in superblock version 2 & 3.
It should decode the root group object header address (root_addr) and verify accordingly.
2019-11-14 15:15:37 -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
David Young
f2bb4e3dbc Good-bye md_open_tries. 2019-11-14 11:11:15 -06:00
David Young
492d8b8b2a Add the latest version of the RFC. 2019-11-13 15:04:46 -06:00
dyoung
d017ff1850 Put the Markdown punch list on the right branch. 2019-11-13 12:17:20 -06:00
David Young
0ea6e75d9f VFD SWMR sparse readers failed to open the .h5 file because the sparse writer
had finished its work and closed the .h5 file, thus removing the shadow file.
Make the sparse writer wait to close the .h5 file for a signal from
testvfdswmr.sh.  In testvfdswmr.sh, send the signal when the readers have all
finished.
2019-10-23 10:47:14 -05:00
David Young
e84a416ad8 Expect the h5ls usage message to mention --poll twice. 2019-10-21 17:08:25 -05:00
David Young
7e4d20453e First, reduce code duplication in h5tools_fopen(). Then, stop h5tools_fopen()
from using the SWMR VFD unless the h5tools_fopen() arguments specifically
choose that VFD.
2019-10-21 16:17:10 -05:00
David Young
6f1469fce4 Fix some tools: try all other VFDs before SWMR. 2019-10-18 15:58:02 -05:00
David Young
63df4fae56 Delay for no more than 1/100 second between any retry in H5C_load_entry().
This lets test/testflushrefresh.sh pass again.  It was timing out while it
waited for expected failures to occur because the retry loop ran for way too
long.
2019-10-18 14:54:06 -05:00
David Young
e100cbdd3c Ntheever skip a read (skip_read is always false). This lets my demos work and
it does not seem to affect either my unit tests or testvfdswmr.sh.
2019-10-18 14:52:59 -05:00
David Young
90a602634e I've changed test/dsets so that every time it needs to visit all
cells in a matrix in an arbitrary order, first it chooses a random
starting `offset` in [0, rows * columns - 1].  Then it chooses a
random `increment` that's relatively prime to `rows * columns`.
Then it visits every cell in `rows * columns` steps:

        for (i = 0; i < rows * columns; i++) {
                visit(cell[offset / columns][offset % columns]);
                offset = (increment + offset) % (rows * columns);
        }

By moving the HDrandom() calls outside of the main loop and visiting
each cell only once, this probably speeds things up quite a bit.  It's
also more resilient to a crummy random sequence.  The new code visits
cells in an order that's probably arbitrary enough for testing purposes.
2019-10-17 16:36:17 -05:00
David Young
fcd490a0bc Use PRIuHADDR. 2019-10-17 13:17:06 -05:00
David Young
8efc3d9757 Move a disused variable inside of the #if 0 region that needs it. 2019-10-17 13:15:54 -05:00
David Young
0850f06862 Repair comments. 2019-10-17 13:14:38 -05:00
David Young
2dd9c3b92f The err_compat test relied on some "lines" on the standard output stream
to end with whitespace padding rather than newlines.  My introduction of
variadic TESTING() got rid of the padding.  I have straightened this out
by newline-terminating the stdout lines in the test program and in its
expected out.  I also add some newlines to the program's standard error
output so that the expected error output still matches.
2019-10-08 16:17:42 -05:00
David Young
c2b841f513 Add NetBSD and Berkeley licenses for struct timespec helper macros. 2019-10-07 17:36:30 -05:00
David Young
730b2fbcb2 Provide the BSD struct timespec arithmetic macro, timespecsub(). 2019-10-07 12:15:40 -05:00
David Young
19304abb51 Fix an off-by-one error in the retries API that made the test "protect
an entry to verify retries" in `test/cache` fail.
2019-10-07 11:50:20 -05:00
David Young
743c9358d1 Introduce PRI*HADDR and PRI*HSIZE for printing haddr_t and hsize_t. 2019-10-03 17:34:05 -05:00
David Young
82f647534c Make some NetBSD compatibility patches. 2019-10-03 17:30:46 -05:00
David Young
09bb031cf1 Refactor a bit, remove dead code, move some helper functions to the top
of the file, remove unused variables.
2019-10-02 17:27:24 -05:00
David Young
4311b2ef9d Fix some comments where "read" was written instead of "write." NFCI. 2019-10-02 16:01:27 -05:00
David Young
b1b98cfafe F ix off-by-one bug affecting metadata-read retries: retries == tries - 1. 2019-10-02 15:48:50 -05:00
David Young
5025be74ea Use int64_t instead of uint64_t to avoid some warnings about sign
conversion.
2019-09-30 14:48:57 -05:00
David Young
20dd9b1372 Initialize data and odata to NULL like the exit sequences
expect.  Free `odata`.
2019-09-30 14:28:13 -05:00
David Young
38f3ece57a Add a test for single-page metadata (SPMDE) writes. Mention in a
comment to myself that I need to reduce code duplication with the MPMDE
test.

In vfd_read_each_equals(), print the correct expected value when there
is a discrepancy.

No functional change intended: correct a comment in
vfd_read_each_equals.  Fix indentation in the test_raw_data_handling()
header comment.
2019-09-30 14:07:15 -05:00
David Young
de33d5cb3c Rename the metadata test again to reflect how it's checking the page
buffer's treatment of multipage metadata entries (MPMDEs).  Mention why
an H5PB_flush() is not necessary for MPMDEs to reach visibility at the
VFD layer.
2019-09-27 13:34:17 -05:00
David Young
f0596cea65 Don't use FILENAME and FILENAME[0] because that looks like worrisome
macro magic.  Use namebases and namebase, instead.

Extract a bunch of copy-and-paste VFD SWMR setup into a new subroutine,
swmr_fapl_augment().

Make sure that the metadata reads all-0s until it reads all -1s.
Extract a subroutine, vfd_read_each_equals(), that reads and compares a
region with one of its arguments.

Rename from test_basic_metadata_handling() to
test_metadata_delay_basic(), since that gets at what we're testing
better.

Don't perform an H5PB_flush(), it's not necessary for this test because
H5Fvfd_swmr_end_tick() has done essentially the same thing.
2019-09-27 13:09:07 -05:00
David Young
078db93752 Fix a typo: adress -> address. 2019-09-27 12:50:48 -05:00
David Young
8b38c2ab1b Skip the metadata accumulator and always perform I/O through the VFD, so
that writes are not delayed.

In H5PB__flush_entry, simplify by eliminating a temporary variable and a
constant.
2019-09-26 17:06:51 -05:00
David Young
b5b9a8907e If a page entry is delayed *until* tick t, and tick t has arrived,
it is eligible to flush *now*, so do that.  Don't wait until tick `t +
1`.
2019-09-26 17:00:05 -05:00
David Young
a6b9394e8c Fix a comment: I don't know what *pbe_ptr was. Refer to page, since
that seems to be the intention.  No functional change intended.
2019-09-26 16:58:38 -05:00
David Young
1b63ff60d2 Rename local variable delay_write_until as until. Reduce
parenthesization in an `if` condition.  Join some lines.  No functional
change intended.
2019-09-26 16:57:22 -05:00
David Young
2fd118ceaf Initialize VFD SWMR configuration block to zeroes. I was hopeful that
this would fix a bug, but I don't think it had any effect.  Still, a
necessary change.
2019-09-26 16:52:41 -05:00
David Young
a68c2c92c3 Oops, straggler from last: rename the nanosecond constants. While I am
here, delete dead code.
2019-09-26 16:49:45 -05:00
David Young
e4f9e45399 SECOND_TO_NANOSECS is the name of a function, not a constant. Rename to
nanosecs_per_second.  Ditto for the tenth-second constant.
2019-09-26 16:48:13 -05:00
David Young
35c049d6a4 Write test data from a different buffer than we read into, since I
anticipate comparing the written buffer with the read buffer.

Don't initialize variables prematurely so that the compiler has a chance
to warn about variables read before they are written.

Repeatedly flush the page buffer, once each time we end the tick.

Write errors to stdout instead of stderr.
2019-09-26 16:43:01 -05:00
David Young
bddf3ff6a5 In H5PB_flush(), skip a page-buffer entry if its write is delayed. 2019-09-26 16:37:15 -05:00
David Young
4d12df1d21 Commit to the clock_gettime() versions of VFD SWMR and delete the
gettimeofday() alternate.  Perform nanoseconds arithmetic using uint64_t
instead of long to avoid unwanted overflows on 32-bit systems like
my i386 (!) development box.
2019-09-25 15:34:16 -05:00
David Young
06806a2765 Add to the page buffer a local printf-like debug function that I can
turn on and off.  Use it here and there.
2019-09-25 11:02:40 -05:00
David Young
bd0c625e38 Clean up excessive casting and parenthesization. No functional change
intended.
2019-09-24 12:18:40 -05:00
David Young
de2edbb238 Add a basic metadata test for VFD SWMR page buffering. Currently the
test fails....

Make some comments more true to reality and fix a couple of typos.
2019-09-23 14:37:53 -05:00
David Young
a8ebf7c541 Tell the compiler that h5_testing() is a printf-like function. 2019-09-23 14:36:13 -05:00
David Young
d4ecff8319 Fix some incorrect format strings. 2019-09-23 14:35:46 -05:00
David Young
0880c57d13 Straggler from last commit: make TESTING() take printf-like varargs
arguments.
2019-09-23 10:34:01 -05:00
David Young
b474650645 Don't calloc() the VFD SWMR configuration, just use a local variable.
Combine the VFD SWMR and non-VFD SWMR raw-data test into one
routine that takes a bool parameter to switch on VFD SMWR.

Update my description of the to-be-written metadata test for VFD SWMR.
2019-09-23 10:30:14 -05:00
David Young
57cfb035ad Delete end-of-block comments, they're uninformative and they make the page
busy.
2019-09-20 14:08:52 -05:00
David Young
89d3461a00 Revise a warning puts() to be more hopeful about VFD SWMR and
multi/split compatibility.
2019-09-20 14:08:52 -05:00
David Young
752fb97ef3 Don't set up raw-data pages for delayed writes. This prevents
an assertion from firing:

"entry_ptr->delay_write_until == 0" failed: file "../../../vchoi_fork/src/H5PB.c", line 4093, function "H5PB__write_raw"

In a comment, mention a change that has to be made to accommodate parallel
mode.
2019-09-19 12:08:55 -05:00
David Young
71499c852b Unse TEST_ERROR instead of the return statement I copied & pasted, oops.
Use a (more) accurate name for the VFD SWMR test routine.
Mention that VFD SWMR isn't expected to work with multi/split VFDs,
yet.
2019-09-19 11:39:13 -05:00
David Young
9cb455ca87 Add the zygote of VFD SWMR-mode page-buffer tests. 2019-09-17 11:26:18 -05:00
David Young
d001d0ec27 Use calloc instead of malloc so that the VFD SWMR configuration
is initialized to default values.
2019-09-17 11:00:10 -05:00
David Young
73e07e2573 Make whitespace consistent: no leading tabs! 2019-09-16 16:57:35 -05:00
David Young
f16d86d3e7 Update function documentation. NFCI. 2019-09-16 16:31:04 -05:00
David Young
2cb57cb926 Enable h5ls to use VFD SWMR. 2019-09-12 14:17:33 -05:00
David Young
1f4dd5692d Use h5_retry_init/_next to retry loading the SWMR shadow file. 2019-09-12 14:16:49 -05:00
David Young
0a81436fab Convert several warnings about const to non-const conversion at H5Tcopy()
invocations to one warning in the H5Tcopy() implementation.
2019-09-12 13:52:38 -05:00
David Young
faf3336f52 Quiet compiler warnings about signedness by changing a signed
integer to an unsigned one.
2019-09-12 13:51:39 -05:00
David Young
93352e65ea Ignore vim swap files and ctags files. 2019-09-12 13:48:52 -05:00
David Young
70152bbd6c Replace a missing curly brace. 2019-09-10 16:38:27 -05:00
David Young
9e2d4344de Merge the latest h5_retry_t code from my sleepy branch. 2019-09-10 15:27:38 -05:00
David Young
508cfab552 Tand the he VFD SWMR test script used | tee to redirect test programs'
output, then it tested $? for an error exit.  $? told the error status of
`tee`, though, not the test programs!  So no test failures were counted, even
when some tests clearly failed.  I changed the test script to use a shell
subroutine, `catch_out_err_and_rc`, to catch test programs' output and result
code.
2019-08-28 13:21:26 -05:00
David Young
e178ab0e11 Consolidate VFD SWMR variable declarations in a new header file,
H5FDvfd_swmr_private.h.

Perform tick processing in FUNC_ENTER_API_NOCLEAR, where it was missing.

Track the number of times the HDF5 library has been entered/exited through its
public API.  Only perform tick processing on the first entry and last exit.
This stops us from performing tick processing in API calls invoked by
application callbacks.  Performing tick processing in nested API calls led to
crashes.

Note well: FUNC_LEAVE_API now performs tick processing even on an error exit!
Previously, it did not.  I'm not sure if the change is ok.
2019-08-28 12:58:08 -05:00
dyoung
1f728439dd In the error message, provide specific information that will help the
developer fix the error.
2019-08-22 14:57:33 -05:00
dyoung
61109c76b2 Quiet warnings, especially signed/unsigned casts. 2019-08-22 14:10:11 -05:00
mainzer
f85986fa9f Merge branch 'feature/vfd_swmr' of https://bitbucket.hdfgroup.org/scm/~vchoi/my_hdf5_fork into feature/vfd_swmr
updated to permit a push.  Should be no changes in VFD SWMR proper.
2019-07-06 18:19:13 -05:00
mainzer
a5b7099215 Tidied up comments and removed some stats code that is un-reachable. 2019-07-06 18:13:36 -05:00
Vailin Choi
311e4ed32d Modifications to the vfd swmr concurrent tests:
(1) Increase the # of records to write (Nrecords) in testvfdswmr.sh.in so as to ensure the writer
will not exit before the reader
(2) Use H5E_BEGIN_TRY/END_TRY when H5Fopen() the test file in reader tests
(3) Add "READER" or "WRITER" to debugging messages
(4) Misc cleanup
2019-01-31 11:47:43 -06:00
mainzer
6feabcb42d Checkin of fixes for a number of bugs in reads to page 0, and in file
open in the VFD SWMR reader case.

Note that the following failures in testvfdswmr.sh:

1) Unable to find metadata file on VFD SWMR reader open.

2) Occasional sanity check failures in the page buffer on raw data write.

3) Filter failures on raw data read in VFD SWMR readers when compression
   is enabled.

4) Unexpected data errors in VFD SWMR readers when compression is
   disabled.

Note that I expect that items 3 & 4 two aspects of the same issues -- the
fact that we don't guarantee that raw data is consistent with metadata.

Item 2) must be addressed, but it is so infrequent that it isn't doesn't
affect the conclusion VFD SWMR seems to work, and thus it can wait until
phase 2.

I am given to understand that Vailin has largely addressed item 1),
and will be checking in her solution to this soon.

Tested on Charis and Jelly.
2019-01-30 15:19:00 -06:00
mainzer
83492f29ed Checkin of fix for the failure to evict all tagged entries issue. 2019-01-16 15:49:54 -06:00
mainzer
5aebfb4f39 Commented out some test code that resulted spurious failures
in un-related tests (i.e. earray, fheap, etc.).

On jelly and charis, vfd_swmr now passes.

testvfdswmr.sh displas the following failures:

1) occasionally ccan't open the metadata file.  This shows
   up more on jelly than charis.

2) occasional complaints about incorrect raw data

3) occasional complaints from Quincey's evict tagged
   entries code that it can't evict all the tagged entries.

4) Numerous filter failures.  At a guess, this is an artifact of
   raw data not making it to file in sync with the metadata.
   I didn't see this on charis, as I don't have compression
   configured.

5) An assertion failure in the page buffer in which a sanity check
    is failing in the code to update the replacement policy.

    This is worrying --- I'll need to look into it on my return.
2019-01-15 23:28:03 -06:00
mainzer
52c5092a63 Merge with Vailin's memory management fixes.
Merge branch 'feature/vfd_swmr' of https://bitbucket.hdfgroup.org/scm/~vchoi/my_hdf5_fork into feature/vfd_swmr
2019-01-15 16:37:41 -06:00
mainzer
b4f607bc13 Intermin commit to allow update from Vailin's recent changes 2019-01-15 16:36:51 -06:00
Vailin Choi
db898db545 Fix for the assertion failure in the free-space manager for the metadata file.
Still need to work on the proper testing for a test in src/H5Ftest.c.
2019-01-06 20:51:50 -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
mainzer
2b613c6c21 Merge branch 'feature/vfd_swmr' of https://bitbucket.hdfgroup.org/scm/~vchoi/my_hdf5_fork into feature/vfd_swmr
resolved conflict in H5PB.c
2018-12-07 16:36:23 -06:00
mainzer
1520b17a34 interim checkin of VFD SWMR writer EOT code.
Added code supporting first cut at the writer end of tick operations.
Tested (to the extent possible) on charis and jelly.
2018-12-07 15:55:55 -06:00
Vailin Choi
49f45640f6 (1) Fix for accumulator issue #1 as described in John's previous checkin
(2) Test files for encoding/decoding property lists
(3) Fix test failures for PB statistics in test/page_buffer.c
    (Will double check with John later about PB statistics collection)
2018-12-02 00:17:15 -06:00
mainzer
8cb185cb08 Merge branch 'feature/vfd_swmr' of https://bitbucket.hdfgroup.org/scm/~vchoi/my_hdf5_fork into feature/vfd_swmr
This merge necessary to access Vailin's latest bug fixes and updates
to the existing SWMR test code.
2018-11-19 02:07:42 -06:00
mainzer
2f2cf050e6 local commit of first cut at vfd swmr writer EOT code.
This is necessary to allow access to Vailin's recent changes

This version passes non-swmr tests in a serial / debug build on charis.
2018-11-19 02:05:37 -06:00
Vailin Choi
ce2748f011 (A) Fixes for the assertion failures described in issue #2 (see John Mainzer's last checkin message):
--src/H5PB.c: checks for size >= page size
--src/H5MF.c: disable/enable page buffering in H5MF_tidy_self_referential_fsm_hack()
--src/H5MFsection.c: call H5PB_remove_entry() for both raw/metadata pages in H5MF__sect_small_merge()
(B) Port and modify existing concurrent swmr tests to VFD SWMR. Also modify the following:
--remove flushes from VFD SWMR writer tests
--set Nreaders to 0 in test/testvfdswmr.sh.in to test for writers only
Please enter the commit message for your changes. Lines starting
2018-11-14 15:35:35 -06:00
mainzer
e62f4bd4fa Initial checkin of page buffer re-implementation to support VFD SWMR.
Tested serial / debug on Charis and Jelly.

Two known issues:

1) New page buffer seems to expose issues in the accumulator code.

   For whatever reason, fheap with the new page buffer exposes corruption
   issues if the page buffer uses H5F__accum_read/write(), but the problems
   go away if the page buffers uses H5FD_read/write() instead.

   Need to either chase this or dis-able page bufffer in combination with
   the accumulator.

2) Encountered a number of assertion failures that are explainable by the
   free space manager code not telling the page buffer to discard pages
   when they are freed.

   Wrote code to handle this -- once the free space manager is modified,
   this code should be removed and the original assertions restored.
2018-11-04 17:54:01 -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
5c7ca8afff Third batch of checkin:
1) Free space manager for the metadata file
2) Delayed free space release linked list
3) H5F_update_vfd_swmr_metadata_file()
3) VFD SWMR driver: read callback
4) Flushing for VFD SWMR
5) Port one concurrent test from swmr test set
6) Bug fixes and refactoring
2018-09-28 11:29:02 -05:00
Vailin Choi
06fa8a9455 Merge branch 'develop' of https://bitbucket.hdfgroup.org/scm/~vchoi/my_hdf5_fork into feature/vfd_swmr
Conflicts:
	src/H5AC.c
	src/H5F.c
	src/H5Pfapl.c
Resolve conflicts for H5AC.c, H5F.c and H5Pfapl.c
2018-09-26 12:45:07 -05:00
Vailin Choi
c8b38985ff Bug fixes for the previous checkin. 2018-09-04 16:53:45 -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
d926ddb1a2 Merge pull request #10 in ~VCHOI/my_hdf5_fork from develop to feature/vfd_swmr
* commit 'c834d9f99d45e5b9752e8525fe8761ea5592bf2c': (41 commits)
  HDFFV-10568 fix hdf5_java library dependency
  Remove another extra path var
  Move muti-config dir setting to root process
  Fix one more intermediate location
  Use different variable
  Cleanup and add intermediate dir for java
  Java must use shared libs to allow dlopen calls
  Correct names
  Call new function
  Correct default API version for develop to 112.
  Fix typo
  HD prefix and whitespace
  Update RELEASE.txt with suggested changes
  Update MANIFEST file for new t_coll_md_read.c file
  Remove now-unused local variable
  Add fix for HDFFV-10501
  Revert testfile FILE change
  change FILE path
  Add testfiles to data copy
  Same changes needed for examples as test
  ...
2018-09-03 22:36:44 -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
Vailin Choi
ce1e816295 Merge pull request #9 in ~VCHOI/my_hdf5_fork from HDFFV/hdf5:develop to feature/vfd_swmr
* commit '5647dea421be9dc8429f08632aa72a8a22904292': (47 commits)
  Rearrange issues by date order
  RELEASE.txt changes for MPI updates
  Update Drop Site options and Coverage settings
  Reorder bugfix release notes from latest to earliest, and miscellaneous format cleanup.
  Add RELEASE.txt entry for HDFFV-10475
  HDFFV-10544 Add more descriptive text
  HDFFV-10544 Correct var name
  HDFFV-10544 remove native from class function
  HDFFV-10544 correct typo
  HDFFV-10544 add release note
  HDFFV-10544 add class name to error text
  HDFFV-10544 exception variable as local class
  Improve error handling of exceptions
  Typo fix
  Set CMAKE_REQUIRED_INCLUDES instead of using path in call
  Add Autotools and CMake checks for big I/O MPI-3 functions
  Add hdf5settings section for parallel compression status in CMake builds
  HDFFV-10508 rework sentence
  HDFFV-10508 clarify library differences
  HDFFV-10508 spelling and grammer
  ...
2018-08-14 12:10:04 -05:00
1894 changed files with 549590 additions and 322381 deletions

View File

@@ -5,7 +5,7 @@
# This file is part of HDF5. The full HDF5 copyright notice, including
# terms governing use, modification, and redistribution, is contained in
# the COPYING file, which can be found at the root of the source code
# distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases.
# distribution tree, or in https://www.hdfgroup.org/licenses.
# If you do not have access to either file, you may request a copy from
# help@hdfgroup.org.

96
.clang-format Normal file
View File

@@ -0,0 +1,96 @@
---
Language: Cpp
BasedOnStyle: LLVM
AlignConsecutiveAssignments: true
#llvm11: AlignConsecutiveBitFields: false
AlignConsecutiveDeclarations: true
AlignConsecutiveMacros: true
#llvm10-11: AlignOperands: true - Align
#llvm11: AllowShortEnumsOnASingleLine: true
AllowShortFunctionsOnASingleLine: None
AlwaysBreakAfterReturnType: AllDefinitions
# Can enable the following section when llvm 12.x is out
#AttributeMacros:
# - H5_ATTR_FORMAT
# - H5_ATTR_UNUSED
# - H5_ATTR_DEPRECATED_USED
# - H5_ATTR_NDEBUG_UNUSED
# - H5_ATTR_DEBUG_API_USED
# - H5_ATTR_PARALLEL_UNUSED
# - H5_ATTR_PARALLEL_USED
# - H5_ATTR_NORETURN
# - H5_ATTR_CONST
# - H5_ATTR_PURE
# - H5_ATTR_FALLTHROUGH
BraceWrapping:
AfterFunction: true
#llvm10-11: AfterControlStatement: false - Never
BeforeCatch: true
BeforeElse: true
#llvm11: BeforeLambdaBody: false
#llvm11: BeforeWhile: false
BreakBeforeBraces: Stroustrup
BreakAfterJavaFieldAnnotations: true
BreakStringLiterals: true
ColumnLimit: 110 # Update $max_trace_macro_line_len in bin/trace also
ForEachMacros: ['ALL_MEMBERS', 'UNIQUE_MEMBERS']
IncludeCategories:
- Regex: '^"(llvm|llvm-c|clang|clang-c)/'
Priority: 3
SortPriority: 0
- Regex: '^(<|"(gtest|gmock|isl|json)/)'
Priority: 4
SortPriority: 0
- Regex: '.*'
Priority: 0
SortPriority: 0
- Regex: '^H5*.*'
Priority: 1
SortPriority: 0
- Regex: 'private.*'
Priority: 2
SortPriority: 0
IncludeIsMainRegex: '(public)?$'
IndentCaseLabels: true
#llvm11: IndentCaseBlocks: false
IndentGotoLabels: false
#llvm11: IndentExternBlock: AfterExternBlock
IndentWidth: 4
#llvm11: InsertTrailingCommas: None
MacroBlockBegin: "^BEGIN_FUNC"
MacroBlockEnd: "^END_FUNC"
ObjCBlockIndentWidth: 4
#llvm11: ObjCBreakBeforeNestedBlockParam: true
ReflowComments: true
SortIncludes: false
StatementMacros:
- FUNC_ENTER_API
- FUNC_LEAVE_API
- FUNC_ENTER_NOAPI_NOINIT_NOERR
- FUNC_LEAVE_NOAPI
- H5_BEGIN_TAG
- HGOTO_DONE_TAG
- H5_END_TAG
- HSYS_DONE_ERROR
- HSYS_GOTO_ERROR
- HDONE_ERROR
- HERROR
- H5_LEAVE
- H5E_PRINTF
- H5E_THROW
- HGOTO_DONE
- HGOTO_ERROR
- HMPI_ERROR
- HMPI_DONE_ERROR
- HMPI_GOTO_ERROR
- H5_GCC_DIAG_OFF
- H5_GCC_DIAG_ON
- CATCH
#llvm10: TypenameMacros:
#llvm10: - STACK_OF
#llvm10: - LIST
#llvm11: WhitespaceSensitiveMacros:
#llvm11: - STRINGIZE
#llvm11: - PP_STRINGIZE
...

6
.gitignore vendored
View File

@@ -1,5 +1,11 @@
# .gitignore file for HDF5
# ctags
**/tags
# vim swap files
**/.*.swp
# Makefile.in files
**/Makefile.in

View File

@@ -5,7 +5,7 @@
# This file is part of HDF5. The full HDF5 copyright notice, including
# terms governing use, modification, and redistribution, is contained in
# the COPYING file, which can be found at the root of the source code
# distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases.
# distribution tree, or in https://www.hdfgroup.org/licenses.
# If you do not have access to either file, you may request a copy from
# help@hdfgroup.org.

View File

@@ -5,7 +5,7 @@
# This file is part of HDF5. The full HDF5 copyright notice, including
# terms governing use, modification, and redistribution, is contained in
# the COPYING file, which can be found at the root of the source code
# distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases.
# distribution tree, or in https://www.hdfgroup.org/licenses.
# If you do not have access to either file, you may request a copy from
# help@hdfgroup.org.
#

View File

@@ -5,7 +5,7 @@
# This file is part of HDF5. The full HDF5 copyright notice, including
# terms governing use, modification, and redistribution, is contained in
# the COPYING file, which can be found at the root of the source code
# distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases.
# distribution tree, or in https://www.hdfgroup.org/licenses.
# If you do not have access to either file, you may request a copy from
# help@hdfgroup.org.
#

View File

@@ -816,8 +816,13 @@ if (HDF5_ENABLE_THREADSAFE)
if (Threads_FOUND)
set (H5_HAVE_THREADSAFE 1)
endif ()
else()
# Always check for pthreads for VFD SWMR (for now)
set (THREADS_PREFER_PTHREAD_FLAG ON)
find_package (Threads REQUIRED)
endif ()
#-----------------------------------------------------------------------------
# Option to build the map API
#-----------------------------------------------------------------------------

View File

@@ -97,10 +97,4 @@ and/or accompanying materials:
-----------------------------------------------------------------------------
HDF5 is available with the SZIP compression library but SZIP is not part
of HDF5 and has separate copyright and license terms. See SZIP Compression
in HDF Products (www.hdfgroup.org/doc_resource/SZIP/) for further details.
-----------------------------------------------------------------------------

View File

@@ -5,7 +5,7 @@
# This file is part of HDF5. The full HDF5 copyright notice, including
# terms governing use, modification, and redistribution, is contained in
# the COPYING file, which can be found at the root of the source code
# distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases.
# distribution tree, or in https://www.hdfgroup.org/licenses.
# If you do not have access to either file, you may request a copy from
# help@hdfgroup.org.
#

View File

@@ -6,7 +6,7 @@
# This file is part of HDF5. The full HDF5 copyright notice, including
# terms governing use, modification, and redistribution, is contained in
# the COPYING file, which can be found at the root of the source code
# distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases.
# distribution tree, or in https://www.hdfgroup.org/licenses.
# If you do not have access to either file, you may request a copy from
# help@hdfgroup.org.
#
@@ -33,6 +33,7 @@
./autogen.sh
./configure.ac
./.clang-format
./.github/workflows/main.yml _DO_NOT_DISTRIBUTE_
./m4/aclocal_cxx.m4
@@ -71,6 +72,8 @@
./bin/deploy
./bin/distdep
./bin/errors _DO_NOT_DISTRIBUTE_
./bin/format_source
./bin/format_source_patch
./bin/genparser
./bin/gcov_script _DO_NOT_DISTRIBUTE_
./bin/h5cc.in
@@ -151,6 +154,7 @@
./config/clang-warnings/error-general
./config/clang-warnings/general
./config/clang-warnings/no-developer-general
./config/clang-warnings/noerror-general
./config/gnu-warnings/4.8-4.last
./config/gnu-warnings/4.8
./config/gnu-warnings/4.9
@@ -159,14 +163,19 @@
./config/gnu-warnings/7
./config/gnu-warnings/8
./config/gnu-warnings/9
./config/gnu-warnings/9.3
./config/gnu-warnings/cxx-general
./config/gnu-warnings/cxx-4.8
./config/gnu-warnings/cxx-4.9
./config/gnu-warnings/cxx-5
./config/gnu-warnings/cxx-error-5
./config/gnu-warnings/cxx-error-general
./config/gnu-warnings/cxx-noerror-5
./config/gnu-warnings/cxx-noerror-general
./config/gnu-warnings/developer-4.8
./config/gnu-warnings/developer-7
./config/gnu-warnings/developer-8
./config/gnu-warnings/developer-10
./config/gnu-warnings/developer-general
./config/gnu-warnings/error-5
./config/gnu-warnings/error-8
@@ -180,15 +189,24 @@
./config/gnu-warnings/no-developer-4.8
./config/gnu-warnings/no-developer-8
./config/gnu-warnings/no-developer-general
./config/gnu-warnings/noerror-5
./config/gnu-warnings/noerror-8
./config/gnu-warnings/noerror-general
./config/intel-warnings/ifort-general
./config/intel-warnings/general
./config/site-specific/BlankForm
./doc/SWMRdataflow.png
./doc/VFD_SWMR_RFC_200916.docx
./doc/VFD_SWMR_RFC_200916.pdf
./doc/vfd-swmr-user-guide.md
./doc/code-conventions.md
./examples/Attributes.txt
./examples/Makefile.am
./examples/credel.c
./examples/gaussians.c
./examples/h5_chunk_read.c
./examples/h5_compound.c
./examples/h5_crtgrpd.c
@@ -227,6 +245,8 @@
./examples/h5_vds-percival.c
./examples/h5_vds-percival-unlim.c
./examples/h5_vds-percival-unlim-maxmin.c
./examples/nbcompat.c
./examples/nbcompat.h
./examples/testh5cc.sh.in
./examples/README
@@ -502,9 +522,11 @@
./release_docs/COPYING
./release_docs/HISTORY-1_0-1_8_0_rc3.txt
./release_docs/HISTORY-1_8_0-1_10_0.txt
./release_docs/HISTORY-1_10_0-1_12_0.txt
./release_docs/HISTORY-1_8.txt
./release_docs/HISTORY-1_10.txt
./release_docs/HISTORY-1_8_0-1_10_0.txt
./release_docs/HISTORY-1_12.txt
./release_docs/INSTALL
./release_docs/INSTALL_CMake.txt
./release_docs/INSTALL_Cygwin.txt
@@ -665,6 +687,7 @@
./src/H5Fprivate.h
./src/H5Fpublic.h
./src/H5Ftest.c
./src/H5Fvfd_swmr.c
./src/H5FA.c
./src/H5FAcache.c
./src/H5FAdbg.c
@@ -714,6 +737,10 @@
./src/H5FDstdio.c
./src/H5FDstdio.h
./src/H5FDtest.c
./src/H5FDvfd_swmr_instr.c
./src/H5FDvfd_swmr_private.h
./src/H5FDvfd_swmr.c
./src/H5FDvfd_swmr.h
./src/H5FDwindows.c
./src/H5FDwindows.h
./src/H5FL.c
@@ -779,6 +806,7 @@
./src/H5HGpkg.h
./src/H5HGprivate.h
./src/H5HGquery.c
./src/H5HGtrap.c
./src/H5HL.c
./src/H5HLcache.c
./src/H5HLdbg.c
@@ -823,6 +851,11 @@
./src/H5MPpkg.h
./src/H5MPprivate.h
./src/H5MPtest.c
./src/H5MV.c
./src/H5MVmodule.h
./src/H5MVsection.c
./src/H5MVpkg.h
./src/H5MVprivate.h
./src/H5O.c
./src/H5Oainfo.c
./src/H5Oalloc.c
@@ -1011,10 +1044,12 @@
./src/H5Zshuffle.c
./src/H5Zszip.c
./src/H5Ztrans.c
./src/H5queue.h
./src/H5retry_private.h
./src/H5win32defs.h
./src/Makefile.am
./src/hdf5.h
./src/libhdf5.settings.in
./src/H5win32defs.h
./test/AtomicWriterReader.txt
./test/COPYING
@@ -1179,6 +1214,8 @@
# ====end distribute this for now. See HDFFV-8236====
./test/specmetaread.h5
./test/stab.c
./test/stubs.c
./test/supervise.subr
./test/swmr.c
./test/swmr_addrem_writer.c
./test/swmr_check_compat_vfd.c
@@ -1220,6 +1257,7 @@
./test/testmeta.c
./test/testswmr.sh.in
./test/testvdsswmr.sh.in
./test/testvfdswmr.sh.in
./test/testvds_env.sh.in
./test/tfile.c
./test/tgenprop.c
@@ -1271,6 +1309,22 @@
./test/vds_swmr_gen.c
./test/vds_swmr_reader.c
./test/vds_swmr_writer.c
./test/vfd_swmr.c
./test/vfd_swmr_common.c
./test/vfd_swmr_common.h
./test/vfd_swmr_generator.c
./test/vfd_swmr_addrem_writer.c
./test/vfd_swmr_bigset_writer.c
./test/vfd_swmr_group_writer.c
./test/vfd_swmr_reader.c
./test/vfd_swmr_remove_reader.c
./test/vfd_swmr_remove_writer.c
./test/vfd_swmr_sparse_reader.c
./test/vfd_swmr_sparse_writer.c
./test/vfd_swmr_vlstr_reader.c
./test/vfd_swmr_vlstr_writer.c
./test/vfd_swmr_writer.c
./test/vfd_swmr_zoo_writer.c
./test/vfd.c
./test/vol.c
./test/vol_plugin.c
@@ -3681,3 +3735,5 @@
./tools/test/misc/Makefile.in
./tools/test/misc/vds/Makefile.in
./tools/test/perform/Makefile.in
./utils/Makefile.in
./utils/mirror_vfd/Makefile.in

View File

@@ -6,7 +6,7 @@
# This file is part of HDF5. The full HDF5 copyright notice, including
# terms governing use, modification, and redistribution, is contained in
# the COPYING file, which can be found at the root of the source code
# distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases.
# distribution tree, or in https://www.hdfgroup.org/licenses.
# If you do not have access to either file, you may request a copy from
# help@hdfgroup.org.
##

View File

@@ -7,7 +7,7 @@
# This file is part of HDF5. The full HDF5 copyright notice, including
# terms governing use, modification, and redistribution, is contained in
# the COPYING file, which can be found at the root of the source code
# distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases.
# distribution tree, or in https://www.hdfgroup.org/licenses.
# If you do not have access to either file, you may request a copy from
# help@hdfgroup.org.

1223
Makefile.in Normal file

File diff suppressed because it is too large Load Diff

View File

@@ -5,7 +5,7 @@
# This file is part of HDF5. The full HDF5 copyright notice, including
# terms governing use, modification, and redistribution, is contained in
# the COPYING file, which can be found at the root of the source code
# distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases.
# distribution tree, or in https://www.hdfgroup.org/licenses.
# If you do not have access to either file, you may request a copy from
# help@hdfgroup.org.
#

1191
aclocal.m4 vendored Normal file

File diff suppressed because it is too large Load Diff

View File

@@ -8,7 +8,7 @@ dnl
dnl This file is part of HDF5. The full HDF5 copyright notice, including
dnl terms governing use, modification, and redistribution, is contained in
dnl the COPYING file, which can be found at the root of the source code
dnl dnl distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases.
dnl dnl distribution tree, or in https://www.hdfgroup.org/licenses.
dnl dnl If you do not have access to either file, you may request a copy from
dnl dnl help@hdfgroup.org.
dnl

View File

@@ -6,7 +6,7 @@
# This file is part of HDF5. The full HDF5 copyright notice, including
# terms governing use, modification, and redistribution, is contained in
# the COPYING file, which can be found at the root of the source code
# distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases.
# distribution tree, or in https://www.hdfgroup.org/licenses.
# If you do not have access to either file, you may request a copy from
# help@hdfgroup.org.
#

View File

@@ -7,7 +7,7 @@
The full HDF5 copyright notice, including terms governing use,
modification, and redistribution, is contained in the COPYING file
which can be found at the root of the source code distribution tree
or in https://support.hdfgroup.org/ftp/HDF5/releases. If you do
or in https://www.hdfgroup.org/licenses. If you do
not have access to either file, you may request a copy from
help@hdfgroup.org.

View File

@@ -6,7 +6,7 @@
# This file is part of HDF5. The full HDF5 copyright notice, including
# terms governing use, modification, and redistribution, is contained in
# the COPYING file, which can be found at the root of the source code
# distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases.
# distribution tree, or in https://www.hdfgroup.org/licenses.
# If you do not have access to either file, you may request a copy from
# help@hdfgroup.org.
##

1410
bin/Makefile.in Normal file

File diff suppressed because it is too large Load Diff

View File

@@ -7,7 +7,7 @@
# This file is part of HDF5. The full HDF5 copyright notice, including
# terms governing use, modification, and redistribution, is contained in
# the COPYING file, which can be found at the root of the source code
# distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases.
# distribution tree, or in https://www.hdfgroup.org/licenses.
# If you do not have access to either file, you may request a copy from
# help@hdfgroup.org.
#

View File

@@ -7,7 +7,7 @@
# This file is part of HDF5. The full HDF5 copyright notice, including
# terms governing use, modification, and redistribution, is contained in
# the COPYING file, which can be found at the root of the source code
# distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases.
# distribution tree, or in https://www.hdfgroup.org/licenses.
# If you do not have access to either file, you may request a copy from
# help@hdfgroup.org.
#

View File

@@ -7,7 +7,7 @@
# This file is part of HDF5. The full HDF5 copyright notice, including
# terms governing use, modification, and redistribution, is contained in
# the COPYING file, which can be found at the root of the source code
# distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases.
# distribution tree, or in https://www.hdfgroup.org/licenses.
# If you do not have access to either file, you may request a copy from
# help@hdfgroup.org.
#

View File

@@ -10,7 +10,7 @@ use warnings;
# This file is part of HDF5. The full HDF5 copyright notice, including
# terms governing use, modification, and redistribution, is contained in
# the COPYING file, which can be found at the root of the source code
# distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases.
# distribution tree, or in https://www.hdfgroup.org/licenses.
# If you do not have access to either file, you may request a copy from
# help@hdfgroup.org.
#
@@ -44,7 +44,27 @@ foreach $arg (@ARGV) {
#
# If a user specifies one file, process it no matter what so people
# can inspect files we normally skip (like H5system.c).
$ignore = 0;
# Ignored files in src/
if($#ARGV gt 0 and $filename =~ /H5FDmulti|H5FDstdio|H5VLpassthru|H5system|H5detect|H5make_libsettings/) {
$ignore = 1;
}
# Ignored atomic test files in test/
if($#ARGV gt 0 and $filename =~ /atomic_reader|atomic_writer/) {
$ignore = 1;
}
# Ignored filter plugins in test/
if($#ARGV gt 0 and $filename =~ /^filter_plugin\d_/) {
$ignore = 1;
}
# Ignored generators in test/
if($#ARGV gt 0 and $filename =~ /^gen_/) {
$ignore = 1;
}
if($ignore) {
print "$filename is exempt from using Standard library macro wrappers\n";
next;
}
@@ -95,13 +115,13 @@ foreach $arg (@ARGV) {
# These are really HDF5 functions/macros even though they don't
# start with `h' or `H'.
next if $name =~ /^FUNC_(ENTER|LEAVE)(_(NO)?API|_PACKAGE|_STATIC)?(_NOFS|_NOCLEAR|_NOINIT)?(_NOFUNC|_TAG)?$/;
next if $name =~ /^FUNC_(ENTER|LEAVE)(_(NO)?API|_PACKAGE|_STATIC)?(_NOFS|_NOCLEAR|_NOINIT|_NOPUSH)?(_NOFUNC|_TAG)?$/;
next if $name =~ /^(BEGIN|END)_FUNC$/;
next if $name =~ /^U?INT(8|16|32|64)(ENCODE|DECODE)(_VAR)?$/;
next if $name =~ /^CI_(PRINT_STATS|INC_SRC|INC_DST)$/;
next if $name =~ /^(ABS|ADDR_OVERFLOW|ALL_MEMBERS|BOUND|CONSTR|DETECT_[I|F|M]|DOWN)$/;
next if $name =~ /^(MIN3?|MAX3?|NELMTS|POWER_OF_TWO|REGION_OVERFLOW)$/;
next if $name =~ /^(UNIQUE_MEMBERS|S_ISDIR)$/;
next if $name =~ /^(SIZE_OVERFLOW|UNIQUE_MEMBERS|S_ISDIR)$/;
next if $name =~ /^addr_defined$/;
# These functions/macros are exempt.
@@ -140,15 +160,38 @@ foreach $arg (@ARGV) {
next if $name =~ /^(pow_fun|round_fun|abs_fun|lround_fun|llround_fun)$/;
}
# This is a macro parameter in H5Rint.c. Ignore it in this file.
if($filename =~ /H5Rint/) {
next if $name =~ /^(func)$/;
}
# Internal calls in the HDFS VFD (H5FDhdfs.c). Ignore it in this file.
if($filename =~ /H5FDhdfs/) {
next if $name =~ /^(hdfs)/;
}
# Macros, etc. from the mirror VFD (H5FDmirror.c). Ignore in this file.
if($filename =~ /H5FDmirror/) {
next if $name =~ /^(LOG)/;
next if $name =~ /^(BSWAP_64|is_host_little_endian)$/;
}
# These are things in H5FDs3comms.c and H5FDros3.c. Ignore them in these files.
if($filename =~ /H5FDs3comms|H5FDros3/) {
next if $name =~ /^(curl_|curlwritecallback|gmnow)/;
next if $name =~ /^(ros3_|ROS3_|S3COMMS_)/;
next if $name =~ /^(EVP_sha256|SHA256|ISO8601NOW)$/;
}
# TESTING (not comprehensive - just noise reduction)
# Test macros and functions (testhdf5.h)
next if $name =~ /^(AddTest|TestErrPrintf|TestSummary|TestCleanup|TestShutdown)$/;
next if $name =~ /^(CHECK|CHECK_PTR|CHECK_PTR_NULL|CHECK_PTR_EQ|CHECK_I)$/;
next if $name =~ /^(VERIFY|VERIFY_STR|VERIFY|TYPE|MESSAGE|ERROR)$/;
next if $name =~ /^(VERIFY|VERIFY_STR|VERIFY_TYPE|MESSAGE|ERROR)$/;
# Test macros and functions (h5test.h)
next if $name =~ /^(TESTING|PASSED|SKIPPED|FAIL_PUTS_ERROR|FAIL_STACK_ERROR|TEST_ERROR)$/;
next if $name =~ /^(TESTING|PASSED|SKIPPED|PUTS_ERROR|FAIL_PUTS_ERROR|FAIL_STACK_ERROR|TEST_ERROR|AT)$/;
next if $name =~ /^(GetTestExpress)$/;
# Ignore functions that start with test_ or check_
@@ -158,9 +201,49 @@ foreach $arg (@ARGV) {
# Ignore functions that start with h5_
next if $name =~ /^h5_/;
# Ignore process completed status
next if $name =~ /(WIFEXITED|WEXITSTATUS|WIFSIGNALED|WTERMSIG|WCOREDUMP|WIFSTOPPED|WSTOPSIG)/;
# Ignore usage functions
next if $name =~ /^usage$/;
# Ignore callbacks
next if $name =~ /(_cb\d?)$/;
# Specific tests (not even remotely comprehensive)
# accum test code
if($filename =~ /accum/) {
next if $name =~ /^(accum_)/;
}
# cache test code
if($filename =~ /cache/) {
next if $name =~ /(_entry|_entries|_cache|_check|_dependency|_status|_op)$/;
next if $name =~ /^(verify_|smoke_check_|row_major_|col_major_)/;
next if $name =~ /^(resize_configs_are_equal|CACHE_ERROR)$/
}
# Splitter VFD test code. Ignore in vfd.c.
if($filename =~ /vfd/) {
next if $name =~ /^(SPLITTER_|splitter_)/;
next if $name =~ /(_splitter_)/;
next if $name =~ /^(file_exists)$/;
}
# S3 VFD test code. Ignore in ros3.c and s3comms.c.
# HDFS VFD test code. Ignore in hdfs.c.
if($filename =~ /ros3|s3comms|hdfs/) {
next if $name =~ /^(JSVERIFY|JSFAILED_|JSERR_|jserr_|FAIL_)/;
next if $name =~ /^(curl_)/;
next if $name =~ /^(S3COMMS_FORMAT_CREDENTIAL|ISO8601NOW|gmnow)$/;
}
# VDS test code. Ignore in vds.c.
if($filename =~ /vds/) {
next if $name =~ /^(vds_)/;
}
print "$filename:$.: $name\n";
}

View File

@@ -6,7 +6,7 @@
## This file is part of HDF5. The full HDF5 copyright notice, including
## terms governing use, modification, and redistribution, is contained in
## the COPYING file, which can be found at the root of the source code
## distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases.
## distribution tree, or in https://www.hdfgroup.org/licenses.
## If you do not have access to either file, you may request a copy from
## help@hdfgroup.org.
##

View File

@@ -7,7 +7,7 @@
# This file is part of HDF5. The full HDF5 copyright notice, including
# terms governing use, modification, and redistribution, is contained in
# the COPYING file, which can be found at the root of the source code
# distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases.
# distribution tree, or in https://www.hdfgroup.org/licenses.
# If you do not have access to either file, you may request a copy from
# help@hdfgroup.org.
#

View File

@@ -7,7 +7,7 @@
# This file is part of HDF5. The full HDF5 copyright notice, including
# terms governing use, modification, and redistribution, is contained in
# the COPYING file, which can be found at the root of the source code
# distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases.
# distribution tree, or in https://www.hdfgroup.org/licenses.
# If you do not have access to either file, you may request a copy from
# help@hdfgroup.org.
#

348
bin/compile Executable file
View File

@@ -0,0 +1,348 @@
#! /bin/sh
# Wrapper for compilers which do not understand '-c -o'.
scriptversion=2018-03-07.03; # UTC
# Copyright (C) 1999-2018 Free Software Foundation, Inc.
# Written by Tom Tromey <tromey@cygnus.com>.
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2, or (at your option)
# any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <https://www.gnu.org/licenses/>.
# As a special exception to the GNU General Public License, if you
# distribute this file as part of a program that contains a
# configuration script generated by Autoconf, you may include it under
# the same distribution terms that you use for the rest of that program.
# This file is maintained in Automake, please report
# bugs to <bug-automake@gnu.org> or send patches to
# <automake-patches@gnu.org>.
nl='
'
# We need space, tab and new line, in precisely that order. Quoting is
# there to prevent tools from complaining about whitespace usage.
IFS=" "" $nl"
file_conv=
# func_file_conv build_file lazy
# Convert a $build file to $host form and store it in $file
# Currently only supports Windows hosts. If the determined conversion
# type is listed in (the comma separated) LAZY, no conversion will
# take place.
func_file_conv ()
{
file=$1
case $file in
/ | /[!/]*) # absolute file, and not a UNC file
if test -z "$file_conv"; then
# lazily determine how to convert abs files
case `uname -s` in
MINGW*)
file_conv=mingw
;;
CYGWIN*)
file_conv=cygwin
;;
*)
file_conv=wine
;;
esac
fi
case $file_conv/,$2, in
*,$file_conv,*)
;;
mingw/*)
file=`cmd //C echo "$file " | sed -e 's/"\(.*\) " *$/\1/'`
;;
cygwin/*)
file=`cygpath -m "$file" || echo "$file"`
;;
wine/*)
file=`winepath -w "$file" || echo "$file"`
;;
esac
;;
esac
}
# func_cl_dashL linkdir
# Make cl look for libraries in LINKDIR
func_cl_dashL ()
{
func_file_conv "$1"
if test -z "$lib_path"; then
lib_path=$file
else
lib_path="$lib_path;$file"
fi
linker_opts="$linker_opts -LIBPATH:$file"
}
# func_cl_dashl library
# Do a library search-path lookup for cl
func_cl_dashl ()
{
lib=$1
found=no
save_IFS=$IFS
IFS=';'
for dir in $lib_path $LIB
do
IFS=$save_IFS
if $shared && test -f "$dir/$lib.dll.lib"; then
found=yes
lib=$dir/$lib.dll.lib
break
fi
if test -f "$dir/$lib.lib"; then
found=yes
lib=$dir/$lib.lib
break
fi
if test -f "$dir/lib$lib.a"; then
found=yes
lib=$dir/lib$lib.a
break
fi
done
IFS=$save_IFS
if test "$found" != yes; then
lib=$lib.lib
fi
}
# func_cl_wrapper cl arg...
# Adjust compile command to suit cl
func_cl_wrapper ()
{
# Assume a capable shell
lib_path=
shared=:
linker_opts=
for arg
do
if test -n "$eat"; then
eat=
else
case $1 in
-o)
# configure might choose to run compile as 'compile cc -o foo foo.c'.
eat=1
case $2 in
*.o | *.[oO][bB][jJ])
func_file_conv "$2"
set x "$@" -Fo"$file"
shift
;;
*)
func_file_conv "$2"
set x "$@" -Fe"$file"
shift
;;
esac
;;
-I)
eat=1
func_file_conv "$2" mingw
set x "$@" -I"$file"
shift
;;
-I*)
func_file_conv "${1#-I}" mingw
set x "$@" -I"$file"
shift
;;
-l)
eat=1
func_cl_dashl "$2"
set x "$@" "$lib"
shift
;;
-l*)
func_cl_dashl "${1#-l}"
set x "$@" "$lib"
shift
;;
-L)
eat=1
func_cl_dashL "$2"
;;
-L*)
func_cl_dashL "${1#-L}"
;;
-static)
shared=false
;;
-Wl,*)
arg=${1#-Wl,}
save_ifs="$IFS"; IFS=','
for flag in $arg; do
IFS="$save_ifs"
linker_opts="$linker_opts $flag"
done
IFS="$save_ifs"
;;
-Xlinker)
eat=1
linker_opts="$linker_opts $2"
;;
-*)
set x "$@" "$1"
shift
;;
*.cc | *.CC | *.cxx | *.CXX | *.[cC]++)
func_file_conv "$1"
set x "$@" -Tp"$file"
shift
;;
*.c | *.cpp | *.CPP | *.lib | *.LIB | *.Lib | *.OBJ | *.obj | *.[oO])
func_file_conv "$1" mingw
set x "$@" "$file"
shift
;;
*)
set x "$@" "$1"
shift
;;
esac
fi
shift
done
if test -n "$linker_opts"; then
linker_opts="-link$linker_opts"
fi
exec "$@" $linker_opts
exit 1
}
eat=
case $1 in
'')
echo "$0: No command. Try '$0 --help' for more information." 1>&2
exit 1;
;;
-h | --h*)
cat <<\EOF
Usage: compile [--help] [--version] PROGRAM [ARGS]
Wrapper for compilers which do not understand '-c -o'.
Remove '-o dest.o' from ARGS, run PROGRAM with the remaining
arguments, and rename the output as expected.
If you are trying to build a whole package this is not the
right script to run: please start by reading the file 'INSTALL'.
Report bugs to <bug-automake@gnu.org>.
EOF
exit $?
;;
-v | --v*)
echo "compile $scriptversion"
exit $?
;;
cl | *[/\\]cl | cl.exe | *[/\\]cl.exe | \
icl | *[/\\]icl | icl.exe | *[/\\]icl.exe )
func_cl_wrapper "$@" # Doesn't return...
;;
esac
ofile=
cfile=
for arg
do
if test -n "$eat"; then
eat=
else
case $1 in
-o)
# configure might choose to run compile as 'compile cc -o foo foo.c'.
# So we strip '-o arg' only if arg is an object.
eat=1
case $2 in
*.o | *.obj)
ofile=$2
;;
*)
set x "$@" -o "$2"
shift
;;
esac
;;
*.c)
cfile=$1
set x "$@" "$1"
shift
;;
*)
set x "$@" "$1"
shift
;;
esac
fi
shift
done
if test -z "$ofile" || test -z "$cfile"; then
# If no '-o' option was seen then we might have been invoked from a
# pattern rule where we don't need one. That is ok -- this is a
# normal compilation that the losing compiler can handle. If no
# '.c' file was seen then we are probably linking. That is also
# ok.
exec "$@"
fi
# Name of file we expect compiler to create.
cofile=`echo "$cfile" | sed 's|^.*[\\/]||; s|^[a-zA-Z]:||; s/\.c$/.o/'`
# Create the lock directory.
# Note: use '[/\\:.-]' here to ensure that we don't use the same name
# that we are using for the .o file. Also, base the name on the expected
# object file name, since that is what matters with a parallel build.
lockdir=`echo "$cofile" | sed -e 's|[/\\:.-]|_|g'`.d
while true; do
if mkdir "$lockdir" >/dev/null 2>&1; then
break
fi
sleep 1
done
# FIXME: race condition here if user kills between mkdir and trap.
trap "rmdir '$lockdir'; exit 1" 1 2 15
# Run the compile.
"$@"
ret=$?
if test -f "$cofile"; then
test "$cofile" = "$ofile" || mv "$cofile" "$ofile"
elif test -f "${cofile}bj"; then
test "${cofile}bj" = "$ofile" || mv "${cofile}bj" "$ofile"
fi
rmdir "$lockdir"
exit $ret
# Local Variables:
# mode: shell-script
# sh-indentation: 2
# eval: (add-hook 'before-save-hook 'time-stamp)
# time-stamp-start: "scriptversion="
# time-stamp-format: "%:y-%02m-%02d.%02H"
# time-stamp-time-zone: "UTC0"
# time-stamp-end: "; # UTC"
# End:

1480
bin/config.guess vendored Executable file

File diff suppressed because it is too large Load Diff

1801
bin/config.sub vendored Executable file

File diff suppressed because it is too large Load Diff

View File

@@ -7,7 +7,7 @@
# This file is part of HDF5. The full HDF5 copyright notice, including
# terms governing use, modification, and redistribution, is contained in
# the COPYING file, which can be found at the root of the source code
# distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases.
# distribution tree, or in https://www.hdfgroup.org/licenses.
# If you do not have access to either file, you may request a copy from
# help@hdfgroup.org.
#

791
bin/depcomp Executable file
View File

@@ -0,0 +1,791 @@
#! /bin/sh
# depcomp - compile a program generating dependencies as side-effects
scriptversion=2018-03-07.03; # UTC
# Copyright (C) 1999-2018 Free Software Foundation, Inc.
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2, or (at your option)
# any later version.
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <https://www.gnu.org/licenses/>.
# As a special exception to the GNU General Public License, if you
# distribute this file as part of a program that contains a
# configuration script generated by Autoconf, you may include it under
# the same distribution terms that you use for the rest of that program.
# Originally written by Alexandre Oliva <oliva@dcc.unicamp.br>.
case $1 in
'')
echo "$0: No command. Try '$0 --help' for more information." 1>&2
exit 1;
;;
-h | --h*)
cat <<\EOF
Usage: depcomp [--help] [--version] PROGRAM [ARGS]
Run PROGRAMS ARGS to compile a file, generating dependencies
as side-effects.
Environment variables:
depmode Dependency tracking mode.
source Source file read by 'PROGRAMS ARGS'.
object Object file output by 'PROGRAMS ARGS'.
DEPDIR directory where to store dependencies.
depfile Dependency file to output.
tmpdepfile Temporary file to use when outputting dependencies.
libtool Whether libtool is used (yes/no).
Report bugs to <bug-automake@gnu.org>.
EOF
exit $?
;;
-v | --v*)
echo "depcomp $scriptversion"
exit $?
;;
esac
# Get the directory component of the given path, and save it in the
# global variables '$dir'. Note that this directory component will
# be either empty or ending with a '/' character. This is deliberate.
set_dir_from ()
{
case $1 in
*/*) dir=`echo "$1" | sed -e 's|/[^/]*$|/|'`;;
*) dir=;;
esac
}
# Get the suffix-stripped basename of the given path, and save it the
# global variable '$base'.
set_base_from ()
{
base=`echo "$1" | sed -e 's|^.*/||' -e 's/\.[^.]*$//'`
}
# If no dependency file was actually created by the compiler invocation,
# we still have to create a dummy depfile, to avoid errors with the
# Makefile "include basename.Plo" scheme.
make_dummy_depfile ()
{
echo "#dummy" > "$depfile"
}
# Factor out some common post-processing of the generated depfile.
# Requires the auxiliary global variable '$tmpdepfile' to be set.
aix_post_process_depfile ()
{
# If the compiler actually managed to produce a dependency file,
# post-process it.
if test -f "$tmpdepfile"; then
# Each line is of the form 'foo.o: dependency.h'.
# Do two passes, one to just change these to
# $object: dependency.h
# and one to simply output
# dependency.h:
# which is needed to avoid the deleted-header problem.
{ sed -e "s,^.*\.[$lower]*:,$object:," < "$tmpdepfile"
sed -e "s,^.*\.[$lower]*:[$tab ]*,," -e 's,$,:,' < "$tmpdepfile"
} > "$depfile"
rm -f "$tmpdepfile"
else
make_dummy_depfile
fi
}
# A tabulation character.
tab=' '
# A newline character.
nl='
'
# Character ranges might be problematic outside the C locale.
# These definitions help.
upper=ABCDEFGHIJKLMNOPQRSTUVWXYZ
lower=abcdefghijklmnopqrstuvwxyz
digits=0123456789
alpha=${upper}${lower}
if test -z "$depmode" || test -z "$source" || test -z "$object"; then
echo "depcomp: Variables source, object and depmode must be set" 1>&2
exit 1
fi
# Dependencies for sub/bar.o or sub/bar.obj go into sub/.deps/bar.Po.
depfile=${depfile-`echo "$object" |
sed 's|[^\\/]*$|'${DEPDIR-.deps}'/&|;s|\.\([^.]*\)$|.P\1|;s|Pobj$|Po|'`}
tmpdepfile=${tmpdepfile-`echo "$depfile" | sed 's/\.\([^.]*\)$/.T\1/'`}
rm -f "$tmpdepfile"
# Avoid interferences from the environment.
gccflag= dashmflag=
# Some modes work just like other modes, but use different flags. We
# parameterize here, but still list the modes in the big case below,
# to make depend.m4 easier to write. Note that we *cannot* use a case
# here, because this file can only contain one case statement.
if test "$depmode" = hp; then
# HP compiler uses -M and no extra arg.
gccflag=-M
depmode=gcc
fi
if test "$depmode" = dashXmstdout; then
# This is just like dashmstdout with a different argument.
dashmflag=-xM
depmode=dashmstdout
fi
cygpath_u="cygpath -u -f -"
if test "$depmode" = msvcmsys; then
# This is just like msvisualcpp but w/o cygpath translation.
# Just convert the backslash-escaped backslashes to single forward
# slashes to satisfy depend.m4
cygpath_u='sed s,\\\\,/,g'
depmode=msvisualcpp
fi
if test "$depmode" = msvc7msys; then
# This is just like msvc7 but w/o cygpath translation.
# Just convert the backslash-escaped backslashes to single forward
# slashes to satisfy depend.m4
cygpath_u='sed s,\\\\,/,g'
depmode=msvc7
fi
if test "$depmode" = xlc; then
# IBM C/C++ Compilers xlc/xlC can output gcc-like dependency information.
gccflag=-qmakedep=gcc,-MF
depmode=gcc
fi
case "$depmode" in
gcc3)
## gcc 3 implements dependency tracking that does exactly what
## we want. Yay! Note: for some reason libtool 1.4 doesn't like
## it if -MD -MP comes after the -MF stuff. Hmm.
## Unfortunately, FreeBSD c89 acceptance of flags depends upon
## the command line argument order; so add the flags where they
## appear in depend2.am. Note that the slowdown incurred here
## affects only configure: in makefiles, %FASTDEP% shortcuts this.
for arg
do
case $arg in
-c) set fnord "$@" -MT "$object" -MD -MP -MF "$tmpdepfile" "$arg" ;;
*) set fnord "$@" "$arg" ;;
esac
shift # fnord
shift # $arg
done
"$@"
stat=$?
if test $stat -ne 0; then
rm -f "$tmpdepfile"
exit $stat
fi
mv "$tmpdepfile" "$depfile"
;;
gcc)
## Note that this doesn't just cater to obsosete pre-3.x GCC compilers.
## but also to in-use compilers like IMB xlc/xlC and the HP C compiler.
## (see the conditional assignment to $gccflag above).
## There are various ways to get dependency output from gcc. Here's
## why we pick this rather obscure method:
## - Don't want to use -MD because we'd like the dependencies to end
## up in a subdir. Having to rename by hand is ugly.
## (We might end up doing this anyway to support other compilers.)
## - The DEPENDENCIES_OUTPUT environment variable makes gcc act like
## -MM, not -M (despite what the docs say). Also, it might not be
## supported by the other compilers which use the 'gcc' depmode.
## - Using -M directly means running the compiler twice (even worse
## than renaming).
if test -z "$gccflag"; then
gccflag=-MD,
fi
"$@" -Wp,"$gccflag$tmpdepfile"
stat=$?
if test $stat -ne 0; then
rm -f "$tmpdepfile"
exit $stat
fi
rm -f "$depfile"
echo "$object : \\" > "$depfile"
# The second -e expression handles DOS-style file names with drive
# letters.
sed -e 's/^[^:]*: / /' \
-e 's/^['$alpha']:\/[^:]*: / /' < "$tmpdepfile" >> "$depfile"
## This next piece of magic avoids the "deleted header file" problem.
## The problem is that when a header file which appears in a .P file
## is deleted, the dependency causes make to die (because there is
## typically no way to rebuild the header). We avoid this by adding
## dummy dependencies for each header file. Too bad gcc doesn't do
## this for us directly.
## Some versions of gcc put a space before the ':'. On the theory
## that the space means something, we add a space to the output as
## well. hp depmode also adds that space, but also prefixes the VPATH
## to the object. Take care to not repeat it in the output.
## Some versions of the HPUX 10.20 sed can't process this invocation
## correctly. Breaking it into two sed invocations is a workaround.
tr ' ' "$nl" < "$tmpdepfile" \
| sed -e 's/^\\$//' -e '/^$/d' -e "s|.*$object$||" -e '/:$/d' \
| sed -e 's/$/ :/' >> "$depfile"
rm -f "$tmpdepfile"
;;
hp)
# This case exists only to let depend.m4 do its work. It works by
# looking at the text of this script. This case will never be run,
# since it is checked for above.
exit 1
;;
sgi)
if test "$libtool" = yes; then
"$@" "-Wp,-MDupdate,$tmpdepfile"
else
"$@" -MDupdate "$tmpdepfile"
fi
stat=$?
if test $stat -ne 0; then
rm -f "$tmpdepfile"
exit $stat
fi
rm -f "$depfile"
if test -f "$tmpdepfile"; then # yes, the sourcefile depend on other files
echo "$object : \\" > "$depfile"
# Clip off the initial element (the dependent). Don't try to be
# clever and replace this with sed code, as IRIX sed won't handle
# lines with more than a fixed number of characters (4096 in
# IRIX 6.2 sed, 8192 in IRIX 6.5). We also remove comment lines;
# the IRIX cc adds comments like '#:fec' to the end of the
# dependency line.
tr ' ' "$nl" < "$tmpdepfile" \
| sed -e 's/^.*\.o://' -e 's/#.*$//' -e '/^$/ d' \
| tr "$nl" ' ' >> "$depfile"
echo >> "$depfile"
# The second pass generates a dummy entry for each header file.
tr ' ' "$nl" < "$tmpdepfile" \
| sed -e 's/^.*\.o://' -e 's/#.*$//' -e '/^$/ d' -e 's/$/:/' \
>> "$depfile"
else
make_dummy_depfile
fi
rm -f "$tmpdepfile"
;;
xlc)
# This case exists only to let depend.m4 do its work. It works by
# looking at the text of this script. This case will never be run,
# since it is checked for above.
exit 1
;;
aix)
# The C for AIX Compiler uses -M and outputs the dependencies
# in a .u file. In older versions, this file always lives in the
# current directory. Also, the AIX compiler puts '$object:' at the
# start of each line; $object doesn't have directory information.
# Version 6 uses the directory in both cases.
set_dir_from "$object"
set_base_from "$object"
if test "$libtool" = yes; then
tmpdepfile1=$dir$base.u
tmpdepfile2=$base.u
tmpdepfile3=$dir.libs/$base.u
"$@" -Wc,-M
else
tmpdepfile1=$dir$base.u
tmpdepfile2=$dir$base.u
tmpdepfile3=$dir$base.u
"$@" -M
fi
stat=$?
if test $stat -ne 0; then
rm -f "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3"
exit $stat
fi
for tmpdepfile in "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3"
do
test -f "$tmpdepfile" && break
done
aix_post_process_depfile
;;
tcc)
# tcc (Tiny C Compiler) understand '-MD -MF file' since version 0.9.26
# FIXME: That version still under development at the moment of writing.
# Make that this statement remains true also for stable, released
# versions.
# It will wrap lines (doesn't matter whether long or short) with a
# trailing '\', as in:
#
# foo.o : \
# foo.c \
# foo.h \
#
# It will put a trailing '\' even on the last line, and will use leading
# spaces rather than leading tabs (at least since its commit 0394caf7
# "Emit spaces for -MD").
"$@" -MD -MF "$tmpdepfile"
stat=$?
if test $stat -ne 0; then
rm -f "$tmpdepfile"
exit $stat
fi
rm -f "$depfile"
# Each non-empty line is of the form 'foo.o : \' or ' dep.h \'.
# We have to change lines of the first kind to '$object: \'.
sed -e "s|.*:|$object :|" < "$tmpdepfile" > "$depfile"
# And for each line of the second kind, we have to emit a 'dep.h:'
# dummy dependency, to avoid the deleted-header problem.
sed -n -e 's|^ *\(.*\) *\\$|\1:|p' < "$tmpdepfile" >> "$depfile"
rm -f "$tmpdepfile"
;;
## The order of this option in the case statement is important, since the
## shell code in configure will try each of these formats in the order
## listed in this file. A plain '-MD' option would be understood by many
## compilers, so we must ensure this comes after the gcc and icc options.
pgcc)
# Portland's C compiler understands '-MD'.
# Will always output deps to 'file.d' where file is the root name of the
# source file under compilation, even if file resides in a subdirectory.
# The object file name does not affect the name of the '.d' file.
# pgcc 10.2 will output
# foo.o: sub/foo.c sub/foo.h
# and will wrap long lines using '\' :
# foo.o: sub/foo.c ... \
# sub/foo.h ... \
# ...
set_dir_from "$object"
# Use the source, not the object, to determine the base name, since
# that's sadly what pgcc will do too.
set_base_from "$source"
tmpdepfile=$base.d
# For projects that build the same source file twice into different object
# files, the pgcc approach of using the *source* file root name can cause
# problems in parallel builds. Use a locking strategy to avoid stomping on
# the same $tmpdepfile.
lockdir=$base.d-lock
trap "
echo '$0: caught signal, cleaning up...' >&2
rmdir '$lockdir'
exit 1
" 1 2 13 15
numtries=100
i=$numtries
while test $i -gt 0; do
# mkdir is a portable test-and-set.
if mkdir "$lockdir" 2>/dev/null; then
# This process acquired the lock.
"$@" -MD
stat=$?
# Release the lock.
rmdir "$lockdir"
break
else
# If the lock is being held by a different process, wait
# until the winning process is done or we timeout.
while test -d "$lockdir" && test $i -gt 0; do
sleep 1
i=`expr $i - 1`
done
fi
i=`expr $i - 1`
done
trap - 1 2 13 15
if test $i -le 0; then
echo "$0: failed to acquire lock after $numtries attempts" >&2
echo "$0: check lockdir '$lockdir'" >&2
exit 1
fi
if test $stat -ne 0; then
rm -f "$tmpdepfile"
exit $stat
fi
rm -f "$depfile"
# Each line is of the form `foo.o: dependent.h',
# or `foo.o: dep1.h dep2.h \', or ` dep3.h dep4.h \'.
# Do two passes, one to just change these to
# `$object: dependent.h' and one to simply `dependent.h:'.
sed "s,^[^:]*:,$object :," < "$tmpdepfile" > "$depfile"
# Some versions of the HPUX 10.20 sed can't process this invocation
# correctly. Breaking it into two sed invocations is a workaround.
sed 's,^[^:]*: \(.*\)$,\1,;s/^\\$//;/^$/d;/:$/d' < "$tmpdepfile" \
| sed -e 's/$/ :/' >> "$depfile"
rm -f "$tmpdepfile"
;;
hp2)
# The "hp" stanza above does not work with aCC (C++) and HP's ia64
# compilers, which have integrated preprocessors. The correct option
# to use with these is +Maked; it writes dependencies to a file named
# 'foo.d', which lands next to the object file, wherever that
# happens to be.
# Much of this is similar to the tru64 case; see comments there.
set_dir_from "$object"
set_base_from "$object"
if test "$libtool" = yes; then
tmpdepfile1=$dir$base.d
tmpdepfile2=$dir.libs/$base.d
"$@" -Wc,+Maked
else
tmpdepfile1=$dir$base.d
tmpdepfile2=$dir$base.d
"$@" +Maked
fi
stat=$?
if test $stat -ne 0; then
rm -f "$tmpdepfile1" "$tmpdepfile2"
exit $stat
fi
for tmpdepfile in "$tmpdepfile1" "$tmpdepfile2"
do
test -f "$tmpdepfile" && break
done
if test -f "$tmpdepfile"; then
sed -e "s,^.*\.[$lower]*:,$object:," "$tmpdepfile" > "$depfile"
# Add 'dependent.h:' lines.
sed -ne '2,${
s/^ *//
s/ \\*$//
s/$/:/
p
}' "$tmpdepfile" >> "$depfile"
else
make_dummy_depfile
fi
rm -f "$tmpdepfile" "$tmpdepfile2"
;;
tru64)
# The Tru64 compiler uses -MD to generate dependencies as a side
# effect. 'cc -MD -o foo.o ...' puts the dependencies into 'foo.o.d'.
# At least on Alpha/Redhat 6.1, Compaq CCC V6.2-504 seems to put
# dependencies in 'foo.d' instead, so we check for that too.
# Subdirectories are respected.
set_dir_from "$object"
set_base_from "$object"
if test "$libtool" = yes; then
# Libtool generates 2 separate objects for the 2 libraries. These
# two compilations output dependencies in $dir.libs/$base.o.d and
# in $dir$base.o.d. We have to check for both files, because
# one of the two compilations can be disabled. We should prefer
# $dir$base.o.d over $dir.libs/$base.o.d because the latter is
# automatically cleaned when .libs/ is deleted, while ignoring
# the former would cause a distcleancheck panic.
tmpdepfile1=$dir$base.o.d # libtool 1.5
tmpdepfile2=$dir.libs/$base.o.d # Likewise.
tmpdepfile3=$dir.libs/$base.d # Compaq CCC V6.2-504
"$@" -Wc,-MD
else
tmpdepfile1=$dir$base.d
tmpdepfile2=$dir$base.d
tmpdepfile3=$dir$base.d
"$@" -MD
fi
stat=$?
if test $stat -ne 0; then
rm -f "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3"
exit $stat
fi
for tmpdepfile in "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3"
do
test -f "$tmpdepfile" && break
done
# Same post-processing that is required for AIX mode.
aix_post_process_depfile
;;
msvc7)
if test "$libtool" = yes; then
showIncludes=-Wc,-showIncludes
else
showIncludes=-showIncludes
fi
"$@" $showIncludes > "$tmpdepfile"
stat=$?
grep -v '^Note: including file: ' "$tmpdepfile"
if test $stat -ne 0; then
rm -f "$tmpdepfile"
exit $stat
fi
rm -f "$depfile"
echo "$object : \\" > "$depfile"
# The first sed program below extracts the file names and escapes
# backslashes for cygpath. The second sed program outputs the file
# name when reading, but also accumulates all include files in the
# hold buffer in order to output them again at the end. This only
# works with sed implementations that can handle large buffers.
sed < "$tmpdepfile" -n '
/^Note: including file: *\(.*\)/ {
s//\1/
s/\\/\\\\/g
p
}' | $cygpath_u | sort -u | sed -n '
s/ /\\ /g
s/\(.*\)/'"$tab"'\1 \\/p
s/.\(.*\) \\/\1:/
H
$ {
s/.*/'"$tab"'/
G
p
}' >> "$depfile"
echo >> "$depfile" # make sure the fragment doesn't end with a backslash
rm -f "$tmpdepfile"
;;
msvc7msys)
# This case exists only to let depend.m4 do its work. It works by
# looking at the text of this script. This case will never be run,
# since it is checked for above.
exit 1
;;
#nosideeffect)
# This comment above is used by automake to tell side-effect
# dependency tracking mechanisms from slower ones.
dashmstdout)
# Important note: in order to support this mode, a compiler *must*
# always write the preprocessed file to stdout, regardless of -o.
"$@" || exit $?
# Remove the call to Libtool.
if test "$libtool" = yes; then
while test "X$1" != 'X--mode=compile'; do
shift
done
shift
fi
# Remove '-o $object'.
IFS=" "
for arg
do
case $arg in
-o)
shift
;;
$object)
shift
;;
*)
set fnord "$@" "$arg"
shift # fnord
shift # $arg
;;
esac
done
test -z "$dashmflag" && dashmflag=-M
# Require at least two characters before searching for ':'
# in the target name. This is to cope with DOS-style filenames:
# a dependency such as 'c:/foo/bar' could be seen as target 'c' otherwise.
"$@" $dashmflag |
sed "s|^[$tab ]*[^:$tab ][^:][^:]*:[$tab ]*|$object: |" > "$tmpdepfile"
rm -f "$depfile"
cat < "$tmpdepfile" > "$depfile"
# Some versions of the HPUX 10.20 sed can't process this sed invocation
# correctly. Breaking it into two sed invocations is a workaround.
tr ' ' "$nl" < "$tmpdepfile" \
| sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' \
| sed -e 's/$/ :/' >> "$depfile"
rm -f "$tmpdepfile"
;;
dashXmstdout)
# This case only exists to satisfy depend.m4. It is never actually
# run, as this mode is specially recognized in the preamble.
exit 1
;;
makedepend)
"$@" || exit $?
# Remove any Libtool call
if test "$libtool" = yes; then
while test "X$1" != 'X--mode=compile'; do
shift
done
shift
fi
# X makedepend
shift
cleared=no eat=no
for arg
do
case $cleared in
no)
set ""; shift
cleared=yes ;;
esac
if test $eat = yes; then
eat=no
continue
fi
case "$arg" in
-D*|-I*)
set fnord "$@" "$arg"; shift ;;
# Strip any option that makedepend may not understand. Remove
# the object too, otherwise makedepend will parse it as a source file.
-arch)
eat=yes ;;
-*|$object)
;;
*)
set fnord "$@" "$arg"; shift ;;
esac
done
obj_suffix=`echo "$object" | sed 's/^.*\././'`
touch "$tmpdepfile"
${MAKEDEPEND-makedepend} -o"$obj_suffix" -f"$tmpdepfile" "$@"
rm -f "$depfile"
# makedepend may prepend the VPATH from the source file name to the object.
# No need to regex-escape $object, excess matching of '.' is harmless.
sed "s|^.*\($object *:\)|\1|" "$tmpdepfile" > "$depfile"
# Some versions of the HPUX 10.20 sed can't process the last invocation
# correctly. Breaking it into two sed invocations is a workaround.
sed '1,2d' "$tmpdepfile" \
| tr ' ' "$nl" \
| sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' \
| sed -e 's/$/ :/' >> "$depfile"
rm -f "$tmpdepfile" "$tmpdepfile".bak
;;
cpp)
# Important note: in order to support this mode, a compiler *must*
# always write the preprocessed file to stdout.
"$@" || exit $?
# Remove the call to Libtool.
if test "$libtool" = yes; then
while test "X$1" != 'X--mode=compile'; do
shift
done
shift
fi
# Remove '-o $object'.
IFS=" "
for arg
do
case $arg in
-o)
shift
;;
$object)
shift
;;
*)
set fnord "$@" "$arg"
shift # fnord
shift # $arg
;;
esac
done
"$@" -E \
| sed -n -e '/^# [0-9][0-9]* "\([^"]*\)".*/ s:: \1 \\:p' \
-e '/^#line [0-9][0-9]* "\([^"]*\)".*/ s:: \1 \\:p' \
| sed '$ s: \\$::' > "$tmpdepfile"
rm -f "$depfile"
echo "$object : \\" > "$depfile"
cat < "$tmpdepfile" >> "$depfile"
sed < "$tmpdepfile" '/^$/d;s/^ //;s/ \\$//;s/$/ :/' >> "$depfile"
rm -f "$tmpdepfile"
;;
msvisualcpp)
# Important note: in order to support this mode, a compiler *must*
# always write the preprocessed file to stdout.
"$@" || exit $?
# Remove the call to Libtool.
if test "$libtool" = yes; then
while test "X$1" != 'X--mode=compile'; do
shift
done
shift
fi
IFS=" "
for arg
do
case "$arg" in
-o)
shift
;;
$object)
shift
;;
"-Gm"|"/Gm"|"-Gi"|"/Gi"|"-ZI"|"/ZI")
set fnord "$@"
shift
shift
;;
*)
set fnord "$@" "$arg"
shift
shift
;;
esac
done
"$@" -E 2>/dev/null |
sed -n '/^#line [0-9][0-9]* "\([^"]*\)"/ s::\1:p' | $cygpath_u | sort -u > "$tmpdepfile"
rm -f "$depfile"
echo "$object : \\" > "$depfile"
sed < "$tmpdepfile" -n -e 's% %\\ %g' -e '/^\(.*\)$/ s::'"$tab"'\1 \\:p' >> "$depfile"
echo "$tab" >> "$depfile"
sed < "$tmpdepfile" -n -e 's% %\\ %g' -e '/^\(.*\)$/ s::\1\::p' >> "$depfile"
rm -f "$tmpdepfile"
;;
msvcmsys)
# This case exists only to let depend.m4 do its work. It works by
# looking at the text of this script. This case will never be run,
# since it is checked for above.
exit 1
;;
none)
exec "$@"
;;
*)
echo "Unknown depmode $depmode" 1>&2
exit 1
;;
esac
exit 0
# Local Variables:
# mode: shell-script
# sh-indentation: 2
# eval: (add-hook 'before-save-hook 'time-stamp)
# time-stamp-start: "scriptversion="
# time-stamp-format: "%:y-%02m-%02d.%02H"
# time-stamp-time-zone: "UTC0"
# time-stamp-end: "; # UTC"
# End:

View File

@@ -7,7 +7,7 @@
# This file is part of HDF5. The full HDF5 copyright notice, including
# terms governing use, modification, and redistribution, is contained in
# the COPYING file, which can be found at the root of the source code
# distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases.
# distribution tree, or in https://www.hdfgroup.org/licenses.
# If you do not have access to either file, you may request a copy from
# help@hdfgroup.org.
#

View File

@@ -7,7 +7,7 @@
# This file is part of HDF5. The full HDF5 copyright notice, including
# terms governing use, modification, and redistribution, is contained in
# the COPYING file, which can be found at the root of the source code
# distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases.
# distribution tree, or in https://www.hdfgroup.org/licenses.
# If you do not have access to either file, you may request a copy from
# help@hdfgroup.org.
#

View File

@@ -10,7 +10,7 @@ eval 'exec perl -p -x -S $0 ${1+"$@"}'
# This file is part of HDF5. The full HDF5 copyright notice, including
# terms governing use, modification, and redistribution, is contained in
# the COPYING file, which can be found at the root of the source code
# distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases.
# distribution tree, or in https://www.hdfgroup.org/licenses.
# If you do not have access to either file, you may request a copy from
# help@hdfgroup.org.
#

View File

@@ -13,11 +13,11 @@ use Text::Tabs;
# This file is part of HDF5. The full HDF5 copyright notice, including
# terms governing use, modification, and redistribution, is contained in
# the COPYING file, which can be found at the root of the source code
# distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases.
# distribution tree, or in https://www.hdfgroup.org/licenses.
# If you do not have access to either file, you may request a copy from
# help@hdfgroup.org.
#
# Robb Matzke, matzke@llnl.gov
# Robb Matzke
# 30 Aug 1997
#
# Purpose: This script will read standard input which should be a

26
bin/format_source Executable file
View File

@@ -0,0 +1,26 @@
#!/bin/bash
#
# Recursively format all C & C++ sources and header files, except those in the
# 'config' directory and generated files, such as H5LTanalyze.c, etc.
#
# Note that any files or directories that are excluded here should also be
# added to the 'exclude' list in .github/workflows/clang-format-check.yml
#
# (Remember to update both bin/format_source and bin/format_source_patch)
find . \( -type d -path ./config -prune -and -not -path ./config \) \
-or \( \( \! \( \
-name H5LTanalyze.c \
-or -name H5LTparse.c \
-or -name H5LTparse.h \
-or -name H5Epubgen.h \
-or -name H5Einit.h \
-or -name H5Eterm.h \
-or -name H5Edefin.h \
-or -name H5version.h \
-or -name H5overflow.h \
\) \) \
-and \( -iname *.h -or -iname *.c -or -iname *.cpp -or -iname *.hpp \) \) \
| xargs clang-format -style=file -i -fallback-style=none
exit 0

34
bin/format_source_patch Executable file
View File

@@ -0,0 +1,34 @@
#!/bin/bash
#
# Recursively format all C & C++ sources and header files, except those in the
# 'config' directory and generated files, such as H5LTanalyze.c, etc.
#
# Note that any files or directories that are excluded here should also be
# added to the 'exclude' list in .github/workflows/clang-format-check.yml
#
# (Remember to update both bin/format_source and bin/format_source_patch)
find . \( -type d -path ./config -prune -and -not -path ./config \) \
-or \( \( \! \( \
-name H5LTanalyze.c \
-or -name H5LTparse.c \
-or -name H5LTparse.h \
-or -name H5Epubgen.h \
-or -name H5Einit.h \
-or -name H5Eterm.h \
-or -name H5Edefin.h \
-or -name H5version.h \
-or -name H5overflow.h \
\) \) \
-and \( -iname *.h -or -iname *.c -or -iname *.cpp -or -iname *.hpp \) \) \
| xargs clang-format -style=file -i -fallback-style=none
git diff > clang_format.patch
# Delete if 0 size
if [ ! -s clang_format.patch ]
then
rm clang_format.patch
fi
exit 0

View File

@@ -7,7 +7,7 @@
# This file is part of HDF5. The full HDF5 copyright notice, including
# terms governing use, modification, and redistribution, is contained in
# the COPYING file, which can be found at the root of the source code
# distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases.
# distribution tree, or in https://www.hdfgroup.org/licenses.
# If you do not have access to either file, you may request a copy from
# help@hdfgroup.org.

View File

@@ -1,12 +1,12 @@
#! /bin/bash
#
# Copyright by The HDF Group.
# All rights reserved.
#
# This file is part of HDF5. The full HDF5 copyright notice, including
# terms governing use, modification, and redistribution, is contained in
# Copyright by The HDF Group.
# All rights reserved.
#
# This file is part of HDF5. The full HDF5 copyright notice, including
# terms governing use, modification, and redistribution, is contained in
# the COPYING file, which can be found at the root of the source code
# distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases.
# distribution tree, or in https://www.hdfgroup.org/licenses.
# If you do not have access to either file, you may request a copy from
# help@hdfgroup.org.
#
@@ -200,28 +200,34 @@ if [ "$verbose" = true ] ; then
fi
${HDF5_FLEX} --nounistd -PH5LTyy -o ${path_to_hl_src}/H5LTanalyze.c ${path_to_hl_src}/H5LTanalyze.l
# fix H5LTparse.c to declare H5LTyyparse return type as an hid_t
# instead of int. Currently the generated function H5LTyyparse is
# fix H5LTparse.c and H5LTlparse.h to declare H5LTyyparse return type as an
# hid_t instead of int. Currently the generated function H5LTyyparse is
# generated with a return value of type int, which is a mapping to the
# flex yyparse function. The return value in the HL library should be
# an hid_t.
# I propose to not use flex to generate this function, but for now I am
# an hid_t.
# I propose to not use flex to generate this function, but for now I am
# adding a perl command to find and replace this function declaration in
# H5LTparse.c.
perl -0777 -pi -e 's/int yyparse/hid_t yyparse/igs' ${path_to_hl_src}/H5LTparse.c
perl -0777 -pi -e 's/int\nyyparse/hid_t\nyyparse/igs' ${path_to_hl_src}/H5LTparse.c
perl -0777 -pi -e 's/int H5LTyyparse/hid_t H5LTyyparse/igs' ${path_to_hl_src}/H5LTparse.c
perl -0777 -pi -e 's/int yyparse/hid_t yyparse/igs' ${path_to_hl_src}/H5LTparse.h
perl -0777 -pi -e 's/int\nyyparse/hid_t\nyyparse/igs' ${path_to_hl_src}/H5LTparse.h
perl -0777 -pi -e 's/int H5LTyyparse/hid_t H5LTyyparse/igs' ${path_to_hl_src}/H5LTparse.h
# Add code that disables warnings in the flex/bison-generated code.
#
# Note that the GCC pragmas did not exist until gcc 4.2. Earlier versions
# will simply ignore them, but we want to avoid those warnings.
#
# Note also that although clang defines __GNUC__, it doesn't support every
# warning that GCC does.
for f in ${path_to_hl_src}/H5LTparse.c ${path_to_hl_src}/H5LTanalyze.c
do
echo '#if defined __GNUC__ && 402 <= __GNUC__ * 100 + __GNUC_MINOR__ ' >> tmp.out
echo '#if defined (__GNUC__) ' >> tmp.out
echo '#if ((__GNUC__ * 100) + __GNUC_MINOR__) >= 402 ' >> tmp.out
echo '#pragma GCC diagnostic ignored "-Wconversion" ' >> tmp.out
echo '#pragma GCC diagnostic ignored "-Wimplicit-function-declaration" ' >> tmp.out
echo '#pragma GCC diagnostic ignored "-Wlarger-than=" ' >> tmp.out
echo '#pragma GCC diagnostic ignored "-Wmissing-prototypes" ' >> tmp.out
echo '#pragma GCC diagnostic ignored "-Wnested-externs" ' >> tmp.out
echo '#pragma GCC diagnostic ignored "-Wold-style-definition" ' >> tmp.out
@@ -230,11 +236,19 @@ do
echo '#pragma GCC diagnostic ignored "-Wsign-conversion" ' >> tmp.out
echo '#pragma GCC diagnostic ignored "-Wstrict-overflow" ' >> tmp.out
echo '#pragma GCC diagnostic ignored "-Wstrict-prototypes" ' >> tmp.out
echo '#if !defined (__clang__) ' >> tmp.out
echo '#pragma GCC diagnostic ignored "-Wlarger-than=" ' >> tmp.out
echo '#pragma GCC diagnostic ignored "-Wsuggest-attribute=const" ' >> tmp.out
echo '#pragma GCC diagnostic ignored "-Wsuggest-attribute=pure" ' >> tmp.out
echo '#endif ' >> tmp.out
echo '#pragma GCC diagnostic ignored "-Wswitch-default" ' >> tmp.out
echo '#pragma GCC diagnostic ignored "-Wunused-function" ' >> tmp.out
echo '#pragma GCC diagnostic ignored "-Wunused-macros" ' >> tmp.out
echo '#pragma GCC diagnostic ignored "-Wunused-parameter" ' >> tmp.out
echo '#endif ' >> tmp.out
echo '#if ((__GNUC__ * 100) + __GNUC_MINOR__) >= 600 ' >> tmp.out
echo '#pragma GCC diagnostic ignored "-Wnull-dereference" ' >> tmp.out
echo '#endif ' >> tmp.out
echo '#elif defined __SUNPRO_CC ' >> tmp.out
echo '#pragma disable_warn ' >> tmp.out
echo '#elif defined _MSC_VER ' >> tmp.out

View File

@@ -7,7 +7,7 @@
# This file is part of HDF5. The full HDF5 copyright notice, including
# terms governing use, modification, and redistribution, is contained in
# the COPYING file, which can be found at the root of the source code
# distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases.
# distribution tree, or in https://www.hdfgroup.org/licenses.
# If you do not have access to either file, you may request a copy from
# help@hdfgroup.org.
##

View File

@@ -7,7 +7,7 @@
# This file is part of HDF5. The full HDF5 copyright notice, including
# terms governing use, modification, and redistribution, is contained in
# the COPYING file, which can be found at the root of the source code
# distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases.
# distribution tree, or in https://www.hdfgroup.org/licenses.
# If you do not have access to either file, you may request a copy from
# help@hdfgroup.org.
#

View File

@@ -13,11 +13,11 @@ use strict;
# This file is part of HDF5. The full HDF5 copyright notice, including
# terms governing use, modification, and redistribution, is contained in
# the COPYING file, which can be found at the root of the source code
# distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases.
# distribution tree, or in https://www.hdfgroup.org/licenses.
# If you do not have access to either file, you may request a copy from
# help@hdfgroup.org.
#
# Robb Matzke <matzke@llnl.gov>
# Robb Matzke
# 17 July 1998
### Purpose

518
bin/install-sh Executable file
View File

@@ -0,0 +1,518 @@
#!/bin/sh
# install - install a program, script, or datafile
scriptversion=2018-03-11.20; # UTC
# This originates from X11R5 (mit/util/scripts/install.sh), which was
# later released in X11R6 (xc/config/util/install.sh) with the
# following copyright and license.
#
# Copyright (C) 1994 X Consortium
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to
# deal in the Software without restriction, including without limitation the
# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
# sell copies of the Software, and to permit persons to whom the Software is
# furnished to do so, subject to the following conditions:
#
# The above copyright notice and this permission notice shall be included in
# all copies or substantial portions of the Software.
#
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
# X CONSORTIUM BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
# AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNEC-
# TION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
#
# Except as contained in this notice, the name of the X Consortium shall not
# be used in advertising or otherwise to promote the sale, use or other deal-
# ings in this Software without prior written authorization from the X Consor-
# tium.
#
#
# FSF changes to this file are in the public domain.
#
# Calling this script install-sh is preferred over install.sh, to prevent
# 'make' implicit rules from creating a file called install from it
# when there is no Makefile.
#
# This script is compatible with the BSD install script, but was written
# from scratch.
tab=' '
nl='
'
IFS=" $tab$nl"
# Set DOITPROG to "echo" to test this script.
doit=${DOITPROG-}
doit_exec=${doit:-exec}
# Put in absolute file names if you don't have them in your path;
# or use environment vars.
chgrpprog=${CHGRPPROG-chgrp}
chmodprog=${CHMODPROG-chmod}
chownprog=${CHOWNPROG-chown}
cmpprog=${CMPPROG-cmp}
cpprog=${CPPROG-cp}
mkdirprog=${MKDIRPROG-mkdir}
mvprog=${MVPROG-mv}
rmprog=${RMPROG-rm}
stripprog=${STRIPPROG-strip}
posix_mkdir=
# Desired mode of installed file.
mode=0755
chgrpcmd=
chmodcmd=$chmodprog
chowncmd=
mvcmd=$mvprog
rmcmd="$rmprog -f"
stripcmd=
src=
dst=
dir_arg=
dst_arg=
copy_on_change=false
is_target_a_directory=possibly
usage="\
Usage: $0 [OPTION]... [-T] SRCFILE DSTFILE
or: $0 [OPTION]... SRCFILES... DIRECTORY
or: $0 [OPTION]... -t DIRECTORY SRCFILES...
or: $0 [OPTION]... -d DIRECTORIES...
In the 1st form, copy SRCFILE to DSTFILE.
In the 2nd and 3rd, copy all SRCFILES to DIRECTORY.
In the 4th, create DIRECTORIES.
Options:
--help display this help and exit.
--version display version info and exit.
-c (ignored)
-C install only if different (preserve the last data modification time)
-d create directories instead of installing files.
-g GROUP $chgrpprog installed files to GROUP.
-m MODE $chmodprog installed files to MODE.
-o USER $chownprog installed files to USER.
-s $stripprog installed files.
-t DIRECTORY install into DIRECTORY.
-T report an error if DSTFILE is a directory.
Environment variables override the default commands:
CHGRPPROG CHMODPROG CHOWNPROG CMPPROG CPPROG MKDIRPROG MVPROG
RMPROG STRIPPROG
"
while test $# -ne 0; do
case $1 in
-c) ;;
-C) copy_on_change=true;;
-d) dir_arg=true;;
-g) chgrpcmd="$chgrpprog $2"
shift;;
--help) echo "$usage"; exit $?;;
-m) mode=$2
case $mode in
*' '* | *"$tab"* | *"$nl"* | *'*'* | *'?'* | *'['*)
echo "$0: invalid mode: $mode" >&2
exit 1;;
esac
shift;;
-o) chowncmd="$chownprog $2"
shift;;
-s) stripcmd=$stripprog;;
-t)
is_target_a_directory=always
dst_arg=$2
# Protect names problematic for 'test' and other utilities.
case $dst_arg in
-* | [=\(\)!]) dst_arg=./$dst_arg;;
esac
shift;;
-T) is_target_a_directory=never;;
--version) echo "$0 $scriptversion"; exit $?;;
--) shift
break;;
-*) echo "$0: invalid option: $1" >&2
exit 1;;
*) break;;
esac
shift
done
# We allow the use of options -d and -T together, by making -d
# take the precedence; this is for compatibility with GNU install.
if test -n "$dir_arg"; then
if test -n "$dst_arg"; then
echo "$0: target directory not allowed when installing a directory." >&2
exit 1
fi
fi
if test $# -ne 0 && test -z "$dir_arg$dst_arg"; then
# When -d is used, all remaining arguments are directories to create.
# When -t is used, the destination is already specified.
# Otherwise, the last argument is the destination. Remove it from $@.
for arg
do
if test -n "$dst_arg"; then
# $@ is not empty: it contains at least $arg.
set fnord "$@" "$dst_arg"
shift # fnord
fi
shift # arg
dst_arg=$arg
# Protect names problematic for 'test' and other utilities.
case $dst_arg in
-* | [=\(\)!]) dst_arg=./$dst_arg;;
esac
done
fi
if test $# -eq 0; then
if test -z "$dir_arg"; then
echo "$0: no input file specified." >&2
exit 1
fi
# It's OK to call 'install-sh -d' without argument.
# This can happen when creating conditional directories.
exit 0
fi
if test -z "$dir_arg"; then
if test $# -gt 1 || test "$is_target_a_directory" = always; then
if test ! -d "$dst_arg"; then
echo "$0: $dst_arg: Is not a directory." >&2
exit 1
fi
fi
fi
if test -z "$dir_arg"; then
do_exit='(exit $ret); exit $ret'
trap "ret=129; $do_exit" 1
trap "ret=130; $do_exit" 2
trap "ret=141; $do_exit" 13
trap "ret=143; $do_exit" 15
# Set umask so as not to create temps with too-generous modes.
# However, 'strip' requires both read and write access to temps.
case $mode in
# Optimize common cases.
*644) cp_umask=133;;
*755) cp_umask=22;;
*[0-7])
if test -z "$stripcmd"; then
u_plus_rw=
else
u_plus_rw='% 200'
fi
cp_umask=`expr '(' 777 - $mode % 1000 ')' $u_plus_rw`;;
*)
if test -z "$stripcmd"; then
u_plus_rw=
else
u_plus_rw=,u+rw
fi
cp_umask=$mode$u_plus_rw;;
esac
fi
for src
do
# Protect names problematic for 'test' and other utilities.
case $src in
-* | [=\(\)!]) src=./$src;;
esac
if test -n "$dir_arg"; then
dst=$src
dstdir=$dst
test -d "$dstdir"
dstdir_status=$?
else
# Waiting for this to be detected by the "$cpprog $src $dsttmp" command
# might cause directories to be created, which would be especially bad
# if $src (and thus $dsttmp) contains '*'.
if test ! -f "$src" && test ! -d "$src"; then
echo "$0: $src does not exist." >&2
exit 1
fi
if test -z "$dst_arg"; then
echo "$0: no destination specified." >&2
exit 1
fi
dst=$dst_arg
# If destination is a directory, append the input filename.
if test -d "$dst"; then
if test "$is_target_a_directory" = never; then
echo "$0: $dst_arg: Is a directory" >&2
exit 1
fi
dstdir=$dst
dstbase=`basename "$src"`
case $dst in
*/) dst=$dst$dstbase;;
*) dst=$dst/$dstbase;;
esac
dstdir_status=0
else
dstdir=`dirname "$dst"`
test -d "$dstdir"
dstdir_status=$?
fi
fi
case $dstdir in
*/) dstdirslash=$dstdir;;
*) dstdirslash=$dstdir/;;
esac
obsolete_mkdir_used=false
if test $dstdir_status != 0; then
case $posix_mkdir in
'')
# Create intermediate dirs using mode 755 as modified by the umask.
# This is like FreeBSD 'install' as of 1997-10-28.
umask=`umask`
case $stripcmd.$umask in
# Optimize common cases.
*[2367][2367]) mkdir_umask=$umask;;
.*0[02][02] | .[02][02] | .[02]) mkdir_umask=22;;
*[0-7])
mkdir_umask=`expr $umask + 22 \
- $umask % 100 % 40 + $umask % 20 \
- $umask % 10 % 4 + $umask % 2
`;;
*) mkdir_umask=$umask,go-w;;
esac
# With -d, create the new directory with the user-specified mode.
# Otherwise, rely on $mkdir_umask.
if test -n "$dir_arg"; then
mkdir_mode=-m$mode
else
mkdir_mode=
fi
posix_mkdir=false
case $umask in
*[123567][0-7][0-7])
# POSIX mkdir -p sets u+wx bits regardless of umask, which
# is incompatible with FreeBSD 'install' when (umask & 300) != 0.
;;
*)
# Note that $RANDOM variable is not portable (e.g. dash); Use it
# here however when possible just to lower collision chance.
tmpdir=${TMPDIR-/tmp}/ins$RANDOM-$$
trap 'ret=$?; rmdir "$tmpdir/a/b" "$tmpdir/a" "$tmpdir" 2>/dev/null; exit $ret' 0
# Because "mkdir -p" follows existing symlinks and we likely work
# directly in world-writeable /tmp, make sure that the '$tmpdir'
# directory is successfully created first before we actually test
# 'mkdir -p' feature.
if (umask $mkdir_umask &&
$mkdirprog $mkdir_mode "$tmpdir" &&
exec $mkdirprog $mkdir_mode -p -- "$tmpdir/a/b") >/dev/null 2>&1
then
if test -z "$dir_arg" || {
# Check for POSIX incompatibilities with -m.
# HP-UX 11.23 and IRIX 6.5 mkdir -m -p sets group- or
# other-writable bit of parent directory when it shouldn't.
# FreeBSD 6.1 mkdir -m -p sets mode of existing directory.
test_tmpdir="$tmpdir/a"
ls_ld_tmpdir=`ls -ld "$test_tmpdir"`
case $ls_ld_tmpdir in
d????-?r-*) different_mode=700;;
d????-?--*) different_mode=755;;
*) false;;
esac &&
$mkdirprog -m$different_mode -p -- "$test_tmpdir" && {
ls_ld_tmpdir_1=`ls -ld "$test_tmpdir"`
test "$ls_ld_tmpdir" = "$ls_ld_tmpdir_1"
}
}
then posix_mkdir=:
fi
rmdir "$tmpdir/a/b" "$tmpdir/a" "$tmpdir"
else
# Remove any dirs left behind by ancient mkdir implementations.
rmdir ./$mkdir_mode ./-p ./-- "$tmpdir" 2>/dev/null
fi
trap '' 0;;
esac;;
esac
if
$posix_mkdir && (
umask $mkdir_umask &&
$doit_exec $mkdirprog $mkdir_mode -p -- "$dstdir"
)
then :
else
# The umask is ridiculous, or mkdir does not conform to POSIX,
# or it failed possibly due to a race condition. Create the
# directory the slow way, step by step, checking for races as we go.
case $dstdir in
/*) prefix='/';;
[-=\(\)!]*) prefix='./';;
*) prefix='';;
esac
oIFS=$IFS
IFS=/
set -f
set fnord $dstdir
shift
set +f
IFS=$oIFS
prefixes=
for d
do
test X"$d" = X && continue
prefix=$prefix$d
if test -d "$prefix"; then
prefixes=
else
if $posix_mkdir; then
(umask=$mkdir_umask &&
$doit_exec $mkdirprog $mkdir_mode -p -- "$dstdir") && break
# Don't fail if two instances are running concurrently.
test -d "$prefix" || exit 1
else
case $prefix in
*\'*) qprefix=`echo "$prefix" | sed "s/'/'\\\\\\\\''/g"`;;
*) qprefix=$prefix;;
esac
prefixes="$prefixes '$qprefix'"
fi
fi
prefix=$prefix/
done
if test -n "$prefixes"; then
# Don't fail if two instances are running concurrently.
(umask $mkdir_umask &&
eval "\$doit_exec \$mkdirprog $prefixes") ||
test -d "$dstdir" || exit 1
obsolete_mkdir_used=true
fi
fi
fi
if test -n "$dir_arg"; then
{ test -z "$chowncmd" || $doit $chowncmd "$dst"; } &&
{ test -z "$chgrpcmd" || $doit $chgrpcmd "$dst"; } &&
{ test "$obsolete_mkdir_used$chowncmd$chgrpcmd" = false ||
test -z "$chmodcmd" || $doit $chmodcmd $mode "$dst"; } || exit 1
else
# Make a couple of temp file names in the proper directory.
dsttmp=${dstdirslash}_inst.$$_
rmtmp=${dstdirslash}_rm.$$_
# Trap to clean up those temp files at exit.
trap 'ret=$?; rm -f "$dsttmp" "$rmtmp" && exit $ret' 0
# Copy the file name to the temp name.
(umask $cp_umask && $doit_exec $cpprog "$src" "$dsttmp") &&
# and set any options; do chmod last to preserve setuid bits.
#
# If any of these fail, we abort the whole thing. If we want to
# ignore errors from any of these, just make sure not to ignore
# errors from the above "$doit $cpprog $src $dsttmp" command.
#
{ test -z "$chowncmd" || $doit $chowncmd "$dsttmp"; } &&
{ test -z "$chgrpcmd" || $doit $chgrpcmd "$dsttmp"; } &&
{ test -z "$stripcmd" || $doit $stripcmd "$dsttmp"; } &&
{ test -z "$chmodcmd" || $doit $chmodcmd $mode "$dsttmp"; } &&
# If -C, don't bother to copy if it wouldn't change the file.
if $copy_on_change &&
old=`LC_ALL=C ls -dlL "$dst" 2>/dev/null` &&
new=`LC_ALL=C ls -dlL "$dsttmp" 2>/dev/null` &&
set -f &&
set X $old && old=:$2:$4:$5:$6 &&
set X $new && new=:$2:$4:$5:$6 &&
set +f &&
test "$old" = "$new" &&
$cmpprog "$dst" "$dsttmp" >/dev/null 2>&1
then
rm -f "$dsttmp"
else
# Rename the file to the real destination.
$doit $mvcmd -f "$dsttmp" "$dst" 2>/dev/null ||
# The rename failed, perhaps because mv can't rename something else
# to itself, or perhaps because mv is so ancient that it does not
# support -f.
{
# Now remove or move aside any old file at destination location.
# We try this two ways since rm can't unlink itself on some
# systems and the destination file might be busy for other
# reasons. In this case, the final cleanup might fail but the new
# file should still install successfully.
{
test ! -f "$dst" ||
$doit $rmcmd -f "$dst" 2>/dev/null ||
{ $doit $mvcmd -f "$dst" "$rmtmp" 2>/dev/null &&
{ $doit $rmcmd -f "$rmtmp" 2>/dev/null; :; }
} ||
{ echo "$0: cannot unlink or rename $dst" >&2
(exit 1); exit 1
}
} &&
# Now rename the file to the real destination.
$doit $mvcmd "$dsttmp" "$dst"
}
fi || exit 1
trap '' 0
fi
done
# Local variables:
# eval: (add-hook 'before-save-hook 'time-stamp)
# time-stamp-start: "scriptversion="
# time-stamp-format: "%:y-%02m-%02d.%02H"
# time-stamp-time-zone: "UTC0"
# time-stamp-end: "; # UTC"
# End:

View File

@@ -7,7 +7,7 @@
# This file is part of HDF5. The full HDF5 copyright notice, including
# terms governing use, modification, and redistribution, is contained in
# the COPYING file, which can be found at the root of the source code
# distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases.
# distribution tree, or in https://www.hdfgroup.org/licenses.
# If you do not have access to either file, you may request a copy from
# help@hdfgroup.org.
#

View File

@@ -7,7 +7,7 @@
# This file is part of HDF5. The full HDF5 copyright notice, including
# terms governing use, modification, and redistribution, is contained in
# the COPYING file, which can be found at the root of the source code
# distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases.
# distribution tree, or in https://www.hdfgroup.org/licenses.
# If you do not have access to either file, you may request a copy from
# help@hdfgroup.org.
#

11251
bin/ltmain.sh Normal file

File diff suppressed because it is too large Load Diff

View File

@@ -11,7 +11,7 @@ use warnings;
# This file is part of HDF5. The full HDF5 copyright notice, including
# terms governing use, modification, and redistribution, is contained in
# the COPYING file, which can be found at the root of the source code
# distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases.
# distribution tree, or in https://www.hdfgroup.org/licenses.
# If you do not have access to either file, you may request a copy from
# help@hdfgroup.org.
#
@@ -38,7 +38,7 @@ sub print_copyright ($) {
print $fh " * This file is part of HDF5. The full HDF5 copyright notice, including *\n";
print $fh " * terms governing use, modification, and redistribution, is contained in *\n";
print $fh " * the COPYING file, which can be found at the root of the source code *\n";
print $fh " * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. *\n";
print $fh " * distribution tree, or in https://www.hdfgroup.org/licenses. *\n";
print $fh " * If you do not have access to either file, you may request a copy from *\n";
print $fh " * help\@hdfgroup.org. *\n";
print $fh " * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */\n";
@@ -64,8 +64,8 @@ sub print_startprotect ($$) {
$file =~ s/(\w*)\.h/$1/;
# Print the ifdef info
print $fh "\n#ifndef _${file}_H\n";
print $fh "#define _${file}_H\n";
print $fh "\n#ifndef ${file}_H\n";
print $fh "#define ${file}_H\n";
}
##############################################################################

View File

@@ -16,7 +16,7 @@ my @ctypes = ( () );
# This file is part of HDF5. The full HDF5 copyright notice, including
# terms governing use, modification, and redistribution, is contained in
# the COPYING file, which can be found at the root of the source code
# distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases.
# distribution tree, or in https://www.hdfgroup.org/licenses.
# If you do not have access to either file, you may request a copy from
# help@hdfgroup.org.
#
@@ -67,7 +67,7 @@ sub print_copyright ($) {
print $fh " * This file is part of HDF5. The full HDF5 copyright notice, including *\n";
print $fh " * terms governing use, modification, and redistribution, is contained in *\n";
print $fh " * the COPYING file, which can be found at the root of the source code *\n";
print $fh " * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. *\n";
print $fh " * distribution tree, or in https://www.hdfgroup.org/licenses. *\n";
print $fh " * If you do not have access to either file, you may request a copy from *\n";
print $fh " * help\@hdfgroup.org. *\n";
print $fh " * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */\n";
@@ -93,8 +93,8 @@ sub print_startprotect ($$) {
$file =~ s/(\w*)\.h/$1/;
# Print the ifdef info
print $fh "\n#ifndef _${file}_H\n";
print $fh "#define _${file}_H\n";
print $fh "\n#ifndef ${file}_H\n";
print $fh "#define ${file}_H\n";
}
##############################################################################

View File

@@ -25,7 +25,7 @@ $indent = 2;
# This file is part of HDF5. The full HDF5 copyright notice, including
# terms governing use, modification, and redistribution, is contained in
# the COPYING file, which can be found at the root of the source code
# distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases.
# distribution tree, or in https://www.hdfgroup.org/licenses.
# If you do not have access to either file, you may request a copy from
# help@hdfgroup.org.
#
@@ -52,7 +52,7 @@ sub print_copyright ($) {
print $fh " * This file is part of HDF5. The full HDF5 copyright notice, including *\n";
print $fh " * terms governing use, modification, and redistribution, is contained in *\n";
print $fh " * the COPYING file, which can be found at the root of the source code *\n";
print $fh " * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. *\n";
print $fh " * distribution tree, or in https://www.hdfgroup.org/licenses. *\n";
print $fh " * If you do not have access to either file, you may request a copy from *\n";
print $fh " * help\@hdfgroup.org. *\n";
print $fh " * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */\n";
@@ -78,8 +78,8 @@ sub print_startprotect ($$) {
$file =~ s/(\w*)\.h/$1/;
# Print the ifdef info
print $fh "\n#ifndef _${file}_H\n";
print $fh "#define _${file}_H\n";
print $fh "\n#ifndef ${file}_H\n";
print $fh "#define ${file}_H\n";
}
##############################################################################

215
bin/missing Executable file
View File

@@ -0,0 +1,215 @@
#! /bin/sh
# Common wrapper for a few potentially missing GNU programs.
scriptversion=2018-03-07.03; # UTC
# Copyright (C) 1996-2018 Free Software Foundation, Inc.
# Originally written by Fran,cois Pinard <pinard@iro.umontreal.ca>, 1996.
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2, or (at your option)
# any later version.
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <https://www.gnu.org/licenses/>.
# As a special exception to the GNU General Public License, if you
# distribute this file as part of a program that contains a
# configuration script generated by Autoconf, you may include it under
# the same distribution terms that you use for the rest of that program.
if test $# -eq 0; then
echo 1>&2 "Try '$0 --help' for more information"
exit 1
fi
case $1 in
--is-lightweight)
# Used by our autoconf macros to check whether the available missing
# script is modern enough.
exit 0
;;
--run)
# Back-compat with the calling convention used by older automake.
shift
;;
-h|--h|--he|--hel|--help)
echo "\
$0 [OPTION]... PROGRAM [ARGUMENT]...
Run 'PROGRAM [ARGUMENT]...', returning a proper advice when this fails due
to PROGRAM being missing or too old.
Options:
-h, --help display this help and exit
-v, --version output version information and exit
Supported PROGRAM values:
aclocal autoconf autoheader autom4te automake makeinfo
bison yacc flex lex help2man
Version suffixes to PROGRAM as well as the prefixes 'gnu-', 'gnu', and
'g' are ignored when checking the name.
Send bug reports to <bug-automake@gnu.org>."
exit $?
;;
-v|--v|--ve|--ver|--vers|--versi|--versio|--version)
echo "missing $scriptversion (GNU Automake)"
exit $?
;;
-*)
echo 1>&2 "$0: unknown '$1' option"
echo 1>&2 "Try '$0 --help' for more information"
exit 1
;;
esac
# Run the given program, remember its exit status.
"$@"; st=$?
# If it succeeded, we are done.
test $st -eq 0 && exit 0
# Also exit now if we it failed (or wasn't found), and '--version' was
# passed; such an option is passed most likely to detect whether the
# program is present and works.
case $2 in --version|--help) exit $st;; esac
# Exit code 63 means version mismatch. This often happens when the user
# tries to use an ancient version of a tool on a file that requires a
# minimum version.
if test $st -eq 63; then
msg="probably too old"
elif test $st -eq 127; then
# Program was missing.
msg="missing on your system"
else
# Program was found and executed, but failed. Give up.
exit $st
fi
perl_URL=https://www.perl.org/
flex_URL=https://github.com/westes/flex
gnu_software_URL=https://www.gnu.org/software
program_details ()
{
case $1 in
aclocal|automake)
echo "The '$1' program is part of the GNU Automake package:"
echo "<$gnu_software_URL/automake>"
echo "It also requires GNU Autoconf, GNU m4 and Perl in order to run:"
echo "<$gnu_software_URL/autoconf>"
echo "<$gnu_software_URL/m4/>"
echo "<$perl_URL>"
;;
autoconf|autom4te|autoheader)
echo "The '$1' program is part of the GNU Autoconf package:"
echo "<$gnu_software_URL/autoconf/>"
echo "It also requires GNU m4 and Perl in order to run:"
echo "<$gnu_software_URL/m4/>"
echo "<$perl_URL>"
;;
esac
}
give_advice ()
{
# Normalize program name to check for.
normalized_program=`echo "$1" | sed '
s/^gnu-//; t
s/^gnu//; t
s/^g//; t'`
printf '%s\n' "'$1' is $msg."
configure_deps="'configure.ac' or m4 files included by 'configure.ac'"
case $normalized_program in
autoconf*)
echo "You should only need it if you modified 'configure.ac',"
echo "or m4 files included by it."
program_details 'autoconf'
;;
autoheader*)
echo "You should only need it if you modified 'acconfig.h' or"
echo "$configure_deps."
program_details 'autoheader'
;;
automake*)
echo "You should only need it if you modified 'Makefile.am' or"
echo "$configure_deps."
program_details 'automake'
;;
aclocal*)
echo "You should only need it if you modified 'acinclude.m4' or"
echo "$configure_deps."
program_details 'aclocal'
;;
autom4te*)
echo "You might have modified some maintainer files that require"
echo "the 'autom4te' program to be rebuilt."
program_details 'autom4te'
;;
bison*|yacc*)
echo "You should only need it if you modified a '.y' file."
echo "You may want to install the GNU Bison package:"
echo "<$gnu_software_URL/bison/>"
;;
lex*|flex*)
echo "You should only need it if you modified a '.l' file."
echo "You may want to install the Fast Lexical Analyzer package:"
echo "<$flex_URL>"
;;
help2man*)
echo "You should only need it if you modified a dependency" \
"of a man page."
echo "You may want to install the GNU Help2man package:"
echo "<$gnu_software_URL/help2man/>"
;;
makeinfo*)
echo "You should only need it if you modified a '.texi' file, or"
echo "any other file indirectly affecting the aspect of the manual."
echo "You might want to install the Texinfo package:"
echo "<$gnu_software_URL/texinfo/>"
echo "The spurious makeinfo call might also be the consequence of"
echo "using a buggy 'make' (AIX, DU, IRIX), in which case you might"
echo "want to install GNU make:"
echo "<$gnu_software_URL/make/>"
;;
*)
echo "You might have modified some files without having the proper"
echo "tools for further handling them. Check the 'README' file, it"
echo "often tells you about the needed prerequisites for installing"
echo "this package. You may also peek at any GNU archive site, in"
echo "case some other package contains this missing '$1' program."
;;
esac
}
give_advice "$1" | sed -e '1s/^/WARNING: /' \
-e '2,$s/^/ /' >&2
# Propagate the correct exit status (expected to be 127 for a program
# not found, 63 for a program that failed due to version mismatch).
exit $st
# Local variables:
# eval: (add-hook 'before-save-hook 'time-stamp)
# time-stamp-start: "scriptversion="
# time-stamp-format: "%:y-%02m-%02d.%02H"
# time-stamp-time-zone: "UTC0"
# time-stamp-end: "; # UTC"
# End:

View File

@@ -7,7 +7,7 @@
# This file is part of HDF5. The full HDF5 copyright notice, including
# terms governing use, modification, and redistribution, is contained in
# the COPYING file, which can be found at the root of the source code
# distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases.
# distribution tree, or in https://www.hdfgroup.org/licenses.
# If you do not have access to either file, you may request a copy from
# help@hdfgroup.org.
#

View File

@@ -7,7 +7,7 @@
# This file is part of HDF5. The full HDF5 copyright notice, including
# terms governing use, modification, and redistribution, is contained in
# the COPYING file, which can be found at the root of the source code
# distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases.
# distribution tree, or in https://www.hdfgroup.org/licenses.
# If you do not have access to either file, you may request a copy from
# help@hdfgroup.org.
#

View File

@@ -4,7 +4,7 @@
## This file is part of HDF5. The full HDF5 copyright notice, including
## terms governing use, modification, and redistribution, is contained in
## the COPYING file, which can be found at the root of the source code
## distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases.
## distribution tree, or in https://www.hdfgroup.org/licenses.
## If you do not have access to either file, you may request a copy from
## help@hdfgroup.org.

View File

@@ -7,7 +7,7 @@
# This file is part of HDF5. The full HDF5 copyright notice, including
# terms governing use, modification, and redistribution, is contained in
# the COPYING file, which can be found at the root of the source code
# distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases.
# distribution tree, or in https://www.hdfgroup.org/licenses.
# If you do not have access to either file, you may request a copy from
# help@hdfgroup.org.
#

View File

@@ -8,7 +8,7 @@
# This file is part of HDF5. The full HDF5 copyright notice, including
# terms governing use, modification, and redistribution, is contained in
# the COPYING file, which can be found at the root of the source code
# distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases.
# distribution tree, or in https://www.hdfgroup.org/licenses.
# If you do not have access to either file, you may request a copy from
# help@hdfgroup.org.
#

View File

@@ -7,7 +7,7 @@
# This file is part of HDF5. The full HDF5 copyright notice, including
# terms governing use, modification, and redistribution, is contained in
# the COPYING file, which can be found at the root of the source code
# distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases.
# distribution tree, or in https://www.hdfgroup.org/licenses.
# If you do not have access to either file, you may request a copy from
# help@hdfgroup.org.
#

View File

@@ -6,7 +6,7 @@
# This file is part of HDF5. The full HDF5 copyright notice, including
# terms governing use, modification, and redistribution, is contained in
# the COPYING file, which can be found at the root of the source code
# distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases.
# distribution tree, or in https://www.hdfgroup.org/licenses.
# If you do not have access to either file, you may request a copy from
# help@hdfgroup.org.
#

View File

@@ -11,7 +11,7 @@ $indent=4;
# This file is part of HDF5. The full HDF5 copyright notice, including
# terms governing use, modification, and redistribution, is contained in
# the COPYING file, which can be found at the root of the source code
# distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases.
# distribution tree, or in https://www.hdfgroup.org/licenses.
# If you do not have access to either file, you may request a copy from
# help@hdfgroup.org.
#

View File

@@ -7,7 +7,7 @@
# This file is part of HDF5. The full HDF5 copyright notice, including
# terms governing use, modification, and redistribution, is contained in
# the COPYING file, which can be found at the root of the source code
# distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases.
# distribution tree, or in https://www.hdfgroup.org/licenses.
# If you do not have access to either file, you may request a copy from
# help@hdfgroup.org.
#

View File

@@ -7,7 +7,7 @@
# This file is part of HDF5. The full HDF5 copyright notice, including
# terms governing use, modification, and redistribution, is contained in
# the COPYING file, which can be found at the root of the source code
# distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases.
# distribution tree, or in https://www.hdfgroup.org/licenses.
# If you do not have access to either file, you may request a copy from
# help@hdfgroup.org.

View File

@@ -6,7 +6,7 @@
# This file is part of HDF5. The full HDF5 copyright notice, including
# terms governing use, modification, and redistribution, is contained in
# the COPYING file, which can be found at the root of the source code
# distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases.
# distribution tree, or in https://www.hdfgroup.org/licenses.
# If you do not have access to either file, you may request a copy from
# help@hdfgroup.org.
#

View File

@@ -7,7 +7,7 @@
# This file is part of HDF5. The full HDF5 copyright notice, including
# terms governing use, modification, and redistribution, is contained in
# the COPYING file, which can be found at the root of the source code
# distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases.
# distribution tree, or in https://www.hdfgroup.org/licenses.
# If you do not have access to either file, you may request a copy from
# help@hdfgroup.org.
#

148
bin/test-driver Executable file
View File

@@ -0,0 +1,148 @@
#! /bin/sh
# test-driver - basic testsuite driver script.
scriptversion=2018-03-07.03; # UTC
# Copyright (C) 2011-2018 Free Software Foundation, Inc.
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2, or (at your option)
# any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <https://www.gnu.org/licenses/>.
# As a special exception to the GNU General Public License, if you
# distribute this file as part of a program that contains a
# configuration script generated by Autoconf, you may include it under
# the same distribution terms that you use for the rest of that program.
# This file is maintained in Automake, please report
# bugs to <bug-automake@gnu.org> or send patches to
# <automake-patches@gnu.org>.
# Make unconditional expansion of undefined variables an error. This
# helps a lot in preventing typo-related bugs.
set -u
usage_error ()
{
echo "$0: $*" >&2
print_usage >&2
exit 2
}
print_usage ()
{
cat <<END
Usage:
test-driver --test-name=NAME --log-file=PATH --trs-file=PATH
[--expect-failure={yes|no}] [--color-tests={yes|no}]
[--enable-hard-errors={yes|no}] [--]
TEST-SCRIPT [TEST-SCRIPT-ARGUMENTS]
The '--test-name', '--log-file' and '--trs-file' options are mandatory.
END
}
test_name= # Used for reporting.
log_file= # Where to save the output of the test script.
trs_file= # Where to save the metadata of the test run.
expect_failure=no
color_tests=no
enable_hard_errors=yes
while test $# -gt 0; do
case $1 in
--help) print_usage; exit $?;;
--version) echo "test-driver $scriptversion"; exit $?;;
--test-name) test_name=$2; shift;;
--log-file) log_file=$2; shift;;
--trs-file) trs_file=$2; shift;;
--color-tests) color_tests=$2; shift;;
--expect-failure) expect_failure=$2; shift;;
--enable-hard-errors) enable_hard_errors=$2; shift;;
--) shift; break;;
-*) usage_error "invalid option: '$1'";;
*) break;;
esac
shift
done
missing_opts=
test x"$test_name" = x && missing_opts="$missing_opts --test-name"
test x"$log_file" = x && missing_opts="$missing_opts --log-file"
test x"$trs_file" = x && missing_opts="$missing_opts --trs-file"
if test x"$missing_opts" != x; then
usage_error "the following mandatory options are missing:$missing_opts"
fi
if test $# -eq 0; then
usage_error "missing argument"
fi
if test $color_tests = yes; then
# Keep this in sync with 'lib/am/check.am:$(am__tty_colors)'.
red='' # Red.
grn='' # Green.
lgn='' # Light green.
blu='' # Blue.
mgn='' # Magenta.
std='' # No color.
else
red= grn= lgn= blu= mgn= std=
fi
do_exit='rm -f $log_file $trs_file; (exit $st); exit $st'
trap "st=129; $do_exit" 1
trap "st=130; $do_exit" 2
trap "st=141; $do_exit" 13
trap "st=143; $do_exit" 15
# Test script is run here.
"$@" >$log_file 2>&1
estatus=$?
if test $enable_hard_errors = no && test $estatus -eq 99; then
tweaked_estatus=1
else
tweaked_estatus=$estatus
fi
case $tweaked_estatus:$expect_failure in
0:yes) col=$red res=XPASS recheck=yes gcopy=yes;;
0:*) col=$grn res=PASS recheck=no gcopy=no;;
77:*) col=$blu res=SKIP recheck=no gcopy=yes;;
99:*) col=$mgn res=ERROR recheck=yes gcopy=yes;;
*:yes) col=$lgn res=XFAIL recheck=no gcopy=yes;;
*:*) col=$red res=FAIL recheck=yes gcopy=yes;;
esac
# Report the test outcome and exit status in the logs, so that one can
# know whether the test passed or failed simply by looking at the '.log'
# file, without the need of also peaking into the corresponding '.trs'
# file (automake bug#11814).
echo "$res $test_name (exit status: $estatus)" >>$log_file
# Report outcome to console.
echo "${col}${res}${std}: $test_name"
# Register the test result, and other relevant metadata.
echo ":test-result: $res" > $trs_file
echo ":global-test-result: $res" >> $trs_file
echo ":recheck: $recheck" >> $trs_file
echo ":copy-in-global-log: $gcopy" >> $trs_file
# Local Variables:
# mode: shell-script
# sh-indentation: 2
# eval: (add-hook 'before-save-hook 'time-stamp)
# time-stamp-start: "scriptversion="
# time-stamp-format: "%:y-%02m-%02d.%02H"
# time-stamp-time-zone: "UTC0"
# time-stamp-end: "; # UTC"
# End:

View File

@@ -7,7 +7,7 @@
# This file is part of HDF5. The full HDF5 copyright notice, including
# terms governing use, modification, and redistribution, is contained in
# the COPYING file, which can be found at the root of the source code
# distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases.
# distribution tree, or in https://www.hdfgroup.org/licenses.
# If you do not have access to either file, you may request a copy from
# help@hdfgroup.org.
##

View File

@@ -7,7 +7,7 @@
# This file is part of HDF5. The full HDF5 copyright notice, including
# terms governing use, modification, and redistribution, is contained in
# the COPYING file, which can be found at the root of the source code
# distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases.
# distribution tree, or in https://www.hdfgroup.org/licenses.
# If you do not have access to either file, you may request a copy from
# help@hdfgroup.org.
##
@@ -154,6 +154,7 @@ $Source = "";
"H5F_info1_t" => "x",
"H5F_info2_t" => "x",
"H5F_retry_info_t" => "x",
"H5F_vfd_swmr_config_t" => "x",
"H5FD_t" => "x",
"H5FD_class_t" => "x",
"H5FD_stream_fapl_t" => "x",

View File

@@ -15,7 +15,7 @@ use warnings;
# http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have
# access to either file, you may request a copy from help@hdfgroup.org.
#
# Quincey Koziol, koziol@hdfgroup.org
# Quincey Koziol
# 9 Aug 2013
#
# Purpose: Given an input file containing the output from a build of the
@@ -30,10 +30,13 @@ use Getopt::Std;
# Global variables, for accumulating information
my $totalcount = 0;
my $notecount = 0;
my $dupcount = 0;
my %warn_count = ();
my $warncount;
my %warn_file = ();
my %warn_file_line = ();
my %warn_file_line_offset = ();
my %file_count = ();
my $filecount;
my $ignorecount = 0;
@@ -48,10 +51,13 @@ my %file_warn_line = ();
my $current_warning = 0;
my $current_file = 0;
my $warn_index;
my $genericize = 1;
# Info about last name / line / offset for file
my $last_c_name;
my $last_fort_name;
my $last_fort_line;
my $genericize = 1;
my $last_fort_offset;
# Display usage
sub do_help {
@@ -98,7 +104,7 @@ if($options{h}) {
# Parse list of file names to ignore
if(exists $options{i}) {
@ignorenames = split /,/, $options{i};
#print @ignorenames;
#print STDERR @ignorenames;
}
# Parse list of warning indices to expand file names
@@ -106,18 +112,18 @@ if(exists $options{w}) {
my @tmp_indices;
@tmp_indices = split /,/, $options{w};
#print @tmp_indices;
#print STDERR @tmp_indices;
for my $x (@tmp_indices) {
#print "x = '$x'\n";
#print STDERR "x = '$x'\n";
if($x =~ /\-/) {
my $start_index;
my $end_index;
#print "matched = '$x'\n";
#print STDERR "matched = '$x'\n";
($start_index, $end_index) = split /\-/, $x;
#print "start_index = '$start_index', end_index = '$end_index'\n";
#print STDERR "start_index = '$start_index', end_index = '$end_index'\n";
for my $y ($start_index..$end_index) {
#print "y = '$y'\n";
#print STDERR "y = '$y'\n";
if(!exists $warn_file_indices{$y}) {
$warn_file_indices{$y} = $y;
}
@@ -130,14 +136,14 @@ if(exists $options{w}) {
}
}
#foreach (sort keys %warn_file_indices) {
# print "$_ : $warn_file_indices{$_}\n";
# print STDERR "$_ : $warn_file_indices{$_}\n";
#}
}
# Parse list of warning strings to expand file names
if(exists $options{s}) {
@warn_match_strings = split /,/, $options{s};
# print @warn_match_strings;
# print STDERR @warn_match_strings;
}
# Parse list of file indices to expand warnings
@@ -145,18 +151,18 @@ if(exists $options{f}) {
my @tmp_indices;
@tmp_indices = split /,/, $options{f};
#print @tmp_indices;
#print STDERR @tmp_indices;
for my $x (@tmp_indices) {
#print "x = '$x'\n";
#print STDERR "x = '$x'\n";
if($x =~ /\-/) {
my $start_index;
my $end_index;
#print "matched = '$x'\n";
#print STDERR "matched = '$x'\n";
($start_index, $end_index) = split /\-/, $x;
#print "start_index = '$start_index', end_index = '$end_index'\n";
#print STDERR "start_index = '$start_index', end_index = '$end_index'\n";
for my $y ($start_index..$end_index) {
#print "y = '$y'\n";
#print STDERR "y = '$y'\n";
if(!exists $file_warn_indices{$y}) {
$file_warn_indices{$y} = $y;
}
@@ -169,14 +175,14 @@ if(exists $options{f}) {
}
}
#foreach (sort keys %warn_file_indices) {
# print "$_ : $warn_file_indices{$_}\n";
# print STDERR "$_ : $warn_file_indices{$_}\n";
#}
}
# Parse list of warning strings for files to expand warnings
if(exists $options{S}) {
@file_match_strings = split /,/, $options{S};
# print @file_match_strings;
# print STDERR @file_match_strings;
}
# Check if warnings should stay unique and not be "genericized"
@@ -197,7 +203,7 @@ while (<>) {
# Retain last FORTRAN compile line, which comes a few lines before warning
if($_ =~ /.*\.[fF]90:.*/) {
($last_fort_name, $last_fort_line, $toss) = split /\:/, $_;
($last_fort_name, $last_fort_line, $last_fort_offset) = split /\:/, $_;
($last_fort_line, $toss) = split /\./, $last_fort_line;
}
@@ -217,38 +223,34 @@ while (<>) {
# Skip warnings from linker
next if $_ =~ /ld: warning:/;
# Skip warnings from build_py and install_lib
# Skip warnings from build_py and install_lib
next if $_ =~ /warning: (build_py|install_lib)/;
# Skip variables with the word 'warning' in them
next if $_ =~ /_warning_/;
# "Hide" the C++ '::' symbol until we've parsed out the parts of the line
while($_ =~ /\:\:/) {
$_ =~ s/\:\:/@@@@/g;
}
# Check for weird formatting of warning message
$line = "??";
$offset = "??";
if($_ =~ /^cc1: warning:.*/) {
$name = $last_c_name;
$line = "??";
($toss, $toss, $warning, $extra, $extra2) = split /\:/, $_;
# Check for CMAKE build with warning on first line and no filename
} elsif($_ =~ /^\s*[Ww]arning:.*/) {
$name = $last_c_name;
$line = "??";
($toss, $warning, $extra, $extra2) = split /\:/, $_;
# Check for FORTRAN warning output
} elsif($_ =~ /^Warning:.*/) {
$name = $last_fort_name;
$line = $last_fort_line;
$offset = $last_fort_offset;
($toss, $warning, $extra, $extra2) = split /\:/, $_;
#print "1:",$.,":",$_;
# $_ = <>;
#print "2:",$.,":",$_;
# if($_ =~ /^\sFC.*/) {
# $_ = <>;
#print "3:",$.,":",$_;
# }
# ($name, $line, $toss) = split /\:/, $_;
#print "4:","'",$name,"'","-","'",$line,"'","\n";
# Check for improperly parsed filename or line
if($name =~ /^$/) {
print "Filename is a null string! Input line #$. is: '$_'";
@@ -265,8 +267,6 @@ while (<>) {
$name =~ s/^\"//g;
$name =~ s/\"$//g;
$line =~ s/^\s*line\s*//g;
# print "name:'", $name, "'-'", $line, "'\n";
# print "warning:'", $warning, "'\n";
# Check for Intel icc warning
} elsif($_ =~ /.*[A-Za-z0-9_]\.[chC]\(.*[0-9]\):.*#.*/) {
($last_c_name, $toss, $warning) = split /\:/, $last_c_name;
@@ -310,9 +310,7 @@ while (<>) {
# Check for ignored file
if(exists $options{i}) {
for my $x (@ignorenames) {
#print "x = '$x'\n";
if($name =~ /$x/) {
# print "matched name = '$name'\n";
$ignorecount++;
if(!(exists $ignored_files{$name})) {
$ignored_files{$name} = $name;
@@ -347,13 +345,22 @@ while (<>) {
# These skipped messages & "genericizations" may be specific to GCC
# Skip supplemental warning message
next if $warning =~ /near initialization for/;
if($warning =~ /near initialization for/) {
$notecount++;
next
}
# Skip C++ supplemental warning message
next if $warning =~ /in call to/;
if($warning =~ /in call to/) {
$notecount++;
next
}
# Skip GCC warning that should be a note
next if $_ =~ /\(this will be reported only once per input file\)/;
if($_ =~ /\(this will be reported only once per input file\)/) {
$notecount++;
next
}
if($genericize) {
# Eliminate C/C++ "{aka <some type>}" and "{aka '<some type>'}" info
@@ -402,16 +409,16 @@ while (<>) {
$warning =~ s/[A-Za-z_0-9]*\([A-Za-z_,0-9]*\) in [A-Za-z_0-9]*/-\(-\) in -/g;
}
}
# print "warning = $warning\n";
# <end possible GCC-specific code>
# Check if we've already seen this warning on this line in this file
# (Can happen for warnings from inside header files)
if( !exists $warn_file_line{$warning}{$name}{$line} ) {
if( !exists $warn_file_line_offset{$warning}{$name}{$line}{$offset} ) {
# Increment count for [generic] warning
$warn_count{$warning}++;
$warn_file{$warning}{$name}++;
$warn_file_line{$warning}{$name}{$line}++;
$warn_file_line_offset{$warning}{$name}{$line}{$offset}++;
# Increment count for filename
$file_count{$name}++;
@@ -421,14 +428,20 @@ while (<>) {
# Increment total count of warnings
$totalcount++;
}
else {
# Increment count of duplicate warnings
$dupcount++;
}
# print "name = $name\n";
# print "line = $line\n";
# print "offset = $offset\n";
# print "warning = \"$warning\"\n";
# print STDERR "name = $name\n";
# print STDERR "line = $line\n";
# print STDERR "offset = $offset\n";
# print STDERR "warning = \"$warning\"\n";
}
print "Total unique [non-ignored] warnings: $totalcount\n";
print "Ignored notes / supplemental warning lines [not counted in unique warnings]: $notecount\n";
print "Duplicated warning lines [not counted in unique warnings]: $dupcount\n";
print "Total ignored warnings: $ignorecount\n";
$warncount = keys %warn_count;
print "Total unique kinds of warnings: $warncount\n";
@@ -439,7 +452,7 @@ print "Total files with warnings: $filecount\n\n";
print "# of Warnings by frequency (file count)\n";
print "=======================================\n";
for my $x (sort {$warn_count{$b} <=> $warn_count{$a}} keys(%warn_count)) {
printf ("[%2d] %4d (%2d) - %s\n", $current_warning++, $warn_count{$x}, scalar(keys %{$warn_file_line{$x}}), $x);
printf ("[%2d] %4d (%2d) - %s\n", $current_warning++, $warn_count{$x}, scalar(keys %{$warn_file{$x}}), $x);
if((exists $options{W}) || (exists $options{w}) || (exists $options{s})) {
my $curr_index = $current_warning - 1;
my $match = 0;
@@ -447,9 +460,9 @@ for my $x (sort {$warn_count{$b} <=> $warn_count{$a}} keys(%warn_count)) {
# Check for string from list in current warning
if(exists $options{s}) {
for my $y (@warn_match_strings) {
# print "y = '$y'\n";
# print STDERR "y = '$y'\n";
if($x =~ /$y/) {
# print "matched warning = '$x'\n";
# print STDERR "matched warning = '$x'\n";
$match = 1;
last;
}
@@ -477,7 +490,7 @@ for my $x (sort {$warn_count{$b} <=> $warn_count{$a}} keys(%warn_count)) {
print "\n# of Warnings by filename (warning type)\n";
print "========================================\n";
for my $x (sort {$file_count{$b} <=> $file_count{$a}} keys(%file_count)) {
printf ("[%3d] %4d (%2d) - %s\n", $current_file++, $file_count{$x}, scalar(keys %{$file_warn_line{$x}}), $x);
printf ("[%3d] %4d (%2d) - %s\n", $current_file++, $file_count{$x}, scalar(keys %{$file_warn{$x}}), $x);
if((exists $options{F}) || (exists $options{f}) || (exists $options{S})) {
my $curr_index = $current_file - 1;
my $match = 0;
@@ -485,9 +498,9 @@ for my $x (sort {$file_count{$b} <=> $file_count{$a}} keys(%file_count)) {
# Check for string from list in current file
if(exists $options{S}) {
for my $y (@file_match_strings) {
# print "y = '$y'\n";
# print STDERR "y = '$y'\n";
if($x =~ /$y/) {
# print "matched warning = '$x'\n";
# print STDERR "matched warning = '$x'\n";
$match = 1;
last;
}

View File

@@ -7,7 +7,7 @@
# This file is part of HDF5. The full HDF5 copyright notice, including
# terms governing use, modification, and redistribution, is contained in
# the COPYING file, which can be found at the root of the source code
# distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases.
# distribution tree, or in https://www.hdfgroup.org/licenses.
# If you do not have access to either file, you may request a copy from
# help@hdfgroup.org.
#

View File

@@ -7,7 +7,7 @@
The full HDF5 copyright notice, including terms governing use,
modification, and redistribution, is contained in the COPYING file
which can be found at the root of the source code distribution tree
or in https://support.hdfgroup.org/ftp/HDF5/releases. If you do
or in https://www.hdfgroup.org/licenses. If you do
not have access to either file, you may request a copy from
help@hdfgroup.org.

View File

@@ -6,7 +6,7 @@
# This file is part of HDF5. The full HDF5 copyright notice, including
# terms governing use, modification, and redistribution, is contained in
# the COPYING file, which can be found at the root of the source code
# distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases.
# distribution tree, or in https://www.hdfgroup.org/licenses.
# If you do not have access to either file, you may request a copy from
# help@hdfgroup.org.
##

1533
c++/Makefile.in Normal file

File diff suppressed because it is too large Load Diff

View File

@@ -5,7 +5,7 @@
# This file is part of HDF5. The full HDF5 copyright notice, including
# terms governing use, modification, and redistribution, is contained in
# the COPYING file, which can be found at the root of the source code
# distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases.
# distribution tree, or in https://www.hdfgroup.org/licenses.
# If you do not have access to either file, you may request a copy from
# help@hdfgroup.org.
#

View File

@@ -6,7 +6,7 @@
# This file is part of HDF5. The full HDF5 copyright notice, including
# terms governing use, modification, and redistribution, is contained in
# the COPYING file, which can be found at the root of the source code
# distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases.
# distribution tree, or in https://www.hdfgroup.org/licenses.
# If you do not have access to either file, you may request a copy from
# help@hdfgroup.org.
##

1479
c++/examples/Makefile.in Normal file

File diff suppressed because it is too large Load Diff

View File

@@ -6,7 +6,7 @@
* This file is part of HDF5. The full HDF5 copyright notice, including *
* terms governing use, modification, and redistribution, is contained in *
* the COPYING file, which can be found at the root of the source code *
* distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. *
* distribution tree, or in https://www.hdfgroup.org/licenses. *
* If you do not have access to either file, you may request a copy from *
* help@hdfgroup.org. *
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
@@ -28,20 +28,20 @@ using std::endl;
#include "H5Cpp.h"
using namespace H5;
const H5std_string FILE_NAME( "SDSextendible.h5" );
const H5std_string DATASET_NAME( "ExtendibleArray" );
const int NX = 10;
const int NY = 5;
const int RANK = 2;
const int RANKC = 1;
const H5std_string FILE_NAME("SDSextendible.h5");
const H5std_string DATASET_NAME("ExtendibleArray");
const int NX = 10;
const int NY = 5;
const int RANK = 2;
const int RANKC = 1;
int main (void)
int
main(void)
{
hsize_t i, j;
hsize_t i, j;
// Try block to detect exceptions raised by any of the calls inside it
try
{
try {
/*
* Turn off the auto-printing when failure occurs so that we can
* handle the errors appropriately
@@ -51,8 +51,8 @@ int main (void)
/*
* Open the file and the dataset.
*/
H5File file( FILE_NAME, H5F_ACC_RDONLY );
DataSet dataset = file.openDataSet( DATASET_NAME );
H5File file(FILE_NAME, H5F_ACC_RDONLY);
DataSet dataset = file.openDataSet(DATASET_NAME);
/*
* Get filespace for rank and dimension
@@ -67,10 +67,9 @@ int main (void)
/*
* Get and print the dimension sizes of the file dataspace
*/
hsize_t dims[2]; // dataset dimensions
rank = filespace.getSimpleExtentDims( dims );
cout << "dataset rank = " << rank << ", dimensions "
<< (unsigned long)(dims[0]) << " x "
hsize_t dims[2]; // dataset dimensions
rank = filespace.getSimpleExtentDims(dims);
cout << "dataset rank = " << rank << ", dimensions " << (unsigned long)(dims[0]) << " x "
<< (unsigned long)(dims[1]) << endl;
/*
@@ -81,13 +80,12 @@ int main (void)
/*
* Read dataset back and display.
*/
int data_out[NX][NY]; // buffer for dataset to be read
dataset.read( data_out, PredType::NATIVE_INT, mspace1, filespace );
int data_out[NX][NY]; // buffer for dataset to be read
dataset.read(data_out, PredType::NATIVE_INT, mspace1, filespace);
cout << "\n";
cout << "Dataset: \n";
for (j = 0; j < dims[0]; j++)
{
for (j = 0; j < dims[0]; j++) {
for (i = 0; i < dims[1]; i++)
cout << data_out[j][i] << " ";
cout << endl;
@@ -117,20 +115,20 @@ int main (void)
*/
hsize_t col_dims[1];
col_dims[0] = 10;
DataSpace mspace2( RANKC, col_dims );
DataSpace mspace2(RANKC, col_dims);
/*
* Define the column (hyperslab) to read.
*/
hsize_t offset[2] = { 0, 2 };
hsize_t count[2] = { 10, 1 };
int column[10]; // buffer for column to be read
hsize_t offset[2] = {0, 2};
hsize_t count[2] = {10, 1};
int column[10]; // buffer for column to be read
/*
* Define hyperslab and read.
*/
filespace.selectHyperslab( H5S_SELECT_SET, count, offset );
dataset.read( column, PredType::NATIVE_INT, mspace2, filespace );
filespace.selectHyperslab(H5S_SELECT_SET, count, offset);
dataset.read(column, PredType::NATIVE_INT, mspace2, filespace);
cout << endl;
cout << "Third column: " << endl;
@@ -161,20 +159,18 @@ int main (void)
*/
hsize_t chunk_dims[2];
int rank_chunk;
if( H5D_CHUNKED == cparms.getLayout() )
{
if (H5D_CHUNKED == cparms.getLayout()) {
/*
* Get chunking information: rank and dimensions
*/
rank_chunk = cparms.getChunk( 2, chunk_dims);
cout << "chunk rank " << rank_chunk << "dimensions "
<< (unsigned long)(chunk_dims[0]) << " x "
<< (unsigned long)(chunk_dims[1]) << endl;
rank_chunk = cparms.getChunk(2, chunk_dims);
cout << "chunk rank " << rank_chunk << "dimensions " << (unsigned long)(chunk_dims[0]) << " x "
<< (unsigned long)(chunk_dims[1]) << endl;
/*
* Define the memory space to read a chunk.
*/
DataSpace mspace3( rank_chunk, chunk_dims );
DataSpace mspace3(rank_chunk, chunk_dims);
/*
* Define chunk in the file (hyperslab) to read.
@@ -183,17 +179,16 @@ int main (void)
offset[1] = 0;
count[0] = chunk_dims[0];
count[1] = chunk_dims[1];
filespace.selectHyperslab( H5S_SELECT_SET, count, offset );
filespace.selectHyperslab(H5S_SELECT_SET, count, offset);
/*
* Read chunk back and display.
*/
int chunk_out[2][5]; // buffer for chunk to be read
dataset.read( chunk_out, PredType::NATIVE_INT, mspace3, filespace );
int chunk_out[2][5]; // buffer for chunk to be read
dataset.read(chunk_out, PredType::NATIVE_INT, mspace3, filespace);
cout << endl;
cout << "Chunk:" << endl;
for (j = 0; j < chunk_dims[0]; j++)
{
for (j = 0; j < chunk_dims[0]; j++) {
for (i = 0; i < chunk_dims[1]; i++)
cout << chunk_out[j][i] << " ";
cout << endl;
@@ -204,25 +199,22 @@ int main (void)
* 2 0 0 0 0
*/
}
} // end of try block
} // end of try block
// catch failure caused by the H5File operations
catch( FileIException error )
{
catch (FileIException error) {
error.printErrorStack();
return -1;
}
// catch failure caused by the DataSet operations
catch( DataSetIException error )
{
catch (DataSetIException error) {
error.printErrorStack();
return -1;
}
// catch failure caused by the DataSpace operations
catch( DataSpaceIException error )
{
catch (DataSpaceIException error) {
error.printErrorStack();
return -1;
}

View File

@@ -6,7 +6,7 @@
* This file is part of HDF5. The full HDF5 copyright notice, including *
* terms governing use, modification, and redistribution, is contained in *
* the COPYING file, which can be found at the root of the source code *
* distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. *
* distribution tree, or in https://www.hdfgroup.org/licenses. *
* If you do not have access to either file, you may request a copy from *
* help@hdfgroup.org. *
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
@@ -29,175 +29,170 @@ using std::endl;
#include "H5Cpp.h"
using namespace H5;
const H5std_string FILE_NAME( "SDScompound.h5" );
const H5std_string DATASET_NAME( "ArrayOfStructures" );
const H5std_string MEMBER1( "a_name" );
const H5std_string MEMBER2( "b_name" );
const H5std_string MEMBER3( "c_name" );
const int LENGTH = 10;
const int RANK = 1;
const H5std_string FILE_NAME("SDScompound.h5");
const H5std_string DATASET_NAME("ArrayOfStructures");
const H5std_string MEMBER1("a_name");
const H5std_string MEMBER2("b_name");
const H5std_string MEMBER3("c_name");
const int LENGTH = 10;
const int RANK = 1;
int main(void)
int
main(void)
{
/* First structure and dataset*/
typedef struct s1_t {
/* First structure and dataset*/
typedef struct s1_t {
int a;
float b;
double c;
} s1_t;
} s1_t;
/* Second structure (subset of s1_t) and dataset*/
typedef struct s2_t {
/* Second structure (subset of s1_t) and dataset*/
typedef struct s2_t {
double c;
int a;
} s2_t;
} s2_t;
// Try block to detect exceptions raised by any of the calls inside it
try
{
/*
* Initialize the data
*/
int i;
s1_t s1[LENGTH];
for (i = 0; i< LENGTH; i++)
{
s1[i].a = i;
s1[i].b = i*i;
s1[i].c = 1./(i+1);
}
// Try block to detect exceptions raised by any of the calls inside it
try {
/*
* Initialize the data
*/
int i;
s1_t s1[LENGTH];
for (i = 0; i < LENGTH; i++) {
s1[i].a = i;
s1[i].b = i * i;
s1[i].c = 1. / (i + 1);
}
/*
* Turn off the auto-printing when failure occurs so that we can
* handle the errors appropriately
*/
Exception::dontPrint();
/*
* Turn off the auto-printing when failure occurs so that we can
* handle the errors appropriately
*/
Exception::dontPrint();
/*
* Create the data space.
*/
hsize_t dim[] = {LENGTH}; /* Dataspace dimensions */
DataSpace space( RANK, dim );
/*
* Create the data space.
*/
hsize_t dim[] = {LENGTH}; /* Dataspace dimensions */
DataSpace space(RANK, dim);
/*
* Create the file.
*/
H5File* file = new H5File( FILE_NAME, H5F_ACC_TRUNC );
/*
* Create the file.
*/
H5File *file = new H5File(FILE_NAME, H5F_ACC_TRUNC);
/*
* Create the memory datatype.
*/
CompType mtype1( sizeof(s1_t) );
mtype1.insertMember( MEMBER1, HOFFSET(s1_t, a), PredType::NATIVE_INT);
mtype1.insertMember( MEMBER3, HOFFSET(s1_t, c), PredType::NATIVE_DOUBLE);
mtype1.insertMember( MEMBER2, HOFFSET(s1_t, b), PredType::NATIVE_FLOAT);
/*
* Create the memory datatype.
*/
CompType mtype1(sizeof(s1_t));
mtype1.insertMember(MEMBER1, HOFFSET(s1_t, a), PredType::NATIVE_INT);
mtype1.insertMember(MEMBER3, HOFFSET(s1_t, c), PredType::NATIVE_DOUBLE);
mtype1.insertMember(MEMBER2, HOFFSET(s1_t, b), PredType::NATIVE_FLOAT);
/*
* Create the dataset.
*/
DataSet* dataset;
dataset = new DataSet(file->createDataSet(DATASET_NAME, mtype1, space));
/*
* Create the dataset.
*/
DataSet *dataset;
dataset = new DataSet(file->createDataSet(DATASET_NAME, mtype1, space));
/*
* Write data to the dataset;
*/
dataset->write( s1, mtype1 );
/*
* Write data to the dataset;
*/
dataset->write(s1, mtype1);
/*
* Release resources
*/
delete dataset;
delete file;
/*
* Release resources
*/
delete dataset;
delete file;
/*
* Open the file and the dataset.
*/
file = new H5File( FILE_NAME, H5F_ACC_RDONLY );
dataset = new DataSet (file->openDataSet( DATASET_NAME ));
/*
* Open the file and the dataset.
*/
file = new H5File(FILE_NAME, H5F_ACC_RDONLY);
dataset = new DataSet(file->openDataSet(DATASET_NAME));
/*
* Create a datatype for s2
*/
CompType mtype2( sizeof(s2_t) );
/*
* Create a datatype for s2
*/
CompType mtype2(sizeof(s2_t));
mtype2.insertMember( MEMBER3, HOFFSET(s2_t, c), PredType::NATIVE_DOUBLE);
mtype2.insertMember( MEMBER1, HOFFSET(s2_t, a), PredType::NATIVE_INT);
mtype2.insertMember(MEMBER3, HOFFSET(s2_t, c), PredType::NATIVE_DOUBLE);
mtype2.insertMember(MEMBER1, HOFFSET(s2_t, a), PredType::NATIVE_INT);
/*
* Read two fields c and a from s1 dataset. Fields in the file
* are found by their names "c_name" and "a_name".
*/
s2_t s2[LENGTH];
dataset->read( s2, mtype2 );
/*
* Read two fields c and a from s1 dataset. Fields in the file
* are found by their names "c_name" and "a_name".
*/
s2_t s2[LENGTH];
dataset->read(s2, mtype2);
/*
* Display the fields
*/
cout << endl << "Field c : " << endl;
for( i = 0; i < LENGTH; i++)
cout << s2[i].c << " ";
cout << endl;
/*
* Display the fields
*/
cout << endl << "Field c : " << endl;
for (i = 0; i < LENGTH; i++)
cout << s2[i].c << " ";
cout << endl;
cout << endl << "Field a : " << endl;
for( i = 0; i < LENGTH; i++)
cout << s2[i].a << " ";
cout << endl;
cout << endl << "Field a : " << endl;
for (i = 0; i < LENGTH; i++)
cout << s2[i].a << " ";
cout << endl;
/*
* Create a datatype for s3.
*/
CompType mtype3( sizeof(float) );
/*
* Create a datatype for s3.
*/
CompType mtype3(sizeof(float));
mtype3.insertMember( MEMBER2, 0, PredType::NATIVE_FLOAT);
mtype3.insertMember(MEMBER2, 0, PredType::NATIVE_FLOAT);
/*
* Read field b from s1 dataset. Field in the file is found by its name.
*/
float s3[LENGTH]; // Third "structure" - used to read float field of s1
dataset->read( s3, mtype3 );
/*
* Read field b from s1 dataset. Field in the file is found by its name.
*/
float s3[LENGTH]; // Third "structure" - used to read float field of s1
dataset->read(s3, mtype3);
/*
* Display the field
*/
cout << endl << "Field b : " << endl;
for( i = 0; i < LENGTH; i++)
cout << s3[i] << " ";
cout << endl;
/*
* Display the field
*/
cout << endl << "Field b : " << endl;
for (i = 0; i < LENGTH; i++)
cout << s3[i] << " ";
cout << endl;
/*
* Release resources
*/
delete dataset;
delete file;
} // end of try block
/*
* Release resources
*/
delete dataset;
delete file;
} // end of try block
// catch failure caused by the H5File operations
catch( FileIException error )
{
error.printErrorStack();
return -1;
}
// catch failure caused by the H5File operations
catch (FileIException error) {
error.printErrorStack();
return -1;
}
// catch failure caused by the DataSet operations
catch( DataSetIException error )
{
error.printErrorStack();
return -1;
}
// catch failure caused by the DataSet operations
catch (DataSetIException error) {
error.printErrorStack();
return -1;
}
// catch failure caused by the DataSpace operations
catch( DataSpaceIException error )
{
error.printErrorStack();
return -1;
}
// catch failure caused by the DataSpace operations
catch (DataSpaceIException error) {
error.printErrorStack();
return -1;
}
// catch failure caused by the DataSpace operations
catch( DataTypeIException error )
{
error.printErrorStack();
return -1;
}
// catch failure caused by the DataSpace operations
catch (DataTypeIException error) {
error.printErrorStack();
return -1;
}
return 0;
return 0;
}

View File

@@ -6,7 +6,7 @@
* This file is part of HDF5. The full HDF5 copyright notice, including *
* terms governing use, modification, and redistribution, is contained in *
* the COPYING file, which can be found at the root of the source code *
* distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. *
* distribution tree, or in https://www.hdfgroup.org/licenses. *
* If you do not have access to either file, you may request a copy from *
* help@hdfgroup.org. *
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
@@ -25,105 +25,99 @@
#include "H5Cpp.h"
using namespace H5;
const H5std_string FILE_NAME( "SDS.h5" );
const H5std_string DATASET_NAME( "IntArray" );
const int NX = 5; // dataset dimensions
const int NY = 6;
const int RANK = 2;
const H5std_string FILE_NAME("SDS.h5");
const H5std_string DATASET_NAME("IntArray");
const int NX = 5; // dataset dimensions
const int NY = 6;
const int RANK = 2;
int main (void)
int
main(void)
{
/*
* Data initialization.
*/
int i, j;
int data[NX][NY]; // buffer for data to write
for (j = 0; j < NX; j++)
{
for (i = 0; i < NY; i++)
data[j][i] = i + j;
}
/*
* 0 1 2 3 4 5
* 1 2 3 4 5 6
* 2 3 4 5 6 7
* 3 4 5 6 7 8
* 4 5 6 7 8 9
*/
/*
* Data initialization.
*/
int i, j;
int data[NX][NY]; // buffer for data to write
for (j = 0; j < NX; j++) {
for (i = 0; i < NY; i++)
data[j][i] = i + j;
}
/*
* 0 1 2 3 4 5
* 1 2 3 4 5 6
* 2 3 4 5 6 7
* 3 4 5 6 7 8
* 4 5 6 7 8 9
*/
// Try block to detect exceptions raised by any of the calls inside it
try
{
/*
* Turn off the auto-printing when failure occurs so that we can
* handle the errors appropriately
*/
Exception::dontPrint();
// Try block to detect exceptions raised by any of the calls inside it
try {
/*
* Turn off the auto-printing when failure occurs so that we can
* handle the errors appropriately
*/
Exception::dontPrint();
/*
* Create a new file using H5F_ACC_TRUNC access,
* default file creation properties, and default file
* access properties.
*/
H5File file( FILE_NAME, H5F_ACC_TRUNC );
/*
* Create a new file using H5F_ACC_TRUNC access,
* default file creation properties, and default file
* access properties.
*/
H5File file(FILE_NAME, H5F_ACC_TRUNC);
/*
* Define the size of the array and create the data space for fixed
* size dataset.
*/
hsize_t dimsf[2]; // dataset dimensions
dimsf[0] = NX;
dimsf[1] = NY;
DataSpace dataspace( RANK, dimsf );
/*
* Define the size of the array and create the data space for fixed
* size dataset.
*/
hsize_t dimsf[2]; // dataset dimensions
dimsf[0] = NX;
dimsf[1] = NY;
DataSpace dataspace(RANK, dimsf);
/*
* Define datatype for the data in the file.
* We will store little endian INT numbers.
*/
IntType datatype( PredType::NATIVE_INT );
datatype.setOrder( H5T_ORDER_LE );
/*
* Define datatype for the data in the file.
* We will store little endian INT numbers.
*/
IntType datatype(PredType::NATIVE_INT);
datatype.setOrder(H5T_ORDER_LE);
/*
* Create a new dataset within the file using defined dataspace and
* datatype and default dataset creation properties.
*/
DataSet dataset = file.createDataSet( DATASET_NAME, datatype, dataspace );
/*
* Create a new dataset within the file using defined dataspace and
* datatype and default dataset creation properties.
*/
DataSet dataset = file.createDataSet(DATASET_NAME, datatype, dataspace);
/*
* Write the data to the dataset using default memory space, file
* space, and transfer properties.
*/
dataset.write( data, PredType::NATIVE_INT );
} // end of try block
/*
* Write the data to the dataset using default memory space, file
* space, and transfer properties.
*/
dataset.write(data, PredType::NATIVE_INT);
} // end of try block
// catch failure caused by the H5File operations
catch( FileIException error )
{
error.printErrorStack();
return -1;
}
// catch failure caused by the H5File operations
catch (FileIException error) {
error.printErrorStack();
return -1;
}
// catch failure caused by the DataSet operations
catch( DataSetIException error )
{
error.printErrorStack();
return -1;
}
// catch failure caused by the DataSet operations
catch (DataSetIException error) {
error.printErrorStack();
return -1;
}
// catch failure caused by the DataSpace operations
catch( DataSpaceIException error )
{
error.printErrorStack();
return -1;
}
// catch failure caused by the DataSpace operations
catch (DataSpaceIException error) {
error.printErrorStack();
return -1;
}
// catch failure caused by the DataSpace operations
catch( DataTypeIException error )
{
error.printErrorStack();
return -1;
}
// catch failure caused by the DataSpace operations
catch (DataTypeIException error) {
error.printErrorStack();
return -1;
}
return 0; // successfully terminated
return 0; // successfully terminated
}

View File

@@ -6,7 +6,7 @@
* This file is part of HDF5. The full HDF5 copyright notice, including *
* terms governing use, modification, and redistribution, is contained in *
* the COPYING file, which can be found at the root of the source code *
* distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. *
* distribution tree, or in https://www.hdfgroup.org/licenses. *
* If you do not have access to either file, you may request a copy from *
* help@hdfgroup.org. *
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
@@ -32,201 +32,195 @@ using std::endl;
#include "H5Cpp.h"
using namespace H5;
const H5std_string FILE_NAME( "SDSextendible.h5" );
const H5std_string DATASET_NAME( "ExtendibleArray" );
const int NX = 10;
const int NY = 5;
const int RANK = 2;
const H5std_string FILE_NAME("SDSextendible.h5");
const H5std_string DATASET_NAME("ExtendibleArray");
const int NX = 10;
const int NY = 5;
const int RANK = 2;
int main (void)
int
main(void)
{
/*
* Try block to detect exceptions raised by any of the calls inside it
*/
try
{
/*
* Turn off the auto-printing when failure occurs so that we can
* handle the errors appropriately
*/
Exception::dontPrint();
/*
* Try block to detect exceptions raised by any of the calls inside it
*/
try {
/*
* Turn off the auto-printing when failure occurs so that we can
* handle the errors appropriately
*/
Exception::dontPrint();
/*
* Create the data space with unlimited dimensions.
*/
hsize_t dims[2] = { 3, 3}; // dataset dimensions at creation
hsize_t maxdims[2] = {H5S_UNLIMITED, H5S_UNLIMITED};
DataSpace mspace1( RANK, dims, maxdims);
/*
* Create the data space with unlimited dimensions.
*/
hsize_t dims[2] = {3, 3}; // dataset dimensions at creation
hsize_t maxdims[2] = {H5S_UNLIMITED, H5S_UNLIMITED};
DataSpace mspace1(RANK, dims, maxdims);
/*
* Create a new file. If file exists its contents will be overwritten.
*/
H5File file( FILE_NAME, H5F_ACC_TRUNC );
/*
* Create a new file. If file exists its contents will be overwritten.
*/
H5File file(FILE_NAME, H5F_ACC_TRUNC);
/*
* Modify dataset creation properties, i.e. enable chunking.
*/
DSetCreatPropList cparms;
/*
* Modify dataset creation properties, i.e. enable chunking.
*/
DSetCreatPropList cparms;
hsize_t chunk_dims[2] ={2, 5};
cparms.setChunk( RANK, chunk_dims );
hsize_t chunk_dims[2] = {2, 5};
cparms.setChunk(RANK, chunk_dims);
/*
* Set fill value for the dataset
*/
int fill_val = 0;
cparms.setFillValue( PredType::NATIVE_INT, &fill_val);
/*
* Set fill value for the dataset
*/
int fill_val = 0;
cparms.setFillValue(PredType::NATIVE_INT, &fill_val);
/*
* Create a new dataset within the file using cparms
* creation properties.
*/
DataSet dataset = file.createDataSet( DATASET_NAME, PredType::NATIVE_INT, mspace1, cparms);
/*
* Create a new dataset within the file using cparms
* creation properties.
*/
DataSet dataset = file.createDataSet(DATASET_NAME, PredType::NATIVE_INT, mspace1, cparms);
/*
* Extend the dataset. This call assures that dataset is at least 3 x 3.
*/
hsize_t size[2];
size[0] = 3;
size[1] = 3;
dataset.extend( size );
/*
* Extend the dataset. This call assures that dataset is at least 3 x 3.
*/
hsize_t size[2];
size[0] = 3;
size[1] = 3;
dataset.extend(size);
/*
* Select a hyperslab.
*/
DataSpace fspace1 = dataset.getSpace ();
hsize_t offset[2];
offset[0] = 0;
offset[1] = 0;
hsize_t dims1[2] = { 3, 3}; /* data1 dimensions */
fspace1.selectHyperslab( H5S_SELECT_SET, dims1, offset );
/*
* Select a hyperslab.
*/
DataSpace fspace1 = dataset.getSpace();
hsize_t offset[2];
offset[0] = 0;
offset[1] = 0;
hsize_t dims1[2] = {3, 3}; /* data1 dimensions */
fspace1.selectHyperslab(H5S_SELECT_SET, dims1, offset);
/*
* Write the data to the hyperslab.
*/
int data1[3][3] = { {1, 1, 1}, /* data to write */
{1, 1, 1},
{1, 1, 1} };
dataset.write( data1, PredType::NATIVE_INT, mspace1, fspace1 );
/*
* Write the data to the hyperslab.
*/
int data1[3][3] = {{1, 1, 1}, /* data to write */
{1, 1, 1},
{1, 1, 1}};
dataset.write(data1, PredType::NATIVE_INT, mspace1, fspace1);
/*
* Extend the dataset. Dataset becomes 10 x 3.
*/
hsize_t dims2[2] = { 7, 1}; /* data2 dimensions */
dims[0] = dims1[0] + dims2[0];
size[0] = dims[0];
size[1] = dims[1];
dataset.extend( size );
/*
* Extend the dataset. Dataset becomes 10 x 3.
*/
hsize_t dims2[2] = {7, 1}; /* data2 dimensions */
dims[0] = dims1[0] + dims2[0];
size[0] = dims[0];
size[1] = dims[1];
dataset.extend(size);
/*
* Select a hyperslab.
*/
DataSpace fspace2 = dataset.getSpace ();
offset[0] = 3;
offset[1] = 0;
fspace2.selectHyperslab( H5S_SELECT_SET, dims2, offset );
/*
* Select a hyperslab.
*/
DataSpace fspace2 = dataset.getSpace();
offset[0] = 3;
offset[1] = 0;
fspace2.selectHyperslab(H5S_SELECT_SET, dims2, offset);
/*
* Define memory space
*/
DataSpace mspace2( RANK, dims2 );
/*
* Define memory space
*/
DataSpace mspace2(RANK, dims2);
/*
* Write the data to the hyperslab.
*/
int data2[7] = { 2, 2, 2, 2, 2, 2, 2};
dataset.write( data2, PredType::NATIVE_INT, mspace2, fspace2 );
/*
* Write the data to the hyperslab.
*/
int data2[7] = {2, 2, 2, 2, 2, 2, 2};
dataset.write(data2, PredType::NATIVE_INT, mspace2, fspace2);
/*
* Extend the dataset. Dataset becomes 10 x 5.
*/
hsize_t dims3[2] = { 2, 2}; /* data3 dimensions */
dims[1] = dims1[1] + dims3[1];
size[0] = dims[0];
size[1] = dims[1];
dataset.extend( size );
/*
* Extend the dataset. Dataset becomes 10 x 5.
*/
hsize_t dims3[2] = {2, 2}; /* data3 dimensions */
dims[1] = dims1[1] + dims3[1];
size[0] = dims[0];
size[1] = dims[1];
dataset.extend(size);
/*
* Select a hyperslab
*/
DataSpace fspace3 = dataset.getSpace ();
offset[0] = 0;
offset[1] = 3;
fspace3.selectHyperslab( H5S_SELECT_SET, dims3, offset );
/*
* Select a hyperslab
*/
DataSpace fspace3 = dataset.getSpace();
offset[0] = 0;
offset[1] = 3;
fspace3.selectHyperslab(H5S_SELECT_SET, dims3, offset);
/*
* Define memory space.
*/
DataSpace mspace3( RANK, dims3 );
/*
* Define memory space.
*/
DataSpace mspace3(RANK, dims3);
/*
* Write the data to the hyperslab.
*/
int data3[2][2] = { {3, 3}, {3, 3} };
dataset.write( data3, PredType::NATIVE_INT, mspace3, fspace3 );
/*
* Write the data to the hyperslab.
*/
int data3[2][2] = {{3, 3}, {3, 3}};
dataset.write(data3, PredType::NATIVE_INT, mspace3, fspace3);
/*
* Read the data from this dataset and display it.
*/
int i, j;
int data_out[NX][NY];
for (i = 0; i < NX; i++)
{
for (j = 0; j < NY; j++)
data_out[i][j] = 0;
}
dataset.read( data_out, PredType::NATIVE_INT );
/*
* Resulting dataset
*
* 1 1 1 3 3
* 1 1 1 3 3
* 1 1 1 0 0
* 2 0 0 0 0
* 2 0 0 0 0
* 2 0 0 0 0
* 2 0 0 0 0
* 2 0 0 0 0
* 2 0 0 0 0
* 2 0 0 0 0
*/
/*
* Display the result.
*/
for (i=0; i < NX; i++)
{
for(j=0; j < NY; j++)
cout << data_out[i][j] << " ";
cout << endl;
}
} // end of try block
/*
* Read the data from this dataset and display it.
*/
int i, j;
int data_out[NX][NY];
for (i = 0; i < NX; i++) {
for (j = 0; j < NY; j++)
data_out[i][j] = 0;
}
dataset.read(data_out, PredType::NATIVE_INT);
/*
* Resulting dataset
*
* 1 1 1 3 3
* 1 1 1 3 3
* 1 1 1 0 0
* 2 0 0 0 0
* 2 0 0 0 0
* 2 0 0 0 0
* 2 0 0 0 0
* 2 0 0 0 0
* 2 0 0 0 0
* 2 0 0 0 0
*/
/*
* Display the result.
*/
for (i = 0; i < NX; i++) {
for (j = 0; j < NY; j++)
cout << data_out[i][j] << " ";
cout << endl;
}
} // end of try block
// catch failure caused by the H5File operations
catch( FileIException error )
{
error.printErrorStack();
return -1;
}
// catch failure caused by the H5File operations
catch (FileIException error) {
error.printErrorStack();
return -1;
}
// catch failure caused by the DataSet operations
catch( DataSetIException error )
{
error.printErrorStack();
return -1;
}
// catch failure caused by the DataSet operations
catch (DataSetIException error) {
error.printErrorStack();
return -1;
}
// catch failure caused by the DataSpace operations
catch( DataSpaceIException error )
{
error.printErrorStack();
return -1;
}
// catch failure caused by the DataSpace operations
catch (DataSpaceIException error) {
error.printErrorStack();
return -1;
}
// catch failure caused by the DataSpace operations
catch( DataTypeIException error )
{
error.printErrorStack();
return -1;
}
return 0;
// catch failure caused by the DataSpace operations
catch (DataTypeIException error) {
error.printErrorStack();
return -1;
}
return 0;
}

View File

@@ -6,7 +6,7 @@
* This file is part of HDF5. The full HDF5 copyright notice, including *
* terms governing use, modification, and redistribution, is contained in *
* the COPYING file, which can be found at the root of the source code *
* distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. *
* distribution tree, or in https://www.hdfgroup.org/licenses. *
* If you do not have access to either file, you may request a copy from *
* help@hdfgroup.org. *
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
@@ -32,22 +32,21 @@ using std::endl;
#include "H5Cpp.h"
using namespace H5;
const H5std_string FILE_NAME( "Group.h5" );
const H5std_string FILE_NAME("Group.h5");
const int RANK = 2;
// Operator function
extern "C" herr_t file_info(hid_t loc_id, const char *name, const H5L_info2_t *linfo,
void *opdata);
extern "C" herr_t file_info(hid_t loc_id, const char *name, const H5L_info2_t *linfo, void *opdata);
int main(void)
int
main(void)
{
hsize_t dims[2];
hsize_t cdims[2];
hsize_t dims[2];
hsize_t cdims[2];
// Try block to detect exceptions raised by any of the calls inside it
try
{
try {
/*
* Turn off the auto-printing when failure occurs so that we can
* handle the errors appropriately
@@ -58,12 +57,12 @@ int main(void)
* Create the named file, truncating the existing one if any,
* using default create and access property lists.
*/
H5File *file = new H5File( FILE_NAME, H5F_ACC_TRUNC );
H5File *file = new H5File(FILE_NAME, H5F_ACC_TRUNC);
/*
* Create a group in the file
*/
Group* group = new Group( file->createGroup( "/Data" ));
Group *group = new Group(file->createGroup("/Data"));
/*
* Create dataset "Compressed Data" in the group using absolute
@@ -71,21 +70,20 @@ int main(void)
* GZIP compression with the compression effort set to 6.
* Note that compression can be used only when dataset is chunked.
*/
dims[0] = 1000;
dims[1] = 20;
cdims[0] = 20;
cdims[1] = 20;
DataSpace *dataspace = new DataSpace(RANK, dims); // create new dspace
DSetCreatPropList ds_creatplist; // create dataset creation prop list
ds_creatplist.setChunk( 2, cdims ); // then modify it for compression
ds_creatplist.setDeflate( 6 );
dims[0] = 1000;
dims[1] = 20;
cdims[0] = 20;
cdims[1] = 20;
DataSpace * dataspace = new DataSpace(RANK, dims); // create new dspace
DSetCreatPropList ds_creatplist; // create dataset creation prop list
ds_creatplist.setChunk(2, cdims); // then modify it for compression
ds_creatplist.setDeflate(6);
/*
* Create the first dataset.
*/
DataSet* dataset = new DataSet(file->createDataSet(
"/Data/Compressed_Data", PredType::NATIVE_INT,
*dataspace, ds_creatplist ));
DataSet *dataset = new DataSet(
file->createDataSet("/Data/Compressed_Data", PredType::NATIVE_INT, *dataspace, ds_creatplist));
/*
* Close the first dataset.
@@ -96,11 +94,10 @@ int main(void)
/*
* Create the second dataset.
*/
dims[0] = 500;
dims[1] = 20;
dims[0] = 500;
dims[1] = 20;
dataspace = new DataSpace(RANK, dims); // create second dspace
dataset = new DataSet(file->createDataSet("/Data/Float_Data",
PredType::NATIVE_FLOAT, *dataspace));
dataset = new DataSet(file->createDataSet("/Data/Float_Data", PredType::NATIVE_FLOAT, *dataspace));
delete dataset;
delete dataspace;
@@ -110,16 +107,16 @@ int main(void)
/*
* Now reopen the file and group in the file.
*/
file = new H5File(FILE_NAME, H5F_ACC_RDWR);
file = new H5File(FILE_NAME, H5F_ACC_RDWR);
group = new Group(file->openGroup("Data"));
/*
* Access "Compressed_Data" dataset in the group.
*/
try { // to determine if the dataset exists in the group
dataset = new DataSet( group->openDataSet( "Compressed_Data" ));
try { // to determine if the dataset exists in the group
dataset = new DataSet(group->openDataSet("Compressed_Data"));
}
catch( GroupIException not_found_error ) {
catch (GroupIException not_found_error) {
cout << " Dataset is not found." << endl;
}
cout << "dataset \"/Data/Compressed_Data\" is open" << endl;
@@ -132,17 +129,16 @@ int main(void)
/*
* Create hard link to the Data group.
*/
file->link( H5L_TYPE_HARD, "Data", "Data_new" );
file->link(H5L_TYPE_HARD, "Data", "Data_new");
/*
* We can access "Compressed_Data" dataset using created
* hard link "Data_new".
*/
try { // to determine if the dataset exists in the file
dataset = new DataSet(file->openDataSet( "/Data_new/Compressed_Data" ));
try { // to determine if the dataset exists in the file
dataset = new DataSet(file->openDataSet("/Data_new/Compressed_Data"));
}
catch( FileIException not_found_error )
{
catch (FileIException not_found_error) {
cout << " Dataset is not found." << endl;
}
cout << "dataset \"/Data_new/Compressed_Data\" is open" << endl;
@@ -165,11 +161,10 @@ int main(void)
* of the objects in the file root direvtory.
*/
cout << "Unlinking..." << endl;
try { // attempt to unlink the dataset
file->unlink( "Data" );
try { // attempt to unlink the dataset
file->unlink("Data");
}
catch( FileIException unlink_error )
{
catch (FileIException unlink_error) {
cout << " unlink failed." << endl;
}
cout << "\"Data\" is unlinked" << endl;
@@ -183,32 +178,28 @@ int main(void)
*/
delete group;
delete file;
} // end of try block
} // end of try block
// catch failure caused by the H5File operations
catch( FileIException error )
{
catch (FileIException error) {
error.printErrorStack();
return -1;
}
// catch failure caused by the DataSet operations
catch( DataSetIException error )
{
catch (DataSetIException error) {
error.printErrorStack();
return -1;
}
// catch failure caused by the DataSpace operations
catch( DataSpaceIException error )
{
catch (DataSpaceIException error) {
error.printErrorStack();
return -1;
}
// catch failure caused by the Attribute operations
catch( AttributeIException error )
{
catch (AttributeIException error) {
error.printErrorStack();
return -1;
}
@@ -236,4 +227,3 @@ file_info(hid_t loc_id, const char *name, const H5L_info2_t *linfo, void *opdata
H5Gclose(group);
return 0;
}

View File

@@ -6,7 +6,7 @@
* This file is part of HDF5. The full HDF5 copyright notice, including *
* terms governing use, modification, and redistribution, is contained in *
* the COPYING file, which can be found at the root of the source code *
* distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. *
* distribution tree, or in https://www.hdfgroup.org/licenses. *
* If you do not have access to either file, you may request a copy from *
* help@hdfgroup.org. *
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
@@ -24,20 +24,20 @@ using std::endl;
#include "H5Cpp.h"
using namespace H5;
const H5std_string FILE_NAME("h5tutr_cmprss.h5");
const H5std_string DATASET_NAME("Compressed_Data");
const int DIM0 = 100;
const int DIM1 = 20;
const H5std_string FILE_NAME("h5tutr_cmprss.h5");
const H5std_string DATASET_NAME("Compressed_Data");
const int DIM0 = 100;
const int DIM1 = 20;
int main (void)
int
main(void)
{
hsize_t dims[2] = { DIM0, DIM1 }; // dataset dimensions
hsize_t chunk_dims[2] = { 20, 20 }; // chunk dimensions
int i,j, buf[DIM0][DIM1];
hsize_t dims[2] = {DIM0, DIM1}; // dataset dimensions
hsize_t chunk_dims[2] = {20, 20}; // chunk dimensions
int i, j, buf[DIM0][DIM1];
// Try block to detect exceptions raised by any of the calls inside it
try
{
try {
// Turn off the auto-printing when failure occurs so that we can
// handle the errors appropriately
Exception::dontPrint();
@@ -49,7 +49,7 @@ int main (void)
DataSpace *dataspace = new DataSpace(2, dims);
// Modify dataset creation property to enable chunking
DSetCreatPropList *plist = new DSetCreatPropList;
DSetCreatPropList *plist = new DSetCreatPropList;
plist->setChunk(2, chunk_dims);
// Set ZLIB (DEFLATE) Compression using level 6.
@@ -62,12 +62,12 @@ int main (void)
// plist->setSzip(szip_options_mask, szip_pixels_per_block);
// Create the dataset.
DataSet *dataset = new DataSet(file.createDataSet( DATASET_NAME,
PredType::STD_I32BE, *dataspace, *plist) );
DataSet *dataset =
new DataSet(file.createDataSet(DATASET_NAME, PredType::STD_I32BE, *dataspace, *plist));
for (i = 0; i< DIM0; i++)
for (j=0; j<DIM1; j++)
buf[i][j] = i+j;
for (i = 0; i < DIM0; i++)
for (j = 0; j < DIM1; j++)
buf[i][j] = i + j;
// Write data to dataset.
dataset->write(buf, PredType::NATIVE_INT);
@@ -83,41 +83,41 @@ int main (void)
// information for dataset and read the data back.
// -----------------------------------------------
int rbuf[DIM0][DIM1];
int numfilt;
size_t nelmts={1}, namelen={1};
unsigned flags, filter_info, cd_values[1], idx;
char name[1];
int rbuf[DIM0][DIM1];
int numfilt;
size_t nelmts = {1}, namelen = {1};
unsigned flags, filter_info, cd_values[1], idx;
char name[1];
H5Z_filter_t filter_type;
// Open the file and the dataset in the file.
file.openFile(FILE_NAME, H5F_ACC_RDONLY);
dataset = new DataSet(file.openDataSet( DATASET_NAME));
dataset = new DataSet(file.openDataSet(DATASET_NAME));
// Get the create property list of the dataset.
plist = new DSetCreatPropList(dataset->getCreatePlist ());
plist = new DSetCreatPropList(dataset->getCreatePlist());
// Get the number of filters associated with the dataset.
numfilt = plist->getNfilters();
cout << "Number of filters associated with dataset: " << numfilt << endl;
for (idx=0; idx < numfilt; idx++) {
for (idx = 0; idx < numfilt; idx++) {
nelmts = 0;
filter_type = plist->getFilter(idx, flags, nelmts, cd_values, namelen, name , filter_info);
filter_type = plist->getFilter(idx, flags, nelmts, cd_values, namelen, name, filter_info);
cout << "Filter Type: ";
switch (filter_type) {
case H5Z_FILTER_DEFLATE:
cout << "H5Z_FILTER_DEFLATE" << endl;
break;
case H5Z_FILTER_SZIP:
cout << "H5Z_FILTER_SZIP" << endl;
break;
default:
cout << "Other filter type included." << endl;
}
case H5Z_FILTER_DEFLATE:
cout << "H5Z_FILTER_DEFLATE" << endl;
break;
case H5Z_FILTER_SZIP:
cout << "H5Z_FILTER_SZIP" << endl;
break;
default:
cout << "Other filter type included." << endl;
}
}
// Read data.
@@ -125,31 +125,27 @@ int main (void)
delete plist;
delete dataset;
file.close(); // can be skipped
file.close(); // can be skipped
} // end of try block
} // end of try block
// catch failure caused by the H5File operations
catch(FileIException error)
{
catch (FileIException error) {
error.printErrorStack();
return -1;
}
// catch failure caused by the DataSet operations
catch(DataSetIException error)
{
catch (DataSetIException error) {
error.printErrorStack();
return -1;
}
// catch failure caused by the DataSpace operations
catch(DataSpaceIException error)
{
catch (DataSpaceIException error) {
error.printErrorStack();
return -1;
}
return 0; // successfully terminated
return 0; // successfully terminated
}

View File

@@ -6,7 +6,7 @@
* This file is part of HDF5. The full HDF5 copyright notice, including *
* terms governing use, modification, and redistribution, is contained in *
* the COPYING file, which can be found at the root of the source code *
* distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. *
* distribution tree, or in https://www.hdfgroup.org/licenses. *
* If you do not have access to either file, you may request a copy from *
* help@hdfgroup.org. *
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
@@ -21,69 +21,62 @@
#include "H5Cpp.h"
using namespace H5;
const H5std_string FILE_NAME( "h5tutr_dset.h5" );
const H5std_string DATASET_NAME( "dset" );
const H5std_string ATTR_NAME( "Units" );
const H5std_string FILE_NAME("h5tutr_dset.h5");
const H5std_string DATASET_NAME("dset");
const H5std_string ATTR_NAME("Units");
const int DIM1 = 2;
const int DIM1 = 2;
int main (void)
int
main(void)
{
int attr_data[2] = { 100, 200};
hsize_t dims[1] = { DIM1 };
int attr_data[2] = {100, 200};
hsize_t dims[1] = {DIM1};
// Try block to detect exceptions raised by any of the calls inside it
try
{
// Try block to detect exceptions raised by any of the calls inside it
try {
// Turn off the auto-printing when failure occurs so that we can
// handle the errors appropriately
Exception::dontPrint();
// Open an existing file and dataset.
H5File file( FILE_NAME, H5F_ACC_RDWR );
DataSet dataset = file.openDataSet( DATASET_NAME );
H5File file(FILE_NAME, H5F_ACC_RDWR);
DataSet dataset = file.openDataSet(DATASET_NAME);
// Create the data space for the attribute.
DataSpace attr_dataspace = DataSpace (1, dims );
DataSpace attr_dataspace = DataSpace(1, dims);
// Create a dataset attribute.
Attribute attribute = dataset.createAttribute( ATTR_NAME, PredType::STD_I32BE,
attr_dataspace);
Attribute attribute = dataset.createAttribute(ATTR_NAME, PredType::STD_I32BE, attr_dataspace);
// Write the attribute data.
attribute.write( PredType::NATIVE_INT, attr_data);
attribute.write(PredType::NATIVE_INT, attr_data);
} // end of try block
} // end of try block
// catch failure caused by the H5File operations
catch( DataSpaceIException error )
{
// catch failure caused by the H5File operations
catch (DataSpaceIException error) {
error.printErrorStack();
return -1;
}
}
// catch failure caused by the H5File operations
catch( AttributeIException error )
{
// catch failure caused by the H5File operations
catch (AttributeIException error) {
error.printErrorStack();
return -1;
}
}
// catch failure caused by the H5File operations
catch( FileIException error )
{
// catch failure caused by the H5File operations
catch (FileIException error) {
error.printErrorStack();
return -1;
}
}
// catch failure caused by the DataSet operations
catch( DataSetIException error )
{
// catch failure caused by the DataSet operations
catch (DataSetIException error) {
error.printErrorStack();
return -1;
}
}
return 0; // successfully terminated
return 0; // successfully terminated
}

View File

@@ -6,7 +6,7 @@
* This file is part of HDF5. The full HDF5 copyright notice, including *
* terms governing use, modification, and redistribution, is contained in *
* the COPYING file, which can be found at the root of the source code *
* distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. *
* distribution tree, or in https://www.hdfgroup.org/licenses. *
* If you do not have access to either file, you may request a copy from *
* help@hdfgroup.org. *
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
@@ -22,17 +22,17 @@
#include "H5Cpp.h"
using namespace H5;
const H5std_string FILE_NAME("h5tutr_dset.h5");
const H5std_string DATASET_NAME("dset");
const int NX = 4; // dataset dimensions
const int NY = 6;
const int RANK = 2;
const H5std_string FILE_NAME("h5tutr_dset.h5");
const H5std_string DATASET_NAME("dset");
const int NX = 4; // dataset dimensions
const int NY = 6;
const int RANK = 2;
int main (void)
int
main(void)
{
// Try block to detect exceptions raised by any of the calls inside it
try
{
try {
// Turn off the auto-printing when failure occurs so that we can
// handle the errors appropriately
Exception::dontPrint();
@@ -41,7 +41,7 @@ int main (void)
H5File file(FILE_NAME, H5F_ACC_TRUNC);
// Create the data space for the dataset.
hsize_t dims[2]; // dataset dimensions
hsize_t dims[2]; // dataset dimensions
dims[0] = NX;
dims[1] = NY;
DataSpace dataspace(RANK, dims);
@@ -49,29 +49,25 @@ int main (void)
// Create the dataset.
DataSet dataset = file.createDataSet(DATASET_NAME, PredType::STD_I32BE, dataspace);
} // end of try block
} // end of try block
// catch failure caused by the H5File operations
catch(FileIException error)
{
catch (FileIException error) {
error.printErrorStack();
return -1;
}
// catch failure caused by the DataSet operations
catch(DataSetIException error)
{
catch (DataSetIException error) {
error.printErrorStack();
return -1;
}
// catch failure caused by the DataSpace operations
catch(DataSpaceIException error)
{
catch (DataSpaceIException error) {
error.printErrorStack();
return -1;
}
return 0; // successfully terminated
return 0; // successfully terminated
}

View File

@@ -6,7 +6,7 @@
* This file is part of HDF5. The full HDF5 copyright notice, including *
* terms governing use, modification, and redistribution, is contained in *
* the COPYING file, which can be found at the root of the source code *
* distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. *
* distribution tree, or in https://www.hdfgroup.org/licenses. *
* If you do not have access to either file, you may request a copy from *
* help@hdfgroup.org. *
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
@@ -26,11 +26,11 @@ using namespace H5;
const H5std_string FILE_NAME("h5tutr_group.h5");
int main(void)
int
main(void)
{
// Try block to detect exceptions raised by any of the calls inside it
try
{
try {
// Turn off the auto-printing when failure occurs so that we can
// handle the errors appropriately
Exception::dontPrint();
@@ -46,14 +46,12 @@ int main(void)
} // end of try block
// catch failure caused by the H5File operations
catch(FileIException error)
{
catch (FileIException error) {
error.printErrorStack();
return -1;
}
// catch failure caused by the Group operations
catch(GroupIException error)
{
catch (GroupIException error) {
error.printErrorStack();
return -1;
}

View File

@@ -6,7 +6,7 @@
* This file is part of HDF5. The full HDF5 copyright notice, including *
* terms governing use, modification, and redistribution, is contained in *
* the COPYING file, which can be found at the root of the source code *
* distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. *
* distribution tree, or in https://www.hdfgroup.org/licenses. *
* If you do not have access to either file, you may request a copy from *
* help@hdfgroup.org. *
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
@@ -26,12 +26,12 @@ using namespace H5;
const H5std_string FILE_NAME("h5tutr_groups.h5");
int main(void)
int
main(void)
{
// Try block to detect exceptions raised by any of the calls inside it
try
{
try {
// Turn off the auto-printing when failure occurs so that we can
// handle the errors appropriately.
@@ -44,7 +44,7 @@ int main(void)
// Create group "MyGroup" in the root group using an absolute name.
Group group1(file.createGroup( "/MyGroup"));
Group group1(file.createGroup("/MyGroup"));
// Create group "Group_A" in group "MyGroup" using an
// absolute name.
@@ -54,7 +54,7 @@ int main(void)
// Create group "Group_B" in group "MyGroup" using a
// relative name.
Group group3(group1.createGroup ("Group_B"));
Group group3(group1.createGroup("Group_B"));
// Close the groups and file.
@@ -66,20 +66,16 @@ int main(void)
} // end of try block
// catch failure caused by the File operations
catch(FileIException error)
{
catch (FileIException error) {
error.printErrorStack();
return -1;
}
// catch failure caused by the Group operations
catch(GroupIException error)
{
catch (GroupIException error) {
error.printErrorStack();
return -1;
}
return 0;
}

View File

@@ -6,7 +6,7 @@
* This file is part of HDF5. The full HDF5 copyright notice, including *
* terms governing use, modification, and redistribution, is contained in *
* the COPYING file, which can be found at the root of the source code *
* distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. *
* distribution tree, or in https://www.hdfgroup.org/licenses. *
* If you do not have access to either file, you may request a copy from *
* help@hdfgroup.org. *
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
@@ -27,20 +27,20 @@ using namespace H5;
const H5std_string FILE_NAME("h5tutr_groups.h5");
const H5std_string DATASET_NAME1("/MyGroup/dset1");
const H5std_string DATASET_NAME2("dset2");
const int RANK = 2;
const int D1DIM1 = 3;
const int D1DIM2 = 3;
const int D2DIM1 = 2;
const int D2DIM2 = 10;
const int RANK = 2;
const int D1DIM1 = 3;
const int D1DIM2 = 3;
const int D2DIM1 = 2;
const int D2DIM2 = 10;
int main(void)
int
main(void)
{
int dset1_data[D1DIM1][D1DIM2], dset2_data[D2DIM1][D2DIM2]; // data buffers
int i, j;
// Try block to catch exceptions raised by any of the calls inside it
try
{
try {
// Turn off the auto-printing when failure occurs so that we can
// handle the errors appropriately
Exception::dontPrint();
@@ -48,12 +48,12 @@ int main(void)
// Initialize the first dataset.
for (i = 0; i < D1DIM1; i++)
for (j = 0; j < D1DIM2; j++)
dset1_data[i][j] = j + 1;
dset1_data[i][j] = j + 1;
// Initialize the second dataset.
for (i = 0; i < D2DIM1; i++)
for (j = 0; j < D2DIM2; j++)
dset2_data[i][j] = j + 1;
for (j = 0; j < D2DIM2; j++)
dset2_data[i][j] = j + 1;
// Open an existing file and dataset.
H5File file(FILE_NAME, H5F_ACC_RDWR);
@@ -62,15 +62,14 @@ int main(void)
// pointer for the instance 'dataspace'. It can be deleted and
// used again later for another data space. An HDF5 identifier is
// closed by the destructor or the method 'close()'.
hsize_t dims[RANK]; // dataset dimensions
dims[0] = D1DIM1;
dims[1] = D1DIM2;
DataSpace *dataspace = new DataSpace (RANK, dims);
hsize_t dims[RANK]; // dataset dimensions
dims[0] = D1DIM1;
dims[1] = D1DIM2;
DataSpace *dataspace = new DataSpace(RANK, dims);
// Create the dataset in group "MyGroup". Same note as for the
// dataspace above.
DataSet *dataset = new DataSet (file.createDataSet(DATASET_NAME1,
PredType::STD_I32BE, *dataspace));
DataSet *dataset = new DataSet(file.createDataSet(DATASET_NAME1, PredType::STD_I32BE, *dataspace));
// Write the data to the dataset using default memory space, file
// space, and transfer properties.
@@ -81,16 +80,15 @@ int main(void)
delete dataspace;
// Create the data space for the second dataset.
dims[0] = D2DIM1;
dims[1] = D2DIM2;
dataspace = new DataSpace (RANK, dims);
dims[0] = D2DIM1;
dims[1] = D2DIM2;
dataspace = new DataSpace(RANK, dims);
// Create group "Group_A" in group "MyGroup".
Group group(file.openGroup("/MyGroup/Group_A"));
// Create the second dataset in group "Group_A".
dataset = new DataSet (group.createDataSet(DATASET_NAME2,
PredType::STD_I32BE, *dataspace));
dataset = new DataSet(group.createDataSet(DATASET_NAME2, PredType::STD_I32BE, *dataspace));
// Write the data to the dataset using default memory space, file
// space, and transfer properties.
@@ -104,31 +102,27 @@ int main(void)
} // end of try block
// catch failure caused by the H5File operations
catch(FileIException error)
{
error.printErrorStack();
return -1;
catch (FileIException error) {
error.printErrorStack();
return -1;
}
// catch failure caused by the DataSet operations
catch(DataSetIException error)
{
error.printErrorStack();
return -1;
catch (DataSetIException error) {
error.printErrorStack();
return -1;
}
// catch failure caused by the DataSpace operations
catch(DataSpaceIException error)
{
catch (DataSpaceIException error) {
error.printErrorStack();
return -1;
}
// catch failure caused by the Group operations
catch(GroupIException error)
{
catch (GroupIException error) {
error.printErrorStack();
return -1;
}
return 0;
return 0;
}

View File

@@ -6,7 +6,7 @@
* This file is part of HDF5. The full HDF5 copyright notice, including *
* terms governing use, modification, and redistribution, is contained in *
* the COPYING file, which can be found at the root of the source code *
* distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. *
* distribution tree, or in https://www.hdfgroup.org/licenses. *
* If you do not have access to either file, you may request a copy from *
* help@hdfgroup.org. *
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
@@ -24,34 +24,28 @@ using std::endl;
#include "H5Cpp.h"
using namespace H5;
const H5std_string FILE_NAME("h5tutr_extend.h5");
const H5std_string DATASETNAME("ExtendibleArray");
const H5std_string FILE_NAME("h5tutr_extend.h5");
const H5std_string DATASETNAME("ExtendibleArray");
int main (void)
int
main(void)
{
hsize_t dims[2] = {3,3}; // dataset dimensions at creation
hsize_t maxdims[2] = {H5S_UNLIMITED, H5S_UNLIMITED};
hsize_t chunk_dims[2] ={2, 5};
int data[3][3] = { {1, 1, 1}, // data to write
{1, 1, 1},
{1, 1, 1} };
hsize_t dims[2] = {3, 3}; // dataset dimensions at creation
hsize_t maxdims[2] = {H5S_UNLIMITED, H5S_UNLIMITED};
hsize_t chunk_dims[2] = {2, 5};
int data[3][3] = {{1, 1, 1}, // data to write
{1, 1, 1},
{1, 1, 1}};
// Variables used in extending and writing to the extended portion of dataset
// Variables used in extending and writing to the extended portion of dataset
hsize_t size[2];
hsize_t offset[2];
hsize_t dimsext[2] = {7, 3}; // extend dimensions
int dataext[7][3] = { {2, 3, 4},
{2, 3, 4},
{2, 3, 4},
{2, 3, 4},
{2, 3, 4},
{2, 3, 4},
{2, 3, 4} };
hsize_t size[2];
hsize_t offset[2];
hsize_t dimsext[2] = {7, 3}; // extend dimensions
int dataext[7][3] = {{2, 3, 4}, {2, 3, 4}, {2, 3, 4}, {2, 3, 4}, {2, 3, 4}, {2, 3, 4}, {2, 3, 4}};
// Try block to detect exceptions raised by any of the calls inside it
try
{
try {
// Turn off the auto-printing when failure occurs so that we can
// handle the errors appropriately
Exception::dontPrint();
@@ -63,15 +57,15 @@ int main (void)
// for the instance 'dataspace'. It can be deleted and used again
// later for another dataspace. An HDF5 identifier can be closed
// by the destructor or the method 'close()'.
DataSpace *dataspace = new DataSpace (2, dims, maxdims);
DataSpace *dataspace = new DataSpace(2, dims, maxdims);
// Modify dataset creation property to enable chunking
DSetCreatPropList prop;
prop.setChunk(2, chunk_dims);
// Create the chunked dataset. Note the use of pointer.
DataSet *dataset = new DataSet(file.createDataSet( DATASETNAME,
PredType::STD_I32BE, *dataspace, prop) );
DataSet *dataset =
new DataSet(file.createDataSet(DATASETNAME, PredType::STD_I32BE, *dataspace, prop));
// Write data to dataset.
dataset->write(data, PredType::NATIVE_INT);
@@ -82,9 +76,9 @@ int main (void)
dataset->extend(size);
// Select a hyperslab in extended portion of the dataset.
DataSpace *filespace = new DataSpace(dataset->getSpace ());
offset[0] = 3;
offset[1] = 0;
DataSpace *filespace = new DataSpace(dataset->getSpace());
offset[0] = 3;
offset[1] = 0;
filespace->selectHyperslab(H5S_SELECT_SET, dimsext, offset);
// Define memory space.
@@ -105,25 +99,26 @@ int main (void)
// Re-open the file and read the data back
// ---------------------------------------
int rdata[10][3];
int i,j, rank, rank_chunk;
hsize_t chunk_dimsr[2], dimsr[2];
int rdata[10][3];
int i, j, rank, rank_chunk;
hsize_t chunk_dimsr[2], dimsr[2];
// Open the file and dataset.
file.openFile(FILE_NAME, H5F_ACC_RDONLY);
dataset = new DataSet(file.openDataSet( DATASETNAME));
dataset = new DataSet(file.openDataSet(DATASETNAME));
// Get the dataset's dataspace and creation property list.
filespace = new DataSpace(dataset->getSpace());
prop = dataset->getCreatePlist();
prop = dataset->getCreatePlist();
// Get information to obtain memory dataspace.
rank = filespace->getSimpleExtentNdims();
rank = filespace->getSimpleExtentNdims();
herr_t status_n = filespace->getSimpleExtentDims(dimsr);
if (H5D_CHUNKED == prop.getLayout())
rank_chunk = prop.getChunk(rank, chunk_dimsr);
cout << "rank chunk = " << rank_chunk << endl;;
rank_chunk = prop.getChunk(rank, chunk_dimsr);
cout << "rank chunk = " << rank_chunk << endl;
;
memspace = new DataSpace(rank, dimsr, NULL);
dataset->read(rdata, PredType::NATIVE_INT, *memspace, *filespace);
@@ -131,7 +126,7 @@ int main (void)
cout << endl;
for (j = 0; j < dimsr[0]; j++) {
for (i = 0; i < dimsr[1]; i++)
cout << " " << rdata[j][i];
cout << " " << rdata[j][i];
cout << endl;
}
@@ -142,29 +137,25 @@ int main (void)
delete dataset;
file.close();
} // end of try block
} // end of try block
// catch failure caused by the H5File operations
catch(FileIException error)
{
catch (FileIException error) {
error.printErrorStack();
return -1;
}
// catch failure caused by the DataSet operations
catch(DataSetIException error)
{
catch (DataSetIException error) {
error.printErrorStack();
return -1;
}
// catch failure caused by the DataSpace operations
catch(DataSpaceIException error)
{
catch (DataSpaceIException error) {
error.printErrorStack();
return -1;
}
return 0; // successfully terminated
return 0; // successfully terminated
}

View File

@@ -6,7 +6,7 @@
* This file is part of HDF5. The full HDF5 copyright notice, including *
* terms governing use, modification, and redistribution, is contained in *
* the COPYING file, which can be found at the root of the source code *
* distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. *
* distribution tree, or in https://www.hdfgroup.org/licenses. *
* If you do not have access to either file, you may request a copy from *
* help@hdfgroup.org. *
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
@@ -21,53 +21,51 @@
#include "H5Cpp.h"
using namespace H5;
const H5std_string FILE_NAME("h5tutr_dset.h5");
const H5std_string DATASET_NAME("dset");
const int DIM0 = 4; // dataset dimensions
const int DIM1 = 6;
const H5std_string FILE_NAME("h5tutr_dset.h5");
const H5std_string DATASET_NAME("dset");
const int DIM0 = 4; // dataset dimensions
const int DIM1 = 6;
int main (void)
int
main(void)
{
// Data initialization.
int i, j;
int data[DIM0][DIM1]; // buffer for data to write
int data[DIM0][DIM1]; // buffer for data to write
for (j = 0; j < DIM0; j++)
for (i = 0; i < DIM1; i++)
data[j][i] = i * 6 + j + 1;
data[j][i] = i * 6 + j + 1;
// Try block to detect exceptions raised by any of the calls inside it
try
{
try {
// Turn off the auto-printing when failure occurs so that we can
// handle the errors appropriately
Exception::dontPrint();
// Open an existing file and dataset.
H5File file(FILE_NAME, H5F_ACC_RDWR);
H5File file(FILE_NAME, H5F_ACC_RDWR);
DataSet dataset = file.openDataSet(DATASET_NAME);
// Write the data to the dataset using default memory space, file
// space, and transfer properties.
dataset.write(data, PredType::NATIVE_INT);
} // end of try block
} // end of try block
// catch failure caused by the H5File operations
catch(FileIException error)
{
catch (FileIException error) {
error.printErrorStack();
return -1;
}
// catch failure caused by the DataSet operations
catch(DataSetIException error)
{
catch (DataSetIException error) {
error.printErrorStack();
return -1;
}
return 0; // successfully terminated
return 0; // successfully terminated
}

View File

@@ -6,7 +6,7 @@
* This file is part of HDF5. The full HDF5 copyright notice, including *
* terms governing use, modification, and redistribution, is contained in *
* the COPYING file, which can be found at the root of the source code *
* distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. *
* distribution tree, or in https://www.hdfgroup.org/licenses. *
* If you do not have access to either file, you may request a copy from *
* help@hdfgroup.org. *
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
@@ -24,23 +24,23 @@ using std::endl;
#include "H5Cpp.h"
using namespace H5;
const H5std_string FILE_NAME("h5tutr_subset.h5");
const H5std_string DATASET_NAME("IntArray");
const H5std_string FILE_NAME("h5tutr_subset.h5");
const H5std_string DATASET_NAME("IntArray");
const int RANK = 2;
const int DIM0_SUB = 3; // subset dimensions
const int DIM1_SUB = 4;
const int DIM0 = 8; // size of dataset
const int DIM1 = 10;
const int RANK = 2;
const int DIM0_SUB = 3; // subset dimensions
const int DIM1_SUB = 4;
const int DIM0 = 8; // size of dataset
const int DIM1 = 10;
int main (void)
int
main(void)
{
int i,j;
int data[DIM0][DIM1], sdata[DIM0_SUB][DIM1_SUB], rdata[DIM0][DIM1];
int i, j;
int data[DIM0][DIM1], sdata[DIM0_SUB][DIM1_SUB], rdata[DIM0][DIM1];
// Try block to detect exceptions raised by any of the calls inside it
try
{
try {
// Turn off the auto-printing when failure occurs so that we can
// handle the errors appropriately
Exception::dontPrint();
@@ -54,28 +54,26 @@ int main (void)
H5File file(FILE_NAME, H5F_ACC_TRUNC);
hsize_t dims[2];
dims[0] = DIM0;
dims[1] = DIM1;
DataSpace dataspace = DataSpace (RANK, dims);
DataSet dataset(file.createDataSet( DATASET_NAME,
PredType::STD_I32BE, dataspace) );
dims[0] = DIM0;
dims[1] = DIM1;
DataSpace dataspace = DataSpace(RANK, dims);
DataSet dataset(file.createDataSet(DATASET_NAME, PredType::STD_I32BE, dataspace));
for (j = 0; j < DIM0; j++) {
for (i = 0; i < DIM1; i++)
if (i< (DIM1/2))
for (i = 0; i < DIM1; i++)
if (i < (DIM1 / 2))
data[j][i] = 1;
else
else
data[j][i] = 2;
}
}
dataset.write(data, PredType::NATIVE_INT);
cout << endl << "Data Written to File:" << endl;
for (j = 0; j < DIM0; j++) {
for (i = 0; i < DIM1; i++)
cout << " " << data[j][i];
cout << " " << data[j][i];
cout << endl;
}
@@ -99,8 +97,8 @@ int main (void)
offset[0] = 1;
offset[1] = 2;
count[0] = DIM0_SUB;
count[1] = DIM1_SUB;
count[0] = DIM0_SUB;
count[1] = DIM1_SUB;
stride[0] = 1;
stride[1] = 1;
@@ -126,17 +124,16 @@ int main (void)
cout << " offset=1x2 stride=1x1 count=3x4 block=1x1" << endl;
for (j = 0; j < DIM0_SUB; j++) {
for (i = 0; i < DIM1_SUB; i++)
sdata[j][i] = 5;
sdata[j][i] = 5;
}
dataset.write(sdata, PredType::NATIVE_INT, memspace, dataspace);
dataset.read(rdata, PredType::NATIVE_INT);
cout << endl << "Data in File after Subset is Written:" << endl;
for (i = 0; i < DIM0; i++) {
for (j = 0; j < DIM1; j++)
cout << " " << rdata[i][j];
cout << " " << rdata[i][j];
cout << endl;
}
cout << endl;
@@ -148,29 +145,25 @@ int main (void)
dataset.close();
file.close();
} // end of try block
} // end of try block
// catch failure caused by the H5File operations
catch(FileIException error)
{
catch (FileIException error) {
error.printErrorStack();
return -1;
}
// catch failure caused by the DataSet operations
catch(DataSetIException error)
{
catch (DataSetIException error) {
error.printErrorStack();
return -1;
}
// catch failure caused by the DataSpace operations
catch(DataSpaceIException error)
{
catch (DataSpaceIException error) {
error.printErrorStack();
return -1;
}
return 0; // successfully terminated
return 0; // successfully terminated
}

View File

@@ -6,7 +6,7 @@
* This file is part of HDF5. The full HDF5 copyright notice, including *
* terms governing use, modification, and redistribution, is contained in *
* the COPYING file, which can be found at the root of the source code *
* distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. *
* distribution tree, or in https://www.hdfgroup.org/licenses. *
* If you do not have access to either file, you may request a copy from *
* help@hdfgroup.org. *
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
@@ -29,184 +29,174 @@ using std::endl;
#include "H5Cpp.h"
using namespace H5;
const H5std_string FILE_NAME( "SDS.h5" );
const H5std_string DATASET_NAME( "IntArray" );
const int NX_SUB = 3; // hyperslab dimensions
const int NY_SUB = 4;
const int NX = 7; // output buffer dimensions
const int NY = 7;
const int NZ = 3;
const int RANK_OUT = 3;
const H5std_string FILE_NAME("SDS.h5");
const H5std_string DATASET_NAME("IntArray");
const int NX_SUB = 3; // hyperslab dimensions
const int NY_SUB = 4;
const int NX = 7; // output buffer dimensions
const int NY = 7;
const int NZ = 3;
const int RANK_OUT = 3;
int main (void)
int
main(void)
{
/*
* Output buffer initialization.
*/
int i, j, k;
int data_out[NX][NY][NZ ]; /* output buffer */
for (j = 0; j < NX; j++)
{
for (i = 0; i < NY; i++)
{
for (k = 0; k < NZ ; k++)
data_out[j][i][k] = 0;
}
}
/*
* Output buffer initialization.
*/
int i, j, k;
int data_out[NX][NY][NZ]; /* output buffer */
for (j = 0; j < NX; j++) {
for (i = 0; i < NY; i++) {
for (k = 0; k < NZ; k++)
data_out[j][i][k] = 0;
}
}
/*
* Try block to detect exceptions raised by any of the calls inside it
*/
try
{
/*
* Turn off the auto-printing when failure occurs so that we can
* handle the errors appropriately
*/
Exception::dontPrint();
/*
* Try block to detect exceptions raised by any of the calls inside it
*/
try {
/*
* Turn off the auto-printing when failure occurs so that we can
* handle the errors appropriately
*/
Exception::dontPrint();
/*
* Open the specified file and the specified dataset in the file.
*/
H5File file( FILE_NAME, H5F_ACC_RDONLY );
DataSet dataset = file.openDataSet( DATASET_NAME );
/*
* Open the specified file and the specified dataset in the file.
*/
H5File file(FILE_NAME, H5F_ACC_RDONLY);
DataSet dataset = file.openDataSet(DATASET_NAME);
/*
* Get the class of the datatype that is used by the dataset.
*/
H5T_class_t type_class = dataset.getTypeClass();
/*
* Get the class of the datatype that is used by the dataset.
*/
H5T_class_t type_class = dataset.getTypeClass();
/*
* Get class of datatype and print message if it's an integer.
*/
if( type_class == H5T_INTEGER )
{
cout << "Data set has INTEGER type" << endl;
/*
* Get class of datatype and print message if it's an integer.
*/
if (type_class == H5T_INTEGER) {
cout << "Data set has INTEGER type" << endl;
/*
* Get the integer datatype
*/
IntType intype = dataset.getIntType();
/*
* Get the integer datatype
*/
IntType intype = dataset.getIntType();
/*
* Get order of datatype and print message if it's a little endian.
*/
H5std_string order_string;
H5T_order_t order = intype.getOrder( order_string );
cout << order_string << endl;
/*
* Get order of datatype and print message if it's a little endian.
*/
H5std_string order_string;
H5T_order_t order = intype.getOrder(order_string);
cout << order_string << endl;
/*
* Get size of the data element stored in file and print it.
*/
size_t size = intype.getSize();
cout << "Data size is " << size << endl;
}
/*
* Get size of the data element stored in file and print it.
*/
size_t size = intype.getSize();
cout << "Data size is " << size << endl;
}
/*
* Get dataspace of the dataset.
*/
DataSpace dataspace = dataset.getSpace();
/*
* Get dataspace of the dataset.
*/
DataSpace dataspace = dataset.getSpace();
/*
* Get the number of dimensions in the dataspace.
*/
int rank = dataspace.getSimpleExtentNdims();
/*
* Get the number of dimensions in the dataspace.
*/
int rank = dataspace.getSimpleExtentNdims();
/*
* Get the dimension size of each dimension in the dataspace and
* display them.
*/
hsize_t dims_out[2];
int ndims = dataspace.getSimpleExtentDims( dims_out, NULL);
cout << "rank " << rank << ", dimensions " <<
(unsigned long)(dims_out[0]) << " x " <<
(unsigned long)(dims_out[1]) << endl;
/*
* Get the dimension size of each dimension in the dataspace and
* display them.
*/
hsize_t dims_out[2];
int ndims = dataspace.getSimpleExtentDims(dims_out, NULL);
cout << "rank " << rank << ", dimensions " << (unsigned long)(dims_out[0]) << " x "
<< (unsigned long)(dims_out[1]) << endl;
/*
* Define hyperslab in the dataset; implicitly giving strike and
* block NULL.
*/
hsize_t offset[2]; // hyperslab offset in the file
hsize_t count[2]; // size of the hyperslab in the file
offset[0] = 1;
offset[1] = 2;
count[0] = NX_SUB;
count[1] = NY_SUB;
dataspace.selectHyperslab( H5S_SELECT_SET, count, offset );
/*
* Define hyperslab in the dataset; implicitly giving strike and
* block NULL.
*/
hsize_t offset[2]; // hyperslab offset in the file
hsize_t count[2]; // size of the hyperslab in the file
offset[0] = 1;
offset[1] = 2;
count[0] = NX_SUB;
count[1] = NY_SUB;
dataspace.selectHyperslab(H5S_SELECT_SET, count, offset);
/*
* Define the memory dataspace.
*/
hsize_t dimsm[3]; /* memory space dimensions */
dimsm[0] = NX;
dimsm[1] = NY;
dimsm[2] = NZ ;
DataSpace memspace( RANK_OUT, dimsm );
/*
* Define the memory dataspace.
*/
hsize_t dimsm[3]; /* memory space dimensions */
dimsm[0] = NX;
dimsm[1] = NY;
dimsm[2] = NZ;
DataSpace memspace(RANK_OUT, dimsm);
/*
* Define memory hyperslab.
*/
hsize_t offset_out[3]; // hyperslab offset in memory
hsize_t count_out[3]; // size of the hyperslab in memory
offset_out[0] = 3;
offset_out[1] = 0;
offset_out[2] = 0;
count_out[0] = NX_SUB;
count_out[1] = NY_SUB;
count_out[2] = 1;
memspace.selectHyperslab( H5S_SELECT_SET, count_out, offset_out );
/*
* Define memory hyperslab.
*/
hsize_t offset_out[3]; // hyperslab offset in memory
hsize_t count_out[3]; // size of the hyperslab in memory
offset_out[0] = 3;
offset_out[1] = 0;
offset_out[2] = 0;
count_out[0] = NX_SUB;
count_out[1] = NY_SUB;
count_out[2] = 1;
memspace.selectHyperslab(H5S_SELECT_SET, count_out, offset_out);
/*
* Read data from hyperslab in the file into the hyperslab in
* memory and display the data.
*/
dataset.read( data_out, PredType::NATIVE_INT, memspace, dataspace );
/*
* Read data from hyperslab in the file into the hyperslab in
* memory and display the data.
*/
dataset.read(data_out, PredType::NATIVE_INT, memspace, dataspace);
for (j = 0; j < NX; j++)
{
for (i = 0; i < NY; i++)
cout << data_out[j][i][0] << " ";
cout << endl;
}
/*
* 0 0 0 0 0 0 0
* 0 0 0 0 0 0 0
* 0 0 0 0 0 0 0
* 3 4 5 6 0 0 0
* 4 5 6 7 0 0 0
* 5 6 7 8 0 0 0
* 0 0 0 0 0 0 0
*/
} // end of try block
for (j = 0; j < NX; j++) {
for (i = 0; i < NY; i++)
cout << data_out[j][i][0] << " ";
cout << endl;
}
/*
* 0 0 0 0 0 0 0
* 0 0 0 0 0 0 0
* 0 0 0 0 0 0 0
* 3 4 5 6 0 0 0
* 4 5 6 7 0 0 0
* 5 6 7 8 0 0 0
* 0 0 0 0 0 0 0
*/
} // end of try block
// catch failure caused by the H5File operations
catch( FileIException error )
{
error.printErrorStack();
return -1;
}
// catch failure caused by the H5File operations
catch (FileIException error) {
error.printErrorStack();
return -1;
}
// catch failure caused by the DataSet operations
catch( DataSetIException error )
{
error.printErrorStack();
return -1;
}
// catch failure caused by the DataSet operations
catch (DataSetIException error) {
error.printErrorStack();
return -1;
}
// catch failure caused by the DataSpace operations
catch( DataSpaceIException error )
{
error.printErrorStack();
return -1;
}
// catch failure caused by the DataSpace operations
catch (DataSpaceIException error) {
error.printErrorStack();
return -1;
}
// catch failure caused by the DataSpace operations
catch( DataTypeIException error )
{
error.printErrorStack();
return -1;
}
// catch failure caused by the DataSpace operations
catch (DataTypeIException error) {
error.printErrorStack();
return -1;
}
return 0; // successfully terminated
return 0; // successfully terminated
}

View File

@@ -6,7 +6,7 @@
# This file is part of HDF5. The full HDF5 copyright notice, including
# terms governing use, modification, and redistribution, is contained in
# the COPYING file, which can be found at the root of the source code
# distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases.
# distribution tree, or in https://www.hdfgroup.org/licenses.
# If you do not have access to either file, you may request a copy from
# help@hdfgroup.org.

View File

@@ -7,7 +7,7 @@
# This file is part of HDF5. The full HDF5 copyright notice, including
# terms governing use, modification, and redistribution, is contained in
# the COPYING file, which can be found at the root of the source code
# distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases.
# distribution tree, or in https://www.hdfgroup.org/licenses.
# If you do not have access to either file, you may request a copy from
# help@hdfgroup.org.
#

View File

@@ -6,7 +6,7 @@
* This file is part of HDF5. The full HDF5 copyright notice, including *
* terms governing use, modification, and redistribution, is contained in *
* the COPYING file, which can be found at the root of the source code *
* distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. *
* distribution tree, or in https://www.hdfgroup.org/licenses. *
* If you do not have access to either file, you may request a copy from *
* help@hdfgroup.org. *
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
@@ -32,31 +32,31 @@ using std::endl;
#include "H5Cpp.h"
using namespace H5;
const H5std_string FILE_NAME( "Select.h5" );
const H5std_string DATASET_NAME( "Matrix in file" );
const int MSPACE1_RANK = 1; // Rank of the first dataset in memory
const int MSPACE1_DIM = 50; // Dataset size in memory
const int MSPACE2_RANK = 1; // Rank of the second dataset in memory
const int MSPACE2_DIM = 4; // Dataset size in memory
const int FSPACE_RANK = 2; // Dataset rank as it is stored in the file
const int FSPACE_DIM1 = 8; // Dimension sizes of the dataset as it is
const int FSPACE_DIM2 = 12; // stored in the file
const int MSPACE_RANK = 2; // Rank of the first dataset in memory
const int MSPACE_DIM1 = 8; // We will read dataset back from the file
const int MSPACE_DIM2 = 9; // to the dataset in memory with these
// dataspace parameters
const int NPOINTS = 4; // Number of points that will be selected
// and overwritten
const H5std_string FILE_NAME("Select.h5");
const H5std_string DATASET_NAME("Matrix in file");
const int MSPACE1_RANK = 1; // Rank of the first dataset in memory
const int MSPACE1_DIM = 50; // Dataset size in memory
const int MSPACE2_RANK = 1; // Rank of the second dataset in memory
const int MSPACE2_DIM = 4; // Dataset size in memory
const int FSPACE_RANK = 2; // Dataset rank as it is stored in the file
const int FSPACE_DIM1 = 8; // Dimension sizes of the dataset as it is
const int FSPACE_DIM2 = 12; // stored in the file
const int MSPACE_RANK = 2; // Rank of the first dataset in memory
const int MSPACE_DIM1 = 8; // We will read dataset back from the file
const int MSPACE_DIM2 = 9; // to the dataset in memory with these
// dataspace parameters
const int NPOINTS = 4; // Number of points that will be selected
// and overwritten
int main (void)
int
main(void)
{
int i,j; // loop indices */
int i, j; // loop indices */
/*
* Try block to detect exceptions raised by any of the calls inside it
*/
try
{
try {
/*
* Turn off the auto-printing when failure occurs so that we can
* handle the errors appropriately
@@ -66,47 +66,51 @@ int main (void)
/*
* Create a file.
*/
H5File* file = new H5File( FILE_NAME, H5F_ACC_TRUNC );
H5File *file = new H5File(FILE_NAME, H5F_ACC_TRUNC);
/*
* Create property list for a dataset and set up fill values.
*/
int fillvalue = 0; /* Fill value for the dataset */
* Create property list for a dataset and set up fill values.
*/
int fillvalue = 0; /* Fill value for the dataset */
DSetCreatPropList plist;
plist.setFillValue(PredType::NATIVE_INT, &fillvalue);
/*
* Create dataspace for the dataset in the file.
*/
hsize_t fdim[] = {FSPACE_DIM1, FSPACE_DIM2}; // dim sizes of ds (on disk)
DataSpace fspace( FSPACE_RANK, fdim );
hsize_t fdim[] = {FSPACE_DIM1, FSPACE_DIM2}; // dim sizes of ds (on disk)
DataSpace fspace(FSPACE_RANK, fdim);
/*
* Create dataset and write it into the file.
*/
DataSet* dataset = new DataSet(file->createDataSet(
DATASET_NAME, PredType::NATIVE_INT, fspace, plist));
DataSet *dataset =
new DataSet(file->createDataSet(DATASET_NAME, PredType::NATIVE_INT, fspace, plist));
/*
* Select hyperslab for the dataset in the file, using 3x2 blocks,
* (4,3) stride and (2,4) count starting at the position (0,1).
*/
hsize_t start[2]; // Start of hyperslab
hsize_t start[2]; // Start of hyperslab
hsize_t stride[2]; // Stride of hyperslab
hsize_t count[2]; // Block count
hsize_t block[2]; // Block sizes
start[0] = 0; start[1] = 1;
stride[0] = 4; stride[1] = 3;
count[0] = 2; count[1] = 4;
block[0] = 3; block[1] = 2;
fspace.selectHyperslab( H5S_SELECT_SET, count, start, stride, block);
start[0] = 0;
start[1] = 1;
stride[0] = 4;
stride[1] = 3;
count[0] = 2;
count[1] = 4;
block[0] = 3;
block[1] = 2;
fspace.selectHyperslab(H5S_SELECT_SET, count, start, stride, block);
/*
* Create dataspace for the first dataset.
*/
hsize_t dim1[] = {MSPACE1_DIM}; /* Dimension size of the first dataset
(in memory) */
DataSpace mspace1( MSPACE1_RANK, dim1 );
hsize_t dim1[] = {MSPACE1_DIM}; /* Dimension size of the first dataset
(in memory) */
DataSpace mspace1(MSPACE1_RANK, dim1);
/*
* Select hyperslab.
@@ -117,7 +121,7 @@ int main (void)
stride[0] = 1;
count[0] = 48;
block[0] = 1;
mspace1.selectHyperslab( H5S_SELECT_SET, count, start, stride, block);
mspace1.selectHyperslab(H5S_SELECT_SET, count, start, stride, block);
/*
* Write selection from the vector buffer to the dataset in the file.
@@ -132,7 +136,7 @@ int main (void)
* 0 41 42 0 43 44 0 45 46 0 47 48
* 0 0 0 0 0 0 0 0 0 0 0 0
*/
int vector[MSPACE1_DIM]; // vector buffer for dset
int vector[MSPACE1_DIM]; // vector buffer for dset
/*
* Buffer initialization.
@@ -141,7 +145,7 @@ int main (void)
for (i = 1; i < MSPACE1_DIM - 1; i++)
vector[i] = i;
dataset->write( vector, PredType::NATIVE_INT, mspace1, fspace );
dataset->write(vector, PredType::NATIVE_INT, mspace1, fspace);
/*
* Reset the selection for the file dataspace fid.
@@ -151,27 +155,31 @@ int main (void)
/*
* Create dataspace for the second dataset.
*/
hsize_t dim2[] = {MSPACE2_DIM}; /* Dimension size of the second dataset
(in memory */
DataSpace mspace2( MSPACE2_RANK, dim2 );
hsize_t dim2[] = {MSPACE2_DIM}; /* Dimension size of the second dataset
(in memory */
DataSpace mspace2(MSPACE2_RANK, dim2);
/*
* Select sequence of NPOINTS points in the file dataspace.
*/
hsize_t coord[NPOINTS][FSPACE_RANK]; /* Array to store selected points
from the file dataspace */
coord[0][0] = 0; coord[0][1] = 0;
coord[1][0] = 3; coord[1][1] = 3;
coord[2][0] = 3; coord[2][1] = 5;
coord[3][0] = 5; coord[3][1] = 6;
coord[0][0] = 0;
coord[0][1] = 0;
coord[1][0] = 3;
coord[1][1] = 3;
coord[2][0] = 3;
coord[2][1] = 5;
coord[3][0] = 5;
coord[3][1] = 6;
fspace.selectElements( H5S_SELECT_SET, NPOINTS, (const hsize_t *)coord);
fspace.selectElements(H5S_SELECT_SET, NPOINTS, (const hsize_t *)coord);
/*
* Write new selection of points to the dataset.
*/
int values[] = {53, 59, 61, 67}; /* New values to be written */
dataset->write( values, PredType::NATIVE_INT, mspace2, fspace );
int values[] = {53, 59, 61, 67}; /* New values to be written */
dataset->write(values, PredType::NATIVE_INT, mspace2, fspace);
/*
* File dataset should look like this:
@@ -195,12 +203,12 @@ int main (void)
/*
* Open the file.
*/
file = new H5File( FILE_NAME, H5F_ACC_RDONLY );
file = new H5File(FILE_NAME, H5F_ACC_RDONLY);
/*
* Open the dataset.
*/
dataset = new DataSet( file->openDataSet( DATASET_NAME ));
dataset = new DataSet(file->openDataSet(DATASET_NAME));
/*
* Get dataspace of the dataset.
@@ -215,10 +223,14 @@ int main (void)
* 0 59 0 61
*
*/
start[0] = 1; start[1] = 2;
block[0] = 1; block[1] = 1;
stride[0] = 1; stride[1] = 1;
count[0] = 3; count[1] = 4;
start[0] = 1;
start[1] = 2;
block[0] = 1;
block[1] = 1;
stride[0] = 1;
stride[1] = 1;
count[0] = 3;
count[1] = 4;
fspace.selectHyperslab(H5S_SELECT_SET, count, start, stride, block);
/*
@@ -234,10 +246,14 @@ int main (void)
* 19 20
* 0 61
*/
start[0] = 2; start[1] = 4;
block[0] = 1; block[1] = 1;
stride[0] = 1; stride[1] = 1;
count[0] = 6; count[1] = 5;
start[0] = 2;
start[1] = 4;
block[0] = 1;
block[1] = 1;
stride[0] = 1;
stride[1] = 1;
count[0] = 6;
count[1] = 5;
fspace.selectHyperslab(H5S_SELECT_OR, count, start, stride, block);
/*
@@ -253,15 +269,23 @@ int main (void)
* Select two hyperslabs in memory. Hyperslabs has the same
* size and shape as the selected hyperslabs for the file dataspace.
*/
start[0] = 0; start[1] = 0;
block[0] = 1; block[1] = 1;
stride[0] = 1; stride[1] = 1;
count[0] = 3; count[1] = 4;
start[0] = 0;
start[1] = 0;
block[0] = 1;
block[1] = 1;
stride[0] = 1;
stride[1] = 1;
count[0] = 3;
count[1] = 4;
mspace.selectHyperslab(H5S_SELECT_SET, count, start, stride, block);
start[0] = 1; start[1] = 2;
block[0] = 1; block[1] = 1;
stride[0] = 1; stride[1] = 1;
count[0] = 6; count[1] = 5;
start[0] = 1;
start[1] = 2;
block[0] = 1;
block[1] = 1;
stride[0] = 1;
stride[1] = 1;
count[0] = 6;
count[1] = 5;
mspace.selectHyperslab(H5S_SELECT_OR, count, start, stride, block);
/*
@@ -289,9 +313,8 @@ int main (void)
* 0 0 0 0 0 0 0 0 0
* 0 0 0 0 0 0 0 0 0
*/
for (i=0; i < MSPACE_DIM1; i++)
{
for(j=0; j < MSPACE_DIM2; j++)
for (i = 0; i < MSPACE_DIM1; i++) {
for (j = 0; j < MSPACE_DIM2; j++)
cout << matrix_out[i][j] << " ";
cout << endl;
}
@@ -301,28 +324,25 @@ int main (void)
*/
delete dataset;
delete file;
} // end of try block
} // end of try block
// catch failure caused by the H5File operations
catch( FileIException error )
{
// catch failure caused by the H5File operations
catch (FileIException error) {
error.printErrorStack();
return -1;
}
}
// catch failure caused by the DataSet operations
catch( DataSetIException error )
{
// catch failure caused by the DataSet operations
catch (DataSetIException error) {
error.printErrorStack();
return -1;
}
}
// catch failure caused by the DataSpace operations
catch( DataSpaceIException error )
{
// catch failure caused by the DataSpace operations
catch (DataSpaceIException error) {
error.printErrorStack();
return -1;
}
}
return 0;
return 0;
}

View File

@@ -6,7 +6,7 @@
* This file is part of HDF5. The full HDF5 copyright notice, including *
* terms governing use, modification, and redistribution, is contained in *
* the COPYING file, which can be found at the root of the source code *
* distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. *
* distribution tree, or in https://www.hdfgroup.org/licenses. *
* If you do not have access to either file, you may request a copy from *
* help@hdfgroup.org. *
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
@@ -38,7 +38,9 @@ namespace H5 {
///\brief Default constructor
// Programmer Binh-Minh Ribler - 2000
//--------------------------------------------------------------------------
AbstractDs::AbstractDs(){}
AbstractDs::AbstractDs()
{
}
//--------------------------------------------------------------------------
// Function: AbstractDs default constructor
@@ -61,19 +63,20 @@ AbstractDs::AbstractDs(){}
///\exception H5::DataTypeIException
// Programmer Binh-Minh Ribler - 2000
//--------------------------------------------------------------------------
H5T_class_t AbstractDs::getTypeClass() const
H5T_class_t
AbstractDs::getTypeClass() const
{
// Gets the datatype used by this dataset or attribute.
// p_get_type calls either H5Dget_type or H5Aget_type depending on
// which object invokes getTypeClass
hid_t datatype_id;
try {
datatype_id = p_get_type(); // returned value is already validated
datatype_id = p_get_type(); // returned value is already validated
}
catch (DataSetIException& E) {
catch (DataSetIException &E) {
throw DataTypeIException("DataSet::getTypeClass", E.getDetailMsg());
}
catch (AttributeIException& E) {
catch (AttributeIException &E) {
throw DataTypeIException("Attribute::getTypeClass", E.getDetailMsg());
}
@@ -82,8 +85,7 @@ H5T_class_t AbstractDs::getTypeClass() const
// Close temporary datatype_id
herr_t ret_value = H5Tclose(datatype_id);
if (ret_value < 0)
{
if (ret_value < 0) {
if (fromClass() == "DataSet")
throw DataTypeIException("DataSet::getTypeClass", "H5Tclose failed");
else if (fromClass() == "Attribute")
@@ -91,14 +93,13 @@ H5T_class_t AbstractDs::getTypeClass() const
}
// Check on the returned type_class
if (type_class == H5T_NO_CLASS)
{
if (type_class == H5T_NO_CLASS) {
if (fromClass() == "DataSet")
throw DataTypeIException("DataSet::getTypeClass", "H5Tget_class returns H5T_NO_CLASS");
else if (fromClass() == "Attribute")
throw DataTypeIException("Attribute::getTypeClass", "H5Tget_class returns H5T_NO_CLASS");
}
return(type_class);
return (type_class);
}
//--------------------------------------------------------------------------
@@ -109,7 +110,8 @@ H5T_class_t AbstractDs::getTypeClass() const
///\exception H5::DataTypeIException
// Programmer Binh-Minh Ribler - 2000
//--------------------------------------------------------------------------
DataType AbstractDs::getDataType() const
DataType
AbstractDs::getDataType() const
{
// Gets the id of the datatype used by this dataset or attribute using
// p_get_type. p_get_type calls either H5Dget_type or H5Aget_type
@@ -118,12 +120,12 @@ DataType AbstractDs::getDataType() const
try {
DataType datatype;
f_DataType_setId(&datatype, p_get_type());
return(datatype);
return (datatype);
}
catch (DataSetIException& E) {
catch (DataSetIException &E) {
throw DataTypeIException("DataSet::getDataType", E.getDetailMsg());
}
catch (AttributeIException& E) {
catch (AttributeIException &E) {
throw DataTypeIException("Attribute::getDataType", E.getDetailMsg());
}
}
@@ -136,7 +138,8 @@ DataType AbstractDs::getDataType() const
///\exception H5::DataTypeIException
// Programmer Binh-Minh Ribler - Jul, 2005
//--------------------------------------------------------------------------
ArrayType AbstractDs::getArrayType() const
ArrayType
AbstractDs::getArrayType() const
{
// Gets the id of the datatype used by this dataset or attribute using
// p_get_type. p_get_type calls either H5Dget_type or H5Aget_type
@@ -147,12 +150,12 @@ ArrayType AbstractDs::getArrayType() const
// problem described in the JIRA issue HDFFV-7947
ArrayType arraytype;
f_DataType_setId(&arraytype, p_get_type());
return(arraytype);
return (arraytype);
}
catch (DataSetIException& E) {
catch (DataSetIException &E) {
throw DataTypeIException("DataSet::getArrayType", E.getDetailMsg());
}
catch (AttributeIException& E) {
catch (AttributeIException &E) {
throw DataTypeIException("Attribute::getArrayType", E.getDetailMsg());
}
}
@@ -165,7 +168,8 @@ ArrayType AbstractDs::getArrayType() const
///\exception H5::DataTypeIException
// Programmer Binh-Minh Ribler - 2000
//--------------------------------------------------------------------------
CompType AbstractDs::getCompType() const
CompType
AbstractDs::getCompType() const
{
// Gets the id of the datatype used by this dataset or attribute using
// p_get_type. p_get_type calls either H5Dget_type or H5Aget_type
@@ -174,12 +178,12 @@ CompType AbstractDs::getCompType() const
try {
CompType comptype;
f_DataType_setId(&comptype, p_get_type());
return(comptype);
return (comptype);
}
catch (DataSetIException& E) {
catch (DataSetIException &E) {
throw DataTypeIException("DataSet::getCompType", E.getDetailMsg());
}
catch (AttributeIException& E) {
catch (AttributeIException &E) {
throw DataTypeIException("Attribute::getCompType", E.getDetailMsg());
}
}
@@ -192,7 +196,8 @@ CompType AbstractDs::getCompType() const
///\exception H5::DataTypeIException
// Programmer Binh-Minh Ribler - 2000
//--------------------------------------------------------------------------
EnumType AbstractDs::getEnumType() const
EnumType
AbstractDs::getEnumType() const
{
// Gets the id of the datatype used by this dataset or attribute using
// p_get_type. p_get_type calls either H5Dget_type or H5Aget_type
@@ -201,12 +206,12 @@ EnumType AbstractDs::getEnumType() const
try {
EnumType enumtype;
f_DataType_setId(&enumtype, p_get_type());
return(enumtype);
return (enumtype);
}
catch (DataSetIException& E) {
catch (DataSetIException &E) {
throw DataTypeIException("DataSet::getEnumType", E.getDetailMsg());
}
catch (AttributeIException& E) {
catch (AttributeIException &E) {
throw DataTypeIException("Attribute::getEnumType", E.getDetailMsg());
}
}
@@ -219,7 +224,8 @@ EnumType AbstractDs::getEnumType() const
///\exception H5::DataTypeIException
// Programmer Binh-Minh Ribler - 2000
//--------------------------------------------------------------------------
IntType AbstractDs::getIntType() const
IntType
AbstractDs::getIntType() const
{
// Gets the id of the datatype used by this dataset or attribute using
// p_get_type. p_get_type calls either H5Dget_type or H5Aget_type
@@ -228,12 +234,12 @@ IntType AbstractDs::getIntType() const
try {
IntType inttype;
f_DataType_setId(&inttype, p_get_type());
return(inttype);
return (inttype);
}
catch (DataSetIException& E) {
catch (DataSetIException &E) {
throw DataTypeIException("DataSet::getIntType", E.getDetailMsg());
}
catch (AttributeIException& E) {
catch (AttributeIException &E) {
throw DataTypeIException("Attribute::getIntType", E.getDetailMsg());
}
}
@@ -246,7 +252,8 @@ IntType AbstractDs::getIntType() const
///\exception H5::DataTypeIException
// Programmer Binh-Minh Ribler - 2000
//--------------------------------------------------------------------------
FloatType AbstractDs::getFloatType() const
FloatType
AbstractDs::getFloatType() const
{
// Gets the id of the datatype used by this dataset or attribute using
// p_get_type. p_get_type calls either H5Dget_type or H5Aget_type
@@ -255,12 +262,12 @@ FloatType AbstractDs::getFloatType() const
try {
FloatType floatype;
f_DataType_setId(&floatype, p_get_type());
return(floatype);
return (floatype);
}
catch (DataSetIException& E) {
catch (DataSetIException &E) {
throw DataTypeIException("DataSet::getFloatType", E.getDetailMsg());
}
catch (AttributeIException& E) {
catch (AttributeIException &E) {
throw DataTypeIException("Attribute::getFloatType", E.getDetailMsg());
}
}
@@ -273,7 +280,8 @@ FloatType AbstractDs::getFloatType() const
///\exception H5::DataTypeIException
// Programmer Binh-Minh Ribler - 2000
//--------------------------------------------------------------------------
StrType AbstractDs::getStrType() const
StrType
AbstractDs::getStrType() const
{
// Gets the id of the datatype used by this dataset or attribute using
// p_get_type. p_get_type calls either H5Dget_type or H5Aget_type
@@ -282,12 +290,12 @@ StrType AbstractDs::getStrType() const
try {
StrType strtype;
f_DataType_setId(&strtype, p_get_type());
return(strtype);
return (strtype);
}
catch (DataSetIException& E) {
catch (DataSetIException &E) {
throw DataTypeIException("DataSet::getStrType", E.getDetailMsg());
}
catch (AttributeIException& E) {
catch (AttributeIException &E) {
throw DataTypeIException("Attribute::getStrType", E.getDetailMsg());
}
}
@@ -300,7 +308,8 @@ StrType AbstractDs::getStrType() const
///\exception H5::DataTypeIException
// Programmer Binh-Minh Ribler - Jul, 2005
//--------------------------------------------------------------------------
VarLenType AbstractDs::getVarLenType() const
VarLenType
AbstractDs::getVarLenType() const
{
// Gets the id of the datatype used by this dataset or attribute using
// p_get_type. p_get_type calls either H5Dget_type or H5Aget_type
@@ -309,12 +318,12 @@ VarLenType AbstractDs::getVarLenType() const
try {
VarLenType varlentype;
f_DataType_setId(&varlentype, p_get_type());
return(varlentype);
return (varlentype);
}
catch (DataSetIException& E) {
catch (DataSetIException &E) {
throw DataTypeIException("DataSet::getVarLenType", E.getDetailMsg());
}
catch (AttributeIException& E) {
catch (AttributeIException &E) {
throw DataTypeIException("Attribute::getVarLenType", E.getDetailMsg());
}
}
@@ -324,6 +333,8 @@ VarLenType AbstractDs::getVarLenType() const
///\brief Noop destructor.
// Programmer Binh-Minh Ribler - 2000
//--------------------------------------------------------------------------
AbstractDs::~AbstractDs() {}
AbstractDs::~AbstractDs()
{
}
} // end namespace
} // namespace H5

View File

@@ -7,7 +7,7 @@
* This file is part of HDF5. The full HDF5 copyright notice, including *
* terms governing use, modification, and redistribution, is contained in *
* the COPYING file, which can be found at the root of the source code *
* distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. *
* distribution tree, or in https://www.hdfgroup.org/licenses. *
* If you do not have access to either file, you may request a copy from *
* help@hdfgroup.org. *
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
@@ -34,49 +34,49 @@ class DataSpace;
and DataSet.
*/
class H5_DLLCPP AbstractDs {
public:
// Gets a copy the datatype of that this abstract dataset uses.
// Note that this datatype is a generic one and can only be accessed
// via generic member functions, i.e., member functions belong
// to DataType. To get specific datatype, i.e. EnumType, FloatType,
// etc..., use the specific functions, that follow, instead.
DataType getDataType() const;
public:
// Gets a copy the datatype of that this abstract dataset uses.
// Note that this datatype is a generic one and can only be accessed
// via generic member functions, i.e., member functions belong
// to DataType. To get specific datatype, i.e. EnumType, FloatType,
// etc..., use the specific functions, that follow, instead.
DataType getDataType() const;
// Gets a copy of the specific datatype of this abstract dataset.
ArrayType getArrayType() const;
CompType getCompType() const;
EnumType getEnumType() const;
IntType getIntType() const;
FloatType getFloatType() const;
StrType getStrType() const;
VarLenType getVarLenType() const;
// Gets a copy of the specific datatype of this abstract dataset.
ArrayType getArrayType() const;
CompType getCompType() const;
EnumType getEnumType() const;
IntType getIntType() const;
FloatType getFloatType() const;
StrType getStrType() const;
VarLenType getVarLenType() const;
///\brief Gets the size in memory of this abstract dataset.
virtual size_t getInMemDataSize() const = 0;
///\brief Gets the size in memory of this abstract dataset.
virtual size_t getInMemDataSize() const = 0;
///\brief Gets the dataspace of this abstract dataset - pure virtual.
virtual DataSpace getSpace() const = 0;
///\brief Gets the dataspace of this abstract dataset - pure virtual.
virtual DataSpace getSpace() const = 0;
// Gets the class of the datatype that is used by this abstract
// dataset.
H5T_class_t getTypeClass() const;
// Gets the class of the datatype that is used by this abstract
// dataset.
H5T_class_t getTypeClass() const;
///\brief Returns the amount of storage size required - pure virtual.
virtual hsize_t getStorageSize() const = 0;
///\brief Returns the amount of storage size required - pure virtual.
virtual hsize_t getStorageSize() const = 0;
// Returns this class name - pure virtual.
virtual H5std_string fromClass() const = 0;
// Returns this class name - pure virtual.
virtual H5std_string fromClass() const = 0;
// Destructor
virtual ~AbstractDs();
// Destructor
virtual ~AbstractDs();
protected:
// Default constructor
AbstractDs();
protected:
// Default constructor
AbstractDs();
private:
// This member function is implemented by DataSet and Attribute - pure virtual.
virtual hid_t p_get_type() const = 0;
private:
// This member function is implemented by DataSet and Attribute - pure virtual.
virtual hid_t p_get_type() const = 0;
}; // end of AbstractDs
} // namespace H5

View File

@@ -7,7 +7,7 @@
* This file is part of HDF5. The full HDF5 copyright notice, including *
* terms governing use, modification, and redistribution, is contained in *
* the COPYING file, which can be found at the root of the source code *
* distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. *
* distribution tree, or in https://www.hdfgroup.org/licenses. *
* If you do not have access to either file, you may request a copy from *
* help@hdfgroup.org. *
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */

View File

@@ -6,7 +6,7 @@
* This file is part of HDF5. The full HDF5 copyright notice, including *
* terms governing use, modification, and redistribution, is contained in *
* the COPYING file, which can be found at the root of the source code *
* distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. *
* distribution tree, or in https://www.hdfgroup.org/licenses. *
* If you do not have access to either file, you may request a copy from *
* help@hdfgroup.org. *
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
@@ -34,7 +34,9 @@ namespace H5 {
///\brief Default constructor: Creates a stub ArrayType
// Programmer Binh-Minh Ribler - May 2004
//--------------------------------------------------------------------------
ArrayType::ArrayType() : DataType() {}
ArrayType::ArrayType() : DataType()
{
}
//--------------------------------------------------------------------------
// Function: ArrayType overloaded constructor
@@ -43,14 +45,18 @@ ArrayType::ArrayType() : DataType() {}
///\exception H5::DataTypeIException
// Programmer Binh-Minh Ribler - May 2004
//--------------------------------------------------------------------------
ArrayType::ArrayType(const hid_t existing_id) : DataType(existing_id) {}
ArrayType::ArrayType(const hid_t existing_id) : DataType(existing_id)
{
}
//--------------------------------------------------------------------------
// Function: ArrayType copy constructor
///\brief Copy constructor: same HDF5 object as \a original
// Programmer Binh-Minh Ribler - May 2004
//--------------------------------------------------------------------------
ArrayType::ArrayType(const ArrayType& original) : DataType(original) {}
ArrayType::ArrayType(const ArrayType &original) : DataType(original)
{
}
//--------------------------------------------------------------------------
// Function: ArrayType overloaded constructor
@@ -62,7 +68,7 @@ ArrayType::ArrayType(const ArrayType& original) : DataType(original) {}
///\exception H5::DataTypeIException
// Programmer Binh-Minh Ribler - May 2004
//--------------------------------------------------------------------------
ArrayType::ArrayType(const DataType& base_type, int ndims, const hsize_t* dims) : DataType()
ArrayType::ArrayType(const DataType &base_type, int ndims, const hsize_t *dims) : DataType()
{
// Call C API to create an array data type
hid_t new_type_id = H5Tarray_create2(base_type.getId(), ndims, dims);
@@ -87,7 +93,7 @@ ArrayType::ArrayType(const DataType& base_type, int ndims, const hsize_t* dims)
// improve usability.
// -BMR, Dec 2016
//--------------------------------------------------------------------------
ArrayType::ArrayType(const H5Location& loc, const char *dtype_name) : DataType()
ArrayType::ArrayType(const H5Location &loc, const char *dtype_name) : DataType()
{
id = p_opentype(loc, dtype_name);
}
@@ -106,7 +112,7 @@ ArrayType::ArrayType(const H5Location& loc, const char *dtype_name) : DataType()
// to improve usability.
// -BMR, Dec 2016
//--------------------------------------------------------------------------
ArrayType::ArrayType(const H5Location& loc, const H5std_string& dtype_name) : DataType()
ArrayType::ArrayType(const H5Location &loc, const H5std_string &dtype_name) : DataType()
{
id = p_opentype(loc, dtype_name.c_str());
}
@@ -122,21 +128,21 @@ ArrayType::ArrayType(const H5Location& loc, const H5std_string& dtype_name) : Da
// each data member from the rhs object. (Issue HDFFV-9562)
// Programmer Binh-Minh Ribler - Mar 2016
//--------------------------------------------------------------------------
ArrayType& ArrayType::operator=(const ArrayType& rhs)
ArrayType &
ArrayType::operator=(const ArrayType &rhs)
{
if (this != &rhs)
{
if (this != &rhs) {
// handling references to this id
try {
setId(rhs.id);
// Note: a = b, so there are two objects with the same hdf5 id
// that's why incRefCount is needed, and it is called by setId
}
catch (Exception& close_error) {
catch (Exception &close_error) {
throw DataTypeIException(inMemFunc("operator="), close_error.getDetailMsg());
}
}
return(*this);
return (*this);
}
//--------------------------------------------------------------------------
@@ -147,7 +153,8 @@ ArrayType& ArrayType::operator=(const ArrayType& rhs)
///\exception H5::DataTypeIException
// Programmer Binh-Minh Ribler - Aug 2017
//--------------------------------------------------------------------------
DataType* ArrayType::decode() const
DataType *
ArrayType::decode() const
{
hid_t encoded_arrtype_id = H5I_INVALID_HID;
try {
@@ -158,7 +165,7 @@ DataType* ArrayType::decode() const
}
ArrayType *encoded_arrtype = new ArrayType;
encoded_arrtype->p_setId(encoded_arrtype_id);
return(encoded_arrtype);
return (encoded_arrtype);
}
//--------------------------------------------------------------------------
@@ -168,16 +175,16 @@ DataType* ArrayType::decode() const
///\exception H5::DataTypeIException
// Programmer Binh-Minh Ribler - May 2004
//--------------------------------------------------------------------------
int ArrayType::getArrayNDims() const
int
ArrayType::getArrayNDims() const
{
// Get the rank of the array type specified by id from the C API
int ndims = H5Tget_array_ndims(id);
if (ndims < 0)
{
if (ndims < 0) {
throw DataTypeIException("ArrayType::getArrayNDims", "H5Tget_array_ndims failed");
}
return(ndims);
return (ndims);
}
//--------------------------------------------------------------------------
@@ -188,7 +195,8 @@ int ArrayType::getArrayNDims() const
///\exception H5::DataTypeIException
// Programmer Binh-Minh Ribler - May 2004
//--------------------------------------------------------------------------
int ArrayType::getArrayDims(hsize_t* dims) const
int
ArrayType::getArrayDims(hsize_t *dims) const
{
// Get the dimensions
int ndims = H5Tget_array_dims2(id, dims);
@@ -196,7 +204,7 @@ int ArrayType::getArrayDims(hsize_t* dims) const
throw DataTypeIException("ArrayType::getArrayDims", "H5Tget_array_dims2 failed");
// Return the number of dimensions
return(ndims);
return (ndims);
}
//--------------------------------------------------------------------------
@@ -204,6 +212,8 @@ int ArrayType::getArrayDims(hsize_t* dims) const
///\brief Properly terminates access to this array datatype.
// Programmer Binh-Minh Ribler - May 2004
//--------------------------------------------------------------------------
ArrayType::~ArrayType() {}
ArrayType::~ArrayType()
{
}
} // end namespace
} // namespace H5

View File

@@ -7,7 +7,7 @@
* This file is part of HDF5. The full HDF5 copyright notice, including *
* terms governing use, modification, and redistribution, is contained in *
* the COPYING file, which can be found at the root of the source code *
* distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. *
* distribution tree, or in https://www.hdfgroup.org/licenses. *
* If you do not have access to either file, you may request a copy from *
* help@hdfgroup.org. *
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
@@ -23,44 +23,48 @@ namespace H5 {
*/
// Inheritance: DataType -> H5Object -> H5Location -> IdComponent
class H5_DLLCPP ArrayType : public DataType {
public:
// Constructor that creates a new array data type based on the
// specified base type.
ArrayType(const DataType& base_type, int ndims, const hsize_t* dims);
public:
// Constructor that creates a new array data type based on the
// specified base type.
ArrayType(const DataType &base_type, int ndims, const hsize_t *dims);
// Assignment operator
ArrayType& operator=(const ArrayType& rhs);
// Assignment operator
ArrayType &operator=(const ArrayType &rhs);
// Constructors that open an array datatype, given a location.
ArrayType(const H5Location& loc, const char* name);
ArrayType(const H5Location& loc, const H5std_string& name);
// Constructors that open an array datatype, given a location.
ArrayType(const H5Location &loc, const char *name);
ArrayType(const H5Location &loc, const H5std_string &name);
// Returns an ArrayType object via DataType* by decoding the
// binary object description of this type.
virtual DataType* decode() const;
// Returns an ArrayType object via DataType* by decoding the
// binary object description of this type.
virtual DataType *decode() const;
// Returns the number of dimensions of this array datatype.
int getArrayNDims() const;
//int getArrayNDims(); // removed 1.8.18 and 1.10.1
// Returns the number of dimensions of this array datatype.
int getArrayNDims() const;
// int getArrayNDims(); // removed 1.8.18 and 1.10.1
// Returns the sizes of dimensions of this array datatype.
int getArrayDims(hsize_t* dims) const;
//int getArrayDims(hsize_t* dims); // removed 1.8.18 and 1.10.1
// Returns the sizes of dimensions of this array datatype.
int getArrayDims(hsize_t *dims) const;
// int getArrayDims(hsize_t* dims); // removed 1.8.18 and 1.10.1
///\brief Returns this class name.
virtual H5std_string fromClass () const { return("ArrayType"); }
///\brief Returns this class name.
virtual H5std_string
fromClass() const
{
return ("ArrayType");
}
// Copy constructor: same as the original ArrayType.
ArrayType(const ArrayType& original);
// Copy constructor: same as the original ArrayType.
ArrayType(const ArrayType &original);
// Constructor that takes an existing id
ArrayType(const hid_t existing_id);
// Constructor that takes an existing id
ArrayType(const hid_t existing_id);
// Noop destructor
virtual ~ArrayType();
// Noop destructor
virtual ~ArrayType();
// Default constructor
ArrayType();
// Default constructor
ArrayType();
}; // end of ArrayType
} // namespace H5

View File

@@ -6,7 +6,7 @@
* This file is part of HDF5. The full HDF5 copyright notice, including *
* terms governing use, modification, and redistribution, is contained in *
* the COPYING file, which can be found at the root of the source code *
* distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. *
* distribution tree, or in https://www.hdfgroup.org/licenses. *
* If you do not have access to either file, you may request a copy from *
* help@hdfgroup.org. *
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
@@ -35,7 +35,9 @@ namespace H5 {
// Purpose Default constructor: creates a stub atomic datatype.
// Programmer Binh-Minh Ribler - 2000
//--------------------------------------------------------------------------
AtomType::AtomType() : DataType() {}
AtomType::AtomType() : DataType()
{
}
//--------------------------------------------------------------------------
// Function: AtomType overloaded constructor [protected]
@@ -44,14 +46,18 @@ AtomType::AtomType() : DataType() {}
// Exception H5::DataTypeIException
// Programmer Binh-Minh Ribler - 2000
//--------------------------------------------------------------------------
AtomType::AtomType(const hid_t existing_id) : DataType(existing_id) {}
AtomType::AtomType(const hid_t existing_id) : DataType(existing_id)
{
}
//--------------------------------------------------------------------------
// Function: AtomType copy constructor
///\brief Copy constructor: same HDF5 object as \a original
// Programmer Binh-Minh Ribler - 2000
//--------------------------------------------------------------------------
AtomType::AtomType(const AtomType& original) : DataType(original) {}
AtomType::AtomType(const AtomType &original) : DataType(original)
{
}
#endif // DOXYGEN_SHOULD_SKIP_THIS
//--------------------------------------------------------------------------
@@ -61,12 +67,12 @@ AtomType::AtomType(const AtomType& original) : DataType(original) {}
///\exception H5::DataTypeIException
// Programmer Binh-Minh Ribler - 2000
//--------------------------------------------------------------------------
void AtomType::setSize(size_t size) const
void
AtomType::setSize(size_t size) const
{
// Call C routine H5Tset_size to set the total size
herr_t ret_value = H5Tset_size(id, size);
if (ret_value < 0)
{
if (ret_value < 0) {
throw DataTypeIException(inMemFunc("setSize"), "H5Tset_size failed");
}
}
@@ -81,18 +87,17 @@ void AtomType::setSize(size_t size) const
///\exception H5::DataTypeIException
// Programmer Binh-Minh Ribler - Mar, 2005
//--------------------------------------------------------------------------
H5T_order_t AtomType::getOrder() const
H5T_order_t
AtomType::getOrder() const
{
// Call C routine to get the byte ordering
H5T_order_t type_order = H5Tget_order(id);
// return a byte order constant if successful
if (type_order == H5T_ORDER_ERROR)
{
throw DataTypeIException(inMemFunc("getOrder"),
"H5Tget_order returns H5T_ORDER_ERROR");
if (type_order == H5T_ORDER_ERROR) {
throw DataTypeIException(inMemFunc("getOrder"), "H5Tget_order returns H5T_ORDER_ERROR");
}
return(type_order);
return (type_order);
}
//--------------------------------------------------------------------------
@@ -112,7 +117,8 @@ H5T_order_t AtomType::getOrder() const
///\exception H5::DataTypeIException
// Programmer Binh-Minh Ribler - 2000
//--------------------------------------------------------------------------
H5T_order_t AtomType::getOrder(H5std_string& order_string) const
H5T_order_t
AtomType::getOrder(H5std_string &order_string) const
{
// Call the overloaded to get the type order without text
H5T_order_t type_order = getOrder();
@@ -124,7 +130,7 @@ H5T_order_t AtomType::getOrder(H5std_string& order_string) const
order_string = "Big endian byte ordering (1)";
else if (type_order == H5T_ORDER_VAX)
order_string = "VAX mixed byte ordering (2)";
return(type_order);
return (type_order);
}
//--------------------------------------------------------------------------
@@ -137,12 +143,12 @@ H5T_order_t AtomType::getOrder(H5std_string& order_string) const
///\exception H5::DataTypeIException
// Programmer Binh-Minh Ribler - 2000
//--------------------------------------------------------------------------
void AtomType::setOrder(H5T_order_t order) const
void
AtomType::setOrder(H5T_order_t order) const
{
// Call C routine to set the byte ordering
herr_t ret_value = H5Tset_order(id, order);
if (ret_value < 0)
{
if (ret_value < 0) {
throw DataTypeIException(inMemFunc("setOrder"), "H5Tset_order failed");
}
}
@@ -158,17 +164,17 @@ void AtomType::setOrder(H5T_order_t order) const
/// value returned by \c DataType::getSize().
// Programmer Binh-Minh Ribler - 2000
//--------------------------------------------------------------------------
size_t AtomType::getPrecision() const
size_t
AtomType::getPrecision() const
{
size_t num_signi_bits = H5Tget_precision(id); // C routine
size_t num_signi_bits = H5Tget_precision(id); // C routine
// returns number of significant bits if successful
if (num_signi_bits == 0)
{
if (num_signi_bits == 0) {
throw DataTypeIException(inMemFunc("getPrecision"),
"H5Tget_precision returns invalid number of significant bits");
"H5Tget_precision returns invalid number of significant bits");
}
return(num_signi_bits);
return (num_signi_bits);
}
//--------------------------------------------------------------------------
@@ -181,12 +187,12 @@ size_t AtomType::getPrecision() const
/// the HDF5 C Reference Manual.
// Programmer Binh-Minh Ribler - 2000
//--------------------------------------------------------------------------
void AtomType::setPrecision(size_t precision) const
void
AtomType::setPrecision(size_t precision) const
{
// Call C routine to set the datatype precision
herr_t ret_value = H5Tset_precision(id, precision);
if (ret_value < 0)
{
if (ret_value < 0) {
throw DataTypeIException(inMemFunc("setPrecision"), "H5Tset_precision failed");
}
}
@@ -205,17 +211,16 @@ void AtomType::setPrecision(size_t precision) const
// - return type changed from size_t to int
// - offset = -1 when failure occurs vs. 0
//--------------------------------------------------------------------------
int AtomType::getOffset() const
int
AtomType::getOffset() const
{
int offset = H5Tget_offset(id); // C routine
int offset = H5Tget_offset(id); // C routine
// returns a non-negative offset value if successful
if (offset == -1)
{
throw DataTypeIException(inMemFunc("getOffset"),
"H5Tget_offset returns a negative offset value");
if (offset == -1) {
throw DataTypeIException(inMemFunc("getOffset"), "H5Tget_offset returns a negative offset value");
}
return(offset);
return (offset);
}
//--------------------------------------------------------------------------
@@ -228,12 +233,12 @@ int AtomType::getOffset() const
/// the HDF5 C Reference Manual.
// Programmer Binh-Minh Ribler - 2000
//--------------------------------------------------------------------------
void AtomType::setOffset(size_t offset) const
void
AtomType::setOffset(size_t offset) const
{
// Call C routine to set the bit offset
herr_t ret_value = H5Tset_offset(id, offset);
if (ret_value < 0)
{
if (ret_value < 0) {
throw DataTypeIException(inMemFunc("setOffset"), "H5Tset_offset failed");
}
}
@@ -252,12 +257,12 @@ void AtomType::setOffset(size_t offset) const
/// \li \c H5T_PAD_BACKGROUND (2) - Leave background alone.
// Programmer Binh-Minh Ribler - 2000
//--------------------------------------------------------------------------
void AtomType::getPad(H5T_pad_t& lsb, H5T_pad_t& msb) const
void
AtomType::getPad(H5T_pad_t &lsb, H5T_pad_t &msb) const
{
// Call C routine to get the padding type
herr_t ret_value = H5Tget_pad(id, &lsb, &msb);
if (ret_value < 0)
{
if (ret_value < 0) {
throw DataTypeIException(inMemFunc("getPad"), "H5Tget_pad failed");
}
}
@@ -275,12 +280,12 @@ void AtomType::getPad(H5T_pad_t& lsb, H5T_pad_t& msb) const
/// \li \c H5T_PAD_BACKGROUND (2) - Leave background alone.
// Programmer Binh-Minh Ribler - 2000
//--------------------------------------------------------------------------
void AtomType::setPad(H5T_pad_t lsb, H5T_pad_t msb) const
void
AtomType::setPad(H5T_pad_t lsb, H5T_pad_t msb) const
{
// Call C routine to set the padding type
herr_t ret_value = H5Tset_pad(id, lsb, msb);
if (ret_value < 0)
{
if (ret_value < 0) {
throw DataTypeIException(inMemFunc("setPad"), "H5Tset_pad failed");
}
}
@@ -291,7 +296,9 @@ void AtomType::setPad(H5T_pad_t lsb, H5T_pad_t msb) const
///\brief Noop destructor.
// Programmer Binh-Minh Ribler - 2000
//--------------------------------------------------------------------------
AtomType::~AtomType() {}
AtomType::~AtomType()
{
}
#endif // DOXYGEN_SHOULD_SKIP_THIS
} // end namespace
} // namespace H5

View File

@@ -7,7 +7,7 @@
* This file is part of HDF5. The full HDF5 copyright notice, including *
* terms governing use, modification, and redistribution, is contained in *
* the COPYING file, which can be found at the root of the source code *
* distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. *
* distribution tree, or in https://www.hdfgroup.org/licenses. *
* If you do not have access to either file, you may request a copy from *
* help@hdfgroup.org. *
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
@@ -26,54 +26,58 @@ namespace H5 {
*/
// Inheritance: DataType -> H5Object -> H5Location -> IdComponent
class H5_DLLCPP AtomType : public DataType {
public:
// Returns the byte order of an atomic datatype.
H5T_order_t getOrder() const;
H5T_order_t getOrder(H5std_string& order_string) const;
public:
// Returns the byte order of an atomic datatype.
H5T_order_t getOrder() const;
H5T_order_t getOrder(H5std_string &order_string) const;
// Sets the byte ordering of an atomic datatype.
void setOrder(H5T_order_t order) const;
// Sets the byte ordering of an atomic datatype.
void setOrder(H5T_order_t order) const;
// Retrieves the bit offset of the first significant bit.
// 12/05/00 - changed return type to int from size_t - C API
int getOffset() const;
// Retrieves the bit offset of the first significant bit.
// 12/05/00 - changed return type to int from size_t - C API
int getOffset() const;
// Sets the bit offset of the first significant bit.
void setOffset(size_t offset) const;
// Sets the bit offset of the first significant bit.
void setOffset(size_t offset) const;
// Retrieves the padding type of the least and most-significant bit padding.
void getPad(H5T_pad_t& lsb, H5T_pad_t& msb) const;
// Retrieves the padding type of the least and most-significant bit padding.
void getPad(H5T_pad_t &lsb, H5T_pad_t &msb) const;
// Sets the least and most-significant bits padding types
void setPad(H5T_pad_t lsb, H5T_pad_t msb) const;
// Sets the least and most-significant bits padding types
void setPad(H5T_pad_t lsb, H5T_pad_t msb) const;
// Returns the precision of an atomic datatype.
size_t getPrecision() const;
// Returns the precision of an atomic datatype.
size_t getPrecision() const;
// Sets the precision of an atomic datatype.
void setPrecision(size_t precision) const;
// Sets the precision of an atomic datatype.
void setPrecision(size_t precision) const;
// Sets the total size for an atomic datatype.
void setSize(size_t size) const;
// Sets the total size for an atomic datatype.
void setSize(size_t size) const;
///\brief Returns this class name.
virtual H5std_string fromClass () const { return("AtomType"); }
///\brief Returns this class name.
virtual H5std_string
fromClass() const
{
return ("AtomType");
}
#ifndef DOXYGEN_SHOULD_SKIP_THIS
// Copy constructor: same as the original AtomType.
AtomType(const AtomType& original);
// Copy constructor: same as the original AtomType.
AtomType(const AtomType &original);
// Noop destructor
virtual ~AtomType();
// Noop destructor
virtual ~AtomType();
#endif // DOXYGEN_SHOULD_SKIP_THIS
protected:
protected:
#ifndef DOXYGEN_SHOULD_SKIP_THIS
// Default constructor
AtomType();
// Default constructor
AtomType();
// Constructor that takes an existing id
AtomType(const hid_t existing_id);
// Constructor that takes an existing id
AtomType(const hid_t existing_id);
#endif // DOXYGEN_SHOULD_SKIP_THIS
}; // end of AtomType

View File

@@ -6,7 +6,7 @@
* This file is part of HDF5. The full HDF5 copyright notice, including *
* terms governing use, modification, and redistribution, is contained in *
* the COPYING file, which can be found at the root of the source code *
* distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. *
* distribution tree, or in https://www.hdfgroup.org/licenses. *
* If you do not have access to either file, you may request a copy from *
* help@hdfgroup.org. *
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
@@ -18,7 +18,7 @@
#endif
#include <string>
#include "H5private.h" // for HDfree
#include "H5private.h" // for HDfree
#include "H5Include.h"
#include "H5Exception.h"
#include "H5IdComponent.h"
@@ -41,14 +41,16 @@ namespace H5 {
using std::cerr;
using std::endl;
class H5_DLLCPP H5Object; // forward declaration for UserData4Aiterate
class H5_DLLCPP H5Object; // forward declaration for UserData4Aiterate
//--------------------------------------------------------------------------
// Function: Attribute default constructor
///\brief Default constructor: Creates a stub attribute
// Programmer Binh-Minh Ribler - May, 2004
//--------------------------------------------------------------------------
Attribute::Attribute() : AbstractDs(), H5Location(), id(H5I_INVALID_HID) {}
Attribute::Attribute() : AbstractDs(), H5Location(), id(H5I_INVALID_HID)
{
}
//--------------------------------------------------------------------------
// Function: Attribute copy constructor
@@ -56,7 +58,7 @@ Attribute::Attribute() : AbstractDs(), H5Location(), id(H5I_INVALID_HID) {}
///\param original - IN: Original Attribute object to copy
// Programmer Binh-Minh Ribler - 2000
//--------------------------------------------------------------------------
Attribute::Attribute(const Attribute& original) : AbstractDs(), H5Location(), id(original.id)
Attribute::Attribute(const Attribute &original) : AbstractDs(), H5Location(), id(original.id)
{
incRefCount(); // increment number of references to this id
}
@@ -82,11 +84,11 @@ Attribute::Attribute(const hid_t existing_id) : AbstractDs(), H5Location(), id(e
///\exception H5::AttributeIException
// Programmer Binh-Minh Ribler - 2000
//--------------------------------------------------------------------------
void Attribute::write(const DataType& mem_type, const void *buf) const
void
Attribute::write(const DataType &mem_type, const void *buf) const
{
herr_t ret_value = H5Awrite(id, mem_type.getId(), buf);
if (ret_value < 0)
{
herr_t ret_value = H5Awrite(id, mem_type.getId(), buf);
if (ret_value < 0) {
throw AttributeIException("Attribute::write", "H5Awrite failed");
}
}
@@ -100,32 +102,29 @@ void Attribute::write(const DataType& mem_type, const void *buf) const
///\exception H5::AttributeIException
// Programmer Binh-Minh Ribler - Apr, 2003
//--------------------------------------------------------------------------
void Attribute::write(const DataType& mem_type, const H5std_string& strg) const
void
Attribute::write(const DataType &mem_type, const H5std_string &strg) const
{
// Check if this attribute has variable-len string or fixed-len string and
// proceed appropriately.
htri_t is_variable_len = H5Tis_variable_str(mem_type.getId());
if (is_variable_len < 0)
{
if (is_variable_len < 0) {
throw AttributeIException("Attribute::write", "H5Tis_variable_str failed");
}
// Convert string to C-string
const char* strg_C;
strg_C = strg.c_str(); // strg_C refers to the contents of strg as a C-str
const char *strg_C;
strg_C = strg.c_str(); // strg_C refers to the contents of strg as a C-str
herr_t ret_value = 0;
// Pass string in differently depends on variable or fixed length
if (!is_variable_len)
{
if (!is_variable_len) {
ret_value = H5Awrite(id, mem_type.getId(), strg_C);
}
else
{
else {
// passing third argument by address
ret_value = H5Awrite(id, mem_type.getId(), &strg_C);
}
if (ret_value < 0)
{
if (ret_value < 0) {
throw AttributeIException("Attribute::write", "H5Awrite failed");
}
}
@@ -138,11 +137,11 @@ void Attribute::write(const DataType& mem_type, const H5std_string& strg) const
///\exception H5::AttributeIException
// Programmer Binh-Minh Ribler - 2000
//--------------------------------------------------------------------------
void Attribute::read(const DataType& mem_type, void *buf) const
void
Attribute::read(const DataType &mem_type, void *buf) const
{
herr_t ret_value = H5Aread(id, mem_type.getId(), buf);
if (ret_value < 0)
{
herr_t ret_value = H5Aread(id, mem_type.getId(), buf);
if (ret_value < 0) {
throw AttributeIException("Attribute::read", "H5Aread failed");
}
}
@@ -167,22 +166,21 @@ void Attribute::read(const DataType& mem_type, void *buf) const
// variable-len string data: p_read_fixed_len and
// p_read_variable_len. This should improve readability. -BMR
//--------------------------------------------------------------------------
void Attribute::read(const DataType& mem_type, H5std_string& strg) const
void
Attribute::read(const DataType &mem_type, H5std_string &strg) const
{
// Check if this attribute has variable-len string or fixed-len string and
// proceed appropriately.
htri_t is_variable_len = H5Tis_variable_str(mem_type.getId());
if (is_variable_len < 0)
{
if (is_variable_len < 0) {
throw AttributeIException("Attribute::read", "H5Tis_variable_str failed");
}
if (!is_variable_len) // only allocate for fixed-len string
if (!is_variable_len) // only allocate for fixed-len string
{
p_read_fixed_len(mem_type, strg);
}
else
{
else {
p_read_variable_len(mem_type, strg);
}
}
@@ -194,62 +192,55 @@ void Attribute::read(const DataType& mem_type, H5std_string& strg) const
///\exception H5::AttributeIException
// Programmer Binh-Minh Ribler - Apr 2009
//--------------------------------------------------------------------------
size_t Attribute::getInMemDataSize() const
size_t
Attribute::getInMemDataSize() const
{
const char *func = "Attribute::getInMemDataSize";
// Get the data type of this attribute
hid_t mem_type_id = H5Aget_type(id);
if (mem_type_id < 0)
{
if (mem_type_id < 0) {
throw AttributeIException(func, "H5Aget_type failed");
}
// Get the data type's size by first getting its native type then getting
// the native type's size.
hid_t native_type = H5Tget_native_type(mem_type_id, H5T_DIR_DEFAULT);
if (native_type < 0)
{
if (native_type < 0) {
throw AttributeIException(func, "H5Tget_native_type failed");
}
size_t type_size = H5Tget_size(native_type);
if (type_size == 0)
{
if (type_size == 0) {
throw AttributeIException(func, "H5Tget_size failed");
}
// Close the native type and the datatype of this attribute.
if (H5Tclose(native_type) < 0)
{
if (H5Tclose(native_type) < 0) {
throw DataSetIException(func, "H5Tclose(native_type) failed");
}
if (H5Tclose(mem_type_id) < 0)
{
if (H5Tclose(mem_type_id) < 0) {
throw DataSetIException(func, "H5Tclose(mem_type_id) failed");
}
// Get number of elements of the attribute by first getting its dataspace
// then getting the number of elements in the dataspace
hid_t space_id = H5Aget_space(id);
if (space_id < 0)
{
if (space_id < 0) {
throw AttributeIException(func, "H5Aget_space failed");
}
hssize_t num_elements = H5Sget_simple_extent_npoints(space_id);
if (num_elements < 0)
{
if (num_elements < 0) {
throw AttributeIException(func, "H5Sget_simple_extent_npoints failed");
}
// Close the dataspace
if (H5Sclose(space_id) < 0)
{
if (H5Sclose(space_id) < 0) {
throw DataSetIException(func, "H5Sclose failed");
}
// Calculate and return the size of the data
size_t data_size = type_size * num_elements;
return(data_size);
return (data_size);
}
//--------------------------------------------------------------------------
@@ -259,20 +250,19 @@ size_t Attribute::getInMemDataSize() const
///\exception H5::AttributeIException
// Programmer Binh-Minh Ribler - 2000
//--------------------------------------------------------------------------
DataSpace Attribute::getSpace() const
DataSpace
Attribute::getSpace() const
{
// Calls C function H5Aget_space to get the id of the dataspace
hid_t dataspace_id = H5Aget_space(id);
// Calls C function H5Aget_space to get the id of the dataspace
hid_t dataspace_id = H5Aget_space(id);
// If the dataspace id is valid, create and return the DataSpace object
if (dataspace_id > 0)
{
// If the dataspace id is valid, create and return the DataSpace object
if (dataspace_id > 0) {
DataSpace dataspace;
f_DataSpace_setId(&dataspace, dataspace_id);
return(dataspace);
return (dataspace);
}
else
{
else {
throw AttributeIException("Attribute::getSpace", "H5Aget_space failed");
}
}
@@ -294,22 +284,21 @@ DataSpace Attribute::getSpace() const
/// first argument and ignore the second argument.
// Programmer Binh-Minh Ribler - Mar, 2014
//--------------------------------------------------------------------------
ssize_t Attribute::getName(char* attr_name, size_t buf_size) const
ssize_t
Attribute::getName(char *attr_name, size_t buf_size) const
{
// H5Aget_name will get buf_size-1 chars of the name to null terminate it
ssize_t name_size = H5Aget_name(id, buf_size, attr_name);
// If H5Aget_name returns a negative value, raise an exception
if (name_size < 0)
{
if (name_size < 0) {
throw AttributeIException("Attribute::getName", "H5Aget_name failed");
}
else if (name_size == 0)
{
else if (name_size == 0) {
throw AttributeIException("Attribute::getName", "Attribute must have a name, name length is 0");
}
// Return length of the name
return(name_size);
return (name_size);
}
//--------------------------------------------------------------------------
@@ -322,7 +311,8 @@ ssize_t Attribute::getName(char* attr_name, size_t buf_size) const
// Mar 2014 - BMR
// Revised to use the modified getName() above
//--------------------------------------------------------------------------
H5std_string Attribute::getName() const
H5std_string
Attribute::getName() const
{
H5std_string attr_name(""); // attribute name to return
@@ -330,32 +320,28 @@ H5std_string Attribute::getName() const
ssize_t name_size = H5Aget_name(id, static_cast<size_t>(0), NULL);
// If H5Aget_name failed, throw exception
if (name_size < 0)
{
if (name_size < 0) {
throw AttributeIException("Attribute::getName", "H5Aget_name failed");
}
else if (name_size == 0)
{
else if (name_size == 0) {
throw AttributeIException("Attribute::getName", "Attribute must have a name, name length is 0");
}
// Attribute's name exists, retrieve it
else if (name_size > 0)
{
char* name_C = new char[name_size+1]; // temporary C-string
HDmemset(name_C, 0, name_size+1); // clear buffer
else if (name_size > 0) {
char *name_C = new char[name_size + 1]; // temporary C-string
HDmemset(name_C, 0, name_size + 1); // clear buffer
// Use overloaded function
name_size = getName(name_C, name_size+1);
name_size = getName(name_C, name_size + 1);
// Convert the C attribute name to return
attr_name = name_C;
// Clean up resource
delete []name_C;
delete[] name_C;
}
// Return attribute's name
return(attr_name);
return (attr_name);
}
//--------------------------------------------------------------------------
@@ -371,14 +357,15 @@ H5std_string Attribute::getName() const
// Mar 2014 - BMR
// Revised to use the new getName() below
//--------------------------------------------------------------------------
H5std_string Attribute::getName(size_t len) const
H5std_string
Attribute::getName(size_t len) const
{
H5std_string attr_name;
ssize_t name_size = getName(attr_name, len);
ssize_t name_size = getName(attr_name, len);
if (name_size < 0)
return("");
return ("");
else
return(attr_name);
return (attr_name);
}
//--------------------------------------------------------------------------
@@ -398,35 +385,34 @@ H5std_string Attribute::getName(size_t len) const
// Added to replace getName(size_t, H5std_string&) so that it'll
// allow the argument "len" to be skipped.
//--------------------------------------------------------------------------
ssize_t Attribute::getName(H5std_string& attr_name, size_t len) const
ssize_t
Attribute::getName(H5std_string &attr_name, size_t len) const
{
ssize_t name_size = 0;
// If no length is provided, get the entire attribute name
if (len == 0)
{
if (len == 0) {
attr_name = getName();
name_size = attr_name.length();
}
// If length is provided, get that number of characters in name
else
{
char* name_C = new char[len+1]; // temporary C-string
HDmemset(name_C, 0, len+1); // clear buffer
else {
char *name_C = new char[len + 1]; // temporary C-string
HDmemset(name_C, 0, len + 1); // clear buffer
// Use overloaded function
name_size = getName(name_C, len+1);
name_size = getName(name_C, len + 1);
// Convert the C attribute name to return
attr_name = name_C;
// Clean up resource
delete []name_C;
delete[] name_C;
}
// Otherwise, keep attr_name intact
// Return name size
return(name_size);
return (name_size);
}
//--------------------------------------------------------------------------
@@ -444,7 +430,7 @@ ssize_t Attribute::getName(H5std_string& attr_name, size_t len) const
// Removed from documentation. -BMR, 2016/03/07 1.8.17 and 1.10.0
// Removed from code. -BMR, 2016/08/11 1.8.18 and 1.10.1
//--------------------------------------------------------------------------
//ssize_t Attribute::getName(size_t len, H5std_string& attr_name) const
// ssize_t Attribute::getName(size_t len, H5std_string& attr_name) const
//{
// return (getName(attr_name, len));
//}
@@ -458,10 +444,11 @@ ssize_t Attribute::getName(H5std_string& attr_name, size_t len) const
// function should have no failure. (from SLU)
// Programmer Binh-Minh Ribler - Mar, 2005
//--------------------------------------------------------------------------
hsize_t Attribute::getStorageSize() const
hsize_t
Attribute::getStorageSize() const
{
hsize_t storage_size = H5Aget_storage_size(id);
return (storage_size);
hsize_t storage_size = H5Aget_storage_size(id);
return (storage_size);
}
//--------------------------------------------------------------------------
@@ -480,9 +467,10 @@ hsize_t Attribute::getStorageSize() const
// an attribute id can be used to specify a location in HDF5
// library.
//--------------------------------------------------------------------------
hid_t Attribute::getId() const
hid_t
Attribute::getId() const
{
return(id);
return (id);
}
//--------------------------------------------------------------------------
@@ -494,13 +482,13 @@ hid_t Attribute::getId() const
// This private function is used in AbstractDs.
// Programmer Binh-Minh Ribler - 2000
//--------------------------------------------------------------------------
hid_t Attribute::p_get_type() const
hid_t
Attribute::p_get_type() const
{
hid_t type_id = H5Aget_type(id);
if (type_id > 0)
return(type_id);
else
{
return (type_id);
else {
throw AttributeIException("", "H5Aget_type failed");
}
}
@@ -517,7 +505,8 @@ hid_t Attribute::p_get_type() const
// Separated the fixed length case from the original
// Attribute::read
//--------------------------------------------------------------------------
void Attribute::p_read_fixed_len(const DataType& mem_type, H5std_string& strg) const
void
Attribute::p_read_fixed_len(const DataType &mem_type, H5std_string &strg) const
{
// Only allocate for fixed-len string.
@@ -525,19 +514,17 @@ void Attribute::p_read_fixed_len(const DataType& mem_type, H5std_string& strg) c
size_t attr_size = getInMemDataSize();
// If there is data, allocate buffer and read it.
if (attr_size > 0)
{
char *strg_C = new char[attr_size+1];
if (attr_size > 0) {
char * strg_C = new char[attr_size + 1];
herr_t ret_value = H5Aread(id, mem_type.getId(), strg_C);
if (ret_value < 0)
{
delete []strg_C; // de-allocate for fixed-len string
if (ret_value < 0) {
delete[] strg_C; // de-allocate for fixed-len string
throw AttributeIException("Attribute::read", "H5Aread failed");
}
// Get string from the C char* and release resource allocated locally
strg_C[attr_size] = '\0';
strg = strg_C;
delete []strg_C;
strg = strg_C;
delete[] strg_C;
}
}
@@ -553,7 +540,8 @@ void Attribute::p_read_fixed_len(const DataType& mem_type, H5std_string& strg) c
// Separated the variable length case from the original
// Attribute::read. -BMR
//--------------------------------------------------------------------------
void Attribute::p_read_variable_len(const DataType& mem_type, H5std_string& strg) const
void
Attribute::p_read_variable_len(const DataType &mem_type, H5std_string &strg) const
{
// Prepare and call C API to read attribute.
char *strg_C;
@@ -561,8 +549,7 @@ void Attribute::p_read_variable_len(const DataType& mem_type, H5std_string& strg
// Read attribute, no allocation for variable-len string; C library will
herr_t ret_value = H5Aread(id, mem_type.getId(), &strg_C);
if (ret_value < 0)
{
if (ret_value < 0) {
throw AttributeIException("Attribute::read", "H5Aread failed");
}
@@ -584,13 +571,14 @@ void Attribute::p_read_variable_len(const DataType& mem_type, H5std_string& strg
// Then the object's id is reset to the new id.
// Programmer Binh-Minh Ribler - 2000
//--------------------------------------------------------------------------
void Attribute::p_setId(const hid_t new_id)
void
Attribute::p_setId(const hid_t new_id)
{
// handling references to this old id
try {
close();
}
catch (Exception& close_error) {
catch (Exception &close_error) {
throw AttributeIException("Attribute::p_setId", close_error.getDetailMsg());
}
// reset object's id to the given id
@@ -605,13 +593,12 @@ void Attribute::p_setId(const hid_t new_id)
///\exception H5::AttributeIException
// Programmer Binh-Minh Ribler - Mar 9, 2005
//--------------------------------------------------------------------------
void Attribute::close()
void
Attribute::close()
{
if (p_valid_id(id))
{
if (p_valid_id(id)) {
herr_t ret_value = H5Aclose(id);
if (ret_value < 0)
{
if (ret_value < 0) {
throw AttributeIException("Attribute::close", "H5Aclose failed");
}
// reset the id
@@ -634,9 +621,9 @@ Attribute::~Attribute()
try {
close();
}
catch (Exception& close_error) {
catch (Exception &close_error) {
cerr << "Attribute::~Attribute - " << close_error.getDetailMsg() << endl;
}
}
} // end namespace
} // namespace H5

Some files were not shown because too many files have changed in this diff Show More