swarm-support
[Top][All Lists]
Advanced

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

Re: archiver questions:


From: Marcus G. Daniels
Subject: Re: archiver questions:
Date: 04 Jun 2000 13:55:31 -0700
User-agent: Gnus/5.070084 (Pterodactyl Gnus v0.84) Emacs/20.4

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

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.

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.

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

PJ> 4. Since the swarm kernel creates the global object "hdf5Archiver"
PJ> why would one want to create more instances of that object in
PJ> their own classes?

hdf5Archiver is associated with the file ~/swarmArchiver.hdf, and
hdf5AppArchiver is associated with the file APPNAME.hdf.  The former
is for common storage of objects across applications (e.g. window
geometry), and the latter is for storage of objects for a single
application in a single, application-specific file.  Other instances
of HDF5Archiver might be useful if an application wanted to have
several HDF5 files for whatever reason.

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.

PJ> 6. Can you tell me something about how the OutputStream class is
PJ> used?  I don't remember noticing it before.  I have a feeling it
PJ> is what I ought to use instead of archiver, since I can just pick
PJ> which variables to output. 

The idea is that any savable class ought to have specialized
serialization method (-hdf5OutShallow:) that captures what is needed
to reproduce the object, if the the literal copy of the ivars is not
appropriate.  It is often possible to restructure things so that a literal
copy of an instance will work, though.

PJ> I also need to know if stderr is a possible value for stream in
PJ> the methods of the various Archiver classes like this one:

PJ> - lispOutShallow: (id <OutputStream>)stream

PJ> It would be nice to use stderr sometimes...

You can pass stderr as the second argument to OutputStream's
+create:setFileStream:.

                  ==================================
   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]