Newsgroups: comp.parallel.pvm
From: cdematt@corsa.ucr.edu (Cheryl Dematteis)
Subject: Re: problems getting stdout from spawned tasks
Organization: University of California, Riverside
Date: 8 Nov 1994 01:50:13 GMT
Message-ID: <39mlgl$8gu@galaxy.ucr.edu>

: : : I'm having trouble getting the stdout of a number of slave processes
: : : spawned by a master.

: : : There is nothing in /tmp/pvml.<UID> and I tried a pvm_catchout( stdout ) but
: : : still nothing.

: : I've had the same problems.  i.e. printf() statments in spawned
: : slave processes produce nothing in /tmp/pvml.xxx.  But when I
: : switched to 'fprintf(stderr,...)' then the stuff appears in the log
: : file.  This is for pvm3.2.6.  I don't know if the same situation
: : persists in pvm3.3

: I don't *know* this, but I suspect it is caused by buffering. I saw
: the same thing, and switched to using stdout. I have observed (in
: non-pvm programs), that if stdout is redirected to a file, then often
: the data is only written to the disk in blocks of (i think) 8KB, while
: stderr is always unbuffered. In short: either use stderr or call
: fflush occationally.

I had the same problem, the solution was to use 

fprintf(stdout, ....);
fflush(stdout);

every time I wanted to print to stdout...  I'm not sure it was
all necessary...but it works now.

--
Cheryl K. DeMatteis					    cdematt@cs.ucr.edu
Graduate Student					    (909)787-3432
Department of Computer Science 				
University of California
Riverside, CA 92521


