Constructor: LogFile(filename, communicator=None)
the name of the file
the communicator in which the file is accesible. The default value of None means to use the global world communicator, i.e. all possible processes.
The purpose of LogFile objects is to collect short text output from all processors into a single file. All processes can write whatever they want at any time; the date is simply stored locally. After the file has been closed by all processes, the data is sent to process 0, which then writes everything to one text file, neatly separated by process rank number.
Note that due to the intermediate storage of the data, LogFile objects should not be used for large amounts of data. Also note that all data is lost if a process crashes before closing the file.
Methods:Write string to the file.
Write buffered data to the text file.
Close the file, causing the real text file to be written.