Newsgroups: comp.parallel.pvm
From: schiotz@oersted (Jakob Schiotz)
Reply-To: schiotz@fysik.dtu.dk
Subject: Re: problems getting stdout from spawned tasks
Organization: Physics Department, Techn. Univ. of Denmark
Date: 26 Oct 1994 12:47:49 GMT
Message-ID: <38lj5l$pv3@news.uni-c.dk>

Heng Kek (nsrcchk@leonis.nus.sg) wrote:
: Gareth Evans# (gme@cpcw7.uea.ac.uk) wrote:

: : 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

: Would be grateful if an explanation can be posted here.

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 hope this is correct :-)

--
Jakob Schiotz                    !  The noble art of losing face
Physics Department               !  May someday save the human race
Technical University of Denmark  !  And turn into eternal merit
DK-2800 Lyngby, Denmark          !  What weaker mind would call disgrace
schiotz@fysik.dtu.dk             !                  - Piet Hein
              ^^^ Note: new domain

