# HDF write error

**URL:** <https://forum.hdfgroup.org/t/hdf-write-error/2748>\
**Category:** Hdf-forum archives\
**Created:** [December 17, 2012, 7:00am UTC](https://forum.hdfgroup.org/t/hdf-write-error/2748 "2012-12-17T07:00:25Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![suman.geek](https://forum.hdfgroup.org/letter_avatar_proxy/v4/letter/s/49beb7/32.png) [@suman.geek](https://forum.hdfgroup.org/u/suman.geek)\
**Post date:** [December 17, 2012, 7:00am UTC](https://forum.hdfgroup.org/t/hdf-write-error/2748/1 "2012-12-17T07:00:25Z")

</div>

Hi all,

I am writing a dataset to a H5 file and in the process getting this error

&nbsp;&nbsp;#009: H5Dint.c line 1034 in H5D\_create(): unable to construct layout  
information  
&nbsp;&nbsp;&nbsp;&nbsp;major: Dataset  
&nbsp;&nbsp;&nbsp;&nbsp;minor: Unable to initialize object

What does this error convey?

Thanks  
Suman

---

<div class="post-metadata">

**Author:** ![epourmal](https://forum.hdfgroup.org/letter_avatar_proxy/v4/letter/e/c67d28/32.png) [@epourmal](https://forum.hdfgroup.org/u/epourmal)\
**Post date:** [December 17, 2012, 7:11am UTC](https://forum.hdfgroup.org/t/hdf-write-error/2748/2 "2012-12-17T07:11:54Z")

</div>

Hard to tell  
Could you please provide a snippet of the source code?

> **···**
>
> Sent from my iPhone
> 
> On Dec 17, 2012, at 1:00 AM, Suman Vajjala \<suman.geek@gmail.com\> wrote:
> 
> > Hi all,
> > 
> > I am writing a dataset to a H5 file and in the process getting this error
> > 
> > &nbsp;&nbsp;#009: H5Dint.c line 1034 in H5D\_create(): unable to construct layout information  
> > &nbsp;&nbsp;&nbsp;&nbsp;major: Dataset  
> > &nbsp;&nbsp;&nbsp;&nbsp;minor: Unable to initialize object
> > 
> > What does this error convey?
> > 
> > Thanks  
> > Suman  
> > \_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_  
> > Hdf-forum is for HDF software users discussion.  
> > Hdf-forum@hdfgroup.org  
> > [http://mail.hdfgroup.org/mailman/listinfo/hdf-forum\_hdfgroup.org](http://mail.hdfgroup.org/mailman/listinfo/hdf-forum_hdfgroup.org)

---

<div class="post-metadata">

**Author:** ![suman.geek](https://forum.hdfgroup.org/letter_avatar_proxy/v4/letter/s/49beb7/32.png) [@suman.geek](https://forum.hdfgroup.org/u/suman.geek)\
**Post date:** [December 17, 2012, 8:02am UTC](https://forum.hdfgroup.org/t/hdf-write-error/2748/3 "2012-12-17T08:02:40Z")

</div>

Hi,

This is a part of the code which gives error:

&nbsp;&nbsp;&nbsp;&nbsp;hsize\_t celldset\_sz = ncells \* gmaxbandwidth;  
&nbsp;&nbsp;&nbsp;&nbsp;filespace = H5Screate\_simple (1, &celldset\_sz, NULL);  
&nbsp;&nbsp;&nbsp;&nbsp;dset\_id = H5Dcreate (file\_id, "cellinfo", H5T\_NATIVE\_INT, filespace,  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;H5P\_DEFAULT, H5P\_DEFAULT, H5P\_DEFAULT);  
&nbsp;&nbsp;&nbsp;&nbsp;H5Sclose (filespace);  
&nbsp;&nbsp;&nbsp;&nbsp;H5Dclose (dset\_id);

&nbsp;&nbsp;celldset\_sz = 2195543407

&nbsp;&nbsp;I've found out the error. Maximum limit addressed by int is 2147483647.  
Maybe this is why the code is raising an error.

Regards  
Suman

> **···**
>
> On Mon, Dec 17, 2012 at 12:41 PM, Elena Pourmal \<epourmal@hdfgroup.org\>wrote:
> 
> > Hard to tell  
> > Could you please provide a snippet of the source code?
> > 
> > Sent from my iPhone
> > 
> > On Dec 17, 2012, at 1:00 AM, Suman Vajjala \<suman.geek@gmail.com\> wrote:
> > 
> > \> Hi all,  
> > \>  
> > \> I am writing a dataset to a H5 file and in the process getting this  
> > error  
> > \>  
> > \> #009: H5Dint.c line 1034 in H5D\_create(): unable to construct layout  
> > information  
> > \> major: Dataset  
> > \> minor: Unable to initialize object  
> > \>  
> > \> What does this error convey?  
> > \>  
> > \> Thanks  
> > \> Suman  
> > \> \_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_  
> > \> Hdf-forum is for HDF software users discussion.  
> > \> Hdf-forum@hdfgroup.org  
> > \> [http://mail.hdfgroup.org/mailman/listinfo/hdf-forum\_hdfgroup.org](http://mail.hdfgroup.org/mailman/listinfo/hdf-forum_hdfgroup.org)
> > 
> > \_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_  
> > Hdf-forum is for HDF software users discussion.  
> > Hdf-forum@hdfgroup.org  
> > [http://mail.hdfgroup.org/mailman/listinfo/hdf-forum\_hdfgroup.org](http://mail.hdfgroup.org/mailman/listinfo/hdf-forum_hdfgroup.org)

---

<div class="post-metadata">

**Author:** ![suman.geek](https://forum.hdfgroup.org/letter_avatar_proxy/v4/letter/s/49beb7/32.png) [@suman.geek](https://forum.hdfgroup.org/u/suman.geek)\
**Post date:** [December 17, 2012, 8:36am UTC](https://forum.hdfgroup.org/t/hdf-write-error/2748/4 "2012-12-17T08:36:13Z")

</div>

Can the filespace size be greater than the limit set by  
std::numeric\_limits\<int\>::max()? I have a vector which is to be written to  
H5 file. The size of the vector is 2195543407 while  
std::numeric\_limits\<int\>::max() = 2147483647. This error disappears when I  
use long instead of int.

Suman

> **···**
>
> On Mon, Dec 17, 2012 at 1:32 PM, Suman Vajjala \<suman.geek@gmail.com\> wrote:
> 
> > Hi,
> > 
> > This is a part of the code which gives error:
> > 
> > &nbsp;&nbsp;&nbsp;&nbsp;hsize\_t celldset\_sz = ncells \* gmaxbandwidth;  
> > &nbsp;&nbsp;&nbsp;&nbsp;filespace = H5Screate\_simple (1, &celldset\_sz, NULL);  
> > &nbsp;&nbsp;&nbsp;&nbsp;dset\_id = H5Dcreate (file\_id, "cellinfo", H5T\_NATIVE\_INT, filespace,  
> > &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;H5P\_DEFAULT, H5P\_DEFAULT, H5P\_DEFAULT);  
> > &nbsp;&nbsp;&nbsp;&nbsp;H5Sclose (filespace);  
> > &nbsp;&nbsp;&nbsp;&nbsp;H5Dclose (dset\_id);
> > 
> > &nbsp;&nbsp;celldset\_sz = 2195543407
> > 
> > &nbsp;&nbsp;I've found out the error. Maximum limit addressed by int is 2147483647.  
> > Maybe this is why the code is raising an error.
> > 
> > Regards  
> > Suman
> > 
> > On Mon, Dec 17, 2012 at 12:41 PM, Elena Pourmal \<epourmal@hdfgroup.org\>wrote:
> > 
> > > Hard to tell  
> > > Could you please provide a snippet of the source code?
> > > 
> > > Sent from my iPhone
> > > 
> > > On Dec 17, 2012, at 1:00 AM, Suman Vajjala \<suman.geek@gmail.com\> wrote:
> > > 
> > > \> Hi all,  
> > > \>  
> > > \> I am writing a dataset to a H5 file and in the process getting this  
> > > error  
> > > \>  
> > > \> #009: H5Dint.c line 1034 in H5D\_create(): unable to construct layout  
> > > information  
> > > \> major: Dataset  
> > > \> minor: Unable to initialize object  
> > > \>  
> > > \> What does this error convey?  
> > > \>  
> > > \> Thanks  
> > > \> Suman  
> > > \> \_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_  
> > > \> Hdf-forum is for HDF software users discussion.  
> > > \> Hdf-forum@hdfgroup.org  
> > > \> [http://mail.hdfgroup.org/mailman/listinfo/hdf-forum\_hdfgroup.org](http://mail.hdfgroup.org/mailman/listinfo/hdf-forum_hdfgroup.org)
> > > 
> > > \_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_  
> > > Hdf-forum is for HDF software users discussion.  
> > > Hdf-forum@hdfgroup.org  
> > > [http://mail.hdfgroup.org/mailman/listinfo/hdf-forum\_hdfgroup.org](http://mail.hdfgroup.org/mailman/listinfo/hdf-forum_hdfgroup.org)
