HDF5 Attribute issue

Hello,

It looks like h5awrite_f does not work when there are more than 1 attributes.

I am writing attribute for one of the datasets and this contains some integers
and some reals. So I have created a compound dataset for this purpose.

Now as mentioned in the tutorial, we need to write one datatype at a time even
if we have a compound dataset with different datatypes. When I do these write
operations, only the first write actually writes to file. The rest of the
function calls do not write anything.

I tried changing the order to verify this and this is indeed what happens. Only
the first call works.

Can anyone tell me a way to overcome this ?

Regards,
Nikhil

···

----------------------------------------------------------------------
This mailing list is for HDF software users discussion.
To subscribe to this list, send a message to hdf-forum-subscribe@hdfgroup.org.
To unsubscribe, send a message to hdf-forum-unsubscribe@hdfgroup.org.

Hi Nikhil,

Could you please send me a short Fortran program that illustrates the problem?

Which version of the HDF5 Library are you using?

Thank you!

Elena

···

On Sep 22, 2008, at 6:23 PM, Nikhil Laghave wrote:

Hello,

It looks like h5awrite_f does not work when there are more than 1 attributes.

I am writing attribute for one of the datasets and this contains some integers
and some reals. So I have created a compound dataset for this purpose.

Now as mentioned in the tutorial, we need to write one datatype at a time even
if we have a compound dataset with different datatypes. When I do these write
operations, only the first write actually writes to file. The rest of the
function calls do not write anything.

I tried changing the order to verify this and this is indeed what happens. Only
the first call works.

Can anyone tell me a way to overcome this ?

Regards,
Nikhil

----------------------------------------------------------------------
This mailing list is for HDF software users discussion.
To subscribe to this list, send a message to hdf-forum-subscribe@hdfgroup.org.
To unsubscribe, send a message to hdf-forum-unsubscribe@hdfgroup.org.

----------------------------------------------------------------------
This mailing list is for HDF software users discussion.
To subscribe to this list, send a message to hdf-forum-subscribe@hdfgroup.org.
To unsubscribe, send a message to hdf-forum-unsubscribe@hdfgroup.org.

Nikhil,

I am replying to the list since it might be of interest to those who use Fortran and parallel HDF5.

You should be able to write several attributes. One thing to remember: since attribute is a piece of HDF5 metatdata, all h5a*_f calls have to be collective.
If you find that it doesn't work, I will appreciate if you create an example to demonstrate the problem.

About writing compound datatypes by fields: this is a deficiency of the current implementation and one cannot do it in C (and in Fortran) using parallel library. We will need to address the problem.

Good news is that we have been working on adding Fortran 2003 features to the HDF5 Fortran library. There will be no need to write compound datatype by fields. We have implementation that works now with Intel 10.1 and higher and g95 compilers. If you are interested, I can point you to the development branch with the new code to try.

Elena

hdfio.f (7.06 KB)

···

Begin forwarded message:

From: "Nikhil Laghave" <nikhill@iastate.edu>
Date: September 23, 2008 6:53:44 PM CDT
To: "Elena Pourmal" <epourmal@hdfgroup.org>
Subject: Re: [hdf-forum] HDF5 Attribute issue

Hi Elena,

I am using version 1.6.5 since NERSC clusters do not have version 1.8 installed yet.

The subroutine that does the write operation is attached below(subroutine compwrite).

I will try and send a small program that would simulate our main program to use this subroutine. If you can find some obvious mistakes in the implementation, please let me know.

Thanks,
Nikhil

On Tue, Sep 23, 2008 at 9:18 AM, Elena Pourmal > <epourmal@hdfgroup.org> wrote:
Hi Nikhil,

Could you please send me a short Fortran program that illustrates the problem?

Which version of the HDF5 Library are you using?

Thank you!

Elena

On Sep 22, 2008, at 6:23 PM, Nikhil Laghave wrote:

Hello,

It looks like h5awrite_f does not work when there are more than 1 attributes.

I am writing attribute for one of the datasets and this contains some integers
and some reals. So I have created a compound dataset for this purpose.

Now as mentioned in the tutorial, we need to write one datatype at a time even
if we have a compound dataset with different datatypes. When I do these write
operations, only the first write actually writes to file. The rest of the
function calls do not write anything.

I tried changing the order to verify this and this is indeed what happens. Only
the first call works.

Can anyone tell me a way to overcome this ?

Regards,
Nikhil

----------------------------------------------------------------------
This mailing list is for HDF software users discussion.
To subscribe to this list, send a message to hdf-forum-subscribe@hdfgroup.org.
To unsubscribe, send a message to hdf-forum-unsubscribe@hdfgroup.org.

----------------------------------------------------------------------
This mailing list is for HDF software users discussion.
To subscribe to this list, send a message to hdf-forum-subscribe@hdfgroup.org.
To unsubscribe, send a message to hdf-forum-unsubscribe@hdfgroup.org.

--
Regards,
Nikhil