[Developers] flush-ing stdout in cctk_vinfo

Jonathan Thornburg jthorn at aei.mpg.de
Wed Jan 31 12:12:24 CST 2007


Hi,

I wrote
> In my opinion, the fact that Bela used  --buffering line , yet (as I
> understand it) found additional output appearing when he did explicit
> flushes, constitutes a bug of some sort.  I'm not quite sure whether
> it's caused by stdout and stderr not being synchronized, or a bug in
> stdio that isn't handling line buffering properly, but from the user's
> perspective, asking for  --buffering line  and not getting it constitues
> a bug.
> 
> Given this, IMHO Bela's suggestion is a reasonable workaround, which
> would certainly avoid the bug in many, albeit not all, cases.  That is,
> we would change the code so that if  --buffering line  is specified,
> CCTK_VInfo() does an explicit  fflush(stdout)  just before returning.

Sorry, I now realise bela specified   -bno   .  But I think this
makes the case even stronger -- he asked for *no* output buffering,
but yet there clearly was some buffering (since explicit flushing
gave additional output).

-- 
-- Jonathan Thornburg <jthorn at aei.mpg.de>      
   Max-Planck-Institut fuer Gravitationsphysik (Albert-Einstein-Institut),
   Golm, Germany, "Old Europe"     http://www.aei.mpg.de/~jthorn/home.html      
   "Washing one's hands of the conflict between the powerful and the
    powerless means to side with the powerful, not to be neutral."
                                      -- quote by Freire / poster by Oxfam



More information about the Developers mailing list