Disk Format of Binary Database Files
Disk format of binary database files.
All the files above are "random access binary files". This means that they are stored in the binary format of the machine, and cannot be read or edited with tools such as a text editor.
There are several machine formats available, the most common one being:
| IEEE | (Stands for the Institute of Electrical and Electronic Engineers). This is the most common, and a de-facto standard on Unix workstations. |
| CRAY | Used on Cray XMP, YMP, C90, J90, etc. |
| Convex | This is now no longer current, but older C1xx, C2xx and C3xx machines used this format. |
| There are two word-lengths in common use: | |
| 32 bit | Single precision, using 4 bytes. This gives 7 or 8 decimal figures of precision, and a decimal exponent in the range +/-38. |
| 64 bit | Double precision, using 8 bytes. This gives 14 or 15 decimal figures of precision, and a decimal exponent of +/-308 in IEEE format, or +/-2465 in Cray format. |
| There are two possible way to arrange the bytes in the words: | |
|
Big endian (or M ost S ignificant B yte : MSB ) |
Byte order [4] [3] [2] [1] (single precision example) |
|
Little endian (or L east S ignificant B yte : LSB ) |
Byte order [1] [2] [3] [4] (single precision example) |
Ansys LS-DYNA is normally supplied such that it writes 32 bit IEEE (Big endian) files, regardless of the machine architecture and precision it is running on. This is achieved by converting results if necessary in the output routines.
D3PLOT is capable of reading any of the formats above. It detects the format by scanning the contents and converts it automatically on input to the native format of the machine on which it is running. Therefore you will sometimes see a message like:
|
[This machine is Cray 64 bit Normal endian ] [File format is IEEE 32 bit Normal endian ] |
when it reads files. This is just a notification message and you need not take any further action: in the example above they will be converted automatically to 64 bit Cray format.
Does using 32 bit format on a 64 bit machine reduce the precision of my answers?
It does not affect the precision of the calculation at all: this is always performed at the full precision of the machine, and dump files also use the full precision (so restarts do not compromise accuracy). It is only the databases written for post-processing that are truncated to 32 bits.
So yes, it does affect the precision in post-processing: you will be forsaking 14 or 15 significant figures for 7 or 8. But consider for a moment what this means: a typical car model might be 5 metres long, so single precision output will resolve displacements to somewhere between 0.05 and 0.5 microns. And anyway, is your calculation really accurate to 0.00001%?
It is hard to envisage the situation where this matters and, in the opinion of Oasys Ltd, the benefits of halving disk space usage and having files which may be post-processed without conversion on workstations far outweigh any disadvantages. However Oasys Ltd will supply the code with 64 bit output on request.
Are there any other limitations in using 32 bit file formats?
Only one: if you are post-processing on a 64 bit machine you will have problems if your 32 bit file contains integers (eg node, element or material numbers) outside the range +/-2 24 (16,777,216). This is because the bit patterns of integer and floating point numbers become hard to tell apart at this point, and this distinction is required for automatic conversion.
So, if you run on (say) a Cray and post-process on that machine then try to keep your node, element, material and other labels below this limit. If you take your files to a 32 bit machine for post-processing the problem will not arise and you can use the full valid integer range.
Alternatively, please request a version that writes 64 bit output from Oasys Ltd Support.
Why does D3PLOT sometimes mix up IEEE and Cray 64 bit formats in older files?
Prior to Ansys LS-DYNA 940 it was not possible to tell if a 64 bit file came from a Cray or an IEEE machine. (Subsequent database files contain values which make distinction possible.)
Therefore if the file type is indeterminate D3PLOT defaults to one or the other format, which may be wrong. You can control the default 32 and 64 bit file types using the following environment variables:
| Variable name | Word size |
Possible values
|
Default in V8.0
|
| FILE_TYPE_32 |
|
IEEE, CONVEX | IEEE |
| FILE_TYPE_64 |
|
CRAY, IEEE, CONVEX | IEEE (was CRAY in V7.x) |
e.g. setenv FILE_TYPE_64 CRAY Would be required to read an older 64 bit Cray file in V8.0