Commit Graph

27 Commits

Author SHA1 Message Date
Charles Mita 78d49aa161 Add -std=c89 to compile flags
Helps with some of the fixed-width typedefs in the bitshuffle library.
2018-10-09 14:12:30 +01:00
Charles Mita d433e6b1d0 Apply mask at same time as data conversion 2018-08-20 12:51:19 +01:00
Charles Mita 5c0b6e8366 Check if the bitshuffle filter was applied before decompressing 2018-08-17 18:00:14 +01:00
Charles Mita f6ba8eb2aa Use the dataset's datatype for H5Dread, convert manually later.
Hopefully this results in less work for the HDF5 library (which would
not be done in parallel) and ensures the conversion is consistent
across all data retrieval strategies.
2018-08-17 18:00:14 +01:00
Charles Mita d1b25e18b8 Refactor description structs 2018-08-17 18:00:14 +01:00
Charles Mita ace6a46717 Implement direct-chunk reading to read data when possible
The HDF5 library was made thread-safe via excessive locking, so does
not gain much from reads being parallelized.

By using the H5DOread_chunk function (introduced in HDF5 1.10.2)
we reduce the time spent the library, improving performance for
when XDS uses multiple threads to process data.

The decompression and type conversions have to be done manually
however, and this is only used in a limited case.
2018-08-17 18:00:14 +01:00
Charles Mita 38660b17fd Fixes to allow bitshuffle-lz4 to compile with -std=c89
Removes all "//" style comments, adds a missing typedef
for "int16_t" (although these are not checked for correct width)
and removes duplicated "intX_t" typedefs.

It would be preferable to detect GCC (with its extensions) and use
its definitions of fixed-with integers if not compiling with C99.
2018-08-17 17:59:42 +01:00
Charles Mita 369948795b Add the bitshuffle-lz4 code and add to the build.
Source for the bitshuffle code is:
https://github.com/kiyo-masui/bitshuffle

Release Tag: 0.3.4

Commit at time of copy:
9ffba9de83036a91d345fa2f62fcaedf55f54c5f

The LZF and HDF5 plugin parts are not included as they are
not required.
2018-08-15 16:55:52 +01:00
Charles Mita f435908a2b Fix nbytes out parameter in plugin_get_header
Previously reported total number of bytes in a frame - should be
the width of the array data type.
2018-08-15 15:53:47 +01:00
Charles Mita 482ab573af Initialise the error stack message arrays at start
This helps prevent potential segfaults due to null-pointer
dereferencing in the face of errors when the plugin is accessed via
multiple threads.

If multiple threads are pushing errors onto the error stack then its
possible for elements of the various string pointer arrays to be left
NULL, causing a segfault when the stack is printed.

Whilst this does nothing to address the "correctness" of the plugin in
a multi-threaded context, at least it shouldn't crash.

Error messages may still be corrupted.
2018-08-15 15:51:28 +01:00
Charles Mita e4466b00fc Stop the HDF5 library installing an exit hook
This will cause XDS to segfault on exit, since the plugin (and hence
HDF5 library) will likely have been unloaded.

Calling "H5dont_atexit" before any other H5 calls will prevent the
hook being installed, and we call "H5Close" ourselves as part of the
plugin_close function.
2018-08-13 13:32:34 +01:00
Charles Mita 87d2d065d3 Add Fortran test framework to Makefile 2018-08-13 13:32:34 +01:00
graeme-winter dc34262acc Code from https://strucbio.biologie.uni-konstanz.de/xdswiki/index.php/LIB for testing plugin implementation 2018-08-13 09:18:44 +01:00
Charles Mita cc4d129932 Copy the HDF5 error stack into ours 2018-04-10 17:16:27 +01:00
Charles Mita fd31a46243 Add README.md 2018-03-28 21:42:16 +01:00
Charles Mita 8938306acb Rename plugin output to durin-plugin.so 2018-03-28 15:48:55 +01:00
Charles Mita 7fb7710a1b Add build dir to .gitignore 2018-03-28 14:14:14 +01:00
Charles Mita b8b66778a2 Improve Makefile to stop unnecessary rebuilds 2018-03-28 14:04:57 +01:00
Charles Mita bcaa5e1f5e Add simple program to open files using code in file.c 2018-03-28 14:04:29 +01:00
Charles Mita 0f4b3d00bd Remove spurious printf 2018-03-28 13:48:44 +01:00
Charles Mita dc94ad89ca Add range checks on frame retrieval 2018-03-28 13:38:40 +01:00
Charles Mita dc41a80525 Internally use zero-based indexing for selecting dataset frame
Convert the one-based index at the plugin level and use zero-based
indexing elsewhere.
2018-03-28 13:38:25 +01:00
Charles Mita 5f57e5329a Handle vlen strings for NX_class attributes 2018-03-28 13:12:33 +01:00
Charles Mita db16131db4 Add manual error tracing
Error messages and function names/line numbers are traced via
__func__ or __FUNCTION__, __LINE__, etc (or just "unknown" if
not available). A manual stack is kept onto which these values
are pushed which can then be dumped to stderr/stdout.

stderr is used to report this information since no other
facility appears to be provided.
2018-03-27 17:58:22 +01:00
Charles Mita af6c98765d Fix dataset rank (ndims) to three.
The get_frame code always assumed a dataset rank of three, so this
doesn't actually change much, but its one less dynamically allocated
buffer to keep track of.
2018-03-27 13:20:35 +01:00
Charles Mita 3c4b00f12f Initial code commit.
Little to no error reporting, still fairly brittle and not very well
tested.
2018-03-27 11:14:33 +01:00
Charles Mita 9e08e01623 Initialise repository 2018-03-26 17:53:48 +01:00