Re: Flushing memory into output file

From: Axel Kohlmeyer (
Date: Thu Oct 07 2010 - 16:30:44 CDT

On Thu, Oct 7, 2010 at 3:39 PM, Nicholas M Glykos <> wrote:
> Hi Parisa,
> I shaw Axel's message, probably I'm wrong and he's right in what follows.
>> I ran a simulation and it crashed.
> If indeed it was the simulation that 'crashed', I should have thought that
> the files would have been properly closed, with no frames missing from


you have to distinguish between (unbuffered) i/o using
open(2)/read(2)/write(2)/close(2) and (buffered) i/o
through fopen(3)/fread(3)/fwrite(3)/fclose(3).

the kernel will close all file descriptors and finish pending work
(the (2) type functions), but stdio (the (3) type functions) based
i/o has a layer of buffering on top of that, which will typically not
finish on a program crashing, if not instructed to do so. one would
need to set up signal handlers to do that. things get even more
complicated, if the i/o has happened on an NFS based network
file system or something similar, that is not fully posix compliant.


> the DCD file up to the last written frame. Was the simulation that crashed
> or the computing machine ? If it was the computer that 'crashed' (and not
> NAMD) there is very little you can do for the missing frames.

> Nicholas
> --
>          Dr Nicholas M. Glykos, Department of Molecular Biology
>     and Genetics, Democritus University of Thrace, University Campus,
>  Dragana, 68100 Alexandroupolis, Greece, Tel/Fax (office) +302551030620,
>    Ext.77620, Tel (lab) +302551030615,

Dr. Axel Kohlmeyer
Institute for Computational Molecular Science
Temple University, Philadelphia PA, USA.

This archive was generated by hypermail 2.1.6 : Wed Feb 29 2012 - 15:56:11 CST