Disable write buffer


I migrated an application from Intel fortran and found that PVF compiled code uses a buffering scheme when writing files. Is there a compiler flag so I can have the file updated for every write statement like with the intel compiler?


Casper Kirkegaard

Hi Casper,

On Linux you could use ‘setvbuf’ to have the OS flush the buffer after each write, but on Windows you’ll need to call ‘fflush(unit)’ after each write.

Hope this helps,

Thanks Mat, thats just what I need … (Running windows)

I can’t find any documentation on the fflush routine. Is there source for it or do I need to link to a library?



Hi Casper,

Sorry, the Fortran wrapper for ‘fflush’ under the name "flush’ and can be found in the Fortran Reference Guide on page 224. (http://www.pgroup.com/doc/pgifortref.pdf).

  • Mat

Great, thanks!