swarm-support
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: archiver questions:


From: Paul E. Johnson
Subject: Re: archiver questions:
Date: Mon, 05 Jun 2000 11:17:04 -0500

"Marcus G. Daniels" wrote:
> 
> >>>>> "PJ" == Paul E Johnson <address@hidden> writes:
> 
> PJ> cannot store objects in compound types
> 
> PJ> Please define "compound types".
> 
> "compound type" is the HDF5 term for a fixed, flat data structure; a
> type without hierarchy.  The HDF5 library can handle these data types
> efficiently.
> 
> Compound types can be used for shallow serialization because, by
> definition, an object serialized in this way can't preserve internal
> objects.  For that, deep serialization is needed.
> 
> The error is pointing out that the thing you are trying to save does
> have hierarchy.

Since the term "type without hierarchy" is not known to me, let me see
if I understand this. hdf5 archives can work for objects that have ints,
floats, doubles, etc, but no lists, C-arrays, Swarm arrays, or such. 
Correct?

> PJ> 2. How can I select which IVARS get written by the
> PJ> HDF5Archiver--i.e., exclude the compound types?
> 
> To do that, you'd need to implement a different -hdf5OutShallow: method
> for the subclass.

OK, I'm looking in DefClass.m and I see that hdf5OutShallow: is not
implemented, presumably because of this hierarchy type problem discussed
in point 1.  lispOutShallow method uses stuff from OutputStream.  I'm
looking for an OutputStream equivalent for hdf5, some way to tell it
what variables to save.  Am I just supposed to get make direct use of
the hdf5 library at that point.

Suppose I want to save the time and two ivar floats, fx and fy.  What do
I put in the guts of this in my object:

- hdf5OutShallow: hdf5Obj
{
  int time=(int)getCurrentTime();
        
  {????????}

  return nil;
}

So when I load this into R, it will be as-if I had used R's "read"
function to grab an ascii dataset with names in the first row.

 
> Alternatively, if you have a class that is sparse, i.e. you don't care
> about most of the instance variables, then you can point the archiver
> at the instance and save the ivars that you do care about providing
> archiver keys for each one.

I do not understand "providing the archiver keys for each one".  

> 
> PJ> 3. I can't understand why the SwarmDocs have no protocol called
> PJ> "HDF5Archiver" but it is used in swarmapps.
> 
> http://www.santafe.edu/projects/swarm/swarmdocs/set/swarm.defobj.hdf5archiver.protocol.html
>
Thanks.  I don't know how I missed it before. Honestly.
> 
> PJ> 5. There is nothing wrong, is there, with having several classes
> PJ> archivers write into the same data file? (suppose you just want a
> PJ> record of parameters for model runs and parameters are spread
> PJ> across many classes).
> 
> Maybe I don't understand the question... but different kinds of objects
> can be saved in the same file.  A file is associated with a single
> HDF5Archiver instance, so if you want to write to that file, it should
> go through the same instance.

This tells me I fundamentally do not understand the usage of archiver
objects for outputting data. I've just been going from that newish
simpleExperBug example. I thought I was supposed to create an archiver
object in each class that needed to save things, and then schedule an
action to dump the IVARs out to a file, using the "OutShallow" methods
for lisp or hdf5.  What you wrote makes me think I should create a
single archiver object in some high level place like main.m, and make it
available to several different objects that need to save values. 



-- 
Paul E. Johnson                         email: address@hidden
Dept. of Political Science              http://lark.cc.ukans.edu/~pauljohn
University of Kansas                    Office: (785) 864-9086
Lawrence, Kansas 66045                  FAX: (785) 864-5700

                  ==================================
   Swarm-Support is for discussion of the technical details of the day
   to day usage of Swarm.  For list administration needs (esp.
   [un]subscribing), please send a message to <address@hidden>
   with "help" in the body of the message.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]