changed log implementation

Open one log on master (default) or one unique log  per mpi task (if logAllProcesses  is True).  We had been letting all  mpi processes open the same file, which is pointless when only the master processes is  writing anyway and probably not smart  when we're logging all processes. This changes fixes the problem on garnet where the first  part of the  log file was binary.