Best way of representing C++ containers in hdf5

All,

I need to store C++ containers like maps , vectors into hdf5 . One method is to use variable length datatypes . To my knowledge too much use of variable length datatype effects the performance . Is there a better way to do this ?

Regards

Ramakrishnan

Hi Ramakrishnan,

···

On Apr 29, 2008, at 7:31 AM, Ramakrishnan Iyer wrote:

All,

I need to store C++ containers like maps , vectors into hdf5 . One method is to use variable length datatypes . To my knowledge too much use of variable length datatype effects the performance . Is there a better way to do this ?

  Most (all?) C++ containers allow you to determine the number of objects within them. You could always use that count to define a dataspace dimension and then store the objects as elements of the dataset...

  Quincey

----------------------------------------------------------------------
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 Quincey ,
Consider a map ( key,value pair) having three elements . In order to
store this I can create a compound data type containing key and value
types in it . Then I need to create a two dimensional dataset , wherein
each row will give me a map entry . Since I said three elements, I can
make the dataspace dimension as three. This will be equivalent to a 2x3
matrix .

Is my understanding right?

In my case what I need to store together is a map and a pointer (
dataset region reference ) . I need to store only one reference along
with entire map contents . How can I achieve this . Any suggestions ?

Regards,
Ramakrishnan

···

-----Original Message-----
From: Quincey Koziol [mailto:koziol@hdfgroup.org]
Sent: Wednesday, April 30, 2008 12:01 AM
To: Ramakrishnan Iyer
Cc: hdf-forum@hdfgroup.org; HDF Helpdesk
Subject: Re: [hdf-forum] Best way of representing C++ containers in hdf5

Hi Ramakrishnan,

On Apr 29, 2008, at 7:31 AM, Ramakrishnan Iyer wrote:

All,

I need to store C++ containers like maps , vectors into hdf5 . One
method is to use variable length datatypes . To my knowledge too
much use of variable length datatype effects the performance . Is
there a better way to do this ?

  Most (all?) C++ containers allow you to determine the number of

objects within them. You could always use that count to define a
dataspace dimension and then store the objects as elements of the
dataset...

  Quincey

----------------------------------------------------------------------
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 Ramakrishnan,

Hi Quincey ,
Consider a map ( key,value pair) having three elements . In order to
store this I can create a compound data type containing key and value
types in it . Then I need to create a two dimensional dataset , wherein
each row will give me a map entry . Since I said three elements, I can
make the dataspace dimension as three. This will be equivalent to a 2x3
matrix .

Is my understanding right?

  If you create a compound datatype that holds both the key & value, why do you need a two dimensional dataset?

In my case what I need to store together is a map and a pointer (
dataset region reference ) . I need to store only one reference along
with entire map contents . How can I achieve this . Any suggestions ?

  Hmm, what about putting the reference as an attribute on the dataset that contains the contents of the map?

    Quincey

···

On Apr 30, 2008, at 1:45 AM, Ramakrishnan Iyer wrote:

Regards,
Ramakrishnan

-----Original Message-----
From: Quincey Koziol [mailto:koziol@hdfgroup.org]
Sent: Wednesday, April 30, 2008 12:01 AM
To: Ramakrishnan Iyer
Cc: hdf-forum@hdfgroup.org; HDF Helpdesk
Subject: Re: [hdf-forum] Best way of representing C++ containers in hdf5

Hi Ramakrishnan,

On Apr 29, 2008, at 7:31 AM, Ramakrishnan Iyer wrote:

All,

I need to store C++ containers like maps , vectors into hdf5 . One
method is to use variable length datatypes . To my knowledge too
much use of variable length datatype effects the performance . Is
there a better way to do this ?

  Most (all?) C++ containers allow you to determine the number of

objects within them. You could always use that count to define a
dataspace dimension and then store the objects as elements of the
dataset...

  Quincey

----------------------------------------------------------------------
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.