25. Logfile Unit

Figure 25.1: The Logfile unit directory structure.
Image Logfile_pic

FLASH supplies the Logfile unit to manage an output log during a FLASH simulation. The logfile contains various types of useful information, warnings, and error messages produced by a FLASH run. Other units can add information to the logfile through the Logfile unit interface. The Logfile routines enable a program to open and close a log file, write time or date stamps to the file, and write arbitrary messages to the file. The file is kept closed and is only opened for appending when information is to be written, thus avoiding problems with unflushed buffers. For this reason, Logfile routines should not be called within time-sensitive loops, as system calls are generated. Even when starting from scratch, the logfile is opened in append mode to avoid deleting important logfiles. Two kinds of Logfiles are supported. The first kind is similar to that in FLASH2 and early releases of FLASH3, where the master processor has exclusive access to the logfile and writes global information to it. The newer kind gives all processors access to their own private logfiles if they need to have one. Similar to the traditional logfile, the private logfiles are opened in append mode, and they are created the first time a processor writes to one. The private logfiles are extremely useful to gather information about failures causes by a small fraction of processors; something that cannot be done in the traditional logfile.

The Logfile unit is included by default in all the provided FLASH simulations because it is required by the Driver/DriverMain Config. As with all the other units in FLASH, the data specific to the Logfile unit is stored in the module Logfile_data.F90. Logfile unit scope data variables begin with the prefix log_variableName and they are initialized in the routine Logfile_init.

By default, the logfile is named flash.log and found in the output directory. The user may change the name of the logfile by altering the runtime parameter log_file in the flash.par.  

# names of files
basenm   = "cellular_"
log_file = "cellular.log"



Subsections