<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
</head>
<body bgcolor="#ffffff" text="#000000">
Dear NeXus users,<br>
<br>
I'm creating HDF files with many NXdata blocks (about 850). <br>
I thus open the file, create a group, and then write iteratively the
blocks with e.g.:<br>
<blockquote><tt>NXhandle pHandle;</tt><br>
<tt>NXopen(filename, NXACC_CREATE, &pHandle);</tt><br>
<br>
<tt>...</tt><br>
<br>
<tt>float *data; /* n*m elements */</tt><br>
<tt>int length[2]={n,m};</tt><br>
<br>
<tt>...</tt><br>
<br>
<tt>NXcompmakedata(pHandle, name, NX_FLOAT32, 2, length,
NX_COMP_LZW, length);</tt><br>
<tt>NXopendata(pHandle, name);</tt><br>
<tt>NXputdata(pHandle, data);</tt><br>
<tt>NXclosedata(pHandle);</tt><br>
</blockquote>
This opens an HDF4 file, which is written in 2 seconds. If I do the
same with an HDF5 file (<tt>NXACC_CREATE5</tt>), then it takes 37
seconds.<br>
Any clue why HDF5 is so slow with many blocks ? The first few
hundred blocks are as fast to write as with HDF4, but then the
program lags... The behaviour is the same if I do not write
compressed data blocks (NXmakedata). I do not know if this comes
from the NeXus library, or from the HDF libraries.<br>
<br>
As a conclusion, I actually tend to recommend to use HDF4 files if
your files are smaller than 2Gb...<br>
<br>
Emmanuel.<br>
<br>
<pre class="moz-signature" cols="72">--
Emmanuel FARHI,<a class="moz-txt-link-abbreviated" href="http://www.ill.eu/computing/people/emmanuel-farhi">www.ill.eu/computing/people/emmanuel-farhi</a> \|/ ____ \|/
CS-Group ILL4/221, Institut Laue-Langevin (ILL) Grenoble ~@-/ oO \-@~
6 rue J. Horowitz, BP 156, 38042 Grenoble Cedex 9,France /_( \__/ )_\
Work :Tel (33/0) 4 76 20 71 35. Fax (33/0) 4 76 48 39 06 \__U_/
</pre>
</body>
</html>