Page tree


H5T_ARRAY Datatype

H5T_ARRAY vs. Dataset Dataspace

H5T_ARRAY is a datatype, and it should not be confused with the dataspace of a dataset. The dataspace of a dataset can consist of a regular array of elements. For example, the datatype for a dataset could be an atomic datatype like integer, and the dataset could be an N-dimensional appendable array, as specified by the dataspace. See H5S_CREATE and H5S_CREATE_SIMPLE for details. Unlimited dimensions and subsetting are not supported when using the H5T_ARRAY datatype.

Why was the H5T_ARRAY datatype created?

The array datatype was created to address the simple case of a compound datatype when all members of the compound datatype are of the same type and there is no need to subset by compound datatype members. Creation of such a datatype is more efficient and I/O also requires less work, because there is no alignment involved.

Previously, you had to create a compound datatype if you wanted to use an array-like datatype for creating a dataset. This was fine if you really wanted to use the array as a field in a compound datatype, but there were developers who wanted to just have a "plain" array (without the compound datatype wrapping) as a datatype for their dataset. We decided to obsolete the array fields in compound datatypes and promote arrays to a "first-class" datatype. This allowed applications to create and use them without involving a compound datatype. Along with being more "obvious" about the intentions of the datatype, array datatypes are also somewhat more efficient in certain circumstances, as mentioned above.