Writing and maintaining the new "xdr" methods is much easier than writing "read"/"write" methods since the new system provides many utility routines. All methods and functions are discussed in the next section where you will also find many examples (some additional examples are presented in section 5.7.6), but first we give an overview of the most important features of the GRAPE XDR archiving system:
XDR stands for ``eXternal Data Representation'', it essentially uses the big endian encoding for integers and the IEEE floating point format. The header files and library routines for XDR are part of Sun's Remote Procedure Call (RPC) package which is freely available and should be installed on most machines since many network services are based on it.
Using a machine-independent data format is essential, it allows for example to write data files on an SGI and read them back in on a Linux or IBM RISC machine. This could also be achieved by using a text format instead of a binary format like XDR, but the big disadvantage of a text format is that it uses much more disk space. Currently we are working on automatic data compression using for example gzip to further reduce the data size.
There are some memory management problems which are caused by the original XDR routines and GRAPE's own memory management, together with some minor portability problems they are discussed in section 5.7.7 where you can also find some useful hints for writing your own archiving routines.
This is another major advantage over the old format which could only handle files because the fseek function was used. The new format can be used on every record oriented XDR stream, this makes it possible to exchange data via pipes between GRAPE processes or even via sockets between GRAPE processes running on different machines.
This greatly simplifies writing "xdr" methods since you don't have to care about writing some object more than once or resolving references when reading in data. If you know the old "read"/"write" methods for TimeStep compare them with the "xdr" method (which is presented in section 5.7.6)....
NULL pointers are also handled automatically by the utility functions, this further simplifies writing "xdr" methods.
This is a characteristic of XDR which was adopted for all GRAPE XDR methods and functions. Using only one function should guarantee that the data written by a method or function can be read back in, it also simplifies maintaining the "xdr" methods and functions (for example when a data structure is changed).
Copyright © by the Sonderforschungsbereich 256 at the Institut für Angewandte Mathematik, Universität Bonn.