[Developers] flush-ing stdout in cctk_vinfo

Erik Schnetter schnetter at cct.lsu.edu
Wed Jan 31 11:41:19 CST 2007

On Jan 31, 2007, at 11:21:47, Bela Szilagyi wrote:

> After some hours of fooling myself (while checking stdout of  
> various processes
> from the same run), I realized that a
> fflush(stdout);
> after debugging CCTK_VInfo(...) messages is crucial if one cares  
> for every
> single line of output.  One of my processes hangs and I want to  
> know which
> process is at what point in the source  code.
> The loss of output lines is there even if I request, in the
> comand line, that, output would not be buffered.
> Apparently the non-buffering options are implemented in a way that  
> would not
> work across all systems, (e.g., peyote nodes).
> Can we add the "flush" to the end of the cctk_vinfo?  From what I  
> understand,
> Jonathan Thornburg  has already suggested this...

We discussed this, and we decided that this would be too expensive in  
general.  Instead we added a command line option "-b" which lets you  
specify whether to flush never, after every line, or after every  
print statement.  This is for all output, not just for CCTK_INFO.   
The default setting is chosen by the operating system, probably  
depending on whether the output goes to a terminal or into a file.

Here are the command line options that Cactus currently understands:

Usage: exe/cactus_bench-wavetoy-carpet [-h] [-O] [-o paramname] [-L  
n] [-W n] [-E n] [-r[o|e|oe|eo]] [--logdir <dir>] [-b <no|line|full>]  
[-S] [-T] [-t name] [--parameter-level <level>] [-v]  

Valid options:
-h, --help                           : gets this help.
-O[v], --describe-all-parameters     : describes all the parameters.
                                        v makes this verbose, i.e.,  
it gives
                                        a verbose description of all  
-o, --describe-parameter <paramname> : describe the given parameter.
-L, --logging-level <n>              : Sets the logging level to n.
-W, --warning-level <n>              : Sets the warning level to n.
-E, --error-level <n>                : Sets the error level to n.
-r, --redirect[o|e|oe|eo]            : Redirects standard output and/or
                                        standard error to files.
     --logdir <dir>                   : Sets the output directory for  
                                        created by the '-r' option
-b, --buffering <no|line|full>       : Set stdout buffering mode.
-S, --print-schedule                 : Print the schedule tree, then  
-T, --list-thorns                    : Lists the compiled-in thorns.
-t, --test-thorn-compiled <name>     : Tests for the presence of  
thorn <name>.
     --parameter-level <level>        : Sets the amount of parameter  
                                        level can be strict, normal,  
-v, --version                        : Prints the version.
-i, --ignore-next                    : Ignores the next argument.


Erik Schnetter <schnetter at cct.lsu.edu>

My email is as private as my paper mail.  I therefore support encrypting
and signing email messages.  Get my PGP key from www.keyserver.net.

-------------- next part --------------
A non-text attachment was scrubbed...
Name: PGP.sig
Type: application/pgp-signature
Size: 186 bytes
Desc: This is a digitally signed message part
Url : http://www.cactuscode.org/pipermail/developers/attachments/20070131/23ca7a83/attachment.bin 

More information about the Developers mailing list