HDF5 write concurrency thread

Can HDF5 handle multiple threads on its own or should it be synchronized externally? An example of OpenMP offers the latter.

If the first, what is the correct way to determine the dataspace to write to?

+4
source share
1 answer

Anycorn,

HDF5 can handle multiple streams without external synchronization, although recordings will still be serial. You must compile the latest version (1.8.6 as of 4/5/2011) and run ./configure using the --enable-threadsafe and -with-pthreads=/pthreads-include-path/,/pthreads-lib-path/ .

For instance:

 ./configure --enable-threadsafe -with-pthreads=/usr/include,/usr/lib 

Regarding the definition of dataspace for recording, the easiest way is to build a basic rectangular hyperplane using a multidimensional array, rank value and the H5Screate_simple function. Usually the mine performs the same steps:

  //NUM = Number of spaces in this dimension //Create a 1 dimensional array hsize_t dsDim[1] = {NUM}; //Create the 1x1xNUM data space (rank param = 1). hid_t dSpace = H5Screate_simple(1, dsDim, NULL); ... Create datasets using the dataspace ... //Release the data space H5Sclose(dSpace); 

Hope this helps!

+7
source

Source: https://habr.com/ru/post/1313924/


All Articles