5. Direct access file management#

Memory manager JEVEUX manages memory offloads on disk, to free up space in memory during execution and to archive the results at the end of work. For this purpose, direct access files are used. The utilities OPENDR, WRITDR, READDR and CLOSDR are called (bibc/utilitai/iodr.c).

The disk address of the JEVEUX objects is obtained by combining the number of the record in the direct access file used to deposit the values, and possibly the position within this record.

The length of the records is fixed, its value is chosen when opening the JEVEUX databases using the JEINIF routine.

The number of records that are part of the parameters is determined in Code_Aster according to operating conditions. Each base is divided into logical units of length 12884901888bytes (concept of « extend »), this value is assigned through the ENVIMALOFIEM function and stored in the common/FENVJE /. JEVEUX manages a global index that it then cuts out for each extend, the disk address is measured in relation to the global index, then modulate the number of records, you can easily obtain the extend number and the relative address. The various logical units are accessible by a local name that is composed from the first four characters in lower case of the name of the associated base and the number of extend.

The size of the records defines two classes of JEVEUX objects:

  1. small objects whose size is less than the length of a recording, they are accumulated in a space the size of a recording before transfer to disk,

  2. large objects that require multiple records to store their contents.

During a disk write request, the content of large objects will be directly transferred to disk, while a write buffer will be used for small objects in order to accumulate them and reach approximately the length of a record before they are transferred. During a read request, at least one record will be used, in the case of small objects a read buffer is used. Read and write buffers are among the system objects associated with each JEVEUX base.

Closing the direct access files is essential to update the access index; it is routine JXFERM that calls the CLOSDR utility.

Record Description

_images/10007DB0000034D000000634E32E665CD20C77C3.svg

Each record is self-described so that its content can be easily identified. As for the memory zone, the records are seen as a sequence of integer-type words (INTEGER *8). The first two words provide global information on the size of stored objects:

  • if Ident1=Ident2=0 the record contains small objects, three whole words (descriptors) are placed in front of each value segment, they contain respectively, when they exist, the collection identifier (Idc1), the simple object identifier or the collection object number (Ids1) and the length of the value segment (Ids1) and the length of the value segment, follow the value segment, and we start again for the next one until Ids1 cn=IDSN=0;

  • if Ident1 or Ident2 is different from 0, the record contains all or part of the value segment associated with a large object.

When a large object is destroyed, the identifiers Ident1 and Ident2 are set to the opposite values (assignment of the - sign). Likewise, when a small object is destroyed, the identifiers Idci and Idsi are assigned the sign -.

Writing objects

It’s routine JXECRO that treats the writing of JEVEUX objects. It also ensures, when necessary, the opening of the logical units associated with the partition by extending the databases. The routine looks at the various records to find a series of records that can accommodate the value segment or the buffer as appropriate. Records corresponding to large destroyed objects can thus be recovered. Writing a small object means moving the content of the value segment into the write buffer by the JXDEPS routine with the descriptors updated. The buffer is transferred to disk only if the value segment is larger than the remaining free space. The value segment associated with large objects is transferred to disk by the JXECRB routine. JXECRB is a hat using the WRITDR utility that updates the Ident1 and Ident2 descriptors as well as a counter associated with the record. During subsequent unloads, the read buffer can be used to refresh the disk image; logic then indicates this type of use.

Reading objects

It’s routine JXLIRO that treats reading JEVEUX objects. The value segments associated with small objects are reloaded into memory from one of the read or write buffers. Optionally, the play buffer can be unloaded onto disk before loading a new record. The value segment associated with large objects is read directly using the JXLIRB routine.