1

I write Server Application which will send extracted data from HDF5 files to many clients simultaneously

There is a code (run in separate thread):

var _fileID = H5F.open("C:\\Temp\\MLS-Aura_L2GP-Temperature_v03-33-c01_2012d347.he5", H5F.OpenMode.ACC_RDONLY);
H5D.open(_fileID, "/HDFEOS/SWATHS/Temperature/Data Fields/Temperature");
var space = H5D.getSpace(dataset);
var size = H5S.getSimpleExtentDims(space);
float[,] SatData = new float[size[0], size[1]];
var wrapArray = new H5Array<float>(SatData);
var dataType = H5D.getType(dataset);
H5D.read(dataset, dataType, wrapArray);

If I try to read HDF5 dataset in separate thread "H5D.read(dataset, dataType, wrapArray);" with more than one thread, i have an Error: "Failed to read data to data set 5000001 with status -1"

What's the problem?

woken
  • 21
  • 3
  • Same issue, but I have 5000000 instead of 5000001. And I only have one thread. Did you manage to resolve it eventually? – Andrey Agibalov Jun 09 '14 at 16:19
  • In my case the issue was that reader and writer were different application and their definitions of compound type were slightly different: writer had a UTF8 string, while reader had a regular string. Managed to fix it by updating the contract. – Andrey Agibalov Jun 09 '14 at 16:25
  • And I am getting 5000002 error. what should I do? – Mohini Mhetre Aug 01 '14 at 12:16

1 Answers1

0

HDF5 library should be compiled with threadsafe mode in order to be used in a multi threaded environment.

./configure --enable-threadsafe ... 

Yet, this configuration assure only threadsafety, but not thread parallelism. In fact current HDF5 version 1.10 implements threadsafe mode with a very simple mutex protection, so every HDF5 operation called by multiple thread is actually serialized.

Luca Ferraro
  • 672
  • 4
  • 12