swarm-support
[Top][All Lists]
Advanced

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

hdf5 question


From: Paul E Johnson
Subject: hdf5 question
Date: Wed, 24 Oct 2001 14:55:06 -0500

Dear Marcus and everybody:

Now I'm trying to make the HDF5Archiver work.  I can get the EZGraph
output to hdf5 vectors to work fine, but I just want to experiment with
the other way too. I'm using swarm-2001-09-25.

In the ASM code, I tried this:  
 
#ifndef USE_LISP
  dataArchiver = [HDF5Archiver create: [self getZone] setPath:
dataArchiveName];
#else
  dataArchiver = [LispArchiver create: [self getZone] setPath:
dataArchiveName];
#endif

And when I want to throw measures into the file, for example, for the
object "outputWorld", I do this:

// t is current time
sprintf (worldName, "world%ld",t); 
[dataArchiver putShallow: worldName object: outputWorld];

With a CPP flag set to USE_LISP, I get what I want, it saves repeatedly
snapshots of the state of objects, like this:
(list
  (cons 'world0
     (make-instance 'World #:intrate 0.100000D0 #:dividendscale
10.000000D0 #:savedd
ividend 11.569778D0 #:savedprice 124.010070D0 #:history_top 4
#:updown_top 4 #:maxhi
story 500 #:price 124.010070D0 #:oldprice 125.898548D0 #:dividend
11.569778D0 #:oldd
ividend 12.753387D0 #:riskNeutral 115.697776D0 #:profitperunit
9.681299D0 #:returnra
tio 0.076898D0 #:nmas 4 #:nworldbits 61 #:exponentialMAs #t))
  (cons 'world12
     (make-instance 'World #:intrate 0.100000D0 #:dividendscale
10.000000D0 #:savedd
ividend 8.005025D0 #:savedprice 104.504712D0 #:history_top 16
#:updown_top 1 #:maxhi
story 500 #:price 104.504712D0 #:oldprice 106.042389D0 #:dividend
8.005025D0 #:olddi
vidend 8.762448D0 #:riskNeutral 80.050247D0 #:profitperunit 6.467348D0
#:returnratio
 0.060988D0 #:nmas 4 #:nworldbits 61 #:exponentialMAs #t))
  (cons 'world15
  
The same code (without the flag USE_LISP) creates hdf5 files, but
something is wrong. The hdf5 dump looks like this, where it uses HDF5_c
where I think it should have the key value world0, and there is only one
piece of output (and in R I can't make any mileage to see it because _
is a synonym for <-). I suspect the HDF5Archiver is not using the key I
give for the object save, instead it uses HDF5_c.  Do you know why?  (I
verfied that the one record in the hdf5 file output is the last time
period inputted.)

$ h5dump swarmDataArchiveWed_Oct_24_13_45_05_2001.hdf 
HDF5 "swarmDataArchiveWed_Oct_24_13_45_05_2001.hdf" {
GROUP "/" {
   DATASET "HDF5_c" {
      DATATYPE  H5T_COMPOUND {
         H5T_IEEE_F64LE "intrate";
         H5T_IEEE_F64LE "dividendscale";
         H5T_IEEE_F64LE "saveddividend";
         H5T_IEEE_F64LE "savedprice";
         H5T_STD_I32LE "history_top";
         H5T_STD_I32LE "updown_top";
         H5T_STD_I32LE "maxhistory";
         H5T_IEEE_F64LE "price";
         H5T_IEEE_F64LE "oldprice";
         H5T_IEEE_F64LE "dividend";
         H5T_IEEE_F64LE "olddividend";
         H5T_IEEE_F64LE "riskNeutral";
         H5T_IEEE_F64LE "profitperunit";
         H5T_IEEE_F64LE "returnratio";
         H5T_STD_I32LE "nmas";
         H5T_STD_I32LE "nworldbits";
         undefined integer "exponentialMAs";
      }        
      DATASPACE  SIMPLE { ( 1 ) / ( 1 ) } 
      DATA {
         {
            0.1,
            10,
            8.81727,
            70.4818,
            145,
            0,
            500,
            70.4818,
            70.7629,
            8.81727,
            9.11766,
            88.1727,
            8.53614,
            0.12063,
            4,
            61,
            1
         }
      } 
 ATTRIBUTE "type" {
         DATATYPE  H5T_STRING {
               STRSIZE 6;
               STRPAD H5T_STR_NULLTERM;
               CSET H5T_CSET_ASCII;
               CTYPE H5T_C_S1;
            }           
         DATASPACE  SIMPLE { ( 1 ) / ( 1 ) } 
         DATA {
            "World"
         } 
      } 
      ATTRIBUTE "row.names" {
         DATATYPE  H5T_STRING {
               STRSIZE 7;
               STRPAD H5T_STR_NULLTERM;
               CSET H5T_CSET_ASCII;
               CTYPE H5T_C_S1;
            }           
         DATASPACE  SIMPLE { ( 1 ) / ( 1 ) } 
         DATA {
            "HDF5_c"
         } 
      } 
   } 
} 
} 




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