Hi,
I have file created via H5LTopen_file_image. According to docs (http://www.hdfgroup.org/HDF5/doc/UG/13_Attributes.html) to overcome 64K limit for large attributes I should set the number of attributes that will be stored in compact storage to 0 with the H5Pset_attr_phase_change.
I create group
hid_t m_gpid = H5Pcreate(H5P_GROUP_CREATE);
H5Pset_attr_phase_change(m_gpid, 0, 0);
const hid_t oParamGroupId = H5Gcreate(p_oFileId, p_sPath, H5P_DEFAULT, m_gpid, H5P_DEFAULT);
And then pass oParamGroupId to WriteAttributeArray
WriteAttributeArray(hid_t p_oGroupId, const char *p_sAttrName, float *p_fValues, unsigned int p_iCount)
{
hsize_t count = p_iCount;
hid_t dataspace_id = H5Screate_simple(1, &count, NULL);
hid_t attribute_id = H5Acreate(p_oGroupId, p_sAttrName, H5T_IEEE_F32LE, dataspace_id, H5P_DEFAULT, H5P_DEFAULT);
H5Awrite(attribute_id, H5T_IEEE_F32LE, p_fValues);
H5Aclose(attribute_id);
H5Sclose(dataspace_id);
}
Attributes smaller than 64K are stored correctly. If larger than 64K I'm getting errors:
-------------H5Acreate error message START
HDF5-DIAG: Error detected in HDF5 (1.8.13) thread 0:
#000: ..\..\src\H5A.c line 256 in H5Acreate2(): unable to create attribute
major: Attribute
minor: Unable to initialize object
#001: ..\..\src\H5A.c line 505 in H5A_create(): unable to create attribute in
object header
major: Attribute
minor: Unable to insert object
#002: ..\..\src\H5Oattribute.c line 347 in H5O_attr_create(): unable to create
new attribute in header
major: Attribute
minor: Unable to insert object
#003: ..\..\src\H5Omessage.c line 224 in H5O_msg_append_real(): unable to crea
te new message
major: Object header
minor: No space available for allocation
#004: ..\..\src\H5Omessage.c line 1945 in H5O_msg_alloc(): unable to allocate
space for message
major: Object header
minor: Unable to initialize object
#005: ..\..\src\H5Oalloc.c line 1142 in H5O_alloc(): object header message is
too large
major: Object header
minor: Unable to initialize object
-------------H5Acreate error message END
HDF5-DIAG: Error detected in HDF5 (1.8.13) thread 0:
#000: ..\..\src\H5A.c line 929 in H5Awrite(): not an attribute
major: Invalid arguments to routine
minor: Inappropriate type
HDF5-DIAG: Error detected in HDF5 (1.8.13) thread 0:
#000: ..\..\src\H5A.c line 2288 in H5Aclose(): not an attribute
major: Invalid arguments to routine
minor: Inappropriate type
HDF5-DIAG: Error detected in HDF5 (1.8.13) thread 0:
#000: ..\..\src\H5A.c line 256 in H5Acreate2(): unable to create attribute
major: Attribute
minor: Unable to initialize object
#001: ..\..\src\H5A.c line 505 in H5A_create(): unable to create attribute in
object header
major: Attribute
minor: Unable to insert object
#002: ..\..\src\H5Oattribute.c line 347 in H5O_attr_create(): unable to create
new attribute in header
major: Attribute
minor: Unable to insert object
#003: ..\..\src\H5Omessage.c line 224 in H5O_msg_append_real(): unable to crea
te new message
major: Object header
minor: No space available for allocation
#004: ..\..\src\H5Omessage.c line 1945 in H5O_msg_alloc(): unable to allocate
space for message
major: Object header
minor: Unable to initialize object
#005: ..\..\src\H5Oalloc.c line 1142 in H5O_alloc(): object header message is
too large
major: Object header
minor: Unable to initialize object
HDF5-DIAG: Error detected in HDF5 (1.8.13) thread 0:
#000: ..\..\src\H5A.c line 929 in H5Awrite(): not an attribute
major: Invalid arguments to routine
minor: Inappropriate type
HDF5-DIAG: Error detected in HDF5 (1.8.13) thread 0:
#000: ..\..\src\H5A.c line 2288 in H5Aclose(): not an attribute
major: Invalid arguments to routine
minor: Inappropriate type
I'm stuck, how can I fix this problem? Example from docs works flawlessly. I'm using HDF1.8.13 and VS2010. Application is compiled in 64bits. I could use datasets but it would require lots of changes in code.
regards
Adam