This program represents the original I/O behavior found in the CacluliX application.
It writes simulation results to a file in .frd
format.
The structure of the program is given by the following (pseudo) code:
open("output.frd", buffered = "yes")
do i = 1, NUM_NODES
write(*,*) node_properties(i)
end do
close("output.frd")
The number of nodes (NUM_NODES
) is typically in the order of millions.
Each node stores some kind of physical information (e.g. stress, flux, …).
In order to write these information to a file the program iterates over all nodes and issues a single write operation per node.
Each write operation writes data in a very small chunk (e.g. 8 byte) and there are millions of them.
In the original version of the program each single write operation is written directly into the output file by the operating system.
In this version of the program the I/O operations are buffered by specifying the keyword buffered = "yes"
when opening the “output.frd” file.
By doing so the operating system will provide a buffer to which the data from each write operation gets written first.
Once the buffer is filled the data will be written from the buffer into the output file.
All of this happens transparent to the user but provides a significant performance increase.