next up previous contents index
Next: User specifications for Up: FZ -- Sequential Previous: FZ -- Sequential

Principles

FZOUT transfers a data-structure from the dynamic store to a sequential file, i.e. to disk or tape, or to flat memory, or via a user routine to the outside world. FZIN does the inverse transfer. In high-energy physics most FZ files contain data-structures representing events; but the concepts are completely general.

Two kinds of user information can be associated to a data-structure on the file. The ``user header vector'' may contain identifying information, essentially numeric, to allow rapid selection of data-structures. The ``text vector'' may contain zero, one, or several lines of Hollerith text, giving context information about the data-structure in one of the natural languages (the implementation of user access to text vectors is pending).

On the file, a data-structure is represented by a straight copy of the relevant sections of the dynamic store, preceded by its ``pilot information'' which describes the data-structure to follow. It predicts the memory requirements of the d/s, and it carries the relocation table necessary to recalculate all links in the data-structure for the new position in memory. It further contains the associated user header vector and the text vector. Files to be read back on the computer of creation can be written in ``native mode''. In this mode, writing and reading is done with standard Fortran unformatted WRITE and READ statements, the representation of numbers and Hollerith is defined by the internal representation of the machine, blocking of logical records into physical records is defined by the Fortran I/O system of the machine. The data are written directly from the dynamic store to the file without going through a Zebra buffer; a data-structure is hence represented in general by several logical records.

Files to be transported from one computer to another one of a different make must be written in ``exchange mode''. Exchange mode implies two separate features:

If the file medium is Disk or Tape the records representing a data-structure are transfered between the Zebra store and the medium by WRITE or READ statements (or equivalent). If the ``file'' medium is Memory the records are tranfered by copying to or from a region of the user's memory (possibly involving packing or byte inversion operations). If the file medium is Channel the records are handed to, or obtained from, a user routine one at a time. This routine is supposed to be an interface to a computer link, permitting to shuffle the records of the data-structure from one machine to another one. For the media Memory and Channel FZIN/FZOUT always operate with the Exchange File Format, ie. with a string of fixed length records, but the Data Format may be either ``exchange'' or ``native''.

A disk file with Exchange File Format can be read with Direct Access permitting a random access to the data, since it is a simple string of fixed-length records. For each data-structure written (or read) FZOUT or FZIN deliver its D/A address which the user can compile into a Direct Access Table together with other relevant information about each d/s. If the table is put into a bank it can be stored at the end of the file itself by calling FZODAT, to be recovered by FZIDAT when one comes back to read the file. Handing a D/A address to FZINXT will reset the current read point of the file, and the next call to FZIN will deliver the wanted d/s.

The Fortran implementations on some machines running Unix cannot handle sequential access of fixed-length records, they require system control words with each record. One can get around this by using the Direct Access mechanisme: Zebra operates sequentially, also for a file which has been initialized for direct access, until the user tells it otherwise by calling FZINXT. However, this is not a satisfactory solution for handling tapes. Therefore, yet another mode, reading and writing through calls to the C Library, is programmed into Zebra, both for sequential and for direct access, but this only on some machines running the Unix operating system.

Direct access with FZ is only for input; creation of files is a strictly sequential process. It serves well in a particular situation which is logically simple, but not at all for managing a data-base with key-words and up-dates. For this one should use the RZ package of Zebra.

It was one of the design aims of the FZ package to provide a representation of the data on external media in exchange mode which fits both off-line data-processing and on-line data-taking requirements. Speed is important in both cases, but it is more critical in the on-line context. For this the ZEBRA Exchange File Format has been defined to allow dumping large areas of memory to a file, without the need to insert control information for physical records during the dumping process; all control information needed is grouped at the very beginning of the data.

The program running on a data-taking on-line computer is likely not to be a ZEBRA program, in which case one will have to write an ad hoc output routine to produce a file readable by FZIN in exchange mode. This point has been kept in mind when designing the exchange format, to make sure that it is simple enough to produce files in this format.

Although the unit of information for ZEBRA is a data-structure in full generality, in the on-line application the ``data-structure'' will most likely consist of just one maybe very large bank, or at most of a few banks. For such simple data-structures the interconnection by links does not need to exist, and the on-line program can disregard this aspect of data-structures. When a ``link-less'' data-structure of several banks is read all its banks will be connected by FZIN into a linear structure, to permit the reading program to access the banks.



next up previous contents index
Next: User specifications for Up: FZ -- Sequential Previous: FZ -- Sequential


Janne Saarela
Mon May 15 08:34:47 METDST 1995