On 10/27/2010 02:20 AM, Anthony Chan wrote:
As you've found, Fortran's and C's IO buffering scheme are independent. AFAIK, there isn't any portable way to do setbuf(stdout,NULL) in Fortran. Because of that, Fortran programmers usually put flush() after their stdout write() to make sure they can see their outputs. Not sure that helps, Bill may know better about Fortran runtime.
Right. We don't have control on the application, so we can't really depend on flush(). There seem to be some compiler-specific environment variables such as GFORTRAN_UNBUFFERED_ALL=y, which seem to do this. But again, we don't really know the compiler either. If there are a set of environment variables for the standard compilers (gnu, intel, pgi, ...), I can automatically set all of them in Hydra to at least help in some cases. -- Pavan -- Pavan Balaji http://www.mcs.anl.gov/~balaji